Skip to content

(OPT) Retain pair-local PLAN path views to remove repeated comparison indexing #886

Open

Description

@wsdt

The existing external native codec owners23/24 fail the unchanged preparation at requested132/rem119 during HIR final validation; they import the ordinary external semaprax library. Confirm the parent build has no exceptional cfg(test) override. The detailed codec03 witness is a cfg(test) library unit test with additional independently preserved UnoptedCrosscheck work, so its gross route counts cannot establish shipping costs. The unchanged codec preparation currently exhausts the67,108,864-byte builder ledger in HIR final validation. Its actual current partial prefix includes12,418,713 production PathComparison bytes. std.data.json.doc.skip_space alone acquires5,916,268 bytes in paired-cursor reservation phase8; this is a gross hotspot, not a saving or successful-build deficit.

Implement a successor to #883 in src/cleanup_plan/replay/ordinary_plan_history/comparison_owner.rs:180-203: after both original left/right prepares succeed, retain references to the two comparison paths only for that pair's inner loop. Replace the four repeatedly charged vector indexing expressions with field access through those references. End both borrows before any heap swap. Keep the existing #883 segment cursor, all remaining actual compound payload fees and all original work calls in their original order.

The first original observation-comparison work charge must precede the new pair-scope acquisition, preserving work refusal precedence. Subsequent-round charge stays immediately before its existing paired reservation and left/right cursor traversal. Preserve terminal ordering, malformed link/depth precedence, left-before-right stepping, exact swaps, original HIR comparison and full cleanup. No new ABI, source syntax, authority flag, cap, refund, payer reclassification or crosscheck bypass.

Price the concrete source shape, including new pair-local reference slots and primitive lexical frames. Proposed typed banks are PAIR_SCOPE =2PATH_INDEX+2size_of::<&PlanPath>(), and INVOCATION_EXTRA =2PAYMENT_HEADER for the new reserve site and additional lexical work-charge site. Remove only4PATH_INDEX from each paired NEXT fee after its four real index expressions have been removed. Every surviving PAIR_MATCH/STEP/EMPTY/LOAD/TAIL/preparation/swap/HIR payload remains charged. On the observed64-bit layout the source model is160N-96P-704, where N is actual paired observation rounds and P is successfully prepared pairs. Any new implementation role must be added before using this model. No numeric speedup or application-fit claim follows.

Add deterministic diagnostic-only N/P census for complete immediate-old/current matched runs, with invocation/function/route binding, overflow/completeness flags, and no admission or allocation effect. Existing30,898 phase8 reservation attempts are not N. Match both source and accounting boundaries; report original failure as well as prefix charges. Keep all original codec/native/catalog applications at64MiB and unchanged source. Retain the complete unopted crosscheck. A later refusal does not satisfy application compilation.

Freeze and independently compile the complete current #883 comparator, lexical cursor and tariffs as immediate-old. The existing shipping880 before_lexical_cursor cannot stand in for #883. Preserve all older compiled controls and source evidence. Register new files and source inverses through every whole-source inventory. Document the #883 contract successor: references are pair-local and cannot enter persistent owner state or survive mutation.

Required owning coverage: current comparison_owner/tests exact work-cut/six-field diagnostics/swap suite; exact-short-zero-floor-sticky and original first refusal; malformed/deep/empty/tail/shared-HIR; typed Oracle missing/foreign/restored ownership; overflow and full allocation/Drop; complete source identity. Retain original producer+comparison owners and freeze the real immediate-old, without padding its tariffs. Run only affected owning controls, unchanged original application cases and scoped production Clippy in the parent's combined source freeze. Do not run full suites or full quality gates.

Optional stage2 may remove fresh Option/tuple pair-head transport only in a separately priced and measured successor. It must retain head/rest/reference/cmp/tail roles and old left-right failure ordering. Keep #885 factored canonical lookup measurements separate before composing changes.

Do not conflate current selected11 phase-count or selected25 missing phase-site-inventory failures with this optimization; they require their own repairs.

Discovery evidence: /Volumes/Semaprax/provenance/astra-current-application-frontier-20261017/report.md. Source discovery only; no execution or gain claim.

Execution-provenance acceptance: run a complete immediate-old/current comparison on the exact shipping-profile fixture using the existing external native23/24 owners or verified identical-source full CLI, in addition to independent library-unit controls. codec03 UnoptedCrosscheck is cfg(test)-only at factored.rs:147-162 and must remain intact. Do not subtract its charges to claim shipping admission; do not equate unit-prefix N/P with shipping N/P. Existing23/24 is adequate faithful qualification input; no replacement app/template is requested. Preserve original source, native allocation assertions and64MiB. Record shipping result and test-only diagnostic census separately.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions