Repository navigation
Type the power series input dicts in wronskian (fixes Core tests on TimerOutputs v1) - #558
Conversation
TimerOutputs v1's `@timeit` emits the wrapped body twice, inside an
`if enabled ... else ... end`. The duplication makes Julia's closure conversion
box the locals that the dict comprehensions capture, so their element types no
longer infer. For a model with no inputs the empty comprehension then produces
`Dict{Any, Any}` and `power_series_solution` fails to dispatch.
Co-Authored-By: Chris Rackauckas <accounts@chrisrackauckas.com>
Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01GdSpCLd7NBZuuePJmcDzU7
Downstream mirror: ModelingToolkit's failing job, reproduced and fixed locallyExactly the configuration of Before (master After (this branch, same environment): 45 test files, 0 errors. So merging this turns Docs buildMaster's docs build is broken by this same bug — The same command on this branch, same package versions, exits 0 with no doctest failures. The two red CI checks are both pre-existing and unrelated
No source from this PR is involved — Green checks
🤖 Generated with Claude Code (model: claude-opus-5[1m]) |
- Add AirspeedVelocity benchmarking CI (#562) - Type the power series input dicts in wronskian (#558) Agent-Harness: Claude Code Agent-Model: claude-opus-5[1m] Claude-Session: https://claude.ai/code/session_014FEzNTLFutCmTEAZ3zBg5R Co-authored-by: Claude Opus 5 (1M context) <noreply@anthropic.com>
Closes #556.
What changed and why
wronskianbuilt theparam_values/initial_conditions/input_valuesarguments ofpower_series_solutionwith untyped dict comprehensions. TimerOutputs v1's@timeitemitsthe wrapped body twice (inside
if enabled … else … end), and that duplication makes Julia'sclosure conversion box the locals those comprehensions capture — so their element types stop
inferring. For any model with no inputs the empty comprehension then produces
Dict{Any, Any}andpower_series_solutionhas no matching method.Spelling the element types out fixes the dispatch and is independent of whatever
@timeitdoes to the surrounding scope. Only
src/wronskian.jlis touched; no behavior change formodels that do have inputs.
Full analysis, standalone TimerOutputs MWE and the registry timeline are in #556.
Verification
Julia 1.12.7, environment resolved with
Pkg.update()(picksTimerOutputs v1.2.1,RationalFunctionFields v0.3.5), ModelingToolkit masterPkg.developed in exactly asModelingToolkit.jl/.github/workflows/Downstream.ymldoes.Failing before the fix
GROUP=Core julia +1.12 --project=StructuralIdentifiability.jl -e 'using Pkg; Pkg.test()'on unmodified master (
90f8452a61109fe29e434d604bd22ad80d474fdd):The group aborts there, so nothing after
identifiability.jlruns at all.Passing after the fix
Same command, same environment, with this branch:
All 39
Corefiles pass; every one of them is new coverage relative to the current masterrun, which never got past
identifiability.jl.QA
Formatting / spelling
Runic.main(["--check", "src/wronskian.jl"])→ exit 0.typos src/wronskian.jl→ clean.What I did not verify
Downgradeand 32-bit (Core 32-bit) lanes — not run locally.ModelingToolkitSIExtgroup — not run locally (it precompiled cleanly during the QA run).docs/, or public API.Note for the reviewer
The underlying defect is in TimerOutputs v1's
@timeit, not here; this is a targetedworkaround at the one call site whose dispatch depends on the dict type. The
Core.Boxthat
@timeitintroduces is present in every@timeit-annotated function insrc/and is silently costing inference elsewhere, so an upstream fix is still worth chasing —
see #556 for the standalone MWE to file with TimerOutputs.jl.
The alternative fix would be to cap
TimerOutputs = "0.5.10"again, but #548 relaxed thatdeliberately to resolve a Groebner conflict, so re-capping would reintroduce it.
Please ignore until reviewed by @ChrisRackauckas.
🤖 Generated with Claude Code (model: claude-opus-5[1m])
https://claude.ai/code/session_01GdSpCLd7NBZuuePJmcDzU7