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: permuted element maps were read by position, giving wrong values #756
An apply-to-all reference across dimensions linked by an explicit element map (simlin:mapping / simlin:elem) read elements by position, ignoring the map.
Results were silently wrong.
Example
Region{a,b}, State{s1,s2}, with element map s1 -> b, s2 -> a. x[a] = 10, x[b] = 20, target[State] = x[State] * 1.
Expected: target[s1] = 20, target[s2] = 10.
Reported: target[s1] = 10, target[s2] = 20.
The bare spelling target[State] = x * 1 behaved the same.
Current state
On main the map is followed. src/simlin-engine/src/mapped_reference_semantics_tests.rs runs this case through the VM for each reference spelling (x[State], x[Region], bare x, a stock's flow), with the map declared on either dimension: a permuted map reads [30, 10, 20] from source [10, 20, 30], and a many-to-one map (#753) compiles and reads through the map.
Landed in PR #1010.
changed the title [-]engine: executed A2A lowering ignores explicit element maps and resolves positionally (silent wrong results for permutation maps)[/-][+]engine: permuted element maps were read by position, giving wrong values[/+]on Oct 12, 2026
PR #1010 (0140175): mapped_reference_semantics_tests.rs expected requires the Permuted row to read [30, 10, 20] from source [10, 20, 30], and assert_cell also asserts the result is NOT the positional answer; every_cell_of_the_matrix (line 643) runs it through the VM for x[State], x[Region], bare x and a stock flow, in both declaration directions. The rule lives in DimensionsContext::resolve_mapped_read / read_through_mapping (src/simlin-engine/src/dimensions.rs:858, :927).
Activity
ltm: core-algorithm batch of root-caused fixes from epic #488 (#761)
ltm: scoring-correctness and visibility batch from epic #488 (#775)
engine: resolve LTM table indices by the shared derivation
engine: resolve LTM table indices by the shared derivation
[-]engine: executed A2A lowering ignores explicit element maps and resolves positionally (silent wrong results for permutation maps)[/-][+]engine: permuted element maps were read by position, giving wrong values[/+]bpowers commentedon Oct 12, 2026
Closing: already fixed on main.
PR #1010 (0140175): mapped_reference_semantics_tests.rs
expectedrequires the Permuted row to read [30, 10, 20] from source [10, 20, 30], and assert_cell also asserts the result is NOT the positional answer; every_cell_of_the_matrix (line 643) runs it through the VM for x[State], x[Region], bare x and a stock flow, in both declaration directions. The rule lives in DimensionsContext::resolve_mapped_read / read_through_mapping (src/simlin-engine/src/dimensions.rs:858, :927).