Skip to content

Commit f127083

Browse files
docs: residue step 2 — the preview pull form measured and stopped (carrier +483 br over a −546 ceiling; net −63); residue doc §3.1 "As measured" + §7b; plan §3 row R2
Measured before writing, per the step's rule, on step 1's head (frames eager 35,250 / 11,654): the deletion ceiling (`stage` whole out) is −1,645 / −546 on this head; the carrier AS THE STEP WOULD HAVE WRITTEN IT — applied to an edited dist copy through the harness's bundler — is +1,414 min / +483 br over it, net −231 / −63 (pages −29 / −37; non-SC 0 / 0). The rule was "carrier > +300 br → stop and report"; nothing of the form reached source. Two findings. (1) The §3.1 sketch (`pullcarrier`, +242) is unsound where the budget was built: it deleted the content token, and `dynamic` delivers a kept resolution only when its address differs — without the token a same-address refetch never runs the follow's compute half or any fill memo in the transaction (#3844's gap 1; C15 (a, b), the optimistic-hold multi-flight arms). The token binding stays in any form: 227 min / 88 br. (2) The honest carrier is twice the sketch because the handler's chunk buffer (≈ 200 min) is replayed through `host.apply` and inherits every semantic the host has — version policy, the landing, L1, per-id routing (nested regions and a flight's several roots stage for free) — while a host-side staged set carries each itself (promote through the store's own `write` + landing tail; the `write` / `settleWait` guards; flight-path per-root staging 176 / 54; nested regions 152 / 53), and the pull read needs a lane gate (the fill keyed by the mount's address accessor, 106 / 29) that the push has by construction, so the read (≈ 750 min) is not smaller than the push it replaces (≈ 700). The unsound floor without flight / regions / gate is still +980 / +339. frames-residue-pass.md: status line; §3.1 "As measured" (the sketch's unsound point, the honest carrier as designed, the attribution table, why the sketch was short by half, the conclusion); §2 row 1c and §4 row 3 corrected to the measured net; §5 item 3 marked stopped; §7b the step's table and what it changes in the path (≈ 120 B of margin instead of ≈ 330 with C1 + claims). frames-savings-pass.md §3: row R2, the surface the form would have added named. frames-consistency-contract.md: C15's pin list gains arm (e), the gap #3844 named. Co-authored-by: Cursor <[email protected]>
1 parent a47bbe8 commit f127083

3 files changed

Lines changed: 151 additions & 5 deletions

File tree

‎documentation/plans/frames-residue-pass.md‎

Lines changed: 145 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,16 @@ edited dist copy through the harness's own bundler (§1); estimates are marked.
3939
without the mirror and the capture arm (2b, 2c, 2e, 2f, 2g), `FRAME_HAVE_*`
4040
off the client entry (5a), the lean re-ask (6b) — **frames eager 11,901 →
4141
11,654 br (−757 min / −247 br)**; see §7 for the measured → built table and
42-
what the step found (2d is pinned; 10 has no export to re-use)._
42+
what the step found (2d is pinned; 10 has no export to re-use).
43+
**Residue step 2 stopped at the carrier budget** (`size/frames-residue-2-pull-form`,
44+
measured on step 1's head, nothing built): the `preview` pull form's sketch
45+
deleted the content token, which is the only carrier by which a same-address
46+
refetch enters the Transaction at all (unsound — #3844's gap (1)); with the
47+
token kept and the carrier built honestly on the edited dist — per-store
48+
staging, a lane-correct read, the flight path, nested regions, the commit's
49+
landing / L1 semantics the chunk replay got for free — it measures **+1,414
50+
min / +483 br over the −546 ceiling: net −63 br**, against the +242 budget
51+
and the −300 target. §3.1 "As measured" has the attribution; §7 the row._
4352

4453
---
4554

@@ -211,7 +220,7 @@ pattern every tier in #3860 showed).
211220
| --: | --- | --- | ---: | ---: | ---: | ---: | ---: | --- |
212221
| 1a | `preview` — the staging **push** half out (commit-only form): `FrameImpl#preview`, `host.preview`, `entry.preview`, `stagedContent.preview` | R.stage | −719 / −216 | −227 | −236 | 0 | — | **not a candidate**: C15 ×4 stay green but `frames-optimistic-hold` ×3 go red (`false/false` in the derivation trace — #3844's finding, re-stated) |
213222
| 1b | `stage` — **everything** out: the buffer, the token, `stagedContent`, `contentAddress`, `CONTENT_TOKEN`, the token arms of `handle` / `applyFlightResponse`, `followAddress` → a plain rebind effect | R.stage | **−1,643 / −542** | −564 | −558 | — (ceiling) | — | C15 ×4 red, optimistic-hold ×3 red: the refetch's morph lands at body end beside siblings the transaction still holds |
214-
| 1c | **the `preview` pull form** = 1b + the carrier sketch (§3.1): a staged record set per address in the host written through as chunks arrive, promoted at the commit; a version tick per frame written in the follow's compute half; the live props read the staged record through it | R.stage | **−803 / −300** | −217 | −264 | **sketch measured: +840 min / +242 br** over 1b (a first honest cut, not golfed; B's first cut was +233 → +145 after golfing) | **−300** (band −250 … −350) | **design**: C15 ×4, `frames-optimistic-hold` ×3, `frames-morph-in-transition` ×3, principles §9.2.2; `c17-gate-bound-address`; public surface: `FrameHost.preview` / `Frame.preview` / `stagedContent` / `contentAddress` removed (approved 2026-10-06, "not even beta") |
223+
| 1c | **the `preview` pull form** = 1b + the carrier sketch (§3.1): a staged record set per address in the host written through as chunks arrive, promoted at the commit; a version tick per frame written in the follow's compute half; the live props read the staged record through it | R.stage | ~~−803 / −300~~ **−231 / −63** (step 2, the sound carrier as designed, measured) | −29 | −37 | ~~sketch +840 min / +242 br~~ **+1,414 / +483 over 1b** — the sketch deleted the token (unsound: `dynamic` never delivers a same-address refetch without it) and omitted the flight path, regions, the lane gate and the commit's landing / L1 semantics (§3.1 "As measured") | **−63** | **stopped at the carrier budget (2026-10-06)**: C15 ×4, `frames-optimistic-hold` ×3, `frames-morph-in-transition` ×3, principles §9.2.2; `c17-gate-bound-address`; public surface: `FrameHost.preview` / `Frame.preview` / `stagedContent` / `contentAddress` removed (approved 2026-10-06, "not even beta") |
215224
| 2a | `_$SC` client mirror | D | −234 / −80 | −70 | −151 | 0 (or ≈ +60 for a minimal `r` without the address arms) | −80 … −60 | **behaviour**: a page whose data scripts carried no reference (so the server never emitted the bootstrap) and a CSR boot have no `_$SC.r` → `handler.component` throws. Needs the server to emit the bootstrap unconditionally on SC pages (≈ +200 B of document output) or the client to keep a minimal `r` |
216225
| 2b | `documentAddress` | D | −95 / −28 | −49 | −3 | 0 | −28 | an unbound adopted mount (direct `_$SC.r(id)` placeholder, no binding) binds the function id instead of the call's address — a post-load refetch under the address would not reach it; `frames-adopted-*` pins to check. Deletes cleanly only with 2a's server half (the t = 0 record carries the address to the mount) |
217226
| 2c | the second dispose map (`bindings` → `fillScopes`) | D | −82 / −20 | −76 | −24 | 0 | −20 | safe (identical bookkeeping; both maps dispose the previous invocation under the same key) |
@@ -321,6 +330,106 @@ refetch — the host's write rule covers it once regions bump per frame).
321330
this pass learned apply: budget the carrier at the sketch (+242), not below
322331
it.
323332

333+
#### As measured — residue step 2 (2026-10-06): stopped at the carrier budget
334+
335+
Branch `size/frames-residue-2-pull-form` on step 1's head (`fce81d2c0`:
336+
frames eager 35,250 / 11,654; page base 114,422 / 36,488; live 126,294 /
337+
40,125). Measured before writing, as the step's rule says: the ceiling
338+
re-applied to this head's dist, then the carrier **as the step would have
339+
written it** (the same text, not a sketch) applied on top of the ceiling,
340+
through the harness's own bundler (§0's method; `.wt-logs/res2-edit.mjs`,
341+
`res2-measure.mjs`). Nothing was written to source; no pin ran against it.
342+
343+
**The sketch is unsound in one place, and it is the place the budget was
344+
built on.** `pullcarrier` deleted the content token with the buffer — the
345+
call resolves the bare per-address binding, `followAddress` reads
346+
`host.staged(address)` off the bare address. But `dynamic` delivers a kept
347+
resolution only when its `.address` differs from the one it last delivered
348+
(`web/src/index.ts`, `resolveBinding` / `sameInstance`): a refetch of the
349+
address a mount SHOWS resolves to the same object, `deliver(address)` is a
350+
same-value write, and neither the follow effect's compute half nor any fill
351+
memo runs in the transaction — the content lands when the body ends, beside
352+
siblings the transaction still holds. That is #3844's gap (1), restated;
353+
the sketch's text could not have kept C15 (a, b) or any multi-flight arm of
354+
`frames-optimistic-hold` green. **The token binding stays in any form**
355+
(`stage`'s mint, `latest`, `settled`, `showing`, one staging target):
356+
**227 min / 88 br** measured — the first thing the +242 did not count.
357+
358+
**The honest carrier, as designed for the build.** Handler: `showing`
359+
decides at the header as today; a staged response's chunks reach the host
360+
flagged (`host.apply(chunk, true)`; the flight path flags by staged root
361+
prefix, as `regionOf` did); the token binding is minted into `latest` and
362+
the call settles at body end. Host: `apply(chunk, stage)` writes a flagged
363+
chunk whose version is newer than the store's into `store.staged = {
364+
version, records }` under the same policy-A `write` (one response's — a
365+
newer replaces it; once the store is at the version, the rest writes
366+
through, as a committed entry did); `settleArgs` through the store's
367+
version-keyed waits, with `settleWait` re-applying only a record that is
368+
the store's current one (a staged record's data settles silently and lands
369+
at the commit); `staged(id)`; `promote(id, version)` = the store's own
370+
`write` plus the landing tail `apply` runs (shown / open / the pending
371+
landing settled or rejected / frames applied / L1 for the response's
372+
undelivered refs), the waits carried across the bump. Frame:
373+
`#stagedRecord(occurrence)` — the staged set's record, else the parent's
374+
when this frame's store does not shadow the key (the `inherited` rule
375+
`preview` had); `ctx.staged()` resolves it through `#resolveArgs` unless it
376+
adds or renames a region (`R.changed`, as `preview` skipped). Fill:
377+
`liveSlotProps` reads `staged() && ctx.staged() || args()`, where
378+
`staged` is the mount's **gate** — `host.staged(address)?.version ===
379+
+version` parsed from the mount's own address accessor (`binding()`), so
380+
the read is keyed by the signal `dynamic` writes in the transaction's pass
381+
and is lane-correct: a write-through recompute between the refetch's header
382+
and its commit (a live op on an adopted boundary, a reveal cascade, a
383+
`settleWait`) reads the committed accessor value and falls to `args()`.
384+
Without the gate the staged set is readable from its first chunk to its
385+
commit — a read outside the pass. Follow: the effect half promotes the
386+
token's version, rebinds, then promotes each region store below
387+
(`regions-tier.ts`, the recursion that replaces `frames()`), so a nested
388+
region's chunks — which the handler's buffer held with the root for free —
389+
land with the root's commit; `Frame.preview`, `FrameHost.preview`,
390+
`stagedContent`, `contentAddress`, the entry's buffer and `named` delete.
391+
392+
**Bytes** (frames eager; the four non-SC scenarios 0 / 0 on every row):
393+
394+
| edited dist | min / br | Δ vs head | carrier over the ceiling |
395+
| --- | ---: | ---: | ---: |
396+
| ceiling — `stage` whole out (§2 row 1b, re-measured on this head) | 33,605 / 11,108 | **−1,645 / −546** | — |
397+
| the carrier as designed | 35,212 / 11,651 | −38 / −3 | +1,607 / +543 |
398+
| … promote through `write` + the shared landing tail (**the lean form; sound**) | 35,019 / 11,591 | **−231 / −63** | **+1,414 / +483** |
399+
| lean − the token binding (_unsound_: nothing delivers) | 34,792 / 11,503 | −458 / −151 | token = 227 / 88 |
400+
| lean − the flight path's staging (_unsound_: a mutation's region tears) | 34,843 / 11,537 | −407 / −117 | flight = 176 / 54 |
401+
| lean − regions (no region promote, no inherited record, no structural check; _unsound_) | 34,867 / 11,538 | −383 / −116 | regions = 152 / 53 |
402+
| lean − the gate (the fill reads the staged set unguarded; _unsound_: a read outside the pass) | 34,913 / 11,562 | −337 / −92 | gate = 106 / 29 |
403+
| lean − flight − regions − gate (the unsound floor) | 34,585 / 11,447 | −665 / −207 | +980 / +339 |
404+
405+
Pages, the lean form: base 114,184 / 36,459 (−238 / −29), live 126,061 /
406+
40,088 (−233 / −37); the ceiling alone −555 / −499.
407+
408+
**Why the sketch was short by half.** The handler's buffer is ≈ 200 min of
409+
dumb array replayed through `host.apply`, and the replay inherits every
410+
semantic the host already has — version policy, the landing, L1, per-id
411+
routing, so nested regions and the flight path's several roots stage for
412+
free. A host-side staged set has to carry each of those itself (≈ 600 min
413+
across `apply`'s branch, `promote`, the `write` / `settleWait` guards and the
414+
region promote), and the pull read (`#stagedRecord` + `ctx.staged` + the gate
415+
+ the `liveSlotProps` / `slotsFor` threading ≈ 750 min) is not smaller than
416+
the push it replaces (`FrameImpl#preview` + `host.preview` + `entry.preview`
417+
≈ 700): the push writes the signal **in** the pass and is lane-correct by
418+
construction, the pull has to buy that with the gate. Keeping the buffer
419+
and pulling from it instead (a `stagedContent.record(token, id,
420+
occurrence)` read, the host's `settleArgs` exposed, the same frame-side
421+
read and gate) measures the same way: ≈ 720 added for ≈ 710 deleted.
422+
423+
**Conclusion.** The deletion ceiling is real (−546) but ≈ 480 of it is
424+
carrier under any sound form; the honest net is **≈ −60 br**, a fifth of
425+
the row's −300 and outside the −250 … −350 band. Stopped per the step's
426+
rule (carrier > +300); §2 row 1c and §4 row 3 are corrected below to the
427+
measured net. What it would still buy if taken for its own sake: the
428+
handler loses `staged` / `named` / `stagedContent` module state and the
429+
flight path's `regions` map; the host gains `staged` / `promote` and
430+
`apply`'s second parameter (`@experimental` surface added, see the step's
431+
PR). Not recommended at −63.
432+
324433
### 3.2 S-ref's pending read belongs to the table (item 12)
325434

