Skip to content

Commit 202521c

Browse files
olwangclaude
andcommitted
docs(selfhost-ledger): record Slice 4 (copy-at-escape) deferral — data-backed NO-GO; Fix 3 complete
Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
1 parent 1d01975 commit 202521c

1 file changed

Lines changed: 17 additions & 0 deletions

File tree

docs/ledgers/rss-selfhost-ledger.md

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -748,6 +748,23 @@ gap is VM value-representation / intrinsic-dispatch cost (the next big lever).
748748
the change only ADDS elisions). New guards:
749749
`reg_vm::tests::…::deepcopy_elision_fires_for_string_read_param` (positive) and
750750
`…::deepcopy_elision_kept_for_stored_read_param` (negative / over-promotion).
751+
- **Slice 4 (copy-at-escape) — DEFERRED, data-backed NO-GO (2026-07-01):** the final
752+
optimization would move a KEPT copy from the prologue to just before the single
753+
escape point (so a cold/rare escape stops costing a per-call copy — AOT's
754+
`retains`-driven clone-at-use). Scoped and declined for now: (1) mid-body copy
755+
insertion shifts **absolute jump/back-edge indices** (`Jump*` targets are absolute,
756+
`model.rs:~2659`), so it must renumber every downstream target and interacts with
757+
the native tier's own renumbering (`passes.rs:~2431`) — large corruption blast
758+
radius. (2) The *sound* applicability is narrow: only a SINGLE escape, NOT in a
759+
loop (a per-iteration copy would be worse), and the escaping reg must be the root
760+
param itself, not an interior alias (deep-copying the root before an alias escapes
761+
does nothing) — all other cases must fall back to the prologue copy. (3) Expected
762+
win is small (most escapes are stores of interior aliases inside loops). Verdict:
763+
high risk / low reward — deferred until a corpus probe shows the simple case is
764+
common enough and it can get its own session with a dedicated jump-renumbering
765+
safety test. **Fix 3 is otherwise COMPLETE**: borrow-by-default (keep only on
766+
proven escape) now holds for every non-escaping `read` param across scalars,
767+
scalar pattern-binds, and pure `String`/`Bytes`/`Map`/`List` readers.
751768

752769
### SH-023 — self-hosted checker reaches RS0005 parity at declaration level; the merged callable namespace is the load-bearing rule
753770

0 commit comments

Comments
 (0)