Commit 411fac6
linq_fold: Phase F PR 3 — decs Terminator lane + migrate 5 decs fns
Introduces DecsDispatch variant (Each / Find / FindReturn /
FindReturnNegated) + DecsTerminatorSpec struct + emit_decs_terminator_lane
helper. The lane owns: decs_range_prelude state init, per-element range
wrap, decs chain wrap, build_decs_inner_for_pruned, 4-way
for_each_archetype{,_find} dispatch, invoke wrap + force_at/generated.
Migrates 5 decs terminator emit fns:
- emit_decs_accumulator (orchestrator: count/long_count/sum/min/max/average)
- emit_decs_early_exit (orchestrator: first/first_or_default/any/all/contains)
- emit_decs_min_max_by (leaf, deferred from F2)
- emit_decs_walk_lane (leaf, deferred from F2: last/single/aggregate)
- emit_decs_element_at (leaf, deferred from F2)
Each becomes a thin spec-builder that picks DecsDispatch based on opName
+ rangeInfo (take/take_while presence) + earlyExitFind state.
emit_decs_count_archsize stays bespoke (no-entity-walk arch.size summer
doesn't fit the canonical lane shape).
Choice: parallel lane (separate from emit_terminator_lane) rather than
extending SourceAdapter.Decs to absorb chain/range/dispatch. Decs has
enough distinct helpers (wrap_decs_chain, decs_range_prelude,
build_decs_inner_for_pruned) that a parallel lane reads cleaner than
forcing both flavors through one adapter API.
AST parity verified byte-identical on 6 chains covering all 4 dispatch
modes (count Each, _select+sum Each, take.count Find, _where._any
FindReturn, _all FindReturnNegated, _min_by Each). tests/linq green
(1689/1689).
Net: -52 LOC in daslib/linq_fold.das (-193 / +141).
Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>1 parent 381317c commit 411fac6
2 files changed
Lines changed: 143 additions & 193 deletions
0 commit comments