Repository navigation
Description
The anomaly
From #39's three-entry run (results/runs/2026-08-28T00-56-44-…-octane-sync-v0147-residual-web.json), startup-suite wireToBtsBytes — bytes crossing MTS→BTS during the startup window — for our entries against upstream:
| scale | hux (pre-sync) | hux (post-sync) | upstream |
|---|---|---|---|
| 0 | 21,601 | 18,710 | 18,680 |
| 1,000 | 1,755 | 1,676 | 1,674 |
| 10,000 | 1,646 | 1,624 | 1,627 |
| 30,000 | 42,841,644 | 36,960,444 | 1,688 |
At 1k and 10k the inverted handoff is doing exactly what #163 C2e promised — the adoption crosses ~1.7 KB, same as upstream's handshake. At 30k, ~1.4 KB per row crosses to the background: the shape and size of a full per-node first-tree description. wireToMtsBytes@30k stays at 274 bytes, so nothing was repainted — whatever crossed was consumed as a successful handoff, meaning some scale-triggered condition routes the 30k first screen onto a describe-and-ship path that 1k/10k never touch. The measurable damage in the same run: FCP@30k is 6–8% behind upstream (8,192 ms vs 7,716 ms) while 0/1k are at parity or ahead — plus whatever this costs on device, where 40 MB through the ContextProxy is not a rounding error.
Why this is worth a real root-cause, not a shrug
- It is a cliff, not a slope: identical mechanism at 10k, different mechanism at 30k. Cliffs mean a threshold or a fallback predicate, and un-root-caused fallback predicates are how "wire-free adoption" quietly stops being true in production shapes.
- It may be one bug wearing three costumes. chore: sync new-lynx with upstream octane v0.1.47 (d5175ca8) #229 flagged two other unexplained anomalies in the same runs:
heapMtsAfterCleardrifting 1.46×→1.58× upstream, and the pre-sync build's first create never completing in second position in a shared browser. A ~40 MB message (and whatever retains it, or its send buffer) is a plausible common root for heap drift and realm poisoning both. Check the linkage before treating them as three issues.
Orders
- See the message. Reproduce a 30k first screen in the
lynx-tableharness with the wire instrumented (the transport codec makes this one dump: capture the MTS→BTS traffic during startup, log messagetypeand size per message). One look answers whether it is the first-tree snapshotdescribe(), a lifecycle payload, profiling leakage, or something else entirely. - Find the flip. Bisect row count between 10k and 30k for the first scale where the bytes explode. The flip point identifies the predicate: a size/host-count threshold, a compact-ACK or incremental-handoff degradation, a capture path that declines and falls back to description shipping, or a native-list/topology shape that only forms at that scale. Read the predicate in source and name it — the number alone is not the answer.
- Fix or justify. If it is a fallback that no longer needs to exist (the C2e inversion plus D-train machinery may have obsoleted the path that ships descriptions), delete the route and let the regression suite say what still needed it. If the fallback is load-bearing for a real shape, make its trigger precise and its payload proportionate — a fallback that ships O(page) bytes must at minimum say so in a diagnostic rather than fire silently. Either way, add the regression the anomaly earned: a wire-byte budget assertion in the harness for the startup window at a scale above the flip point, so a reintroduction cannot land quietly.
- Close the loop on the cousins. After the fix, re-measure
heapMtsAfterClearand re-try the second-position sequence on the fixed build. If they move, say the three were one; if they don't, they become their own probes (tracked in The create residual: attribute it, tax-test it, then extend compiled programs to steady-state mounts (E-train) #230's attached-probes section).
Oracle
wireToBtsBytes@30000 back in the KB class in the harness's startup window; FCP@30k re-measured against upstream on the #39 protocol (same host, one physical run, order-controlled); no regression at 1k/10k; the adoption/first-screen suites — nested programs, declines, visibility, the whole comparator surface — pass unmodified.
Activity
Huxpro commentedon Aug 28, 2026
Orders 1–2: it is a race, it is not ours, and the payload is used as a boolean
Three of this issue's premises do not survive its own run file. Reporting before fixing, per the disagreement rule.
The per-rep samples
wireToBtsBytesis reported as a median. The samples behind the fourstartup@30000medians:wireToBtsBytessamplesa-octane-hux(pre-sync)[42841644, 42841649, 42841642, 42841643, 42841647]octane(upstream v0.1.47)[36960349, 1688, 1676, 1682, 36960364]octane-sync(post-sync)[36960444, 36960441, 36960447, 1687, 36960451]So:
It is not a fork defect. Upstream ships 36,960,349 B on the same workload, in 2 of 5 reps. The issue's
upstream = 1,688 Bcolumn is the median of a bimodal sample — three small reps outvoted two 37 MB ones. Post-sync and upstream agree to within 100 bytes (36,960,44x vs 36,960,3xx) when both fire, which says they are shipping the same description.It is a cliff in the aggregate only. Per rep it is bimodal — 1.7 KB or 37 MB, same build, same scale, same page. That is a race, not a threshold, so there is no row count to bisect and no size predicate to find. Row count matters only because it sets how long the window stays open.
The trigger is visible in the same records.
wireToMtsBytes@30000moves with it, positionally, with no exceptions:wireToMtsByteswireToBtsBytesoctane[256, 60, 60, 60, 256][36960349, 1688, 1676, 1682, 36960364]octane-sync[257, 257, 257, 60, 257][36960444, 36960441, 36960447, 1687, 36960451]Every rep that received ~200 B extra inbound shipped ~37 MB outbound; every rep that received 60 B shipped 1.7 KB. The extra inbound is a correlated
main-ready-requestreaching the main thread while it still holds the first-tree journal.The mechanism, in source
main-thread.ts:1334— the snapshot rides any correlated ready reply, and only the uncorrelated announcement (request 0) is free:firstTreeis set on every successful synchronous first screen (main-thread.ts:1977) and released at1453when adoption completes. So the race is between adoption releasing the journal and the background's correlated request arriving. At 30k the main thread is inside an ~8 s paint, which holds the window open long enough that the request usually lands first — hence "only at 30k", on both sides of the fork.LynxFirstTreeSnapshotcarriesnodes: readonly LynxFirstTreeNodeSnapshot[], one entry per physical node, so the reply is O(tree) with no bound: ~350 B/node at benchmark scale.What the background does with 37 MB
transport.ts:765:That is the only read of the field anywhere in
packages/lynx/src. Nothing inspectsnodes,roots,plan, orversion;adoptingFirstTreeexists to suppress capabilities for the first batch so it preserves main's first-screen IDs. The whole per-node description is structured-cloned across the wire to communicate one bit — andprotocol.ts:1747then pays a full O(tree)assertFirstTreeSnapshotvalidating it on receipt.Order 1 in the
lynx-tableharness: it does not reproduce thereFive browser runs of the startup window, per-message
type/bytesvia__OCTANE_STAGE_WIRE__, all KB-class with no Octane protocol message at all — only web-core lifecycle chatter:dist-rows(universal)dist-mtsprogram-rowsdist-block-rows(BENCH_CORE=block BENCH_BLOCK_MODE=scoped)entries/octane-sync/distThe last row is the exact artifact that logged 36,960,444 B in the #39 run. At FCP 5.5–7.8 s against the run's 8.2 s, so not a host-speed difference — the harness simply lands on the lucky side of the race, which is what a 1-rep probe of a bimodal variable does. A single-sample reproduction was never going to be the right instrument here; the run file's
samplesarrays were.Where Order 3 lands
Not "delete the route": the bit it carries is load-bearing, and ID preservation for the first background batch is exactly the kind of obligation that must not be approximated away. But the payload is not load-bearing at all. The fix is to make the payload proportionate to the one bit the receiver reads, keeping the full description only for a peer that negotiated at a rung predating the inverted handoff — and to add the wire-byte budget assertion so a reintroduction cannot land quietly.
Doing that next, with the budget regression, on
fix/lynx-first-screen-wire-cliff.Order 4, adjusted
heapMtsAfterClearand the second-position poisoning are worth re-checking against a fixed build for a reason stronger than "same neighbourhood": a 37–43 MB structured clone landing in the background realm during startup is a plausible common cause for both, and it now has a known trigger to hold or release on demand rather than wait for.Generated by Claude Code
Huxpro commentedon Aug 28, 2026
Order 3: the fix, and the budget that keeps it
#233 (draft, stacked on #229's head).
What changed
main-readynow states the painted first screen as a fact instead of adescription:
A background whose readiness request is tagged at that rung gets the bit. The
main thread picks the encoding from the peer's rung, and every downstream branch
now turns on whether the reply announces a first tree rather than on which
encoding carried it.
The description route is kept. A peer below the rung is still sent the whole
snapshot, because for it presence is the key — the bit alone would tell it no
first screen happened at all, and it would rebuild the page over the command
path with fresh IDs. That is the load-bearing obligation from the Order 1/2
report, and it is not approximated away; it is written at the constant's
definition site and pinned by a test that drives a peer below the rung and
asserts it still receives all 401 nodes. Both directions of version skew are
therefore safe, and the two spellings are mutually exclusive on the wire so a
receiver never has to decide which one wins.
A second win the issue did not ask for
firstTree.snapshotis built on first read (#148). The presence path neverreads it, so a first screen that hands off this way never allocates a
description of itself either — the saving is main-thread allocation as well as
wire bytes.
The budget regression, in two places
packages/lynx/tests/first-screen-ready-wire.test.ts— the reply isbyte-identical at 50 and 400 rows and under 512 B. Not "smaller": it has
stopped being a function of the page. Red-verified by breaking
announcesByPresence, which fails 2 of its 3 cases.benchmarks/lynx-table/first-screen-selectors.mjs— a 4,096 Bmain-to-background budget over the whole first screen, with the offending
wireTracedumped on failure. Measuredmts->bts=468Bon both handshake armsat rows=1000.
That second one closes the gap this issue fell through. The ops suite has
reported bytes since it existed; the first screen reported only counts, on the
reasoning that a screen the direct applier paints sends no commands. True of the
background-to-main direction, and silent about the other one — which is where
the 37 MB was.
Order 4
Not in #233. Next, against the fixed build.
Generated by Claude Code
test(lynx-table): say what the first-screen wire budget can and canno…
Huxpro commentedon Aug 28, 2026
Order 4 — the fix at the cliff scale, and three corrections
All measurements same machine, single run, #39 protocol.
The cliff is gone, measured at 30,000 rows
benchmarks/lynx-table/first-screen-selectors.mjs --scales 1000,30000on the fixed head:Two bytes across a 30× tree. Against the pre-fix browser harness at the same scale (
startup/wireToBtsBytes, median of 5):octane-sync36,960,444 B,a-octane-hux42,841,644 B, upstreamoctane1,688 B.Correction 1 — the budget I shipped does not guard this
I claimed in the code that its job was "to catch a payload that scales with the tree". It cannot. I instrumented
dispatchReadyand both arms of that harness reportfirstTreeNull=true: they render from the background, so the main thread applies commands and never captures a first tree. There is no description on that wire to bound. The proof: I dropped the background below the presence rung and re-ran — still 470 B, because neither arm has a description to send either way.Fixed in
73882702a. The check stays, because it does bound something real — the rest of the handshake must not become a function of the page by any route — but the comment now says that is its scope and names where the description's own budget lives:first-screen-ready-wire.test.tsdrives a real main-thread paint, pins the reply byte-identical across an 8× tree and under 512 B at the presence rung, and proves that budget can fail by dropping a peer below it and watching the same reply grow past 4×. That test is the wire-byte regression this fix ships with; the bench number above is corroboration, not the guard.Correction 2 — I withdraw my own common-cause hypothesis
My Orders 1–2 comment proposed the 37 MB startup clone as a plausible common cause for
heapMtsAfterClearand the second-position stall. The same run file refutes it.startup/wireToBtsBytesat 10,000 rows:octanea-octane-huxoctane-syncThe clone only fires at 30k.
heapMtsAfterClearis measured at 10k, where no clone happens. Different defect.Also worth recording: the cliff is not a sync regression. The pre-sync block core is worse (42.8 MB vs 37.0 MB). Both block-core builds have it; upstream does not.
The retention, named, and split by cause
CDP heap-snapshot probe: one browser per entry, harness-identical readiness, create 10,000 → clear →
HeapProfiler.collectGarbage→Runtime.getHeapUsage→takeHeapSnapshot, aggregated by constructor self size. It reproduces the harness:heapMtsAfterClearoctanea-octane-huxoctane-syncoctane-syncover upstreamoctane, +4,282,580 B:array:native:system / ExternalStringDatastring:rowarray:(object elements)Using the pre-sync block core as the control splits that in two:
array:+3.15 MB is the block core's, not the sync's.a-octane-huxcarries +3,146,388 B of it too. Present since v0.1.36. ~315 B/row.string:row1 → 10,001 (+479,968 B, exactly one per row),ExternalStringData19,857 → 30,285 (+184,050 B, ~one more per row),array:(object elements)+135,568 B across only +3 arrays — three arrays each grew ~45 kB.So the v0.1.47 sync adds ~92 B/row of per-row strings that survive teardown, on top of a separate ~315 B/row of arrays that predates it. Repeated across three runs the numbers reproduce to four significant figures.
Limit: I aggregated by constructor self size, which names what is retained, not who holds it. Naming the holder needs a dominator/edge walk.
Correction 3 — I withdraw the second-position stall
Seven runs, fresh browser per entry:
octane→octane-sync(shared browser)octane→octane-sync(fresh browser)octane→octane-sync(fresh browser)octane-syncaloneoctane-sync→octanea-octane-hux→octane-syncoctane→a-octane-hux2/3 in one ordering and 0/5 elsewhere looked pair-specific until the third run of that same ordering completed. With a fresh browser per entry over a static file server, no application state carries between entries — the only carryover is host state. I can't call this a framework defect on this evidence, and it is consistent with #230's note that the post-sync build survives the sequence. I'm not spending more runs on it.
Handoff to #230
The retained per-row strings (exactly 1/row) and #230's per-host
handlesacknowledgement (~1,742 B/row) are both per-host and both outlive teardown. That is a hypothesis, not a finding, and #230 Order 2's compact-v1 A/B will settle it for free: if forcing compact-v1 also dropsheapMtsAfterClear, one fix closes both; if it doesn't, the retention needs its own owner. I'll report the answer on #230 either way.Generated by Claude Code
fix(lynx): acknowledge every compact-eligible run compactly, not just…