Skip to content

Execution plan (#58): complete L2, then drive L4→L6 — full context handoff #66

Open

Description

@Huxpro

Important

Plan revision 2026-08-19: §3 Phase A's A4/A5 cut is superseded by the plan-revision comment — the integration base is now new-lynx, Phase A resumes as Phase 0 (update-path attribution with a decision gate) → Phase 1 (protocol v2 per #61's closure analysis) → Phase 2 (A4/A5 fused ABI cutover) → Phase 3 (in-loop gates). Phases B–E below stand. Read that comment together with this body.

Single-goal execution plan for finishing the #58 roadmap, written as a self-contained handoff for an agent session with no prior context. Read this top to bottom before writing any code. The owner reviews PRs the next morning — everything lands as draft stacked PRs, nothing merges autonomously.

0. Where things stand (verified state, 2026-08-18)

Landed as a 4-PR draft stack (merge order #59 → #63 → #64 → #65; each base is the previous branch):

PR branch what it proved
#59 (L0) claude/octane-issue-58-arch-j4ya6v GO verdict: direct emission beats the interpreted representation — FCP@10k 0.575× vs the universal path on the architecture-floor prototype; committed session records in benchmarks/lynx-table/prototype/results/
#63 (L1) claude/octane-issue-58-l1-lynx-target target: 'lynx' accepted (renderer config v5); eligible host-only plans emit {kind:'template', slots, create(env, values)}; template and plan encodings render deep-equal first-screen batches (differential suite packages/octane/tests/lynx-target-templates.test.ts); lynxMainThreadRenderer runs on the new target
#64 (L2 spike) claude/octane-issue-58-l2-kernel-spike packages/octane/src/universal-kernel.ts: host-neutral hook cells + queue types + pure helpers, zero drift, zero imports (pinned)
#65 (L3 slice 1) claude/octane-issue-58-l3-direct-first-screen applyLynxFirstScreenDirect in host-driver.ts: first screen through direct PAPI writes, adoption capture byte-compatible (differential + fault-injection tests in packages/lynx/tests/first-screen-direct.test.ts); in-product FCP@10k −240 ms (0.865×), floor 979 ms

All five owner review findings on #63/#64/#65 are fixed and their threads resolved (commits c9190afc, 4924e406, 2fe14465). Test state at stack head: lynx 26 files/344, octane+octane-prod 837/12,418+, typecheck clean.

The living spec is docs/lynx-specialized-target-l0.md — §3 IR/protocol, §5 kernel-extraction seam inventory (in extraction order), §8 landed increments and the accepted gzip trade. Roadmap issues: #60 (L1 breadth), #61 (L2), #62 (L3 remainder). Update the spec's §8 as each slice lands.

1. Non-negotiable working discipline

  • Every slice is an assumption-validating vertical slice: differential test proving old-path/new-path equivalence, red-green verified (break it, watch it fail, restore), plus a same-window measurement when the slice claims performance. This is what got the stack through review — keep it.
  • Follow CLAUDE.md + .rulesync/rules/core-engineering.md: AST-only emission (builders, copy-on-write; the deep-frozen-AST and emit-audit suites enforce it), behavioral tests only, pnpm sync + pnpm format:files before every push, changesets on the patch track, provenance footers on commits/PRs, agent-authored conventions.
  • Stacked PRs continue: new branch per slice, base = previous branch, draft, honest Validation/Risk sections with real numbers. On review events: fix + reply + resolve (drive-to-green). If the stack merges mid-session, restart per the merged-PR rule (git checkout -B <branch> origin/main).
  • Measurement honesty (benchmarks/lynx-table/README.md): quiet host, fresh page per sample, AB/BA alternation, n≥5, same-window ratios only; absolute ms are host-bound and NOT comparable across sessions/hosts. A cell that can't be driven end-to-end is "not measured".

2. Environment gotchas (each cost real time to discover)

  1. Playwright browsers: the container ships /opt/pw-browsers/chromium-1194 + chromium_headless_shell-1194, but playwright 1.61 wants revision 1228. Fix (do NOT playwright install):
    mkdir -p /opt/pw-browsers/chromium_headless_shell-1228/chrome-headless-shell-linux64
    ln -sf /opt/pw-browsers/chromium_headless_shell-1194/chrome-linux/headless_shell \
      /opt/pw-browsers/chromium_headless_shell-1228/chrome-headless-shell-linux64/chrome-headless-shell
    touch /opt/pw-browsers/chromium_headless_shell-1228/INSTALLATION_COMPLETE
  2. Importing compile.js inside the vitest lynx project fails (the octane plugin tries to transform the compiler itself). Compiler-executing tests live at packages/octane/tests/ top level (octane project), or use the child-process pattern in packages/lynx/tests/first-screen.test.ts.
  3. rspeedy-plugin tests native-demo ("escalates cleanup for a detached descendant") and packed-consumer fail pre-existing in this container (verified on clean tree) — not yours, don't chase them.
  4. stages/run.mjs with OCTANE_LYNX_PROFILE=1 temporarily patches packages/lynx/src sources via stages/instrument-source.mjs (restored in a finally) — don't run it concurrently with edits.
  5. Useful harnesses beyond the CI gates: benchmarks/lynx-table/prototype/run-fcp.mjs (FCP A/B, supports --extra id=path cells + --out-suffix), prototype/smoke.mjs (functional parity per op), web/run-web.mjs --cells octane,octane-direct,vue-vdom,vue-vapor,react (cross-framework wall clock), node benchmarks/bench.mjs --only lynx-table --ratios (deterministic wire gates).
  6. packages/lynx/src/config.ts and config.runtime.js are hand-kept mirrors — edit both, config.test.ts pins parity.

3. Phase A — L2 to complete (#61). The hardest remaining milestone; take it in order.

Superseded 2026-08-19 from A4 onward — A1–A3 landed (#67–#75); the A4/A5 cut below stalled at the boundary for the reasons recorded in the plan-revision comment, which replaces it with Phase 0–3. Kept for the record.

A1. Typed delta protocol module (new packages/lynx/src/core/delta-protocol.ts): opcodes per spec §3.4 — RUN(templateId, anchorSlot, count, values…), SET(instance, slotIndex, value), REMOVE, MOVE(instance, before) (LIS output), BRANCH(slot, templateId|none, values…), range framing for @for/@try. Flat self-delimiting op sequences, header/type validation only (version, opcode bounds, arity). Round-trip + malformed-input tests. Pure addition, zero risk, no dependency on the stack review. Behavioral oracle: the L0 prototype's applier (benchmarks/lynx-table/prototype/lepus-root.js).

A2. Kernel slice 2 — owner abstraction + injected scheduleOwner: per §5 inventory. This is where drift risk starts: per the #64 review note, the guard must render through a universal root and assert observed behavior, not call helpers standalone. Guard set: universal-scheduling, universal-event-scope, universal-retained-suspense, universal-activity, universal-renderer + full octane/octane-prod.

A3. Kernel slices 3–5: transition-batch seam (globals + scheduleTransition/discardTransitionBatch/__scheduleMicrotask as injected root services), then root services used inside hooks (formatUniversalId, warm-memo cache keyed off an opaque token instead of the root, readBridgeContext), owner claiming last. One PR per slice, same guard discipline. If any slice cannot stay green without behavioral drift, stop and record the fresh-core fallback decision in the spec — that is a legitimate exit, not a failure.

A4. Background delta emission: make the Lynx background driver produce protocol deltas natively. Start at the client-driver.ts boundary: map the existing mount-template-run/prop-patch output onto RUN/SET, kill the updates.classify double diff (planLynxHostPropPatch run-and-discard at client-driver.ts:1471-1477) and the full-props-bag update command. Land it dual-path first: a differential harness proving delta-stream application ≡ command-batch application on the same commits (the deterministic workload.ts chassis in benchmarks/lynx-table/run.mjs drives real commits over a fake PAPI — reuse it). Wire gates (update_storm/select/swap in benchmarks/baselines/ratios.json) must hold by construction.

A5. Main-thread delta applier: consume the slots tables #63 already emits — table dispatch into pre-bound PAPI setters, no prop-bag replanning on either side. Measure update10th/select (L0 targets: 82/44 ms floor vs 146/75 current at 10k) and bg_replay reduction in the stages harness.

Exit gate (from #58 L2): current Lynx + relevant universal suites pass on the new path (ported, not weakened); wire floors hold; validateLynxBackgroundOutboundMessage's recursive walk replaced by header checks for delta traffic.

4. Phase B — L3 remainder (#62)

  • Lazy/elided command batch when the direct path succeeds (it's still built today; it remains the product for the list fallback and the returned result — make it demand-built and measure).
  • captureLynxFirstTree fast exit keyed off state.hasMainThreadProps (it re-plans prop patches per node today).
  • First-screen create functions binding the template env straight to PAPI (today: env → records → direct applier; collapse to env → PAPI with the adoption metadata table from the feat(lynx): direct-emission first screen with unchanged adoption capture (issue-58 L3) #65 exploration — the "minimal contract" is documented in that PR's discussion and host-driver.ts comments).
  • Re-measure FCP@10k same-window vs the preserved pre-change build each slice (run-fcp.mjs --extra). Current: 1543 ms, floor 979 ms.

5. Phase C — L4 (lists, worklets, platform surface)

Mostly porting; the L0 analysis confirmed worklets/NodesRef/init-data/ContextProxy "were never the problem". Risk concentrates in native lists: recycling callbacks + slot tables, and revisiting the lists-excluded-from-adoption divergence. The direct first-screen path deliberately declines lists today (applyLynxFirstScreenDirect returns false) — extending it is part of this phase. Exit: lynx-list physical-cell ratio holds; full packages/lynx suite green.

6. Phase D — L5 (parity, size, cutover) — partially blocked in this environment

7. Phase E — L6 (cleanup + ABI decision)

Remove Lynx-only universal capabilities/compensation layers (template-program-mount and friends) from octane/universal where @octanejs/three doesn't use them; update docs/universal-renderer-architecture.md + docs/lynx-native-renderer-plan.md; file the follow-up on the universal ABI's remaining scope. Answer spec §9's open question 3 (does three want slot tables) as part of the decision.

8. Definition of done for the session

Phases in order; a phase is done only with its differential evidence + measurements + green suites + a pushed draft PR on the stack. If time runs out mid-phase, land the completed slices and update this issue + the spec §8 with exact state, remaining seams, and any NO-GO findings — the owner reviews everything the next morning.

Activity

  1. Huxpro commented on Aug 18, 2026

    @Huxpro
    OwnerAuthor

    Adversarial audit of the L0–L3 equivalence claims

    Ran against stack head 2fe14465f (claude/octane-issue-58-l3-direct-first-screen). Goal was to break the equivalence claims the strategy rests on, not to confirm them.

    Bottom line: 2 of the 4 claims are false. #63's compile-equivalence and #65's applier-equivalence both have executable counterexamples. #64's zero-drift claim and the deterministic wire gates both survived everything thrown at them.

    Red tests on claude/octane-issue-58-adversarial-audit (f70f46aa3, 5d000b30e) — failing on purpose, no fixes, no shipping code touched.

    Claims × lenses × verdicts

    Claim Lens Rounds Verdict
    1 (#63) prop names 1 CONFIRMED BREAK → #71
    1 prop values 1 CONFIRMED BREAK → #70
    1 static/binding order + slot table 1 not-attackable — collisions force propsSlot → eligibility rejects; integer-like keys unauthorable; slot table verified correct on 20+ templates via a Proxy-recording env
    1 text holes 1 candidates raised, superseded by #70/#71 root causes
    1 eligibility boundaries 1 2 new findings → #77 + measurement note below
    1 hidden Activity / keyed @for 1 candidates raised, unadjudicated
    1 HMR-enabled compiles 0 NOT RUN — truncated
    2 (#65) applier acceptance 1 (mine) CONFIRMED BREAK → #76
    2 fault matrix, 11 PAPI methods × 3 positions 1 (mine) HOLDS
    2 ordered PAPI call journal 1 (mine) differs; assessed not a defect
    2 main-thread: props / worklet registry 0 NOT RUN — truncated
    2 real adoption round after each applier 0 NOT RUN — truncated
    2 degenerate tree shapes 0 NOT RUN — truncated
    3 (#64) render-phase reentrancy 1 HOLDS — findings reproduce on base → #72, #73
    3 suite ordering / seeds / --no-isolate 0 NOT RUN — truncated
    3 effect-event across retained-Suspense discard 0 NOT RUN — truncated
    3 linked-state parked drafts 0 NOT RUN — truncated
    3 kernel mutation testing 0 NOT RUN — truncated
    4 committed wire gates 1 (mine) HOLDS
    4 adversarial tap sequences 1 (mine) HOLDS

    Filed

    Issue Claim What
    #70 1 Prop-value observation order — template validates props before children, plan validates after. Under @catch, both renders succeed and paint different text ('outer prop exploded' vs 'inner prop exploded'); child subtree renders 0× vs 2×. Reachable with plain data-* on standard intrinsics.
    #71 1 Custom elements skip attribute validation entirely (compile-universal.js:1817 gates on Object.hasOwn(hostProps, name)); a __proto__ prop then poisons [[Prototype]] on one path and is laundered on the other. hostCount 1 vs 2, 2- vs 4-command batch.
    #76 2 applyLynxFirstScreenDirect paints trees the staged applier refuses (#text under a non-text host). Direct: 2 instances. Staged: throws. Also documents that children={...} bypasses the compiler's own text-under-<view> rule.
    #72 — Pre-existing. Warm-plan drain loop is unbounded — 200,001 invocations, terminated only by the probe's guard. Unbounded synchronous stall on the Lynx main thread during first screen.
    #73 — Pre-existing. Main-thread first-screen useState returns a no-op updater; render-phase updates are dropped, forcing a mismatch repair on every launch.
    #77 — Pre-existing. Glob-vs-regex classifier disagreement: <view bind-tap={h}> compiles clean, the handler is silently destroyed, and Symbol(octane.lynx.first-screen-event) leaks into the wire props.

    #72, #73 and #77 were verified to reproduce identically on base 6079a6804 (via a git worktree) and are explicitly not stack regressions — they don't count against #63/#64/#65.

    What was attacked and held

    Reporting these because a summary listing only hits overstates itself.

    • refactor(universal): extract the host-neutral hook-cell kernel (issue-58 L2 spike) #64 zero-drift survives. Both reentrancy findings reproduce on base. The extraction itself shows no behavioral drift.
    • feat(lynx): direct-emission first screen with unchanged adoption capture (issue-58 L3) #65 fault discipline survives. Faults injected at setEvent/remove/setAttribute/flush/insertBefore during teardown give byte-identical LynxHostCleanupResult (complete, errors, remainingRoots) and identical container.disposed on both appliers. The retry contract (disposed:false + populated errors) works as documented. Flush obligation is exactly one flush on a mid-walk fault on both.
    • Wire gates hold at their floors. --only lynx-table --ratios: 24/299 applicable guards, 0 breached, select and swap flat from 1k→10k. Plus 12 adversarial sequences the committed gate never measures — including re-tapping the already-selected row (0 commits, 0 commands, floor is zero and it hits zero) and selecting a row the swap physically moved (227 B vs the 225 B baseline, so moved survivors do not republish handle state).
    • Hypotheses killed by execution, not argument: static object-value freshness (object values always become bindings on both paths); static/binding name collisions (forced to propsSlot, eligibility rejects); integer-like key reordering (unauthorable); the emitted slots table (verified correct against actual create() usage on every emitted template).
    • PAPI call journals differ (direct 46 calls, staged 48; direct interleaves insertBefore during the walk and skips setEvent SET/REMOVE pairs on hidden subtrees) but terminal container state is identical. Assessed not a defect — .rulesync/rules/testing.md lists exact internal call order as a non-contract, and feat(lynx): direct-emission first screen with unchanged adoption capture (issue-58 L3) #65's claim is about container state.

    Measurement-validity concern (not a bug, but load-bearing for the roadmap)

    lynxTemplateEligible is all-or-nothing over the whole plan. One ref anywhere in a module flips it from templates=1 planHostNodes=0 to templates=0 planHostNodes=4 — the entire module reverts to the interpreted encoding while rendering an identical tree. Same cliff for a key, a children prop, a duplicate class/className pair, or any static event-shaped prop.

    Correctness is unaffected (both encodings render the same 5 hosts). But <view ref={r}> is among the most ordinary gestures in the framework, and under main-thread render-only a ref value is already erased to literal undefined and deleted by the record path — so the lowering only needed to skip emitting for that binding, not abandon the tree.

    This bears directly on the L1/L3 FCP numbers in §8: any fixture measured without refs overstates template coverage on real components. Worth re-checking what fraction of a realistic app actually lowers before the L5 cutover gate.

    Residual list — what was NOT attacked

    No silent caps. Explicitly:

    1. 0 of ~63 adversarial refuter panels adjudicated. The 2-of-3 refutation stage never produced a verdict — the box has 4 CPUs, workflow concurrency capped at 2, and refuters queued behind finders. The 6 filed issues rest on my own independent reproduction, not on panel votes, and each issue says so. 27 of 33 candidates remain unadjudicated and are not filed.
    2. 10 of 17 planned finder lenses never ran (marked above). The largest hole is CLAIM 2's five designed lenses — none ran; I substituted three by hand (acceptance, fault matrix, journal), leaving main-thread:/worklet-registry, the real adoption round, and degenerate tree shapes unattacked.
    3. CLAIM 3 got 1 of 5 lenses. Suite-ordering/seed/--no-isolate probing, effect-event across retained-Suspense discard, linked-state parked drafts, and the kernel mutation-testing lens all never ran. The zero-drift verdict is therefore weakly evidenced — it rests on one lens plus that lens's base comparison, not on the planned matrix.
    4. Loop-until-dry never converged. No claim reached the 2-consecutive-dry-rounds criterion; round 1 was still in flight.
    5. The completeness critic never ran. This residual list is mine, not its output.
    6. H9 unreachable in the available harness — whether state.hasMainThreadProps (a sticky flag mutated mid-walk and fed per-node into applyProps) makes earlier nodes observe false and later ones true needs a container with a real worklet registry. Every fixture with a real main-thread worklet prop died identically on both appliers before the flag mattered.
    7. No native-engine evidence. Whether __AddEvent-then-remove is truly net-zero, and whether direct's incremental attach vs staged's batched attach shifts layout/paint timing, is only answerable on a device — the limit §6 already records.
    8. octane-prod project and dev-diagnostics modes were only touched incidentally; the HMR-compile lens never ran.

    Both workflows were still running when this was posted; anything material that lands later will be added as a follow-up rather than by editing this comment.


    Generated by Claude Code

  2. Huxpro commented on Aug 18, 2026

    @Huxpro
    OwnerAuthor

    Session handoff — 2026-08-18 SG1

    Completed Phase A through A3 and the first A4 dual-path slice as six draft stacked PRs on #65; nothing was merged or marked ready:

    1. feat(lynx): define typed slot-delta protocol (issue-66 A1) #67 feat/lynx-delta-protocol (base feat(lynx): direct-emission first screen with unchanged adoption capture (issue-58 L3) #65) — A1 versioned flat RUN/SET/REMOVE/MOVE/BRANCH protocol, malformed/opaque-value coverage.
    2. refactor(universal): extract hook owner scheduling seam (issue-66 A2) #68 refactor/universal-kernel-owner (base feat(lynx): define typed slot-delta protocol (issue-66 A1) #67) — A2 committed/draft owner contracts + injected scheduleOwner.
    3. refactor(universal): extract transition batch controller (issue-66 A3) #69 refactor/universal-kernel-transitions (base refactor(universal): extract hook owner scheduling seam (issue-66 A2) #68) — A3 transition controller (active/in-flight state, pending listeners, promotion, cross-root settlement/re-home).
    4. refactor(universal): inject hook root services (issue-66 A3) #74 refactor/universal-kernel-root-services (base refactor(universal): extract transition batch controller (issue-66 A3) #69) — A3 injected ID/warm-token/bridge-context services.
    5. refactor(universal): extract lazy owner claiming seam (issue-66 A3) #75 refactor/universal-kernel-owner-claiming (base refactor(universal): inject hook root services (issue-66 A3) #74) — A3 lazy owner activation + hook-slot composition. Extraction remains GO; fresh-core fallback not selected.
    6. feat(lynx): prove typed delta shadow over real commits (issue-66 A4) #78 feat/lynx-delta-shadow (base refactor(universal): extract lazy owner claiming seam (issue-66 A3) #75) — A4 profiling-only transactional command→typed-delta shadow and real-workload proof.

    All six are open drafts, mergeable, provenance declared, with no review comments as of handoff.

    Red-green / behavior evidence

    • A1: missing module red; deliberate nullable MOVE decoder break failed round-trip; 15 focused cases green.
    • A2: dropping injected schedule callback left rendered state/reducer at 1/2 instead of 3/6 in dev+prod.
    • A3 transition: dropping injected microtask left public root stuck pending=true/count=0; restored final false/1.
    • A3 root services: ignoring useId index produced duplicate opaque IDs in dev+prod.
    • A3 claiming: disabling lazy-scope claim made keyed getter items render A/A instead of A/B. First draft also exposed a real nullable renderer-region probe invariant (22 failures); controller now separates nullable owner probes from strict hook access.
    • Final A3 guard set: 14 files / 396 tests green in dev+prod.
    • A4: offsetting emitted SET slot by +1 failed per-commit command-vs-delta differential. Final Lynx: 28 files / 362 tests; stage/fold: 8 tests. Non-profile bundle is byte-equal to control.

    Same-window measurements

    • A2 B/A/B/A universal leaf: 4k scoped 0.038/0.037 ms base vs 0.040/0.040 candidate; clean-root 6.764/6.571 vs 6.927/6.615. Noise/inconclusive, no claim.
    • A3 transition controller: 7×200 public transitions per window, 0.0559/0.0576 ms base vs 0.0591/0.0579 candidate. Noise/inconclusive.
    • A3 root services: 4k scoped 0.037/0.039 vs 0.041/0.041; clean-root moved opposite direction. Mixed/inconclusive.
    • A3 claiming: 4k scoped 0.039/0.039 vs 0.042/0.040; list-item 0.203/0.217 vs 0.192/0.195. Mixed/inconclusive.
    • A4 shadow real lynx-table, 1k+10k, two iterations: all 166 measured commits expressible, 0 misses, existing command/render/wire/identity/event controls unchanged. 10k projected delta/current bytes: create 349,778/350,619; update10th 36,755/69,874; select 40/225; swap 27/368; update storm 1,133,250/2,789,296; select storm 1,346/6,956. These are projections only; command wire remains authoritative.

    Environment / validation caveat

    A2 broad octane+octane-prod reached 833/837 files and 12,418 passing tests but was not green because Vite fixture watchers hit SG1 inotify EMFILE (55,190 repeated watcher errors), causing web3/timeouts and one hydration wait. HMR + deferred hydration passed isolated (50 tests); web3 assertions passed (4 tests) but its dev-server watcher still emitted the same environment error. Relevant universal guards are green. The issue-noted rspeedy-plugin pre-existing failures were not chased. No native-engine evidence was claimed.

    Exact remaining work

    • A4 authoritative cutover: capability/versioned delta message in protocol union; background sends delta envelope; main consumes compiler slot tables; preserve ACK/accepted-fault/handle/public-instance/event/worklet semantics; then remove full-props update commands and client-driver.updates.classify double diff. The feat(lynx): prove typed delta shadow over real commits (issue-66 A4) #78 shadow proves the table workload needs no lossy fallback but intentionally declines cold event/lifecycle/public-instance and non-binding prop mutations.
    • A5 main-thread slot-table applier and stage measurement (update10th/select + bg_replay).
    • Then Phase B onward in issue order. Native macOS/Android/iOS gates remain owner handoff per §6.

    Living spec §8 is updated through #78 with exact measurements and extraction verdict.


    Agent-authored session update; owner review requested before any readiness/merge action.

  3. Huxpro commented on Aug 18, 2026

    @Huxpro
    OwnerAuthor

    Adversarial audit of the L0–L3 equivalence claims — REVISED, supersedes my earlier comment

    The earlier summary is superseded. It is wrong in three ways: it misattributes half of #71, it lists the HMR lens as truncated when that lens later ran, and it predates #79–#82. Read this one. Ran against stack head 2fe14465f.

    Bottom line unchanged: 2 of the 4 claims are false. #63's compile-equivalence and #65's applier-equivalence both have executable counterexamples. #64's zero-drift claim holds behaviorally but its evidence does not. The wire gates hold.

    Red tests on claude/octane-issue-58-adversarial-audit (f70f46aa3, 5d000b30e) — failing on purpose, no fixes, no shipping code modified.

    Verdicts

    Claim Verdict Issues
    1 (#63 compile equivalence) BROKEN #70, #71(B), #79
    2 (#65 applier equivalence) BROKEN — two independent mechanisms #76
    3 (#64 kernel zero-drift) HOLDS behaviorally; evidence deficient #80
    4 (deterministic wire gates) HOLDS —

    Filed — stack-introduced

    Issue What
    #70 Prop-value observation order. Template emits every env.p before children; renderPlanNode materializes children first and validates after. Consequence is worse than first reported: the two encodings commit different @try arms (@catch vs @pending), painting the framework's internal diagnostic as user-visible text — identical across prod/hmr-vite/hmr-webpack/dev/profile. Also masks the app's own error while its subtree never renders (childRenders=0 vs 1, so use()/useBatch prefetch never registers), and blames a different element in the native-resource diagnostic.
    #71(B) Foreign [[Prototype]] survives freezeTemplateHostProps, then cloneProps→hasCrossRealmPlainPrototype rejects it. On any page with a native <list> (which forces the staged path), target:'lynx' throws the first screen where target:'universal' paints 3 hosts.
    #79 Source-map origins collapse to the plan root. A component spanning authored lines 3–9 decodes to only lines 3 and 9; four elements lose their entries. OCTANE_COMPILE_ASSERT_LOC passes because origins exist — they are just the wrong ones.
    #76 applyLynxFirstScreenDirect paints trees the staged applier refuses. Two independent mechanisms: #text under a non-text host, and a main-thread:ref shared by a visible and a hidden <Activity> host. The base check is decisive — the direct applier does not exist at 6079a6804, so the divergence is new.
    #80 #64's guard suites cannot observe effect-event cell lifecycle. Gutting deactivateEffectEventCells leaves 77/77 green across all five named suites (independently reproduced); inverting the retained-Suspense shared-cell guard at universal-core.ts:8200 leaves all 299 universal-* tests green while breaking every useEffectEvent handler mid-transition.

    Filed — pre-existing, verified on base 6079a6804, NOT counting against this stack

    Issue What
    #81 Any page with a bind*/catch* handler inside <Activity mode="hidden"> can never adopt its first screen — main emits event commands for every host (main-renderer.ts:1104), background gates on isVisible (universal-core.ts:10277). Every launch: paint, then full rebuild, identityPreserved: false.
    #82 On the repair path, main-thread.ts:2211 bare-truncates the buffered native-event queue with no diagnostic. The user's first taps vanish silently. Compounds with #81: for that whole class of page, the fast first screen is strictly worse than none.
    #72 Warm-plan drain loop unbounded — 200,001 invocations, terminated only by the probe's guard. Unbounded synchronous main-thread stall during first screen.
    #73 Main-thread first-screen useState returns a no-op updater; render-phase updates dropped, forcing a mismatch repair every launch.
    #77 Glob-vs-regex classifier split: <view bind-tap={h}> compiles clean, the handler is silently destroyed, and Symbol(octane.lynx.first-screen-event) leaks into wire props.
    #71(A) Unguarded props.children prototype read at main-renderer.ts:802, missing the hasOwnProp guard universal-core.ts:3695 has. From octanejs#660.

    Corrections made during the audit

    Recorded because they bear on how much to trust the rest:

    What was attacked and held

    • refactor(universal): extract the host-neutral hook-cell kernel (issue-58 L2 spike) #64 zero-drift survives. Both reentrancy findings reproduce on base.
    • feat(lynx): direct-emission first screen with unchanged adoption capture (issue-58 L3) #65 fault discipline survives. Faults at setEvent/remove/setAttribute/flush/insertBefore during teardown give byte-identical LynxHostCleanupResult and container.disposed on both appliers; exactly one flush on a mid-walk fault on both.
    • Wire gates hold. 24/299 applicable guards, 0 breached; select/swap flat 1k→10k. Plus 12 adversarial sequences the committed gate never measures — re-tapping the selected row is 0 commits / 0 commands (floor is zero, hits zero), and selecting a swap-moved row costs 227 B vs the 225 B baseline, so moved survivors do not republish handle state.
    • Killed by execution: static object-value freshness; static/binding name collisions; integer-like key reordering; the emitted slots table (verified against actual create() usage on all 20+ emitted templates via a Proxy-recording env).

    Measurement validity — load-bearing for the roadmap

    lynxTemplateEligible is all-or-nothing over the whole plan. One ref anywhere flips a module from templates=1 planHostNodes=0 to templates=0 planHostNodes=4 — the entire module reverts to the interpreted encoding. Same cliff for a key, a children prop, a duplicate class/className, or any static event-shaped prop. Correctness is unaffected; coverage is not. Any §8 FCP fixture measured without refs overstates template coverage on real components. Worth re-checking what fraction of a realistic app actually lowers before the L5 cutover gate.

    Residual list — what was NOT attacked

    No silent caps.

    1. Panel adjudication is partial: 5 verdicts across 43 candidates. The __proto__ family got a full 3-refuter panel (3 not-refuted, 1 refuted-on-attribution). Everything else filed rests on my own independent reproduction, stated in each issue.
    2. Lenses that never ran: c2-shapes (degenerate tree shapes); c3-order (suite ordering/seeds/--no-isolate); c3-linkedstate (parked drafts, incl. two components sharing a WeakMap-keyed source). The gap-mutation and gap-worklet lenses were still running at posting time.
    3. The completeness critic never reported. This residual list is mine, not its output.
    4. CLAIM 3 remains the thinnest verdict — 2 of 5 planned lenses. Its "holds" rests on two base comparisons plus The #64 kernel guard suites cannot observe effect-event cell lifecycle: two load-bearing behaviors survive mutation with every test green #80's mutation work, not the planned matrix.
    5. Loop-until-dry never converged for any claim.
    6. H9 partially closed: applyLynxFirstScreenDirect paints first-screen trees the staged applier refuses #76's second mechanism reached the main-thread:ref surface, but the specific sticky-hasMainThreadProps ordering question (do earlier nodes see false and later ones true?) still needs a registry-backed container.
    7. No native-engine evidence — whether __AddEvent-then-remove is net-zero, and whether incremental vs batched attach shifts layout timing, needs a device. The limit §6 already records.
    8. Not attacked at all: the rspeedy production dual-graph build; SSR/hydration interaction with target:'lynx'; the feat(compiler): target 'lynx' — create-function template emission for the Lynx main thread (issue-58 L1) #63 bundle/gzip trade; whether firstScreenTreeHasList is itself a correct decline predicate.

    Generated by Claude Code

  4. Huxpro commented on Aug 18, 2026

    @Huxpro
    OwnerAuthor

    Audit addendum — corrections, two new issues, and a triage ranking

    Closing note on the revised summary. Not a third rewrite; this records what changed after it and gives the ranking I would actually work from.

    Read this first: what fires on ordinary, type-valid code

    The panel repeatedly found my consumer-impact claims stronger than my evidence, always at the reachability boundary. Sorting by that gives a very different priority order than issue-number order:

    fires on code someone would write issue
    yes #70 — @try commits a different arm; app errors masked; use()/useBatch prefetch never registers. data-* on standard intrinsics, all 5 compile modes
    yes #81 — any bind* handler inside a hidden <Activity> makes the first screen unadoptable; full rebuild every launch
    yes #82 — buffered first taps silently discarded on the repair path; compounds with #81
    yes #83 — useLinkedState keystroke loss while any async transition is pending; also hits the DOM runtime, and leaves getValue() disagreeing with the DOM
    yes #84 — direct applier skips assertNoMainThreadEventCollision; main-thread handler silently dead, behaviour flips depending on whether the page has a <list>
    narrower #76 (mech. 2/3), #79, #80
    no #71, #77 — need a consumer-invented type augmentation or a bypassed tsrx-tsc

    #81 + #82 + #83 + #84 are where I would start. Note that three of those four are pre-existing, so they do not count against the stack — but #81/#82 negate what L0–L3 is for, and #83 reaches beyond Lynx entirely.

    Corrections since the revised summary

    Four of my own conclusions moved. Each is recorded on its issue:

    1. applyLynxFirstScreenDirect paints first-screen trees the staged applier refuses #76's headline mechanism is refuted. A refuter ran the full production stack (installLynxMainThread + real background adoption) across five configurations and showed the #text-placement divergence never reaches a consumer — adoption throws the identical error or repairs the node away with a published diagnostic. My claim that it "reaches the Element PAPI on every launch" was the one sentence I never executed, and it is false. CLAIM 2 remains falsified, but on mechanisms 2, 3 and 5 — not the one the issue is titled after. Mechanism 2 has since been panel-confirmed (preExisting=false, attacker's strongest avenue "closed against me twice").
    2. Event props accepted by the glob but rejected by the regex silently lose their handler and leak a renderer Symbol into the wire props #77's severity was overstated. tsrx-tsc --noEmit — mandated by CLAUDE.md — rejects every triggering name. All 170 declared event props agree between the two matchers; the desync only fires on names outside the declared prop set, and LynxCustomIntrinsicElements ships empty. Hardening, not a live failure.
    3. Custom native elements skip attribute validation, and a prop named __proto__ then diverges between the lynx and universal encodings #71 was misattributed, then split. Defect A (inherited children) is pre-existing, from bench(lynx): gate the dual-thread commit wire cost against a changed-rows floor octanejs/octane#660, and belongs at main-renderer.ts:802. Defect B (foreign [[Prototype]] → thrown first screen) is genuinely this stack's. Panel split 4 not-refuted / 2 refuted; the dispute was ownership and severity, never mechanism.
    4. The disposeLynxHostContainer "swallowed fault" I briefly reported was my probe ignoring the documented LynxHostCleanupResult.errors channel. No defect.

    Also: the committed red test packages/lynx/tests/first-screen-applier-acceptance.test.ts may pin a non-contract. The refuter argues "indistinguishable" is scoped to container state, not acceptance sets, which would make it a .rulesync/rules/testing.md violation. Left in place because it documents a real mechanical divergence — your call whether acceptance parity is worth pinning.

    New since the revised summary

    Panel totals

    11 verdicts: 8 not refuted, 3 refuted. Every refutation changed a filing. Coverage remains partial — most filed findings rest on my own reproduction, stated in each issue.

    Still unrun

    c2-shapes (degenerate tree shapes) and c3-order (suite ordering/seeds/--no-isolate) never ran. The completeness critic still has not reported, so the residual lists in this thread remain mine rather than its output. Loop-until-dry never converged. No native-engine evidence is producible here. Untouched entirely: the rspeedy dual-graph build, SSR/hydration interaction with target:'lynx', the #63 bundle/gzip trade, and whether firstScreenTreeHasList is itself a correct decline predicate.


    Generated by Claude Code

  5. Huxpro commented on Aug 18, 2026

    @Huxpro
    OwnerAuthor

    CLAIM 3 upgrade — the ordering lens ran, and #64's zero-drift claim is now well evidenced

    I twice described CLAIM 3's verdict as the thinnest in this audit, resting on 2 of 5 planned lenses. The c3-order lens has since run — 58 vitest invocations, logs retained — and that caveat no longer applies. Correcting it here rather than leaving the understatement standing.

    The guard suites are order-independent, and symmetric with base

    configuration result
    universal-* (16 files, 299 tests), --sequence.shuffle seeds 1,2,3,5,7,11 × octane and octane-prod 12/12 runs, 299 passed
    --no-isolate --no-file-parallelism (one shared module registry), 8 seeds dev + 3 seeds prod 299 passed
    --pool=forks, plain and shuffled, both projects green
    seed-777 confirmation, both projects green

    Crucially: base 6079a6804 is symmetric at 297/297, and the 2-test delta is exactly the new universal-kernel-boundary pin. So the extraction lost no test, renamed none away, and made none order-sensitive.

    That is a much stronger statement than "two reentrancy findings reproduce on base." Combined with the 8-mutant matrix in #80, CLAIM 3's zero-drift claim is the best-evidenced verdict in this audit — while #80's finding stands unchanged: the guard set is blind in three specific places, and that blindness predates the stack.

    A methodological correction that matters for future reviewers

    --no-isolate at full-project scale is nondeterministic at a fixed commit. It flips between two disjoint failure clusters — DOM transition tests stuck at isPending='pending', versus compiler tests hitting the vi.mock registry for compile.js — driven by transform/timer timing rather than source content. Reproduced on both HEAD and base.

    The lens's own first measurement in that mode (a 21-vs-16 difference) was noise, and it discarded it rather than reporting it. No --no-isolate delta should be read as drift evidence in either direction. Worth knowing before A2/A3, since that mode is the obvious thing to reach for when hunting extraction drift.

    Also, for the A2 guard runs: --poolOptions.threads.singleThread=true no longer exists in vitest 4 (CACError: Unknown option --poolOptions); --no-file-parallelism is the working equivalent.

    Filed separately

    #85 — four suites that pass only in default file order, all pre-existing. One has roadmap consequences: packages/lynx/tests/main-renderer.test.ts:352 asserts main/background listener-ID parity, but the background base comes from a module-scoped counter (universal-core.ts:6602) while the main thread is pinned to a constant (main-renderer.ts:1069) — so it holds only when the background capture is the first root in the module. The multi-root case is unguarded, which matters now that #65 has introduced a second applier.

    Residual list, updated

    c3-order is no longer truncated. Still unrun: c2-shapes (degenerate tree shapes) and the completeness critic, which has still not reported — so the residual lists in this thread remain mine rather than its output.


    Generated by Claude Code

  6. Huxpro commented on Aug 18, 2026

    @Huxpro
    OwnerAuthor

    Final corrections — #73 withdrawn, CLAIM 2 narrowed, corrected triage table

    Two of my filings did not survive the panel. Correcting the addendum's triage table, which now points at a closed issue.

    #73 is withdrawn and closed as not-planned

    I filed the Lynx main-thread no-op useState updater as a bug. It is the documented, intended, already-test-pinned contract:

    • packages/lynx/tests/main-renderer.test.ts:404 — it('uses initial hook values and never publishes effects, refs, or updates') performs a render-phase setCount(9) and asserts the pre-convergence value. Green. It sits 58 lines below the oracle I cited, in the same describe block. My claim that no test covers this was simply false.
    • packages/lynx/README.md:98-103 states the main renderer "does not publish effects, refs, state ownership, or later updates."
    • The repair path I called the harm is the declared handoff (README.md:153-154).
    • My mechanism description was also wrong: the two threads do not compile the same source — background is target:'universal', main is target:'lynx' plus the main-thread-render-only capability.

    CLAUDE.md warns that React instincts are this repo's main failure mode. I filed an intentional divergence as a defect, on agent output I noted at the time I had not re-run. That caveat was the tell.

    CLAIM 2 is narrower than the addendum states

    Both mechanisms #76 was titled around are refuted as stack defects:

    • Mechanism 1 (#text placement) — adoption throws the same error or repairs the node away; no consumer outcome changes.
    • Mechanism 2 (main-thread:ref visible + hidden) — the direct applier is correct; the staged path was already broken on base. HEAD ≥ base at every observable point, strictly better in the common path.

    So: CLAIM 2 as literally worded is false (container state does differ), but #84 is the only regression. Mechanisms 2 and 3 are the direct path fixing pre-existing staged bugs. Anyone acting on this should not "make the direct path match the staged path" — that would propagate staged bugs into a correct applier.

    Corrected triage — what fires on ordinary, type-valid code

    priority issue why
    1 #81 + #82 any bind* handler in a hidden <Activity> makes the first screen unadoptable, full rebuild every launch, and the buffered first taps are then silently discarded. Together the fast first screen is worse than none. Pre-existing.
    2 #83 useLinkedState keystroke loss while any async transition is pending; reaches the DOM runtime, and leaves getValue() disagreeing with the DOM. Pre-existing.
    3 #84 direct applier skips assertNoMainThreadEventCollision; main-thread handler silently dead, behaviour flips on whether the page has a <list>. Stack-introduced — the only CLAIM 2 regression.
    4 #70 @try commits a different arm; app errors masked; use()/useBatch prefetch never registers. data-* on standard intrinsics, all 5 compile modes. Stack-introduced.
    5 #80, #85 evidence/oracle gaps: kernel guard blindness (3 probes) and 4 order-dependent suites, one guarding a parity contract the roadmap needs
    6 #79, #76 (mech. 3/4), #71, #77 narrower or hardening; #71 and #77 need an invented type augmentation or a bypassed tsrx-tsc

    Score after adversarial review

    13 filed, 1 withdrawn, 12 standing. Seven of my conclusions moved under refutation: one filing withdrawn, two #76 mechanisms refuted, #77 downgraded, #71 re-attributed then split, CLAIM 3 upgraded from "thinnest verdict" to best-evidenced.

    Final claim verdicts:

    claim verdict
    1 (#63) BROKEN — #70 is the load-bearing evidence
    2 (#65) literally false; #84 is the only regression
    3 (#64) HOLDS — 299/299 across ~20 randomized configs, symmetric with base; guard-set blindness (#80) is separate and pre-existing
    4 HOLDS

    The completeness critic never reported, so every residual list in this thread is mine. c2-shapes never ran. Untouched: rspeedy dual-graph build, SSR/hydration under target:'lynx', the #63 bundle/gzip trade, and whether firstScreenTreeHasList is a correct decline predicate.


    Generated by Claude Code

  7. Huxpro commented on Aug 18, 2026

    @Huxpro
    OwnerAuthor

    The completeness critic reported — residual list, and it corrects the audit twice

    Every earlier residual list in this thread was mine, labelled as such because the critic had not run. It has now, with executed evidence for the whole checklist. Its output is better than mine and supersedes it.

    New issues from the critic

    issue finding
    #86 The gzip 10–22% trade in §8 is not bounded — toolbar-4 +19%, toolbar-40 +120%, toolbar-120 +230%. Both fixtures the doc measured happen to sit inside the quoted band. The doc's stated cause is also wrong: it is the emitter's unique per-node locals (naming.next++) breaking LZ77, not "JSON keys compress better than code" — which suggests a cheap fix.
    #87 No vitest project executes target: 'lynx' at runtime. The lynx project's renderers alias to the background config (target:'universal'), so applyLynxFirstScreenDirect has never run against a template-encoded plan — while production ships exactly that pair, verified from the real .lynx.bundle string table. Same structural hole octane-prod exists to prevent.
    #88 §8's FCP numbers were measured on the one shape clearing both eligibility cliffs. lynx-table uses <view> + keyed @for, no <list> — so a canonical scrolling-list app receives zero L3 win, making L4 load-bearing rather than L3.
    #89 The −240 ms L3 claim rests on n=5 medians whose ranges are separated by 6.0 ms. The architecture-floor gap is robust; the increment-justifying gap is not.

    It corrected the audit twice

    1. My "one ref reverts a whole module" framing was wrong. Eligibility is per-plan (universalPlanDeclarationsAst maps over state.plans independently), and the benchmark app is fully template-encoded (Plan0: TEMPLATE env.h=4, Plan2: TEMPLATE env.h=28). The L0 measurement is not invalidated the way I claimed. The real concern is restated correctly as The §8 FCP numbers are measured on the one shape that clears both eligibility cliffs; a &lt;list&gt; page receives zero L3 win #88.
    2. firstScreenTreeHasList is sound, which I had flagged as unexamined. list/list-item are the only list intrinsics and the staged path keys off exactly those; a stray <list-item> also matches, so it declines consistently. No under-approximation — it is simply whole-tree.

    Surfaces closed, not gaps

    • SSR/hydration with target:'lynx' — genuinely unreachable. All four server spellings throw at the renderer-capability gate before any lynx code runs; renderers.js:221 structurally forbids server:'render' for non-DOM targets, and the omit-child boundary path cannot reach it either.
    • Dev-only diagnostics — no gap, because there are none: zero console.warn/error/log in all of packages/lynx/src/.
    • Production vs dev vs octane-prod compiler output — not a gap. Identical template emission across hmr:false/true/'vite'/'webpack', dev, profile, strong, autoMemo, inlineHookMemo. The mode-shaped risk is runtime, which is No vitest project ever executes target: 'lynx' output at runtime — the L1 × L3 pair production ships has zero committed coverage #87.
    • Portals — closed unconditionally (main-renderer.ts:971 throws).
    • The L0 prototype's honesty notes — "unusually good", nothing dishonest found.

    Residuals that remain open

    1. hmr:'webpack' template hot-replacement. That mode produces materially different output (2106 vs 1418 bytes) and is what the rspeedy dev server uses. Nothing exercises hot-replacing a template create function mid-session — and a create function is a closure identity in a way a JSON plan is not.
    2. @try/@pending runtime through the template encoding. Compile side verified (arms lower to separate sub-plans); the runtime side was never exercised with a real suspending use() through the direct applier. That is precisely target 'lynx' and target 'universal' render different first screens when a prop value throws #70's neighbourhood, and renderTry has its own checkpoint/restore of ACTIVE_FIRST_SCREEN_WARM_PLANS and attempt.nextUniversalId that TEMPLATE_ENV.s re-enters from a different stack shape.
    3. Universal-target compile ceiling (the c2-shapes lens, which the critic ran): universal output is O(n²) in nesting depth and throws Maximum call stack size exceeded between depth 400 and 700, where lynx is linear and survives — depth=400: universal 1,157,662 bytes vs lynx 34,488. Pre-existing, and L1 strictly improves it. Its relevance here: above that ceiling the two encodings do not both exist, so compile equivalence is not merely broken by target 'lynx' and target 'universal' render different first screens when a prop value throws #70 — it is undefined on part of the input space, and the committed red test cannot be written for those shapes.
    4. No encoding assertion in the rspeedy build test. build.test.ts runs in 9.82 s and asserts module membership, DOM-freeness, and worklets — nothing about the template encoding. An eligibility regression reverting every plan leaves the repo green while production silently loses L1.
    5. Eligibility rate in the field is unmeasured. No diagnostic names ineligible plans, so §8's "eligible host-only templates emit create functions" is unfalsifiable in practice.

    The critic's risk ranking of my own standing issues

    Asked which filings are most likely wrong on the axis the panel kept catching, it ranked #76 highest — its impact section still asserts a tree "reaches the Element PAPI on every launch" when the panel already refuted that scenario, and it now carries two stacked reachability hops. I have posted corrections on #76 but its title and body still read as filed; treat the corrections as authoritative over the body, and see the settling probe named there.


    Generated by Claude Code

  8. Huxpro commented on Aug 18, 2026

    @Huxpro
    OwnerAuthor

    Closing note — reachability audit complete, final verified triage

    After four findings were withdrawn on reachability grounds, I turned the same attack on my own surviving high-priority claims. All three results are in, plus the c2-shapes lens. This is the last update.

    Reachability results

    finding verdict outcome
    #84 STANDS Only finding to survive unqualified. Reachable from ordinary .tsrx, tsrx-tsc EXIT=0 with the shipped demo's config, stack-introduced with a provenance discriminator. Worse than filed: the page is destroyed at the background handshake, and adoption never runs to repair it.
    #81 NARROWED, confirmed Reachable from shipped-preset compiler output, production-verified, not intentional. Worse than filed: the always-visible node loses identity too — one hidden handler discards the entire painted tree. Qualified only by #91 currently masking it.
    #83 WITHDRAWN Unreachable from a keystroke (input is discrete → urgent path), test-pinned at linked-state.test.ts:680/:712, and polarity inverted — the "correct" parked path produced cross-record corruption in the end-to-end app.

    New from the c2-shapes lens, which I had listed as never-run

    Sequencing note: #91 currently masks #81. Fixing the typing gap without also fixing #81 converts a feature that "doesn't typecheck" into one that typechecks and then discards the whole first screen on every launch.

    Final verdicts

    claim verdict
    1 (#63) BROKEN — #70
    2 (#65) BROKEN — #84 and #90, both stack-introduced and base-verified. #76's own two mechanisms were refuted; it is documentation now.
    3 (#64) HOLDS — 299/299 across ~20 randomized configs, symmetric with base; 6/6 candidates refuted. Best-evidenced verdict here.
    4 HOLDS — 24 guards, 0 breached; 12 adversarial sequences within the changed-rows model

    What I would act on, in order

    1. Direct first-screen applier skips the main-thread/background event collision check, silently dropping the main-thread handler #84 — survived the harshest scrutiny in this audit. Note its flagged sibling defect (main-thread:bindtap alone, the shipped swiper shape) needs one probe to settle and may matter more.
    2. applyLynxFirstScreenDirect recurses per host level, so deep first screens now hard-fail with RangeError — and a throw has no staged fallback #90 — the throw-has-no-fallback asymmetry is worth fixing independently of the depth limit.
    3. A first screen can never be adopted if any host inside a hidden &lt;Activity&gt; carries a bind*/catch* handler #81 + &lt;Activity&gt; fails tsrx-tsc with TS2604 everywhere, including committed fixtures in published packages #91 together, in that order.
    4. The #63 gzip trade is not bounded at 10–22%: it grows without bound in static host count, and the cause is the emitter's unique per-node locals #86–The −240 ms L3 FCP claim rests on n=5 medians whose ranges are separated by 6 ms #89 — the roadmap set. These attack the numbers the L5 gate is sized against: gzip unbounded rather than 10–22%, no runtime coverage of the shipped encoding, FCP measured on the one shape clearing both cliffs, and a −240 ms claim resting on n=5 medians separated by 6 ms.
    5. target 'lynx' and target 'universal' render different first screens when a prop value throws #70, The #64 kernel guard suites cannot observe effect-event cell lifecycle: two load-bearing behaviors survive mutation with every test green #80, Four test suites pass only in default file order, including the Lynx main/background listener-ID parity oracle #85 — one real compile-equivalence break plus two evidence gaps.

    Calibration

    18 filed, 4 withdrawn. Every withdrawal was a real, reproducible mechanism that failed on reachability, declared intent, or inverted polarity — and in two cases my proposed fix would have caused harm (#82 would have routed a user's tap to a handler they never touched). That ratio is the honest calibration on everything above, and it is why the last thing this audit did was attack itself rather than hunt further.

    Residuals unchanged from the critic's list: hmr:'webpack' template hot-replacement, @try/@pending runtime through the template encoding, the universal-target compile ceiling, no encoding assertion in the rspeedy build test, and no field measurement of the eligibility rate.


    Generated by Claude Code

  9. Huxpro commented on Aug 18, 2026

    @Huxpro
    OwnerAuthor

    Correction to the headline verdict — CLAIM 1 is falsified far more narrowly than I reported

    Late refuters took apart #70, which I had been presenting as the load-bearing CLAIM 1 evidence and ranking first in the triage. Two things I said are wrong, and one is in a committed test, so this supersedes the CLAIM 1 row in every earlier comment on this issue.

    My committed red-test fixture is not "pure consumer code"

    packages/octane/tests/lynx-target-template-equivalence.test.ts builds its throwing values as { get $$kind() { throw … } }. $$kind is the property isLynxNativeResource reads (packages/lynx/src/resource.ts:22), so the throw fires inside the framework's own validation predicate — the object impersonates the internal resource brand. I described it in the commit message and on #70 as ordinary consumer objects. An app does not define $$kind.

    No app-authored throw diverges, and the batch is identical for pure programs

    Executed controls:

    • Two ordinary app errors thrown from prop expressions (data-bad={props.f()}) → MATCH. Slot values evaluate up-front in identical source order on both encodings.
    • Single fault at any depth, two faults on the same host, two faults in sibling subtrees, zero faults → all MATCH.
    • The same fixture with @catch painting a constant instead of error.message → batch equal: true, byte-identical including ids.
    • With pure children: painted text, hostCount, logicalCount, and the entire host batch equal.

    So the divergence requires the app to have already committed two simultaneous violations of the background-only-resource rule at different depths, and it surfaces only because the app renders the framework's diagnostic string. The childRenders sub-case is measured through an impure render, which testing.md excludes as an oracle.

    Both orderings already ship inside target: 'lynx'

    Adding an unrelated ref flips a plan to the interpreted encoding, and that build matches universal exactly — documented behaviour since L1. Pinning the ordering would freeze lynxTemplateEligible against an obvious future slice.

    Revised CLAIM 1 verdict

    Still literally false — but only just. Two counterexamples survive, both requiring the app to violate a documented rule first:

    1. The @try arm flip (real createLynxNativeResource + a real suspending use()): both renders succeed and commit different arms, @catch vs @pending, with different create commands, identically across all five compile modes. This is a genuine batch divergence on a renderable program.
    2. Custom native elements skip attribute validation, and a prop named __proto__ then diverges between the lynx and universal encodings #71 defect B: on a page with a native <list>, target: 'lynx' throws the first screen where universal paints — requiring an app-declared __proto__ attribute on a custom element.

    Everything else I filed under CLAIM 1 collapses to parity.

    Corrected triage

    priority issue why
    1 #84 4× independently confirmed, survived reachability audit unqualified, ordinary code, typechecks clean
    2 #90 base paints what HEAD refuses; a throw has no staged fallback
    3 #81 + #91 in that order — #91 masks #81
    4 #86–#89 the roadmap numbers the L5 gate is sized against
    5 #80, #85 evidence/oracle gaps
    6 #70, #71, #76, #77, #79 narrow, precondition-gated, or documentation

    #70 moves from first to sixth. Its committed red test should be re-cut against the arm-flip fixture with a real native resource, or dropped.

    Running calibration

    18 filed, 4 withdrawn, 1 substantially downgraded. The pattern has not varied: a real, reproducible mechanism, and a severity claim that outran what an ordinary program can reach. It caught my top-ranked finding twice — #83 withdrawn, #70 downgraded — which is the strongest argument for weighting #84 and #90 above anything I ranked highly on first pass.


    Generated by Claude Code

  10. Huxpro commented on Aug 19, 2026

    @Huxpro
    OwnerAuthor

    Session wrap-up — three slices on top of #78, and a measurement correction that changes how A4/A5 should be sized

    Picked up at the stack head feat/lynx-delta-shadow (#78). A1–A3 and the A4
    shadow were already landed, so this session continued from there. Nothing was
    merged; everything is a draft stacked PR.

    Stack now

    #59 → #63 → #64 → #65 → #67 → #68 → #69 → #74 → #75 → #78 → #92 → #93 → #94

    PR branch what it proved
    #92 perf/lynx-host-prop-classify the A4 run-and-discard double diff is gone on both drivers; verdict and throw parity pinned against the planner it replaced. Seam 0.224× (178 → 40 ns/call) over 4,000 real captured triples; end-to-end 0.986× with overlapping ranges — explicitly not a performance claim
    #93 fix/lynx-first-screen-depth the direct first screen no longer imposes a tree-depth ceiling (#90). FCP@10k no-regression (1694.6 → 1557.1 ms, overlapping ranges), +506 B raw
    #94 fix/lynx-first-screen-event-collision the direct applier refuses a main-thread/background channel collision before mutating, as the staged path does (#84). FCP@10k 0.974×, no measurable cost, +219 B raw

    Every slice: differential test, red-green verified by applying each break and
    watching it fail, same-window measurement, spec §8 updated.

    The measurement correction — please read before sizing A4/A5

    The lynx-table in-process runner's per-stage millisecond fields are not a
    production wire proxy, in either direction.
    dispatchMs is the interval around
    context.dispatchEvent (transport.ts:336-338), and the harness ContextProxy
    delivers synchronously — so that interval contains the entire main-thread
    receive pipeline plus the harness's own per-message JSON.stringify byte
    counter (workload.ts:94). At 10k it reads ~750 ms for the update storm and
    ~950 ms for create. Neither is serialization cost.

    I nearly used that 750 ms to justify going straight at the delta wire cutover.
    README.md already draws the right line — wall clock belongs to the browser
    harness, this runner owns deterministic counts — and the stage fields should not
    be quoted as evidence for or against A4/A5.

    Related: updates.classify is inside none of those stages. It runs during
    commit planning, before dispatch. Measuring it needed a seam A/B over inputs
    captured from a real run, which is how #92 got its number.

    Why the A4/A5 cutover is still open, and what it actually needs

    A4-authoritative and A5 are one unit, not two slices. The full-props-bag
    update command cannot leave the wire until the main thread can apply SET
    deltas, and the main thread cannot apply them until the wire carries them. The
    shadow in #78 already proves the encoding is lossless over the real workload
    (166/166 commits, 0 misses), so what remains is genuinely the ABI change:

    1. a commit message that is either command-encoded or delta-encoded, with
      capability negotiation like the existing templateRuns: 1 gate;
    2. RUN carrying its program on first use so both threads agree on templateId;
    3. a main-thread slot dispatch table — per template program, valueIndex → (nodeIndex, prop route) — bound to PAPI setters, which is what finally kills
      the cloneProps + planLynxHostPropPatch replanning at
      host-driver.ts:4423-4441;
    4. only then the §3 exit gate, replacing validateLynxBackgroundOutboundMessage's
      recursive walk with header checks for delta traffic.

    I did not start it rather than land it half-done. The honest target for it is
    the browser update10th/select numbers (§3 A5: 146/75 ms now, 82/44 ms floor),
    which I did not measure this session — the FCP harness is what I got running, and
    there is no equivalent update-path browser cell yet. Building that cell is
    probably the right first move next session
    , because right now A5's headline
    target has no instrument in this container.

    Environment gotchas to add to §2

    1. A copied lynx-table runner must call process.exit(). The app opens a
      MessageChannel for its storm ticks, so a runner that merely finishes
      runTable never exits — run.mjs documents this at its tail. Without it the
      result is already computed but buffered behind a pipe, and it reads as a build
      hang. Cost me ~25 minutes.
    2. A separate runner must set NODE_ENV=production before importing the
      built workload; run.mjs sets it at module top.
    3. --out-suffix needs = for a value starting with a dash:
      --out-suffix=-l3, not --out-suffix -l3 (parseArgs rejects it).
    4. The FCP harness works here. scripts/build-app.mjs (~2 s),
      prototype/build.mjs --rows 10000 (needs app/dist/main.web.bundle, i.e.
      a plain build-app.mjs run first), then prototype/run-fcp.mjs --extra id=path. It launches full /opt/pw-browsers/chromium, so the §2 note-1
      headless-shell symlink is not needed for it.
    5. packages/drei/tests/browser/upstream-e2e.browser.test.ts fails for
      network reasons
      — it routes raw.githack.com → raw.githubusercontent.com
      and the fetch cannot complete. Add it to the pre-existing list.

    Full-suite state at #92

    pnpm test: 20,961 passed, 5 failed. All five were re-run on the base commit
    c3baf805a and produced the identical five failures — established, not assumed.
    Beyond drei and the already-known native-demo case, the other three are
    rspeedy-plugin-octane/tests/browser/web-host.test.ts,
    octane/tests/browser/suspense-hydration/…, and
    dropzone/tests/probes/hydration.test.ts — all browser projects, and the last two
    touch the DOM renderer only.

    Two findings worth carrying, both from trying to break my own work

    On #90's second half, which I did not take

    Extending main-thread.ts:1906 so a throw also falls back to staged is not the
    one-line change the issue suggests. The direct applier mutates as it walks, so a
    mid-walk throw leaves partially-painted PAPI state, marks the container faulted,
    and invalidates main-thread lifetimes; replaying the staged path onto that
    container would paint on top of the partial tree. A real fallback needs the
    applier to be transactional. #94's pre-walk is one step toward that (refuse
    before mutating) but does not get there — PAPI faults mid-walk remain
    unrecoverable. I would rather leave it correct-and-open than ship an unsafe
    retry.

    Still untouched from the audit's triage

    #81 + #91 (in that order — #91 masks #81), #86–#89, #80, #85. §8's stated cause
    for the gzip trade is the one #86 says is wrong ("repeated JSON keys compress
    better than code" vs the emitter's unique per-node locals breaking LZ77); I left
    that line alone rather than rewrite it on #86's word without measuring.


    Generated by Claude Code

  11. Huxpro commented on Aug 19, 2026

    @Huxpro
    OwnerAuthor

    Correction to the wrap-up — A5's instrument already exists, and here is the baseline

    One claim in my previous comment is wrong, and it is the one that would have cost the next session the most time.

    I wrote that A5's headline target "has no instrument in this container" and
    suggested building an update-path browser cell first. web/run-web.mjs
    already measures it
    — web/run-web.mjs:206-231 drives update10th, select,
    updateStorm, and selectStorm alongside create, through the same
    byte-identical page driver as the reference cells. I had read §2's one-line
    description of it as a create-only cross-framework cell and did not open it.

    So I ran it, and A5 has a baseline on this host:

    node web/run-web.mjs --scales 10000 --reps 3 --cells octane
    
    op median ms (n=3)
    create 1233 ±42
    update10th 175 ±3
    select 83 ±7
    updateStorm 572 ±71
    selectStorm 158 ±22

    Host: 4× Xeon @ 2.10GHz, 1-minute load 0.29 at start, fresh page per rep.

    Two things to note before anyone compares these to §3 A5's "146/75 ms current":

    • They are not comparable. §3's numbers came from a different host and
      session; absolute milliseconds are host-bound, per README.md. 175/83 here
      and 146/75 there are the same measurement on different machines, not a
      regression. What transfers is the shape: select at 10k costs about half of
      update10th, and both are far above the L0 floors (82/44) that the direct
      path is supposed to reach.
    • The three vendored reference bundles are present and usable
      (reference/{react,vapor-ifr,vdom-ifr-et}/main.web.bundle), so a cutover
      measurement can carry the portable vue-vdom ratios rather than bare
      milliseconds. I ran octane-only to keep the window short; a real A5 slice
      should run the full cell set.

    benchmarks/lynx-table/results/ is gitignored, so this run committed nothing and
    clobbered nothing — the numbers above are the record.

    Net effect on the plan: the "build an instrument first" step I proposed is
    not needed. An A5 slice can go straight at the main-thread slot dispatch table
    and measure update10th/select against this baseline in the same window.


    Generated by Claude Code

  12. Huxpro commented on Aug 19, 2026

    @Huxpro
    OwnerAuthor

    Final state — four slices, and #86's gzip trade is gone

    Adds #95 to the wrap-up. Stack head is now perf/lynx-template-local-naming. Nothing merged.

    … → #78 → #92 → #93 → #94 → #95

    #95 — the L5 bundle gate no longer has a trade to repay

    I went looking to verify #86 before acting on it, and it holds, with the
    mechanism it names. §8 recorded the L1 trade as "gzip 10–22% larger because
    repeated JSON keys compress better than code". Both halves are wrong:

    toolbar fixture raw vs interpreted gzip vs interpreted
    4 buttons −3.6% +14.9%
    40 buttons −7.7% +81.5%
    120 buttons −6.8% +128.6%

    Raw output is smaller at every width, so nothing about the encoding is verbose
    — the penalty is purely a compression effect, and it grows with node count
    rather than sitting in a band. The two fixtures §8 measured both happened to sit
    at the shallow end, which is why it read as bounded.

    The cause is the emitter naming every host local from a per-node counter, so
    each repeated subtree differs from the last by its identifier's bytes — exactly
    what LZ77 matches on. A host local is live only from its creation until the
    env.a that appends it, and that window nests with tree depth, so siblings can
    share a name. After naming locals by depth: +4.8% / +1.8% / −2.9%, and raw
    improves to −15.0% at 120 nodes.

    This matters beyond the number. A trade that scales with template size is not
    one the L5 re-audit could have repaid by deleting the interpreter, so §8's
    "accepted as an L1 trade, re-audited at L5" was resting on an assumption that
    was never true. The doc is corrected in #95 rather than quietly rewritten.

    Deterministic, so it is gated rather than merely measured:
    lynx-target-template-size.test.ts pins the structural property (a 4-button and
    a 120-button toolbar are both three levels deep, so their create functions must
    use the same identifiers) and a ≤1.10× gzip ratio across the ladder. Reverting
    to the per-node counter gives 241 distinct locals instead of 4 and a 1.152×
    ratio. FCP@10k unchanged (0.988×, overlapping ranges); lynx-table's own bundle
    shrinks 273 B / 367 B gzipped, small because it has one shallow row template.

    Session totals

    Four slices, each with a differential, red-green verified by applying every
    break and watching it fail, and a same-window measurement. Every performance
    claim in these four PRs is a no-claim or a no-regression except one
    — the
    0.224× classifier seam in #92 and the gzip ladder here are the only two results
    whose ranges actually separate. That is the honest yield; the rest of the value
    is correctness (#93, #94) and a corrected map of where the remaining cost is.

    Full suite at the head: 20,970 passed, 4 failed, all four among the five
    container failures established on #92 by re-running them at base c3baf805a.
    The fifth (dropzone hydration probe) passed this time — flaky here rather than
    consistently red.

    What is still open, unchanged

    A4-authoritative + A5 remain one unit and are untouched; §3's exit gate follows
    them. The audit triage still has #81 + #91 (in that order), #87–#89, #80, #85.
    #90's throw-side fallback stays open for the reason in #93 — it needs a
    transactional direct applier, and #94's pre-walk is only the first step toward
    that.


    Generated by Claude Code

  13. Huxpro commented on Aug 19, 2026

    @Huxpro
    OwnerAuthor

    Session close — six slices, and #81 is fixed with an end-to-end reproduction

    Adds #96 and #97 to the running record. Nothing merged.

    … → #78 → #92 → #93 → #94 → #95 → #96 → #97

    PR slice
    #92 A4: kill the updates.classify double diff
    #93 #90: iterative first-screen walk
    #94 #84: refuse event-channel collisions before mutating
    #95 #86: create-function local naming — the gzip trade is gone
    #96 #87: runtime coverage of the L1 × L3 pair
    #97 #81: gate first-screen event emission on visibility

    #97 is the one to look at first

    #81 turned out to be exactly as filed, and it is the most consequential thing
    found this session. A bind* handler anywhere inside a hidden <Activity> made
    the main and background first-screen batches disagree by one event command, so
    that page's first screen could never be adopted — repaint from scratch on
    every launch, native identity discarded, buffered taps dropped. For that class
    of page the synchronous first screen was worse than not having one.

    The fix is to walk with the inherited-visibility rule the host driver already
    applies. Notably applyLynxFirstScreenDirect was already using it when
    installing events — the batch was the half disagreeing with both the applier
    and the background.

    Reproduced from the public API, not asserted from the inside: the
    retained-integration adoption round now carries a handler on its hidden
    Activity, and without the gate it reports #81's own diagnostic —
    first-screen mismatch at snapshot.nodes[13].events: the event binding count differs — deterministically, 3/3 runs each way.

    Per the audit's sequencing warning, landing #81 before #91 is the safe order.
    #91 is still open and I did not take it: it is orthogonal to this stack
    (a unique symbol with no JSX call signature), and I verified it reproduces —
    TS2604 on packages/octane/tests/_fixtures/activity.tsrx and on the
    base-ui fixture in a published package.

    #96 corrects #87's suggested remedy

    #87 proposes a lynx-target vitest project over packages/lynx/tests/** with
    the main-thread renderers. That does not work: lynxMainThreadRenderer carries
    main-thread-render-only, so recompiling the background suites under it would
    fail them by design rather than find bugs. The uncovered thing is the
    composition — a target: 'lynx' component reaching host-driver.ts — and a
    test is the right size for it.

    Its scope is stated honestly in the PR, because a differential is easy to
    over-read: it catches divergence between cells (skipping native event
    installation in the direct applier turns it red) and not a regression that
    moves all four cells together (dropping the class patch in the shared
    applyProps does not). Measured, not assumed.

    Two things I got wrong and corrected mid-session

    Recording them because the calibration matters more than the tally.

    1. I read the harness's dispatchMs as wire cost and nearly sized A4/A5 against
      ~750 ms that does not exist. It is a synchronous ContextProxy plus the
      harness's own JSON.stringify.
    2. I wrote that A5 had no instrument here and proposed building one. It has one
      — web/run-web.mjs:206-231 — and the baseline is update10th 175 ms,
      select 83 ms at 10k.

    Where Phase A actually stands

    A4-authoritative + A5 remain one unit and are untouched: the full-props-bag
    update cannot leave the wire until the main thread applies SET deltas, and
    the reverse. #78's shadow already proves the encoding is lossless over the real
    workload, so what remains is the ABI change and its capability negotiation,
    then §3's exit gate. I did not start it rather than land it half-done, and that
    judgement has not changed.

    Of everything in these six PRs, exactly two results have ranges that separate:
    the 0.224× classifier seam (#92) and the gzip ladder (#95). Everything else is a
    no-regression or a correctness fix. That is the honest yield.


    Generated by Claude Code

  14. 5 remaining items

  15. Huxpro commented on Aug 20, 2026

    @Huxpro
    OwnerAuthor

    Phase 3 execution record — the flag it was written to gate does not exist

    PR #102 (draft), head 88e9db5f0. Same PR as Phase 2: this is one attribution
    slice, and splitting it would have produced a PR whose diff is three lines of
    counter.

    Phase 3's literal subject is void, and that is the first thing to report

    The revision specifies Phase 3 as "web/run-web.mjs … same-window flag on/off;
    then wire into benchmarks/baselines/ratios.json"
    . That gates Phase 2's
    flagged delta path
    . Phase 2's decision gate re-aimed away from that path — per
    the revision's own instruction that the gate's output outranks the plan — so
    there is no flag to toggle and no delta path to measure on and off.

    Recording that rather than inventing a subject for it. What Phase 3 can
    deliver against the actual Phase 2 outcome is the thing a gate needs: a
    deterministic quantity that tracks the segment Phase 2 named.

    None of the 24 committed lynx-table gates can see the drain

    This is structural, not an oversight. Every one of them — commands, bytes, item
    renders, handle deltas, commits — is measured downstream of the reconciler,
    and every one is already at its floor. select@10k passes all of them while
    spending 73 ms in the drain. That is precisely why Phases 0 and 2 had to be
    measured by hand.

    The counter that does see it

    reconcileChildren is the reconciler's per-child entry. The number of child
    blueprints it visits is fixed for a given app and interaction; counted under the
    same replay-window gate as the drain timer, so first-screen reconciliation stays
    out of it. Zero spread across five samples in every cell, at both scales.

    cell row renders host commands wire out reconciled blueprints
    select@10k 1 1 289 B 10,042
    update10th@10k 1,000 1,000 70,022 B 11,041
    updateStorm@10k 4,000 4,000 223,539 B 11,041
    select@1k 1 1 289 B 1,042
    update10th@1k 100 100 7,110 B 1,141

    Two deterministic counts for the same interaction, disagreeing by three orders of
    magnitude. Row renders track the change; blueprints track the list, exactly:
    select is rows + 42 at both scales, update10th is rows + changed + 41.
    select holds its change fixed (1 render, 1 command, 289 B at both scales), so
    the entire movement is list size, and its drain follows — 12.4 ms at 1k, 73.2 ms
    at 10k.

    The semantic floor is the changed-rows-model the wire gates already use: 1
    plus the app's fixed chrome for select. The standing debt is a factor of
    roughly 235 at 10k
    , and unlike a share of a wall clock it can be asserted.
    This is the number the scoped-commit slice has to move.

    Stage shares re-confirmed on this run: bg_prepare 48.3% / 34.1% / 9.2%
    (select / update10th / updateStorm at 10k), bg_replay_other 0.3–1.1 ms.

    Why it is not in ratios.json yet

    A real constraint rather than an omission. That gate runs workload.ts
    in-process against uninstrumented sources, so it can only read counters that
    exist permanently in the shipped packages behind a build flag — the arrangement
    packages/lynx/src/core/profiling.ts already documents for the wire counters.
    The equivalent counter for the reconciler belongs in universal-core.ts.

    I did not land it, and the reason is a judgement worth stating: a permanent core
    counter landed ahead of the change it exists to gate would pin today's cost
    as though it were the contract. It belongs as the first commit of the
    scoped-commit slice, where the gate can be committed green against the improved
    number instead of green against the defect.

    A hazard the restore test caught

    Instrumenting universal-core.ts from two separate update() calls made the
    second call record the already-instrumented text as the pristine original, so
    restore would have left a framework source patched and poisoned every later
    build — the same failure mode as the invalidated pnpm test earlier in this
    session. The two patches are now one transform, and update() throws if a file
    is claimed twice.

    Where Phases 0–3 leave the plan

    • Phase 0 ✅ — attribution built, delta candidate NO-GO.
    • Phase 1 ✅ — protocol v2 landed; A6 partially, with the reason recorded as a
      finding.
    • Phase 2 ✅ — re-aim complete, GO, owner identified as the background
      full-root drain, mechanism located in source.
    • Phase 3 ✅ with its subject void — target expressed as a deterministic count;
      gate deferred to the slice that changes it, with the reason.

    Phases 0–3 are complete and none of them changed runtime behavior. The next
    unit is a design deliverable, not an increment: a sub-tree ACK/rollback protocol
    that lets a transported root commit a scoped attempt. It is large enough to want
    review before implementation, which is why I am stopping the phase sequence here
    rather than starting it unreviewed overnight, and it is what makes the v2 delta
    protocol's instance-addressed pairs load-bearing after all.

    Body Phases B–E are untouched.

    Validation state

    pnpm typecheck exit 0; stage tests 17/17; both measurement runs
    reportable: true on a quiet host. pnpm test is starting now against the
    final diff and its result goes on #102.


    Generated by Claude Code

  16. Huxpro commented on Aug 20, 2026

    @Huxpro
    OwnerAuthor

    Direction resolved — the pending scoped-commit design is superseded by #103

    The "sub-tree ACK/rollback protocol" question Phase 2 left for review is resolved at the direction level in #103: the Lynx specialized background core is runtime.ts's Block model ported to a wire host (per-block eager v2-op emission, no whole-tree version to ACK), with the universal-core scoped-commit retrofit recorded as fallback only. Evidence: the Phase 0–3 attribution here, runtime.ts's no-vdom Block anatomy, and the Huxpro/vue-lynx reference implementation (ShadowElement + eager flat ops + element templates + adoption-by-allocator-determinism).

    Execution continues on #103 (U0 ceiling measurement → U1 core design doc → U2 first vertical slice). Phases B–E of this issue's body remain valid and queue behind it.


    Generated by Claude Code

  17. Huxpro commented on Aug 20, 2026

    @Huxpro
    OwnerAuthor

    Phase B execution record — bullets 1 and 2 landed

    Draft PR #108 (perf/lynx-first-screen-batch, base test/lynx-u0-block-counts), two commits plus the spec §8 entry.

    §4 bullet 1 — demand-built command batch

    The direct applier needed the node tree and the background listeners; it read the batch only for its event commands. So renderLynxFirstScreen now returns an envelope (renderer, version, the listener bindings) and applyLynxFirstScreenDirect takes that instead. batch became a cached lazy property built from the same bindings — the staged path, the native-list fallback, and anything reading the batch as a value are unchanged.

    At 10,000 fixture rows the direct path was building 160,094 frozen command objects and reading 20,012 of them. It now builds zero. The event commands are re-projected from the envelope's bindings rather than assigned a second time, so the two paths' listener ids cannot drift. packages/lynx/package.json does not export ./core/*, so the signature change is package-internal.

    §4 bullet 2 — capture fast exit

    Widened from the single state.hasMainThreadProps bullet to the four per-record allocations the capture actually made: the re-planned prop patch (now guarded by the sticky flag, plus the same unscoped-#text shortcut create already takes), the spread-and-sorted empty event table, the copied-and-frozen empty child list, and the per-record Set/Map cycle-tracking pair.

    Measurement

    Alternated before/after/before/after over three rounds, 10,000 rows, n=30 per side, each phase timed on a collected heap:

    phase before after Δ min Δ p25 Δ med
    first-screen render 205.9 ms 134.9 ms −34.5% −33.6% −37.3%
    direct apply 468.2 ms 412.4 ms −11.9% −12.2% −11.7%
    first-tree capture 291.8 ms 213.8 ms −26.7% −28.4% −30.2%
    direct-path total 965.9 ms 761.1 ms −21.2% −21.8% −23.1%

    Two findings worth recording because both nearly produced a wrong conclusion:

    1. My first harness read result.batch at the end of every rep. On the post-change build that materializes the batch and leaves its garbage for the next rep's apply phase — a property of the harness, not the change. Fixed; the timed loop never touches batch.
    2. Even after that fix, apply measured +8% "slower" across two independent 36-sample alternated experiments. The applier strictly does less work now (20,012 iterations, not 160,094), so I did not accept it as a regression: forcing a collection between phases moved apply to −12% and every phase into the win column. The old arrangement's eager batch was being collected during the apply phase. Both numbers are in the PR — the un-isolated −8% is what an un-instrumented run sees.

    Deterministic half, no statistics needed: the batch is unchanged at 160,094 commands, byte-identical in shape (asserted), and the direct path builds none of them.

    Red–green

    Six deliberate breaks, all red and restored: batch builder minting fresh listener ids (4 tests); visibility gate dropped (2); batch builder mutating the unfrozen bindings (2, incl. the new test); empty-children fast path inverted (7); events never collected (5); main-thread patch guard forced vacuously false (1, via the ref assertion).

    One new behavioral test pins what is genuinely new — paints the same first screen whether or not the command batch was materialized.

    Honest gaps

    • The missing main-thread event / retains main-thread event assertions in captureLynxFirstTree have no oracle: deleting that loop leaves the suite green. Verified pre-existing — the same deletion on the unmodified capture code is also green. My guard sits in front of them and is covered (forcing it false goes red via the ref assertion), but a scene exercising the two event assertions is owed, in its own change.
    • The clone-scratch clear() cannot be red–greened and shouldn't be: both clones are deep-frozen, so cross-record aliasing is unobservable; it bounds memory rather than correcting semantics.

    Remaining in Phase B

    • §4 bullet 3 — first-screen create functions binding the template env straight to PAPI. Not started; this is the large one (id minting during creation, bottom-up attach order, adoption metadata replacing records, native-list detection before any PAPI call, visibility gating).
    • §4 bullet 4 — FCP@10k same-window A/B through prototype/run-fcp.mjs. Owed. Needs BENCH_AUTOROWS=10000 builds and a quiet host; run-fcp.mjs refuses a busy one, and this container is currently running the full suite.

    pnpm test results for the stack below this PR are posted on #105/#106/#107; no lynx failures, and every failure A/B'd against the merge-base.


    Generated by Claude Code

  18. Huxpro commented on Aug 20, 2026

    @Huxpro
    OwnerAuthor

    Phase B §4 bullet 3 — finding: this one belongs to #103, not here

    Bullet 3 asks for "first-screen create functions binding the template env
    straight to PAPI (today: env → records → direct applier; collapse to env → PAPI
    with the adoption metadata table)". I went to implement it and stopped at the
    design, because on the universal first-screen path the collapse either does
    not remove work or does not preserve behaviour. Four things, all checkable in
    the current source:

    1. The container does not exist while the create functions run.
    renderFirstScreenNow (main-thread.ts) orders it: renderLynxFirstScreen,
    then createLynxHostContainer, then applyLynxFirstScreenDirect. A create
    function that emits PAPI needs the container during render, so the container
    would have to be constructed before the component tree has run at all.

    2. Render is speculative, and today it rolls back for free. renderTry
    renders the body, and on suspension or a thrown error discards the body
    entirely
    and renders pending/catch instead — rolling back the speculative
    useId allocations explicitly (main-renderer.ts, renderTry). Records make
    that rollback free: the abandoned subtree is simply not returned. Direct
    emission would have to tear down every element the abandoned body had already
    created, and get that right under nested @try.

    3. The decline must happen before the first PAPI call.
    applyLynxFirstScreenDirect returns false for trees containing a native
    <list> so the staged path can paint them; refusing after the walk has begun
    would leave a half-painted page. List-ness is by host type and is only known
    once the whole tree has materialised, dynamic component output included. Emit
    as you go and the options are create-then-discard — a real regression for
    exactly the pages that take the staged path today — or a static guarantee that
    no template and no slot can yield a list, which the plan encoding does not give.

    4. Templates are only part of the tree. Only template subtrees go through
    create(env, values). Components, ranges, @if/@for/@switch, dynamic
    slots, and text from materialize build records through renderPlanNode. A
    fused env yields a hybrid — PAPI nodes for the template parts, records for the
    rest — and the applier has to walk both. That is more machinery, not less.

    And the premise is already half-true: the "adoption metadata table" exists.
    applyLynxFirstScreenDirect builds state.records as it walks. Fusing moves
    when that table is written, not whether it is.

    So the version of bullet 3 that actually removes work — one pass producing PAPI
    nodes and the adoption table together, with no intermediate record tree — needs
    the whole render path to emit directly, with subtree teardown for speculative
    renders and a static list guarantee. That is the specialized core in #103, not
    an increment on the universal path. Recommend retargeting bullet 3 to #103 and
    marking it superseded here.

    What I did instead

    The part of bullet 3's motivation that was reachable without the
    re-architecture: make the intermediate records cheap rather than absent. Two
    stacked draft PRs, both measured at 10k rows with GC-isolated phases:

    Combined, the direct first screen at 10k rows goes from ~966 ms to ~877 ms
    median across the three timed phases, with the record tree and both consumers
    semantically unchanged.

    Still owed on Phase B: the sanctioned FCP@10k A/B through
    benchmarks/lynx-table/prototype/run-fcp.mjs, which needs a quiet host —
    run-fcp.mjs refuses to run when load exceeds half the CPU count.


    Generated by Claude Code

  19. Huxpro commented on Aug 20, 2026

    @Huxpro
    OwnerAuthor

    Phase B closed — §4 bullet 4 measured, and what Phase C actually is

    §4 bullet 4 — FCP@10k, sanctioned harness

    Done. The app built at 781e4fca3 (the stack base) and at the Phase B head,
    driven through prototype/run-fcp.mjs in one window, cells alternating AB/BA,
    fresh page per sample. 4× Xeon @ 2.80 GHz, load 0.49 at start, n=30 per
    cell
    . Record committed at prototype/results/fcp-10000-phase-b.{json,md}.

    cell median FCP min–max
    octane-baseline — stack base 2751.6 ms 2519.4–3098.2
    octane — Phase B head 2599.1 ms 2307.2–2783.0
    octane-direct — L0 floor 1534.0 ms 1407.2–1898.6

    Paired (cells alternate inside one window, so each rep is a matched pair):
    −158.5 ms mean, sd 175.8, t(29) = −4.94, 95% CI [−224.2, −92.9],
    head faster in 22 of 30, median ratio 0.947×. That is ~12.6% of the
    distance from the base to the floor
    .

    n=15 said "cannot tell" and I am reporting that too: −113.6 ms with a
    261.8 ms paired spread, t = −1.68, head faster in 10 of 15, ranges overlapping
    end to end. §1 sets n≥5 as the floor; at this boundary n=15 was still not
    enough to separate a 150 ms effect from page-load noise. The n=15 table would
    have read as a clean −4% win and would not have been one.

    Also worth recording for §1's "not comparable across sessions" rule: the
    direct/octane ratio reproduces at 0.590× here against 0.575× in the
    record #59 committed on a different host, while absolute ms differ by ~1.7×.
    The ratio travels; the milliseconds do not.

    Phase B is complete: bullet 1 and 2 in #108, the reachable part of bullet 3
    in #109, bullet 3 proper retargeted to #103 per the finding above, bullet 4
    here. Stack: #107 → #108 → #109, all draft, none merged.

    pnpm test at the stack tip: 2182/2196 files, 20,954 tests passing. No
    packages/lynx or packages/octane failure. All 14 failures are timeouts or
    browser/process flakes on a loaded host; of the failing packages exactly one
    depends on @octanejs/lynx (rspeedy-plugin-octane, whose native-demo §2.3
    already records as pre-existing here), and its assertion is about killing a
    detached process tree.

    Phase C — the ordering in §5 is not the order the code allows

    §5 names two list items: extending the direct first-screen path to lists, and
    "revisiting the lists-excluded-from-adoption divergence". Reading the source,
    they are strictly ordered, and the second gates the first:

    captureLynxFirstTree refuses every list tree — state.lists.size !== 0,
    and record.type === 'list'. So a native-<list> first screen is always
    declined and torn down, however it was painted. Extending
    applyLynxFirstScreenDirect to lists therefore buys nothing on its own:
    painting faster still ends in the same teardown.

    And the reason the divergence is not a small fix is structural.
    physicalChildren returns [] for a list, so the apply walk never descends
    into cells and every list-item record keeps node === null — which is exactly
    what capture throws on (first-tree host N must own an attached physical node). Cells are materialized on demand by componentAtIndex and their
    identity is not stable across recycling. Adopting a list means defining adoption
    for a host whose children exist as descriptors rather than nodes, and handing
    the recycling contract across the thread boundary. That is a design question,
    and §5 leaves "keep the divergence" open as an answer.

    So Phase C is C1 → C2 → C3, and I am starting with C1, which the source
    itself asks for at main-thread.ts:1919:

    The batch is built before any of this is applied, so a <list> is in
    principle knowable before the tree is created; declining that early would
    avoid building and tearing down a first screen that is never kept. That
    needs the prepared batch to publish what it stages.

    It no longer does. #108 put the list pre-walk on the record tree
    (firstScreenTreeHasList, run before the applier touches PAPI), so the same
    question can be asked one step earlier — against result.nodes, before
    createLynxHostContainer exists. Today a list page builds the full command
    batch, prepares it, creates every element, fails capture, and disposes all of
    it. C1 removes 100% of that.

    Two details that decide whether C1 is correct rather than merely faster:

    • The predicate is not firstScreenTreeHasList. That one is true for
      list-item as well, which is right for its own job but would silently swallow
      two diagnostics the staged path throws — nested <list> hosts are not supported by the initial recycling contract. and <list-item> N must be placed directly under a <list>.. C1's predicate is list-only and
      conditional on well-formed topology
      : a malformed tree falls through to the
      existing path so both errors still fire from where they fire today. The
      result is a change with no observable difference except that a discarded tree
      is never built.
    • Ranges are transparent. LynxFirstScreenDirectNode.kind is
      'host' | 'range', and a @for range is not a record — the staged check
      reads record.parent, i.e. the nearest host ancestor. native-list.lynx.tsrx
      is <list> → @for range → <list-item>, so a pre-walk using the immediate
      parent would call the fixture malformed and decline nothing.

    C2 gets a design comment before any code.


    Generated by Claude Code

  20. Huxpro commented on Aug 20, 2026

    @Huxpro
    OwnerAuthor

    Phase C opener (C1) — decline an unadoptable first screen before painting it

    Draft PR: #110 (perf/lynx-decline-unadoptable-first-screen, based on #109).

    C3 is not independent of C2

    §5 lists C1 → C2 → C3 and reads C3 (extending direct emission to lists) as an
    item that can be taken on its own. It cannot: captureLynxFirstTree refuses
    every root holding a <list>, whatever painted it, so extending the direct
    applier to lists buys nothing until adoption can carry a list. The sequence is
    right; the independence is not. C3 is blocked behind C2, and C2 is also the item
    that makes C1 unnecessary rather than merely cheap. C1 is still worth taking
    first — it is small, and a strict improvement that C2 later subsumes.

    What landed

    A <list> page rendered, built a full command batch, took a host container,
    staged and applied it, planned the native list, was refused by capture, and was
    torn all the way back out — for a verdict that never depended on any of it.
    firstScreenTreeIsUnadoptable asks the question against the record tree
    instead, before the container exists.

    I originally framed this as "skip work whose outcome is known", which is the
    framing that makes it dangerous: a cheap pre-check that guesses would swallow
    the diagnostics the staged path raises. Reframing it as "run the list
    validation early and decline only when it passes" removes that risk
    structurally — it calls createLynxListItemDescriptor and planLynxListUpdate
    from core/list.ts over the same nodes and treats a throw as "not a decline".

    Eight of the nine list diagnostics are covered that way (five from the
    descriptor, one from the plan, two placement rules the prepare walk owns and
    this walk tracks alongside). The ninth is a host with no list PAPI: without
    __CreateList a <list> cannot be built at all, and that report is owed to the
    application, so the whole pre-check is gated on papi.list !== undefined.

    Measurement

    Real installLynxMainThread first-screen path, 1,000 native rows (4,002 logical
    hosts). Arms by stashing the change; 21 samples per pass after 3 warmups, each
    in a fresh environment. PAPI traffic counted by wrapping every function-valued
    __* global and asserted identical across all 21 samples of a pass. A fixture
    differing only in element types is the regression control.

    fixture PAPI calls median first screen
    native list, before 18 37.8 ms
    native list, after 0 5.1 ms
    list-free control, before 20,012 107.9 ms
    list-free control, after 20,012 111.2 ms

    Medians of four before-passes and three after-passes; the list distributions are
    disjoint (slowest after 12.0 ms, fastest before 30.8 ms).

    Only 18 PAPI calls before, because an unscrolled native list creates no cells —
    the platform materializes rows through the recycling callbacks. So the ~33 ms
    removed is Octane's own work behind those calls, not host traffic.

    The control resolves nothing end to end — its between-arm spread is the size of
    its within-arm spread — so the walk was timed directly instead: 0.063 ms
    median (p95 0.117 ms) on the list-free tree, 0.06% of that page's first screen.
    0.501 ms on the list tree, where it runs the real validators over 1,000
    descriptors.

    Two things I got wrong, both caught by red/green

    The placement break came back green. The stray-<list-item> fixture had no
    well-formed <list> in it, so the predicate declined to claim that tree whether
    or not the guard existed. The fixture now holds a valid list beside the stray
    row.

    Every fixture nested rows directly under the <list>, which no .tsrx
    produces.
    I stopped assuming and compiled
    tests/_fixtures/native-list.lynx.tsrx with lynxMainThreadRenderer. The real
    lowering is not a host plan node at all:

    __octaneUniversalPlan('lynx', {
      "kind": "template",
      "slots": ["r"],
      "create": (env, values) => {
        let n0 = env.h("list");
        env.p(n0, "id", "native-feed");
        env.s(n0, values[0]);
        return n0;
      }
    });

    with the rows in that single child hole as __octaneUniversalFor(...). Rendered,
    the record tree is:

    host <list> {"id":"native-feed"}
      range
        host <list-item> {"item-key":"a", ...}
          host <text> → host <#text>
      range
        host <list-item> {"item-key":"b", ...}
    

    Two things the fixtures never covered. A template-created <list> still records
    as an ordinary list host — the property the whole pre-check rests on. And its
    rows are one range per row away, not its own children, so a reader stopping
    at the immediate children would validate an empty list, decline, and swallow
    every row defect while still passing a decline test. Both realistic fixtures
    (keyed-loop and template-lowered) therefore carry a decline test and a
    duplicate-item-key test; making ranges opaque turns both duplicate tests red
    and leaves both decline tests green.

    Same pass made both walks iterative: a range chain is a chain of nested
    directives, and per #90 nothing in the first-screen pipeline may cap a depth the
    renderer accepted.

    Red/green

    deliberate break result
    predicate always true 9 failed, 8 passed
    predicate always false 9 failed, 8 passed
    drop the nested-<list> guard 1 failed, 16 passed
    drop the <list-item> placement guard 1 failed, 16 passed
    drop the list.ts validators 1 failed, 16 passed
    drop the papi.list gate 1 failed, 16 passed
    ranges opaque in the host-children walk 2 failed, 19 passed
    restored 21 passed

    The first six ran against the 17-test file, before the realistic fixtures
    existed; predicate always false re-run against the final 21-test file fails 13.

    A format:check failure the stack was carrying

    Worth flagging because it affects four branches, not just this one.
    pnpm format:check fails on three committed benchmark result JSONs
    (stages/results/live-1000.json, live-10000.json,
    prototype/results/u0-block-core-counts.json). All three are formatted correctly
    on new-lynx; the unformatted copies arrived with the stack — the first two via
    888d9034f/88e9db5f0 on #102, the third new in 781e4fca3 on #107.

    I repaired them forward on this tip rather than at the source, since #102 and
    #107 are published and under review and fixing in place would rewrite history
    four and two branches deep. Whitespace only, verified by reparsing each file to a
    byte-identical JSON value. If you would rather it land on the owning branches,
    say so and I will move it.

    Related audit item

    The audit addendum
    lists "whether firstScreenTreeHasList is itself a correct decline predicate" as
    untouched. That is still true and is a different function — the direct applier's
    own list check. This slice adds a second decline predicate rather than
    validating the first; the new one has seven diagnostic-preservation tests,
    firstScreenTreeHasList still has none.

    One part of that I did answer while here. firstScreenTreeHasList reads the same
    record tree, so I checked whether the range problem above reaches it: it does not.
    It descends into every node's children regardless of kind and matches any host
    of type list or list-item anywhere, so it is range-agnostic by construction.
    The difference is what each predicate needs — existence, which survives blind
    descent, versus host parentage, which does not, and which is why the new one has
    to make ranges transparent deliberately. That closes the range question for
    firstScreenTreeHasList; it does not close the audit's broader item, and it
    still has no diagnostic-preservation tests of its own.

    Validation

    • pnpm format:check — clean repo-wide, after the repair above.

    • pnpm typecheck — clean.

    • pnpm test — did not complete in this container. The full run was killed at
      a 60-minute cap. I ran the projects this change can reach explicitly instead:

      • --project lynx — 32 files, 434 passed.
      • --project octane --project octane-prod — 841 files, 12,436 passed,
        4 skipped, 0 failed
        ; 2 files errored.
      • packages/lynx/tests/first-screen.test.ts alone — 21 passed.

      The 2 errored files are react-hosted/web3-island.test.ts, once per project,
      failing Hook timed out in 10000ms while building the rainbowkit hydration
      fixture — no assertion fails, the setup hook times out and its 2 tests are
      skipped. I first called it a regression and was wrong: I had one base pass
      and one head failure, but both sat on the boundary (10.25 s and 10.02 s against
      a 10,000 ms cap) and both failures followed heavy load. Three consecutive
      standalone runs on this head pass. It is a threshold flake, and nothing in this
      diff is reachable from that file — the change is confined to
      packages/lynx/src, which the octane project does not import.

    • node benchmarks/bench.mjs --quick --ratios lynx-list — PASS, 0.012x eager
      (12 physical cells for 1,000 logical items, 988 reuses, 0 after teardown). This
      is the exit gate §5 names for Phase C. C1 does not touch the list runtime, so
      it is a no-regression check here rather than the phase's evidence.

    Per §2.3 the rspeedy-plugin native-demo and packed-consumer failures remain
    pre-existing in this container and were not chased.

    Next

    C2 design comment (teaching adoption to carry lists), then Phases D–E. Nothing
    is merged; every PR in the stack remains a draft.


    Generated by Claude Code

  21. Huxpro commented on Aug 20, 2026

    @Huxpro
    OwnerAuthor

    Phase C — C2 design: teach adoption to carry native lists

    §5 names "revisiting the lists-excluded-from-adoption divergence" as where Phase
    C's risk concentrates. This is that design. No code yet; C1 (#110) is the only
    thing landed.

    What the divergence actually costs

    It is not "lists cannot be adopted". It is that a page containing a native
    <list> gets no synchronous first screen at all.
    captureLynxFirstTree
    returns null for such a root, renderFirstScreenNow retires the paint as
    skipped, and the page stays empty until the background's first commit lands
    and paints it from scratch. C1 made that verdict cheap; it did not change it.

    So the feature is absent exactly on the page Lynx exists to render. Everything
    below is aimed at that, not at shaving the list path.

    What a list's first screen actually is

    Measured, not assumed — a probe over the staged path with a five-row list, using
    the public getLynxListDiagnostics and isLynxHostAttached:

    list diagnostics: {"logicalItems":5,"physicalCells":0,"attachedCells":0,
                       "pooledCells":0,"createdCells":0,"reusedCells":0,
                       "enterCount":0,"leaveCount":0}
    row 0: item attached=false  text attached=false
    row 1..4: same
    list host attached = true
    captureLynxFirstTree => null
    

    The <list> host is the only attached node in the entire subtree. Every row
    and every descendant of a row is a live record with node === null; the platform
    materializes them later through componentAtIndex. Driving one cell in
    (enterListItemAtIndex(0)) flips exactly row 0 to attached and moves
    physicalCells/createdCells/enterCount to 1.

    That is the shape adoption has to carry: a partially materialized tree —
    every logical record present, only some owning a physical node.

    The four things that block it today

    1. captureLynxFirstTree returns null on state.lists.size !== 0
      (host-driver.ts:3302) and on record.type === 'list'. Without those it
      throws at the first unmaterialized row (:3313): first-tree host N must own an attached physical node.
    2. The same function asserts state.ownedNodes.size === state.records.size
      (:3427) — physical count equals logical count. A partially materialized tree
      breaks it by construction.
    3. compareFirstTree refuses sourceState.lists.size !== 0 || listUpdates.length !== 0 (:3517).
    4. transferFirstTree requires sourceRecord.node non-null for every target
      record (:3643), and knows nothing about state.lists.

    The design

    The key structural fact: LynxNativeListState — cellsBySign,
    attachedByItem, retainedByItem, recyclePools, the three callbacks, the
    counters — is main-local and never crosses the wire. Adoption is a
    main-thread operation (prepareLynxHostBatch(target, batch, { firstTree })), and
    the background only ever tests message.firstTree !== undefined as a flag
    (transport.ts:758); it never reads a node. So the list bookkeeping does not
    need a serialized representation. It needs to be moved, by reference, from
    one container to the other.

    That collapses most of the apparent difficulty.

    1. A snapshot node may be logical-only.

    nativeId: number becomes nativeId: number | null. null states: this record
    exists, the background must agree on its type, props, parent, child order and
    visibility, and no physical node was painted for it. Capture permits null only
    for a record inside a <list> — anywhere else a missing node stays the fault it
    is today.

    Everything else about the node snapshot is unchanged, and a <list> is an
    ordinary node whose children are its logical rows (snapshot.children already
    comes from record.children, not from physicalChildren, so this needs no
    change).

    2. Capture emits the list instead of declining.

    • Drop the two early returns.
    • Emit rows and row descendants with nativeId: null where record.node is
      null, and with a real nativeId where a cell is currently attached — attached
      cells are ordinary owned nodes, so they snapshot exactly as they do today.
    • Relax the ownership assertion to ownedNodes.size === (records with a node).
    • Record, in the opaque journal (LynxFirstTreeState, which already carries
      main-local eventsByToken beside the clone-safe snapshot), one entry per
      list: its items and a capture-time epoch
      enterCount + leaveCount + createdCells + reusedCells.

    3. compareFirstTree compares the list instead of refusing it.

    • Every captured list host must be a list in the background's records.
    • listUpdates must contain exactly one entry per captured list, matching
      hostId, with sameListItems(captured.items, update.next). Anything else →
      repair. This is what proves the update-list-info attribute already on the
      adopted node is the one the background would have written.
    • Logical-only nodes skip the nativeId, native-event and main-thread-ref
      assertions — there is no node to assert about — and keep type, props, parent,
      children and visibility.
    • The live epoch must equal the captured epoch. Any componentAtIndex /
      enqueueComponent traffic between capture and adoption moves it, and the tree
      repairs rather than adopting a stale picture. One integer instead of a race to
      reason about.

    4. transferFirstTree carries the list state.

    • Skip records the snapshot marked logical-only; keep throwing for any other
      null node.
    • Move each LynxNativeListState from sourceState.lists to
      targetState.lists and set targetState.hasNativeListTopology.
    • Rebuild the three callbacks against the target container and install them with
      listPAPI.updateCallbacks.

    That last point is the one real refactor. componentAtIndex,
    enqueueComponent and componentAtIndexes are closures created inside
    createNativeListNode (:2403) over the source state, container and
    listState; moving the state does not move what they write to. They need
    extracting into a bindNativeListCallbacks(state, container, listState) that
    both createNativeListNode and adoption call — a pure extraction, with
    list-recycling.test.ts as the guard. The updateCallbacks seam itself is not
    new: applyListUpdate (:2576) and disposeNativeListState (:2078) both
    already retarget a live list's callbacks.

    Re-entrancy. A native callback cannot interleave with the transfer:
    transferFirstTree makes no PAPI call, so nothing yields to the platform between
    the first record moving and the callbacks being reinstalled. That is a real
    invariant with a real way to break it — adding any flush, setAttribute or
    insertBefore to the transfer path would open the window — so it belongs in a
    comment on the function, not just in this design.

    What this deliberately does not do

    • It does not touch recycling, componentAtIndex semantics, cell signs, or the
      update-list-info protocol. The lynx-list physical-cell ratio gate is
      untouched by construction: this changes who owns the list state, never how
      cells are created or reused.
    • It does not make C3 unnecessary. C3 (direct first-screen emission for lists)
      is a separate cost and only becomes reachable once capture stops declining —
      which is what C2 delivers. applyLynxFirstScreenDirect's own
      firstScreenTreeHasList bail stays in place through C2 and is C3's subject.

    Protocol impact

    assertFirstTreeSnapshot (protocol.ts:1477) is strict: exactKeys on the
    snapshot and on every node, format !== 1 fails, and positiveInteger(nativeId)
    rejects null. So C2 bumps the snapshot to format: 2 and relaxes nativeId to
    a nullable positive integer. Nothing else changes on the wire — the per-list
    block stays main-local, per the structural fact above.

    A format: 2 snapshot reaching an older peer fails validation and the reply is
    rejected, which lands on "no adoption" rather than on a corrupt tree. That is the
    right failure, and it is the same shape as the existing templateProgram
    capability negotiation at transport.ts:762.

    Test plan

    • Differential: the same list fixture rendered through the first-screen path
      and through a cold background commit must produce identical final container
      state — records, props, events, attachment, and getLynxListDiagnostics.
    • Adoption proper: a list page adopts; the adopted container's list responds
      to enterListItemAtIndex afterwards and recycles normally. This is the
      assertion that catches a callback trio still bound to the dead source.
    • Repair paths, one test each: background rows differ from captured rows;
      a second list appears only in the background; componentAtIndex fires between
      capture and adopt (epoch moved). Each must repair, not fault, and must leave a
      usable tree.
    • Fault preserved: a non-list record with a null node still throws in
      capture and in transfer.
    • Gates: node benchmarks/bench.mjs --only lynx-table --ratios and the
      lynx-list physical-cell ratio, which is §5's stated exit for this phase, plus
      the full packages/lynx suite.

    What to measure, and the honest prediction

    The C1-shaped measurement (PAPI calls + first-screen wall clock, arms by
    stashing) is the wrong instrument here. Adoption removes work from the
    background's first commit, and for a list page that commit creates one list
    element and N row records with no elements — so the PAPI delta will be small,
    and quoting it would oversell the change.

    The number that matters is time-to-first-paint for a list page, which today is
    "after background boot" and after C2 is "at main-thread paint". That has to be
    measured as first-paint timing on the native-list fixture, with the
    before-arm being the current no-first-screen behaviour. I will state it that way
    rather than produce a PAPI count that flatters the change.

    Risks

    • The epoch is a proxy. It counts callback traffic, not state divergence, so
      it can repair a tree that was actually still fine. That direction is safe and
      the case is rare; the reverse would not be.
    • Partially materialized capture is new ground for the invariants. The
      ownership assertion relaxed in (2) is a real guard — it has caught untracked
      nodes — and weakening it to "records with a node" must not weaken it for
      non-list trees. It should be expressed as an exact count of the logical-only
      records the walk itself emitted, not as an inequality.
    • Whether the engine materializes cells during the first-screen flush is not
      verifiable in this container
      (per §6, native evidence cannot be produced
      here). The design does not depend on the answer — attached cells snapshot as
      ordinary nodes and the list state moves wholesale either way — but the shape
      of a real device's first capture is unverified, so the differential test has to
      cover both physicalCells === 0 and physicalCells > 0, which it does above.
    • The list-item records' props are compared, but the descriptors derived from
      them by createLynxListItemDescriptor are what the platform actually consults.
      sameListItems on the prepared update is what ties the two together; if that
      check were dropped the page could adopt a list whose native metadata disagrees
      with its records.

    Slicing

    1. C2a — extract bindNativeListCallbacks, no behaviour change. Guarded by
      the existing recycling suite.
    2. C2b — nullable nativeId, format: 2, capture emits logical-only nodes
      and the journal's list block; capture still declines at the end. Nothing
      adopts yet; the snapshot is just richer, and its validator is red/green'd.
    3. C2c — compareFirstTree and transferFirstTree, with the repair tests.
      This is the slice that flips the behaviour, and the one that carries the
      first-paint measurement.

    Order matters: 1 and 2 are independently reviewable and cannot regress anything,
    which leaves 3 as the only slice where a review finding is expensive.


    Generated by Claude Code

  22. Huxpro commented on Aug 20, 2026

    @Huxpro
    OwnerAuthor

    C2 design correction: no protocol change, and C2b/C2c are one slice

    Two things in the C2 design are wrong. Both surfaced while starting the implementation, and one of them would have shipped a boot failure.

    1. The format: 2 bump is unsafe, and unnecessary.

    I claimed a format: 2 snapshot reaching an older peer "fails validation and the reply is rejected, which lands on no adoption rather than on a corrupt tree." That is not what happens. validateLynxBackgroundInboundMessage runs unconditionally on the receive side (transport.ts:1332, not dev-gated), and a malformed inbound message goes to rejectExpectedMalformed — the ready deferred never resolves and the background root never boots. For an old-background/new-main pair that turns today's "list pages don't adopt" into "list pages don't start".

    It is also unnecessary. The design's own key fact already rules it out: the background never reads a node, only message.firstTree !== undefined. So logical-only rows have no reason to be on the wire at all. They belong in the journal — LynxFirstTreeState, main-local, never serialized, which already exists to hold exactly this kind of state beside the clone-safe snapshot.

    Revised: snapshot.nodes keeps its current meaning and its current shape — every node that owns a physical node, nativeId non-null, format: 1. The journal gains the logical-only records and the per-list block. compareFirstTree runs main-side and reads both; its snapshot.nodes.length !== finalIds.size check becomes a count over snapshot plus journal. assertFirstTreeSnapshot is untouched.

    No protocol change, no format bump, no skew risk. Strictly better than what I posted.

    2. C2b and C2c cannot be separate PRs.

    I sliced them as "capture emits the richer snapshot but still declines" then "adoption consumes it". The first is not shippable either way: if capture keeps declining, the new code is unreachable; if it stops declining before adoption can consume the result, a list page paints, hands over a first tree adoption cannot match, and repairs — paint, tear down, repaint, which is worse than today's no-paint. C1 exists precisely to avoid that shape.

    The capture change and the adopt change are one atomic behavioural change. With the protocol slice gone, C2 is now two PRs, not three:

    1. C2a — extract bindNativeListCallbacks. Landed, refactor(lynx): bind the native list callbacks through one definition #111.
    2. C2b — capture, compare and transfer together, with the repair tests and the first-paint measurement.

    Everything else in the design stands: the epoch check, the wholesale transfer of LynxNativeListState, the callback rebind through updateCallbacks, the relaxed ownership assertion, the test plan, and the lynx-list ratio as the phase's exit gate.


    Generated by Claude Code

  23. Huxpro commented on Aug 20, 2026

    @Huxpro
    OwnerAuthor

    Phase C — C2 landed: a painted native <list> is adopted

    Draft PR: #112 (feat/lynx-adopt-native-list, based on #111).
    Design: comment and its correction, both already posted.

    What the design got right, and what it got wrong

    Right: the whole thing rests on a measurement rather than an assumption. At
    first screen a native list has no cells.
    A 1,000-row feed paints one node — the
    <list> — and every row is a live record with node === null. So transfer moves
    one node, and LynxNativeListState (cells by sign, pools, retained items, the
    three callbacks) is main-local and never crosses the wire, which means adoption
    can move it by reference rather than serialize it. Only the callbacks are
    rebound, because they close over the container adoption empties.

    Wrong, and corrected publicly before implementing:

    • format: 2 would have bricked older peers. validateLynxBackgroundInboundMessage
      runs unconditionally on receive and assertFirstTreeSnapshot fails a
      format !== 1, so a background peer would reject the whole main-ready reply
      and never boot — to describe rows no peer reads. The snapshot keeps format: 1;
      rows live in the main-local journal.
    • C2b/C2c could not be split. The intermediate state is either dead code or a
      paint→repair→repaint regression.

    A third error only implementation found: listUpdates.length !== journal.lists.size
    looked like the obvious agreement check and is wrong, because a rowless list
    produces no prepared update at all. Predicted while writing the empty-feed case,
    confirmed by watching adopts a native list that has no rows at all fail, fixed
    by deleting the count equality.

    Measurement — the phase's own obligation, for the slice that flips behavior

    Real first-screen path against compiled lowering (template-created shell, <list>,
    rows via keyed @for), background stood in for by a second render dispatched over
    the real ContextProxy. Every head sample asserted to have actually adopted.

    page arm first paint total main-thread PAPI
    1,000 rows declines 70.4 ms 70.4 ms 12
    1,000 rows paints and adopts 42.8 ms 117.1 ms 21
    50 rows declines 5.6 ms 5.6 ms 12
    50 rows paints and adopts 2.9 ms 7.1 ms 21

    I expected the compare walk to explain the extra total work. It does not: paint
    43.2 ms, compareFirstTree 11.1 ms, transferFirstTree 0.8 ms, and the commit's
    remaining 59.0 ms is the same prepareLynxHostBatch record walk the declining arm
    also pays — adoption skips the mutation, not the preparation. Adoption's host
    traffic is constant, not per-row (21 vs 12 at both sizes).

    Both numbers understate the case: the harness dispatches the background commit
    immediately, charging the declining arm 3.6 ms for what is really a bundle load
    and a cold render on another thread.

    C1 is deleted by this slice

    firstScreenTreeIsUnadoptable cannot predict cell materialization, which is now
    the only thing capture declines. Left in place it would decline exactly the pages
    that gained a first screen. Its changeset is amended to say so in the same
    release; its measurement stands as the record of what build-and-discard cost.

    Two checks came back green under red/green, and are declared rather than kept quietly

    deliberate break result
    transfer keeps the source-bound callbacks 1 failed, 23 passed
    drop the epoch check 1 failed, 23 passed
    drop the sameListItems check 24 passed
    install loop does not skip logical rows 1 failed, 23 passed
    capture treats list rows as ordinary hosts 6 failed, 18 passed
    transfer does not skip logical rows 1 failed, 23 passed
    ownership assertion ignores logical rows 24 passed
    restored 24 passed

    The items check cannot fail alone: every descriptor field comes from a row's id,
    its position, and four props, all compared more strictly by the node walk. It
    states the update-list-info agreement where adoption relies on it. The contract
    is still guarded — the differing-rows repair test passes through the props
    comparison.

    The ownership equality is unreachable from any test, and that is not new: I
    disabled it entirely on the parent commit, in its original un-relaxed form, and
    all 434 lynx tests still passed. My own design comment set the bar here — "must
    not weaken it for non-list trees… expressed as an exact count of the logical-only
    records the walk itself emitted, not as an inequality" — and that bar is met by
    construction; what is missing is test reachability that the assertion never had.

    One thing the measurement opens for C3

    The compare walk spends 11.1 ms proving agreement over 4,000 records that own
    nothing physical. The load-bearing contract for a list page is narrower: the
    painted nodes agree, and the list's items agree. An unpainted row's descendants
    materialize later from the background's records, so a difference there has no
    physical consequence. Narrowing the walk is the same change that would make the
    items check load-bearing — the two green rows above and the 11.1 ms have one
    cause. Not taken here.

    Validation

    • pnpm format:check clean, pnpm typecheck clean.
    • --project lynx — 437 passed (parent 434); first-screen.test.ts 24 passed.
    • node benchmarks/bench.mjs --quick --ratios lynx-list — PASS, 0.012x eager
      (12 physical cells / 1,000 logical, 988 reuses, 0 after teardown). This is §5's
      Phase C exit gate.
    • pnpm test not run to completion in this container (60-minute cap); reachable
      projects run explicitly. §2.3 rspeedy-plugin failures remain pre-existing and
      unchased.

    Next

    C3 (extending direct first-screen emission to lists), which this unblocks — it was
    never independent of C2, since capture refused every list tree whatever painted
    it. Then Phases D–E. Nothing is merged; every PR in the stack is a draft.


    Generated by Claude Code

  24. Huxpro commented on Aug 20, 2026

    @Huxpro
    OwnerAuthor

    Phase C — C3 execution record: direct first-screen emission builds native lists

    Draft PR #113, on feat/lynx-adopt-native-list (#112). This closes Phase C.

    What it does

    The direct applier writes the rendered record tree straight to the Element PAPI —
    no command batch, no prepared operation list, no cloned record maps — and refused
    any tree containing a <list>. That refusal was correct while such a page could
    not be adopted anyway (painting a page the background will re-render is worse
    than not painting it). C2 (#112) made it adoptable, so the refusal became the
    remaining cost on exactly the pages a fast first screen exists for.

    A <list> breaks the applier's shape twice: its element comes from
    __CreateList with the recycling callbacks passed at creation, not from
    __CreateElement; and its rows are not attached to it, so the walk records every
    row and row-descendant without creating anything — the same create operations
    the staged path skips.

    Creation order was the design constraint. The list's element is created on
    the way down, so its unique ID lands in the same order the staged path assigns
    it; a list whose element were created after its subtree would hand a later
    sibling the lower ID, and element identity would depend on which applier painted
    the page. Only the row metadata waits for the way back up, because it is read
    off records the walk has not created yet. createNativeListNode split into
    beginNativeListNode + publishNativeListItems for that, and the staged path
    calls the composition unchanged. The differential fixture carries a <text>
    sibling after the list precisely to hold this — remove the sibling and the
    ordering bug is invisible.

    It asks before it paints. Emitting as it walks means it cannot discover a
    malformed list partway and back out; that leaves a half-painted page, the one
    state the staged path never produces. So a pre-walk runs the real validators
    (createLynxListItemDescriptor, planLynxListUpdate) plus the two placement
    rules the prepare walk owns, and hands anything it cannot vouch for back with
    nothing created. Ranges are transparent in it, for the same reason as in C1's
    predicate: an authored list takes its rows through a keyed @for, so they are
    not its own children, and a reader stopping at the immediate children would
    validate an empty list and fault at publish.

    Two trees still fall back, both deliberately: a host offering no __CreateList
    (that page is owed the diagnostic), and a list topology the pre-walk will not
    vouch for.

    Measurement

    Same harness and fixture as C2. 21 samples per pass after 3 warmups, each in a
    fresh environment; every sample of both arms asserted to have adopted.

    page arm first paint total main-thread PAPI
    1,000 rows staged 42.5 ms 120.6 ms 21
    1,000 rows direct 29.5 ms 102.3 ms 21
    50 rows staged 3.1 / 2.9 ms 9.3 / 7.7 ms 21
    50 rows direct 2.3 / 2.5 ms 6.7 / 6.9 ms 21

    Each cell is a median of 21 samples. The 1,000-row rows take the middle of three
    passes (paint: staged 42.5 / 40.9 / 45.7, direct 28.5 / 29.5 / 31.4), so the
    distributions are disjoint. The 50-row page ran two passes each, so both are
    given rather than averaged.

    Element PAPI traffic is identical in both arms at both sizes — 21 calls. What
    this removes is Octane's own staging, not one host call.

    Phase C, end to end, on the same 1,000-row page

    state when the page appears PR
    C1 — declined before painting; background renders it 70.4 ms #110
    C2 — painted and adopted through the staged path 42.8 ms #111, #112
    C3 — painted and adopted through the direct path 29.5 ms #113

    A 2.4× improvement in when a 1,000-row native-list page appears, and each
    figure is a lower bound: the harness hands the background's commit over
    immediately, where a real page pays a bundle load and a cold render on another
    thread first.

    C1's predicate itself was removed by C2 — a page holding a list is painted and
    adopted now, so a predicate that declined every such tree would decline exactly
    the pages that gained a first screen. What it measured stands as the cost of
    building a first screen and discarding it.

    Red/green (--project lynx, 440 tests)

    break result
    rows painted as ordinary hosts 8 failed | 431 passed
    never publish the rows 4 failed | 435 passed
    publish on the way down instead of the way back up 4 failed | 435 passed
    hasNativeListTopology never set 440 passed — unguarded
    pre-walk always returns true 3 failed | 437 passed
    pre-walk always returns false 2 failed | 437 passed
    ranges opaque in the pre-walk 1 failed | 439 passed
    restored 440 passed

    The unguarded line, stated rather than papered over.
    state.hasNativeListTopology = true has no test that fails without it, and is
    unobservable on a direct-painted container by construction: the only caller of
    applyLynxFirstScreenDirect is main-thread.ts:1907, on the first-screen source
    container, and the staged prepareLynxHostBatch(source, …) only runs when the
    direct applier returned false. A container is therefore never both
    direct-painted and batch-prepared, so the flag's consumers — the compact-run and
    lazy-public-instance fast paths — never read it on a container this path built.
    It is set anyway, because the flag describes the container's topology rather than
    the applier that produced it. No test was added: the only one that could fail
    would have to assert an internal LynxHostState field, which
    .rulesync/rules/testing.md forbids, and it would protect the current routing
    rather than the behavior.

    Validation

    pnpm format:check ✅, pnpm typecheck ✅, vitest run --project lynx → 440
    passed ✅, bench.mjs --quick --ratios lynx-list → PASS (allocation ratio 0.012x
    eager, unchanged) ✅, pnpm sync → no generated changes ✅. Full pnpm test is
    running against this head; the result goes on #113 as a comment either way.

    Follow-up the phase surfaced, not taken here

    compareFirstTree walks all 4,002 records on the 1,000-row page to compare 2
    physical nodes — 11.1 ms in C2's instrumentation. Narrowing that walk to the
    records that own something physical is the same change that would make the list
    items check load-bearing, and it is the natural next increment.

    Next: #66 body Phases D–E.


    Generated by Claude Code

  25. Huxpro commented on Aug 20, 2026

    @Huxpro
    OwnerAuthor

    Phase D — D1 execution record: the L5 bundle re-audit

    Draft PR #114, on #113. Documentation only — no source touched.

    §6 calls this a hard gate and records that #95 already repaid #63's module-level
    trade, so the instruction was re-verify rather than re-pay. It does not come
    back clean, so here is all of it.

    Protocol

    Two arms, same host, same session, deterministic bytes — exact, and independent
    of host quiet: origin/new-lynx 5d61724 against the stack tip 566700e, plus
    five cut points between. The inventory arm used the harness's own
    OCTANE_INVENTORY_CALIBRATE=1 escape hatch so the full metric set is collected
    instead of aborting on the first breach. No budget was edited to obtain any
    number.

    1. The #63 trade stays repaid ✅

    Nothing in the stack re-incurs it; the compiler-side arm moves preview main gzip
    by 0 bytes.

    2. Every frozen budget but one is already red on new-lynx ⚠️

    Before a single commit of this stack. They were calibrated on upstream
    ffadd397.

    gate budget base head
    preview main gzip 77,286 79,491 ✗ 81,212 ✗
    IFR main gzip 82,274 85,106 ✗ 87,016 ✗
    preview background raw (must equal) 272,504 277,052 ✗ 278,520 ✗
    rows-0 web raw / gzip 485,345 / 132,334 489,394 / 134,200 ✗ 493,596 / 135,495 ✗
    rows-0 lynx raw / gzip 474,618 / 159,077 479,350 / 161,888 ✗ 483,375 / 163,744 ✗
    rows-0 lynx main raw / gzip 203,712 / 57,563 208,894 / 59,494 ✗ 213,096 / 60,783 ✗
    rows-0 lynx background raw 277,505 276,387 ✓ 276,387 ✓
    rows-0 lynx background gzip 74,381 74,414 ✗ 74,418 ✗

    bench.mjs --ratios lynx-bundle-size fails on the base and the head, first at
    preview main gzip both times. A gate red on its own base cannot report a
    regression. I did not re-freeze: doing that from the branch that grew the
    number would launder the growth into the baseline. It is an owner call, and the
    table is what it needs.

    3. The stack costs +1,721 B main gzip, and the ladder says exactly where

    arm commit preview main gzip Δ base step
    base new-lynx 5d61724 79,491 — —
    #103 U2b block core af33496 79,491 +0 +0
    Phase B end fbccb04 79,794 +303 +303
    C1 decline (#110) 5ac4c9b 80,108 +617 +314
    C2a binding (#111) 6e52ff8 80,161 +670 +53
    C2b adoption (#112) f34bea7 80,682 +1,191 +521
    C3 direct lists (#113) 566700e 81,212 +1,721 +530

    Two things fall out of that shape.

    The specialized background core taxes the main thread nothing — 0 bytes on
    preview main, −1 on IFR main — and puts its whole +1,468 B where it runs, on the
    background program. A per-root flag shipping a second core did not tax the thread
    it does not run on. That is a real result for #103.

    Every byte of main-thread growth is first-screen work: +2.17%, bought against
    a 1,000-row native-list page appearing at 29.5 ms instead of 70.4 ms. On the
    rows-0 app the split is total — main raw +4,202 B, background raw +0.

    C1 reads oddly at +314 B: it added a pre-check walk that C2b then deleted, and
    C2b still grew, because what replaced it is the adoption journal for rows that
    were never painted.

    4. The ≤1.5× target is missed, and was missed before this stack ❌

    what is compared base head ratio, head
    App.lynx.tsrx preview main gzip 79,491 81,212 1.585×
    App.lynx.tsrx IFR main gzip 85,106 87,016 1.699×
    rows-0 lynx main gzip 59,494 60,783 1.187×
    rows-0 lynx complete artifact gzip 161,888 163,744 3.196×

    The verdict depends on which fixture answers the gate, and #58 does not say.
    On the lynx-bundle-size fixture — whose budgets are the checked gate — 1.585×,
    missed, from 1.552× on the base. On the rows-0 app, 1.187×, met with room. They
    disagree because they are different applications, not because either is wrong.

    Closing it needs what #58's L5 bullet names — deleting the plan interpreter, the
    batch pipeline, and the recursive validator from the main bundle — and none of
    the three is deletable yet
    : the staged path is still the fallback the direct
    applier hands trees back to, and validateLynxBackgroundInboundMessage still
    runs on every inbound message.

    One caveat on the denominator: the 51,228 B median is a carried constant, not a
    reproducible measurement
    . Only the three references' .web.bundle fixtures are
    vendored; the median was taken over five Lynx-mode configs and nothing here
    rebuilds them. If ≤1.5× is to remain a gate, that needs fixing or restating.

    Recommendations for the owner

    1. Recalibrate inventory-budgets.json and NO_WORKLET_BUDGET deliberately on a
      chosen tree, once the stack's disposition is decided — otherwise the gate
      cannot report the next regression.
    2. Decide the +1,721 B trade explicitly. It is 2.17% of the main program for a
      2.4× first paint on native-list pages.
    3. Rebuild and vendor the five reference Lynx configs, or restate the ≤1.5×
      target against something this repository can measure.

    Next: D2 (full cross-framework web sweep vs the vendored references) is running
    now; D3 is the cutover-gate verdict plus the native-evidence handoff.


    Generated by Claude Code

  26. Huxpro commented on Aug 20, 2026

    @Huxpro
    OwnerAuthor

    Phase D execution record — D1 ✅ D2 ✅ D3 ✅ (verdict: NO-GO)

    Phase D is complete. Two draft PRs: #114 (D1, bundle re-audit) and #115 (D2+D3, parity sweep and cutover-gate verdict), stacked on the Phase C tip 566700e.

    The verdict

    #58's L5 cutover asks to flip lynxRendererRules and deprecate the universal Lynx path, gated on three clauses. One of three passes.

    clause verdict
    create@10k materially below 1,201 ms, PAPI dominance reduced FAIL
    main-thread gzip ≤1.5× the ~51 KB median FAIL on the gated fixture
    no wire-floor regressions PASS

    The 1,201 ms figure is not comparable — different host, and taken at the pre-correction background boundary — so the clause was judged against a same-window base arm instead. Control create is 1,825.5 ms on new-lynx against 1,901.8 ms on the stack tip; PAPI-stage dominance is 77.2% → 77.4%. Neither moved.

    The mismatch is the finding

    #58's L5 gate is written about the create path. Phases B–C were executed against the first-screen path. On this app those are different code paths — create is a button-driven background render through the staged batch, the first screen is the direct applier — and the measurement shows work on one did not move the other.

    Where B–C were aimed, they landed:

    cell @10k base 5d61724 head 566700e Δ
    FCP control wall 2,577.6 ms 2,382.5 ms −7.6%
    FCP plan_interpretation 117.0 ms 77.9 ms −33.4%
    create control wall 1,825.5 ms 1,901.8 ms +4.2%
    PAPI-stage dominance of create 77.2% 77.4% +0.2 pt

    That FCP row also leaves #58's L3 exit gate open: it wanted plan interpretation eliminated, not reduced. At 77.9 ms / 3.2% it is neither gone nor negligible — the direct applier bypasses the interpreter for trees it accepts, and the interpreter still ships and still runs.

    The planning consequence: the create clause will not be closed by more first-screen work. PAPI creation plus other host apply is 77% of create and has been at every measurement since live-report.md. It needs a milestone that owns host materialization.

    Two things I did not paper over

    A small unexplained excess on the mutation cells. selectStorm@10k looked like a +34% regression in the single-pass sweep. Six alternating AB/BA passes settle it at 0.997 head/base — window noise — but the same six passes leave create at 1.032, update10th at 1.042, and updateStorm at 1.076, consistent in both orderings and corroborated independently by the stage arm's +4.2%. Two same-window protocols agreeing on direction is more than noise and less than a demonstrated regression. Mechanism unidentified; the hypothesis I'd test first is that #109's record-shape change sits on a path shared with the staged update route, so the mutation cells pay for a first-screen optimization they never use. Written down as a hypothesis, in the report, so the next session starts from the number.

    A defect in this stack's own Phase 1 work, reported on #101: from 2dc0768e4 onward the profiling delta shadow misses 100% of lynx-table's commits — 0 commits, 0 ops, 0 bytes in every cell, where v1 measured 0 misses and real byte counts. siteOf requires a mount's parent to be a host registered by an earlier mount-template-run, which is never true at an app root. Every mount-template-run fixture in delta-shadow.test.ts passes parent: null, which short-circuits before the lookup, so the suite passes 5/5 while the facility measures nothing. Profiling-only, no doc or PR body cites those counters, and I left the repair to you rather than re-opening a reviewed design and rebasing ten descendants.

    Measurement discipline

    Both stage arms driven end to end in one window on one host, n=5, fresh page per sample, AB/BA, quiet-host preflight passed on both. The report has an explicit "what is comparable and what is not" section, because the stack changes the harness as well as the runtime: the background stage split and the added cells are not comparable across arms, while the outer wall-clock endpoints and the PAPI/apply timers are verified untouched. Drift is bounded by an invariant rather than asserted — the vendored vue-vdom bundle is byte-identical in both windows and moved 3.4% on create@10k, so deltas under that are reported as unresolved.

    Full reports: stack-66-cutover-gate.md and stack-66-reaudit.md.

    Moving to Phase E (L6: retiring the Lynx-only universal capabilities, and §9 open question 3).


    Generated by Claude Code

  27. Huxpro commented on Aug 20, 2026

    @Huxpro
    OwnerAuthor

    Phase E execution record ✅ — and the L6 dependency is wrong in the plan

    Phase E is complete as #116 (draft, stacked on #115), with the follow-up filed as #117. That closes Phases B–E; the whole of this issue's body is now executed.

    The decision: nothing is removed, and Phase D's NO-GO is not the reason

    §7 asks to remove the Lynx-only universal capabilities "where @octanejs/three doesn't use them". I inventoried that surface first, and the inventory changes the answer:

    side Lynx-only Three-only shared
    compiler capability strings template-program-mount, class-name-alias, thread-functions, main-thread-render-only local-host-callback, portal visibility
    driver capability flags templateMount, collapsedTemplateMount, templateProgramMount, templateProgramRuns, stableStaticHostProps, lazyPublicInstances localHostCallbacks, compilerLeafProps text, visibility
    commands mount-template-run + coalescing — the rest

    The specialized target never replaced the descriptor ABI. lynxMainThreadRenderer is target: 'lynx', but it lowers only eligible host-only templates into create functions and otherwise keeps the descriptor ABI — its own config comment says so — and the background half of the same path is lynxBackgroundRenderer at target: 'universal', the renderer that declares template-program-mount. Both halves of the shipping Lynx path run through octane/universal.

    So the removal is not downstream of the L5 cutover, as #58 and §7 have it. It is downstream of a background core that stops speaking the descriptor ABI at all — #103's Block-over-wire core, behind a per-root flag today. The two are independent: resolving the cutover would not make the deletion safe, and making the block core the default would, whatever the cutover said. Deleting on the stated trigger would have broken the shipping path.

    Filed as #117 with the corrected precondition and the deletion checklist, including the point that the removal is the one remaining lever on #58's ≤1.5× gzip target.

    §9's carried open question, answered: Three does not want slot tables

    Three declares none of the template capabilities and its driver has no mount-template-run arm. It has no boundary to amortize a collapse across — the driver runs in the host's own realm, and the package's only transport reference is a guard refusing one portal case. And the headroom settles it, node benchmarks/bench.mjs --only three-renderer --ratios at n=20:

    op octane r3f 9.6.1 plain three
    mount_1k 7.725 ms 10.090 ms 4.115 ms
    reconstruct_dispose_1k 7.030 ms 7.875 ms 3.235 ms
    reorder_1k 4.975 ms 5.770 ms 1.195 ms
    unmount_tree_1k 2.520 ms 5.280 ms 0.860 ms

    53% of the biggest creation cell is Three's own object construction — an irreducible host floor. The entire declarative overhead above it is 3.6 ms per 1,000 objects, and slot tables reach only the descriptor share of that, never component and hook execution. Octane already leads r3f on seven of the suite's eight operations. Against a mechanism that costs Lynx +1,721 B main-thread gzip plus a compiler backend and a second driver path, Three should not take it.

    One honest note from that run: three-renderer reconstruct_component_dispose_1k breached its ratio guard at 1.07× (maxRatio 1). Not from this stack — packages/three, packages/octane/src/universal-core.ts, and benchmarks/three are byte-identical between origin/new-lynx and this head — and below the measurement's own resolution here, where the two scores carry 14.7% and 11.9% RME. It needs a quiet-host same-window check before it means anything.

    Where the whole stack stands

    Fourteen draft PRs on new-lynx, none merged: #100–#102 (Phase 0–1), #104–#109 (#103 block core, Phase B), #110–#113 (Phase C), #114–#116 (Phase D–E). Plus #117 filed, and the delta-shadow defect reported on #101.

    Three findings I'd want read before the next session picks this up:

    1. The L5 gate measures the create path; B–C moved the first-screen path. FCP@10k control −7.6%; create@10k flat to +4.2%. More first-screen work will not close the gate — PAPI creation plus other apply is 77% of create.
    2. L6's dependency is Lynx specialized background core: the Block model over the wire (#58 L2 body, post-attribution direction) #103's block core, not the cutover (above).
    3. A small unexplained excess on the mutation cells (create 1.032, update10th 1.042, updateStorm 1.076 head/base, consistent in both AB and BA orderings). Hypothesis to test first is perf(lynx): build first-screen host records without spread-and-delete #109's record-shape change sitting on a path shared with the staged update route.

    Generated by Claude Code

  28. Huxpro commented on Aug 20, 2026

    @Huxpro
    OwnerAuthor

    Correction: the mutation-cell hypothesis I posted is wrong

    Two comments up I named #109's record-shape change as the hypothesis to test first for the few-percent excess on create, update10th, and updateStorm. I then went and read the stack's source diff, and it disproves that. Retracting it here so it doesn't become the next session's starting point — #115's report and PR body are corrected, and its second commit carries the file-by-file table.

    The stack edits nine source files, and none of them is on the mutation path after adoption:

    file reaches a mutation cell?
    core/block-core.ts, core/block-root.ts no — new, behind a per-root flag
    core/delta-protocol.ts, core/delta-shadow.ts no — profiling-only, constructed under LYNX_PROFILE
    main-renderer.ts, core/first-screen.ts no — first-screen render
    main-thread.ts no — the direct-applier call site
    core/host-driver.ts no — every hunk lands in applyLynxFirstScreenDirect, captureLynxFirstTree, compareFirstTree, transferFirstTree, the native-list constructors, or the once-per-root firstTreeAction === 'adopt' branch of prepareLynxHostBatch
    compiler/compile-universal.js no — one slot kind flips 'c' → 'r'; slots is read only by main-renderer.ts, which validates and copies it and branches on neither value

    host-driver.ts was the one that needed checking rather than assuming — it holds both the first-screen path and the staged one, and it does have a hunk inside prepareLynxHostBatch. That hunk is in the firstTreeAction === 'adopt' branch, which runs once per root, not per mutation.

    What remains. A logic regression on the mutation path is ruled out. Two candidates are left, and I claim neither:

    1. The bigger main-thread bundle — +4,202 B raw / +1,721 B gzip, and every mutation cell runs inside it. If this is the mechanism, the excess is the trade docs(bench): re-audit the L5 bundle gate on the unmerged issue-66 stack #114 priced in bytes, seen in milliseconds, and not a defect.
    2. Slow host drift across the session — AB/BA alternation controls ordering within a window; it does not control a host trending over an afternoon, and both protocols ran on the same container in the same afternoon.

    The first is directly testable: pad the base bundle with dead bytes to the head's size and re-run the AB/BA sweep. That is the experiment to start from, not #109.

    The measurement itself is unchanged — create 1.032, update10th 1.042, updateStorm 1.076 head/base, consistent in both orderings. Only my explanation of it was wrong.


    Generated by Claude Code

  29. added a commit that references this issue on Aug 21, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    agent-authoredenhancement

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions