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: element-level cycle check misses edges between arrayed variables #575
When two or more arrayed variables depend on each other element by element, the engine must decide whether the per-element dependencies form a real cycle or just an ordering problem.
The check that builds the per-element graph compared each variable's slot numbers as if they shared one layout, but each variable was compiled in its own private layout.
So for a group of two or more variables it found no edges between them.
This (test/sdeverywhere/models/ref/ref.mdl) needs an interleaved order, giving ce = 1,3,5 and ecc = 2,4,6.
The check returned all of ce then all of ecc.
Worse, for a real cycle, a[i] = b[i] and b[i] = a[i], it reported no cycle at all.
The bug was hidden because only single-variable recurrences were sent to the check; groups of two or more were always reported as circular.
Why it matters
Allowing multi-variable groups (needed for C-LEARN) would have turned a correct circular-dependency error into a silently wrong simulation.
Fix
Build the per-element graph from the compiled code's symbolic variable references (name plus element), which are the same across variables, so the one-variable and many-variable cases share one builder.
changed the title [-]engine: phase_element_order builds the SCC element graph from per-variable mini-slots -- zero cross-member edges + unsound resolution of genuine multi-variable element cycles (masked by members.len()!=1; Phase 2 Subcomponent B must remove mask)[/-][+]engine: element-level cycle check misses edges between arrayed variables[/+]on Oct 12, 2026
The per-element graph is built from symbolic name+element references by symbolic_phase_element_order (src/simlin-engine/src/db/dep_graph.rs:896), shared by one- and many-variable groups in refine_scc_to_element_verdict (:1190). Pinned by ref_mdl_multi_variable_recurrence_simulates (tests/integration/simulate.rs:4649, ce=1,3,5 / ecc=2,4,6 against ref.dat), resolve_dt_two_member_ref_shaped_scc_resolves_interleaved (db/dep_graph_tests.rs:1856) and model_dep_graph_genuine_element_two_cycle_stays_circular (:2828, a[d]=b[d]; b[d]=a[d] still reports a cycle).
Activity
doc: revise phase 2 subcomponent B for symbolic-ref architecture (GH #…
engine: rebuild SCC element-graph verdict on symbolic refs (multi-mem…
doc: insert phase 2 task 5b (multi-member SCC dependency-graph consum…
engine: ref.mdl multi-variable recurrence simulates (AC2.1)
engine: interleaved.mdl element interleave simulates (AC2.2)
engine: phase 2 review doc-accuracy fixes (no logic change)
doc: reconcile phase 3 to phase 2 symbolic accessor (GH #575 follow-t…
doc: add phase 6 tasks 4-5 for #580 latent compile bugs
doc: add phase 6 task 6 for #582 cross-fragment GF de-dup
doc: add phase 6 task 7 for #583 temp recycle fix
engine: element-level cycle resolution (C-LEARN hero model) (#592)
[-]engine: phase_element_order builds the SCC element graph from per-variable mini-slots -- zero cross-member edges + unsound resolution of genuine multi-variable element cycles (masked by members.len()!=1; Phase 2 Subcomponent B must remove mask)[/-][+]engine: element-level cycle check misses edges between arrayed variables[/+]bpowers commentedon Oct 12, 2026
Closing: already fixed on main.
The per-element graph is built from symbolic name+element references by
symbolic_phase_element_order(src/simlin-engine/src/db/dep_graph.rs:896), shared by one- and many-variable groups inrefine_scc_to_element_verdict(:1190). Pinned byref_mdl_multi_variable_recurrence_simulates(tests/integration/simulate.rs:4649, ce=1,3,5 / ecc=2,4,6 against ref.dat),resolve_dt_two_member_ref_shaped_scc_resolves_interleaved(db/dep_graph_tests.rs:1856) andmodel_dep_graph_genuine_element_two_cycle_stays_circular(:2828,a[d]=b[d]; b[d]=a[d]still reports a cycle).