Store validated stream paths in shared text

Merged
VA
1d ago
+628-43

Problem

Ordinary Stream paths retain a byte-buffer owner and copy it when cloned. Internal byte-prefix slicing also allows a crate child module to form an invalid path such as a/ from a/b.

Design

Store ordinary validated text once and share complete ancestor views. Keep the representation in a private module; expose validated ancestor operations instead of raw prefix lengths. Native paths retain their original funded owner and admission/refund semantics. Use the existing byte comparator for path ordering, with exact differential and work controls.

Deletions

Remove ordinary path-buffer cloning and unchecked prefix construction; repoint internal callers. Native custody is preserved. Relative to main after #819: 628 added / 43 deleted, net +585 across 20 files, chiefly properties, independent baselines and fuzz seeds. No accounting/runtime stack is included in this PR anymore.

Tests run

At signed restacked head363e1675741f2ac35709a5be6facf7c5972de735, through bs.ps1:

  • 37 focused Stream tests passed. Six groups completed in0.01–0.07s: path9, owned bytes11, path work4, children6, native read differential3, cursor work4.
  • Exact N/2N width/depth allocation checks retain one text owner. The actual old/copy controls allocate5/5/17/33 and fail the same bound. Value size64 ->24bytes; copied-output fixture4allocations/84bytes ->3/78. Independent baselines compare full paths, errors, ancestors, hashes and ordering; native tests compare ordered admission/recording/refund events and preserve owner identity.
  • Windows GNU Stream --lib --tests check passed26.78s; WASM Stream --lib --tests check passed5.88s. Fuzz is Linux-only. The path validator, codec, target and seeds are unchanged by this main merge; reuse the preceding pinned-nightly512-run path_text gate.
  • Runtime/admission controls passed3tests in0.03s, including the actual old eight-case admission cap.
  • Full e2e target FAILED:75passed/5failed/1pre-existingignored;356/722 scenario deadlines;14.60s test time,15.26s process wall. The other four failures are Elapsed(()) in read-range, rejected-fs-command, schema-bypass and bash-stdout negative controls. No output/byte-order mismatch was reported. Stopped at the first failing group; the3x group was not run.

The full target is not claimed green. At that run bb1 exposed all160 CPUs, no visible cgroup CPU quota or throttling, host load834.7 and CPU pressure48.24%. The process received143%CPU and spent19.98user+1.99sysCPU-seconds before cancellation, with one major page fault. A separate frozen published#819 baseline run earlier that day also failed146/722 deadlines in7.87s; these observations are not a controlled before/after speedup measurement.

Earlier4f132533c (same path implementation, before this dependency-only main merge) passed80tests/722cases in2.56s isolated and3.00/3.06/3.36s at3x. Those are historical results, not substituted for the failed current-head run.

Decisions

#834 and #819 are merged. This signed main merge resolves only two comparator conflicts: keep the crate-visible comparator required by the private path implementation, and retain both byte-key and path-key work checks. Keep all main's automatic merges, including PersistenceCut. No published history was rebased or force-pushed. No guard, limit, admission, expectation or coverage changed. The separate worker-frame experiment is on a WIP branch without a PR and is not included here.

Reproduce the exact batch: $gate=Get-Content -Raw Q:/lanes/gc-e2e-path-landed-runtime-gate.py; Q:/lanes/bs.ps1 python3 -c $gate. Reuse built binaries instead of rebuilding unchanged code. Artifact root /home/var/targets/gc-e2e-da7560f9/e2e-path-landed-runtime-b6z1rakz; job1792250474193-209817. Compilation2m21s(Stream) and10m08s(e2e) is excluded from test runtimes. Outstanding shared-runtime/production CPU work remains in the lane handoff; it is not represented as solved by this path change.