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: a many-to-one element map reference failed to compile #753
An apply-to-all reference through a many-to-one element map (more elements in the equation's dimension than in the referenced variable's) failed to compile with "failed to compile fragments for variables: target".
Example
State{s1,s2,s3} mapped to Region{a,b} with s1 -> a, s2 -> a, s3 -> b (the simlin:mapping / simlin:elem extension). x[Region], and target[State] = x[State] * c.
Expected target[s1] = x[a], target[s2] = x[a], target[s3] = x[b]; reported a compile error.
Aggregating states into regions is the usual reason to write such a map.
Current state
On main this compiles and reads through the map. src/simlin-engine/src/mapped_reference_semantics_tests.rs covers it as the ManyToOne row (three target elements over two source elements read [10, 20, 10]), and the reverse 2-to-3 case as ReverseCardinality, for every reference spelling and with the map declared on either dimension.
Landed in PR #1010.
Sibling issue filed: #756 -- same-cardinality (permutation) element maps DO compile, but the executed A2A lowering ignores the map and resolves positionally, producing silent wrong results. The positional-only execution there is consistent with the different-cardinality compile failure here; a per-element-indirection fix for #756 likely generalizes to resolve this issue too.
changed the title [-]engine: different-cardinality element-map reference fails to compile (failed to compile fragments)[/-][+]engine: a many-to-one element map reference fails to compile[/+]on Oct 12, 2026
changed the title [-]engine: a many-to-one element map reference fails to compile[/-][+]engine: a many-to-one element map reference failed to compile[/+]on Oct 12, 2026
PR #1010 (0140175) added src/simlin-engine/src/mapped_reference_semantics_tests.rs; expected (line ~575) requires the ManyToOne row (3 State onto 2 Region) to read [10, 20, 10] and ReverseCardinality to read [30, 10], and every_cell_of_the_matrix (line 643) runs both through TestProject -> salsa -> VM for all four spellings (x[State], x[Region], bare x, stock flow) with the map declared on either dimension.
Activity
bpowers commentedon Jun 10, 2026
Sibling issue filed: #756 -- same-cardinality (permutation) element maps DO compile, but the executed A2A lowering ignores the map and resolves positionally, producing silent wrong results. The positional-only execution there is consistent with the different-cardinality compile failure here; a per-element-indirection fix for #756 likely generalizes to resolve this issue too.
ltm: core-algorithm batch of root-caused fixes from epic #488 (#761)
[-]engine: different-cardinality element-map reference fails to compile (failed to compile fragments)[/-][+]engine: a many-to-one element map reference fails to compile[/+][-]engine: a many-to-one element map reference fails to compile[/-][+]engine: a many-to-one element map reference failed to compile[/+]bpowers commentedon Oct 12, 2026
Closing: already fixed on main.
PR #1010 (0140175) added src/simlin-engine/src/mapped_reference_semantics_tests.rs;
expected(line ~575) requires the ManyToOne row (3 State onto 2 Region) to read [10, 20, 10] and ReverseCardinality to read [30, 10], and every_cell_of_the_matrix (line 643) runs both through TestProject -> salsa -> VM for all four spellings (x[State], x[Region], bare x, stock flow) with the map declared on either dimension.