Bump DiscreteComponents to v0.3 (SynchToolkit 0.5 initialization semantics) - #13
Open
baggepinnen wants to merge 1 commit into
Open
Bump DiscreteComponents to v0.3 (SynchToolkit 0.5 initialization semantics)#13baggepinnen wants to merge 1 commit into
baggepinnen wants to merge 1 commit into
Conversation
DiscreteComponents v0.3 requires SynchToolkit 0.5, whose initialization comes exclusively from initialization equations (JuliaComputing/SynchToolkit.jl#183): initial conditions declared on discrete variables and shift-history overrides in a problem's u0 are rejected. Nothing here declares either. The clocked states in friction.dyad and identification.dyad are already initialized by `initial x@(clk-1) = ...` equations, `UnitDelay`/`ZeroOrderHold`'s `initial_condition` is an ordinary parameter feeding DiscreteComponents' own such equation, and `Revolute(phi(initial = ...))` is a continuous state. So the Dyad sources need no changes; the adaptations were confined to DiscreteComponents itself. What the bump does break is one ModelingToolkit name: 11.39.1 switched from `using SymbolicIndexingInterface` to `import`, so `ModelingToolkit.default_values` no longer resolves. Take it from its owner, which becomes a direct dependency of both the package and the test env. Compat: DiscreteComponents 0.3, SynchToolkit 0.5, SynchJulia 0.4.4, SynchCompiler 0.4.3. The SynchToolkit bound was still 0.4.8 even though the `CompiledNode` consumption path this repo now uses needs 0.4.9. Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
baggepinnen
force-pushed
the
bump-discretecomponents-0.3
branch
from
August 24, 2026 14:14
be3ef18 to
8d9b9e0
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
DiscreteComponents v0.3 requires SynchToolkit 0.5, whose initialization comes exclusively from initialization equations (JuliaComputing/SynchToolkit.jl#183): initial conditions declared on discrete variables, and shift-history overrides in a problem's
u0, are now rejected.(Rebased onto
mainafter #12 landed — that merge brought in theCompiledNodeconsumption path the first version of this branch had to write by hand, so what's left is much smaller.)The Dyad sources need no changes
Nothing here declares either of the rejected forms. The clocked states in
friction.dyadandidentification.dyadare already initialized byinitial x@(clk-1) = ...equations;UnitDelay/ZeroOrderHold'sinitial_conditionis an ordinary parameter feeding DiscreteComponents' own such equation; andRevolute(phi(initial = ...))is a continuous state. The adaptations for the new semantics were confined to DiscreteComponents itself (JuliaComputing/DiscreteComponents.jl#108).What the bump does break
One ModelingToolkit name. 11.39.1 switched from
using SymbolicIndexingInterfacetoimport, soModelingToolkit.default_valuesno longer resolves. It's taken from its owner instead, which becomes a direct dependency of both the package and the test env (src/program.jl, and the two uses intest/runtests.jl).Compat:
DiscreteComponents = "0.3",SynchToolkit = "0.5",SynchJulia = "0.4.4",SynchCompiler = "0.4.3". Note the SynchToolkit bound was still0.4.8even though theCompiledNodepath this repo already uses needs 0.4.9.Verification
test/runtests.jlwas run in two environments — one with DiscreteComponents 0.3.0 / SynchToolkit 0.5.0, one pinned to a pre-#183 baseline (SynchToolkit atecac23e, DiscreteComponents 0.2, same source otherwise). Results are identical::cbackend removeddesign_lqrgain[-2.831113224036648, -21.52650125219085, -0.9274687478416253, -1.7177662878222943][-2.831113224033555, -21.52650125217831, -0.9274687478408721, -1.7177662878212678]Testset for testset the two runs match (
compile and step (julia),shared analysis base,run_program!,friction experiment,friction fit,FurutaFrictionExperiment analysis,swingup — Dyad plant (SeeToDee)at 2403 assertions, and the rest). So the bump is behaviour-neutral.Pre-existing failures, not from this PR
Identical before and after, and left alone:
:cbackend and C export are broken onmain— filed upstream as JuliaComputing/SynchJulia.jl#234. SynchCompiler's C backend throwsInternalError: IFunction ^ has no emitted C name; register the callee before reaching emit_call. Reduced to a bare@nodewithy = x^3: exponent 3 is the only one that fails (0, 1, 2, 4, 5, 6, 7, -1, -3 and float/variable exponents all emit fine), so the trigger here isk3 * w ^ 3inFrictionAndBackEMF(dyad/friction.dyad), which reaches the compiled node throughswingup_catch's friction feed-forward. That also explains why C export worked before the program layer landed: the older controller had no friction feed-forward. It killscompile and step (c),C exportandFurutaSwingupExperiment analysis, and aborts the suite at the first testset — which is why the second row above exists at all. Reproduces identically on the pre-#183 baseline, so it is not a SynchToolkit-semantics regression.identification replay/safety supervisor/FurutaIdentificationExperiment analysisneedinput_design.csv, which is gitignored and so absent from a fresh checkout; they error withCannot open '.../input_design.csv': not a fileuntilexamples/input_design.jlhas been run.🤖 Generated with Claude Code