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
engine: incremental compiler panics on C-LEARN #363
The incremental compiler panicked on C-LEARN instead of returning an error, and several callers (the compiler benchmark, a cross-validation test loop, LTM analysis, layout) wrapped it in catch_unwind.
That does not help in WASM, where a panic aborts.
Status
Fixed on main.
The panic (a PREVIOUS with a subscript in code generation) became a typed error in #592, and C-LEARN now compiles and runs in the default test suite.
None of the listed catch_unwind wrappers remain.
The remaining catch_unwind calls are in tests: corpus sweeps that guard against importer panics, and tests of assertions that are meant to panic.
Per the Phase 6 plan, #363 was re-verified after the element-level lagged-read strip in the symbolic SCC graph landed (Task 3 Part B). The plan's thesis was that the cycle gate's false CircularDependency was masking#363's deeper-pipeline panic; with the gate now clean, the panic should reproduce if it still exists.
Outcome: #363's panic does NOT reproduce. The incremental compiler returns a clean typed Result::Err on C-LEARN — it does not panic, unwrap, or expect-blow-up anywhere in the incremental path.
Evidence (debug build, RUST_BACKTRACE=1/full):
compile_project_incremental on test/xmutil_test_models/C-LEARN v77 for Vensim.mdl returns Err(NotSimulatable, "failed to compile fragments for variables: ...") — a clean error, no panic.
A direct diagnostic harness calling compile_project_incremental + assemble_simulation on C-LEARN passes (no panic, no backtrace; both return Err cleanly).
The element-cycle gate itself is now clean: has_circular_dependency = false, model_dependency_graph: has_cycle=false, the 22-member recurrence SCC resolves in both the dt and init phases.
The only panic observed is the Phase 6 Task 1 structural-gate test's ownpanic!("AC7.1 ...") assertion on compile_result.is_err() at tests/simulate.rs:3610 (frames entirely in the test harness) — that is correct AC7.5 test behavior, not an engine-internal panic.
Conclusion:#363's incremental-compiler panic on C-LEARN was masked by the cycle gate and/or already eliminated by prior element-cycle-resolution phases. It does not reproduce now that the gate is clean. The residual C-LEARN compile failure is a separate, clean-errorassemble_simulation fragment-compile gap (synthetic temp-arg helpers + a few real arrayed vars), filed as #580 — that is not a panic and not#363.
Leaving #363open (not closing) pending owner direction: the catch_unwind removal/audit it tracks (Phase 6 Task 2 retires the one residual test-only C-LEARN catch_unwind; the historical bench/analysis/layout sites were already removed on this branch) and a final no-panic confirmation once #580 lets C-LEARN compile end-to-end may still warrant tracking under this issue.
changed the title [-]Incremental compiler panics on C-LEARN model (catch_unwind workaround)[/-][+]engine: incremental compiler panics on C-LEARN[/+]on Oct 12, 2026
The codegen panic site now propagates a typed Err (src/simlin-engine/src/compiler/codegen.rs:935-950, from #592 / 81cdcb1) and C-LEARN compiles and runs un-wrapped in the default suite (simulates_clearn, tests/integration/simulate.rs:4011). No catch_unwind remains in benches/, src/analysis.rs, src/layout/ or src/db/; the remaining ones are test-only (importer guards in analysis_reads_tests.rs, tools/loops_tests.rs, tools/corpus_tests.rs; panic-assertion tests) plus libsimlin's VDF-open guard (src/libsimlin/src/results.rs:90), which is unrelated to the compiler.
Activity
docs: add finish-salsa-migration design plan
engine: remove catch_unwind from incremental compilation paths
engine: add World3 LTM discovery intractability test
bpowers commentedon May 19, 2026
Re-verification (element-cycle-resolution Phase 6 Task 3)
Per the Phase 6 plan, #363 was re-verified after the element-level lagged-read strip in the symbolic SCC graph landed (Task 3 Part B). The plan's thesis was that the cycle gate's false
CircularDependencywas masking #363's deeper-pipeline panic; with the gate now clean, the panic should reproduce if it still exists.Outcome: #363's panic does NOT reproduce. The incremental compiler returns a clean typed
Result::Erron C-LEARN — it does not panic,unwrap, orexpect-blow-up anywhere in the incremental path.Evidence (debug build,
RUST_BACKTRACE=1/full):compile_project_incrementalontest/xmutil_test_models/C-LEARN v77 for Vensim.mdlreturnsErr(NotSimulatable, "failed to compile fragments for variables: ...")— a clean error, no panic.compile_project_incremental+assemble_simulationon C-LEARN passes (no panic, no backtrace; both returnErrcleanly).has_circular_dependency = false,model_dependency_graph: has_cycle=false, the 22-member recurrence SCC resolves in both the dt and init phases.panic!("AC7.1 ...")assertion oncompile_result.is_err()attests/simulate.rs:3610(frames entirely in the test harness) — that is correct AC7.5 test behavior, not an engine-internal panic.Conclusion: #363's incremental-compiler panic on C-LEARN was masked by the cycle gate and/or already eliminated by prior element-cycle-resolution phases. It does not reproduce now that the gate is clean. The residual C-LEARN compile failure is a separate, clean-error
assemble_simulationfragment-compile gap (synthetic temp-arg helpers + a few real arrayed vars), filed as #580 — that is not a panic and not #363.Leaving #363 open (not closing) pending owner direction: the
catch_unwindremoval/audit it tracks (Phase 6 Task 2 retires the one residual test-only C-LEARNcatch_unwind; the historical bench/analysis/layout sites were already removed on this branch) and a final no-panic confirmation once #580 lets C-LEARN compile end-to-end may still warrant tracking under this issue.engine: element-level lagged-read strip in symbolic SCC graph; re-ver…
doc: add phase 6 task 11 for #363 codegen panic->Err (AC7.5)
engine: convert codegen PREVIOUS-subscript panic to typed Err (#363, …
doc: index element-cycle-resolution plan; test-requirements finalizat…
engine: element-level cycle resolution (C-LEARN hero model) (#592)
[-]Incremental compiler panics on C-LEARN model (catch_unwind workaround)[/-][+]engine: incremental compiler panics on C-LEARN[/+]bpowers commentedon Oct 12, 2026
Closing: already fixed on main.
The codegen panic site now propagates a typed Err (src/simlin-engine/src/compiler/codegen.rs:935-950, from #592 / 81cdcb1) and C-LEARN compiles and runs un-wrapped in the default suite (simulates_clearn, tests/integration/simulate.rs:4011). No catch_unwind remains in benches/, src/analysis.rs, src/layout/ or src/db/; the remaining ones are test-only (importer guards in analysis_reads_tests.rs, tools/loops_tests.rs, tools/corpus_tests.rs; panic-assertion tests) plus libsimlin's VDF-open guard (src/libsimlin/src/results.rs:90), which is unrelated to the compiler.