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
ltm: element-graph projection proptest never generates inlined reducers, so ThroughAgg routing is verified only vacuously #739
The element-graph projection property test (src/simlin-engine/src/db/element_graph_proptest.rs) has a structural blind spot: project_spec_strategy() (line ~125) never generates a model containing an inlined (sub-expression) array reducer, e.g.
total = base + SUM(pop[*] * scale)
Because no generated model contains such a pattern, the aggregate-node hoisting machinery never fires under the proptest -- no synthetic $⁚ltm⁚agg⁚{n} node is ever minted. As a consequence:
the arrayed ThroughAgg routing in model_element_causal_edges (db/analysis.rs), and
are completely unexercised by the projection invariant element_edges_project_to_variable_edges (line ~238). The property "element edges project onto variable edges" holds only vacuously for the entire agg-routed edge class.
Why it matters
The projection invariant is the main structural guard on the element graph. The #533 fast-path bug (a scalar feeder of a hoisted reducer with a scalar target losing the agg hop) is exactly the kind of routing mistake this proptest exists to catch, yet the generator could never have found it -- and cannot detect a regression of the fix. Test coverage gap only; no production bug.
Extend project_spec_strategy with an inlined-reducer equation pattern (a reducer like SUM(arr[*]) or SUM(arr[*] * scalar) appearing as a sub-expression, not the whole RHS), covering both arrayed and scalar feeders/targets so both ThroughAgg arms are reachable.
Teach the test's project_to_variable_edges to collapse synthetic $⁚ltm⁚agg⁚{n} nodes the same way real consumers trim them (splice from -> agg -> to into from -> to before comparing against the variable-level graph), so the invariant is stated over the trimmed graph.
Context
Surfaced during adversarial review of the #533 fix (branch ltm-bug-batch, commit 189e7d0). Related: #533, #520, #737, #738. Part of epic #488.
Activity