326435
As built (#3844), the host mints a pending promise per undelivered key per
@@ -427,7 +536,7 @@ still has to pay; the "built" column subtracts it.
427536
| 0 | head `5c5991cbd` | | **13,083** | | | | |
428537
| 1 | **C6** bind tier (`tight-nopair`, in flight) | −1,243 | **11,840** | 0 (C6's glue is in) | 11,840 | 11,548 | C6's pins; `tier-bind-hold`; the click-replay finding (C6 P1) |
429538
| 2 | **the D list** (2a–2g) + the s / v stamp (10) + the nested marking (8a) + `FRAME_HAVE_*` off the entry (5a) | −349 | **11,491** | +10 (`readHydratedValue` export); the mirror's server half is output, not client bytes | 11,501 | 11,209 | 2a / 2b need the server to emit the bootstrap unconditionally; 2f / 5a / 10 are public-surface items; 2d / 2g are behaviour changes |
430-
| 3 | **the `preview` pull form** (1c; carrier sketched **and measured in the row**) | −277 | **11,214** | 0 | 11,224 | 10,932 | **design** §3.1; C15 ×4, optimistic-hold ×3, morph-in-transition ×3 |
539+
| 3 | **the `preview` pull form** (1c; carrier sketched **and measured in the row**) | −277 → **−63 as designed** (step 2: the sketch's carrier was unsound and half-counted; §3.1 "As measured") | **11,214** (≈ 11,430 with the honest carrier) | 0 | 11,224 (≈ 11,440) | 10,932 (≈ 11,150) | **stopped** (carrier +483 > +300); C15 ×4, optimistic-hold ×3, morph-in-transition ×3 |
431540
| 4 | **R.insert** — every fill through `insert` (3) | −196 | **11,018** | 0 | 11,028 | 10,736 | public surface: the marker-less `createFrame` path |
432541
| 5 | the fallback pass (4a) | −75 | 10,943 | DR-4 (its own plan) | — | — | **not recommended** (§3.4); kept to show it does not matter — the rows below are measured **without** it where marked |
433542
| 6 | **the lean re-ask** (6b) | −78 | **10,865** (10,940 without row 5) | pages +30 | 10,950 | 10,658 | **design** §3.3 (sf client ctx) |
@@ -495,7 +604,9 @@ two seeds clean):
495604
sketch's budget (+242 br), with C15 ×4 and optimistic-hold ×3 as the
496605
gate. It also simplifies the handler (no `stage` / `latest` / `named` /
497606
token) and `applyFlightResponse` (regions bump per frame, no staged-region
498-
map).
607+
map). **Stopped (residue step 2, §3.1 "As measured" / §7):** the token
608+
cannot go (it is the delivery), the honest carrier is +483 br over the
609+
−546 ceiling, net −63; not recommended at that price.
499610
4. **R.insert** (−196) with the marker-less `createFrame` path ruled (an
500611
anchor requirement on `createFrame`, documented).
501612
5. **S-ref to the table** (§3.2; ≈ −250 built) — a decode-chunk change plus
@@ -599,6 +710,36 @@ server half (§3.7 — the mirror alone, now that `documentAddress` is gone);
599710
the capture arm, which needs a ruling on the away/back behaviour of an
600711
SSR'd boundary; the stamp, which needs a `solid-js/internal` export.
601712

713+
## 7b. Measured, not landed — residue step 2 (2026-10-06): the `preview` pull form
714+
715+
Branch `size/frames-residue-2-pull-form` on step 1's head (`fce81d2c0`,
716+
frames eager **35,250 / 11,654**). §5 row 3, measured before writing per the
717+
step's rule (ceiling, then the carrier as it would be written, both on an
718+
edited dist copy through the harness's bundler) — and **stopped at the
719+
carrier budget**: the rule was "if the carrier exceeds +300 br, stop and
720+
report the design". Nothing of the form reached source; the step's one
721+
source change is a pin.
722+
723+
| item | measured on this head | note |
724+
| --- | ---: | --- |
725+
| the ceiling — `stage` whole out (§2 row 1b) | **−1,645 / −546** (pages −555 / −499) | matches the row's −542 |
726+
| the sketch's carrier (`pullcarrier`, §2 row 1c) | +840 / +242 (the row's figure) | **unsound**: it deleted the content token; `dynamic` delivers a kept resolution only when its address differs, so without the token a same-address refetch never runs the follow's compute half or any fill memo in the transaction (#3844's gap (1); C15 (a, b), the optimistic-hold multi-flight arms) |
727+
| the carrier as the step would have written it (§3.1 "As measured") | **+1,414 / +483** over the ceiling → **−231 / −63 net** (pages −29 / −37) | token 227 / 88 · flight-path staging 176 / 54 · nested regions 152 / 53 · the lane gate 106 / 29 · the host's staged set with promote's landing / L1 / waits ≈ the rest; every one load-bearing |
728+
| the unsound floor (no flight, no regions, no gate) | +980 / +339 | still over the +300 budget |
729+
| **built** | **—** | stopped; frames eager stays **11,654** |
730+
731+
**Pin added (by name, green on the push form):** `c15-staging-atomic` (e) —
732+
the gap #3844 named: a same-address refetch enters the transaction (the
733+
fill derives the new arg in its pass — `seen` is `["one", "two"]` while the
734+
DOM, `frame:applied` and the frame's version still show v1), and the commit
735+
lands it whole. Any carrier of the staging — push or pull — must keep both
736+
halves.
737+
738+
What this changes in the path (§4): row 3's −277 becomes ≈ −60 as a sound
739+
build, so the residue proper (rows 2–4, 6) stalls ≈ 215 B higher than §4
740+
says; crossing 10.0 still needs C1 and the claims chunk, with ≈ 120 B of
741+
margin instead of ≈ 330. The push form stays, as #3844 left it.
742+
602743
---
603744

604745
## Appendix A — every unit on the head (273 units, 40,000 B; by whole unit)

0 commit comments

Comments
 (0)