Repository navigation
Description
Found by an adversarial audit of the #58 L0–L3 equivalence claims.
This is a pre-existing defect, not a regression from the #59→#63→#64→#65 stack. It reproduces identically on base 6079a6804 (verified in a worktree). It is filed because the audit surfaced it and it is the most severe finding of that audit, not because it counts against any stack claim.
Root cause
packages/lynx/src/main-renderer.ts:1358:
for (let index = 0; index < ACTIVE_FIRST_SCREEN_WARM_PLANS.length; index++) {
warmFirstScreenPlan(ACTIVE_FIRST_SCREEN_WARM_PLANS[index]);
}The loop bound is re-evaluated on every iteration, and warmFirstScreenPlan can append to the very array being iterated — useBatch's early-return path at packages/lynx/src/main-renderer.ts:1345-1348 does exactly that:
if (items.length === 0) {
if (warm !== undefined) ACTIVE_FIRST_SCREEN_WARM_PLANS.push(warm);
return;
}So a cycle in the warm graph grows the queue faster than the loop drains it. FIRST_SCREEN_WARM_DEPTH_CAP (64) does not apply on this path: it bounds nesting depth, not queue length.
Reproduction
Two mutually recursive components whose warm plans are useBatch([], () => warmChild(Other, {})) — the compiler-generated warm shape, matching the repo's own fixtures at packages/lynx/tests/main-renderer.test.ts:280 and :320.
W1 (direct-recursion control): maxNestedDepth 63 ← cap works here
W2 (useBatch-mediated cycle): expected 200001 to be less than or equal to 64
200,001 warm-plan invocations in 97 ms, terminated only by the probe's own guard — nothing inside the renderer stops it. Raising the guard to 20,000 yields 20,001; to 200,000 yields 200,001. It does not converge.
W1 is the control that establishes the cap is real and intended, which is what makes W2 a defect rather than a design choice.
Consumer impact
An unbounded synchronous stall on the Lynx main thread during the first screen — the exact code path issue #58 L3 exists to make fast. Reaching it requires a cycle in the warm graph (mutually recursive components, or a self-warming recursive component). Authors can create that without touching the renderer, because the warm-plan shape is compiler-generated rather than hand-written.
Suggested direction
Snapshot the queue length before draining, or track visited plans across the drain, so a cyclic warm graph terminates the way direct recursion already does under FIRST_SCREEN_WARM_DEPTH_CAP.
Verification performed
Reproduced independently of the finding agent. Base-vs-head comparison performed by the finding agent in a 6079a6804 worktree and reported as identical. No red test is committed for this on the audit branch: that branch is scoped to counterexamples against the stack's own equivalence claims, and this is neither caused by nor claimed against them.
Activity
Huxpro commentedon Aug 18, 2026
Withdrawing this — the compiler cannot emit the shape the unbounded loop requires
This report is wrong and I am closing it. A refuter established the reachability question I never asked, and every point holds.
The precondition is unreachable
The drain loop at
main-renderer.ts:1358re-reads.length, so it is unbounded only if a__warmplan's body callsuseBatch([], warm)— that early-return path is the sole push site intoACTIVE_FIRST_SCREEN_WARM_PLANS.I justified that precondition by citing
packages/lynx/tests/main-renderer.test.ts:280and:320as "byte-for-byte the compiler warm shape." That was a misreading. Those lines are component bodies:The repo's only actual
__warmexample is line 314:I moved a body-level construct into a warm plan and called it the same shape.
The real compiler shape, established by execution
buildWarmArtifacts(packages/octane/src/compiler/compile.js:15185-15201) emits the plan as(__wp) => { const props = __wp; <warmMemo(...)>; <warmChild(...)> }— onlywarmMemoandwarmChildcalls, each optionallyif-guarded. Compiling two mutually recursive async components, and the repo's ownpackages/octane/tests/_fixtures/parallel-use.tsrx(32 emitted plans), yields zerouseBatchinside any__warmbody. The empty-items registration_$useBatch([], () => _$warmChild(B, ...))is emitted in the component body, structurally disjoint from the drain.So the push site and the drain site cannot meet: pushes come only from component bodies during render; the drain executes only
__warmplans, which contain no pushes.The one non-compiler
__warmin the renderer is lazy's (main-renderer.ts:580), whoseinitializestarts the chunk load and never callsuseBatch; theuseBatch([thenable!])at:569is in the wrapper's render body with a non-empty array, which takes the drain branch, not the push branch.With the real shape, every cycle is bounded
Running the identical warm-graph cycles I claimed were unbounded, using the compiler's actual output: A↔B mutual recursion 63, warmMemo+warmChild cycle 63, self-recursion 63 — exactly the
FIRST_SCREEN_WARM_DEPTH_CAPbehaviour I described as "the intended bound" and wrongly claimed does not apply. Each commits the correct pending arm in ~1 ms.Two further points against the report: the compiler already carries a deliberate guard for the pure-self-recursion case (
compile.js:15100-15111), and the main client runtime'srunActiveWarmPlans(runtime.ts:9207-9238) snapshots into a local array before draining, so it is structurally immune regardless.What went wrong on my side
I reproduced the 200,001 iterations myself and treated that as confirmation. It confirmed the mechanism, not the reachability — the probe fed a hand-written
__warmplan, and I never asked whether the compiler emits that shape. That is the same error the panel caught in #71, #76, #77 and #73: a real mechanism, an unreachable trigger, and a severity claim built on the gap between them.I called this the most severe finding of the audit. It is not a finding at all.
Closing as not-planned. No change is warranted.
Generated by Claude Code