Uniform Evaluator Scalar Dispatch Altitude
Routed Finding
Hygiene design route: hr-cffc86a1aa736150
- Rule: DESIGN-29 (single level of abstraction across comparable branches).
- Severity: Major.
- Evidence:
dispatch_byte_methodimplements a long series of comparable method strategies inline, then delegates the remaining sibling strategies todispatch_byte_tail. The same dispatch family therefore mixes orchestration-level delegation with multi-line inline validation and execution logic. - Why this is not SPEC-14: the defect exists even if the enclosing function meets a line threshold; once one comparable strategy family delegates, all comparable siblings must read at the same altitude.
- No within-budget cure: extracting one or two arms would preserve the mixed boundary. The entire scalar dispatch family and its shared validation/error conventions must be normalized coherently and pinned across bool, char, byte, and newtype behavior.
Goal
Give evaluator scalar dispatch one readable level of abstraction while preserving exact method selection, arity/type validation, overflow behavior, error identity, and ownership of returned values.
Required Design
- Define one uniform dispatch shape for scalar method strategy selection; comparable method branches either all delegate to named helpers or are represented by one typed strategy table where behavior permits.
- Split byte arithmetic, bit operations, shifts, predicates, and conversions at semantic seams rather than at an arbitrary tail boundary.
- Apply the same rule to participating bool, char, and newtype siblings so the local cure does not move the altitude break elsewhere.
- Centralize repeated arity/type validation only when semantics are genuinely identical; preserve method-specific diagnostic names and checked arithmetic.
- Keep evaluator semantics representation-abstract and independent of VM or compiled-backend mechanisms.
Verification
- Table-driven tests cover every supported scalar receiver/method pair and wrong-arity/wrong-type case.
- Boundary tests pin byte overflow, divide/modulo by zero, invalid shifts, char conversion, and missing-method diagnostics.
- Structural review confirms no comparable sibling branch combines multi-line inline work with delegation.
- Evaluator/VM/LLVM/AOT observable parity stays exact for the applicable scalar corpus.
Closeout
This section closes only after its owned criterion is satisfied, code-side TPR is clean, and a source-fingerprint-current canonical test-all run is full green.
Work Items
- Refactor scalar method dispatch into one uniform strategy level with complete per-family regression coverage