You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Commit 96fed7c
Browse filesBrowse the repository at this point in the historyBrowse files
v0.3.0: subflows in both generators (Moonkale ADR-0021 stage C)
Mistral's stage C work, finished by Claude while Mistral's tokens are out.
ModelingToolkit flattens: a subsystem's components join the parent
circuit under per-instance names (rc_filter_1_resistor_1 — `_`, since
ModelingToolkit reads `₊` as its namespace separator at runtime), each
boundary pin's inner net merges with the parent's, nested subsystems
recurse (bounded depth), and the one-library rule covers the inside. A
boundary end takes its pin from the pseudo-block's id and must be a
declared pin; "both sides" counts inner and parent wires separately, so
two inner wires on one pin are still one-sided.
Lux splices: a subflow with exactly one input and one output is a
sub-Chain — its layer path spliced in, nested subflows recursing, a
pass-through splicing nothing.
Pins ext-api-2026-10-13 (the subflow model); flow::BOUNDARY is still
unreleased there, so the prefix is a local constant. 15 tests, clippy
-D warnings clean; Moonkale's mtk.mjs simulates the flattened RC to
99.3 %.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01Y1i4K2wqeXyatSepWdxX4R
description = "A Lux.jl block library for Moonkale's flow editor, with Julia codegen. An opt-in Moonkale extension (Milestone 6); its own repository since Milestone 18 phase 6.4."
Copy file name to clipboardExpand all lines: README.md
+8-3Lines changed: 8 additions & 3 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -1,6 +1,11 @@
1
1
# moonkale-julia
2
2
3
-
Julia for [Moonkale](https://github.com/MathStruct/Moonkale) — today one crate, **`moonkale-ext-lux`**: a [Lux.jl](https://lux.csail.mit.edu) block library for Moonkale's flow editor. Layers (`Dense`, `Conv`, `MaxPool`, `Flatten`, `Dropout`, `BatchNorm`), activations, an input, a loss and an optimiser, with tensor-shape ports (a shape mismatch is a red wire), and code generation to a Julia file (`Lux.Chain(…)` plus a training scaffold) that runs with `julia model.jl`.
3
+
Julia for [Moonkale](https://github.com/MathStruct/Moonkale) — today one crate, **`moonkale-ext-lux`**, with two block libraries for Moonkale's flow editor:
4
+
5
+
-**Lux.jl** ([lux.csail.mit.edu](https://lux.csail.mit.edu)): layers (`Dense`, `Conv`, `MaxPool`, `Flatten`, `Dropout`, `BatchNorm`), activations, an input, a loss and an optimiser, with tensor-shape ports (a shape mismatch is a red wire), and code generation to a Julia file (`Lux.Chain(…)` plus a training scaffold) that runs with `julia model.jl`.
6
+
-**ModelingToolkit** (since v0.2.0): acausal, domain-typed components — Resistor, Capacitor, Inductor, Voltage, Ground; Mass, Spring, Damper, Fixed — and code generation to `circuit.jl`: `@named` components, one `connect` per net, `structural_simplify` and a solved ODE problem.
7
+
8
+
Both generators understand **subflows** (since v0.3.0, Moonkale ADR-0021): an MTK subsystem flattens into the parent circuit, its components named per instance (`rc_filter_1_resistor_1`) and its boundary pins merging the inner and outer nets; a Lux subflow with one input and one output splices its layer path into the parent `Chain`.
4
9
5
10
It lived in the Moonkale repository as `packages/extensions/lux` until Milestone 18 (phase 6.4): it is what its author needs, and for everyone else an opt-in extension, so it is off by default and built only when asked for.
6
11
@@ -14,10 +19,10 @@ cd packages/desktop && dx serve --features julia # or: cargo build -p deskt
14
19
cd packages/web && dx serve --features julia
15
20
```
16
21
17
-
then switch it on in **Settings → Extensions → Lux.jl library**; the flow editor's palette gets the Lux blocks, and **Generate** writes the Julia file. The generated code needs `Lux`, `Optimisers`, `Zygote` and `Random` in your Julia environment; the extension itself has no Julia dependency.
22
+
then switch it on in **Settings → Extensions → Lux.jl library**; the flow editor's palette gets the Lux blocks, and **Generate** writes the Julia file. The generated Lux code needs `Lux`, `Optimisers`, `Zygote` and `Random` in your Julia environment, the circuit `ModelingToolkit`, `ModelingToolkitStandardLibrary` and `OrdinaryDiffEq`; the extension itself has no Julia dependency.
18
23
19
24
## Developing it
20
25
21
-
It depends on Moonkale's extension contract by **git tag** (`lib-v1`; see Moonkale's `packages/ext-api/CHANGELOG.md`), so `cargo test` here builds against that tag. To work on both at once, point Moonkale's distribution at a local checkout (`[patch."https://github.com/MathStruct/moonkale-julia"]` in Moonkale's `Cargo.toml`).
26
+
It depends on Moonkale's extension contract by **git tag** (`ext-api-YYYY-MM-DD`, today `ext-api-2026-10-13`; see Moonkale's `packages/ext-api/CHANGELOG.md`), so `cargo test` here builds against that tag. To work on both at once, point Moonkale's distribution at a local checkout (`[patch."https://github.com/MathStruct/moonkale-julia"]` in Moonkale's `Cargo.toml`).
0 commit comments