Skip to content

ui-react: parallel-sessions runtime announces B's failure twice under load on 390 phone #3414

Closed

Description

@schlessera

Context

Under local CPU load, packages/ui-react/tests/parallel-sessions-runtime.test.ts failed once in 30 sequential runs of the case "mounted parallel sessions > 390 phone, light, coarse pointer, reduced motion: A and B stream side by side; trackers follow success, failure and a queued follow-up, and clear only once seen". The run used real Chromium 1243 and --rerun-each 30, with eight busy-loop processes on a 16-core host and a sampled one-minute load median of 19.6 (10.8–22.6). The tree was #3409's head (6f99fd349), with the observer fix from #3406 reverted.

The failure is at the final announcement check (parallel-sessions-runtime.test.ts:742 on that tree):

error: every change spoken once, and nothing else
    "Row through Scylla's strait failed.",
+   "Row through Scylla's strait failed.",
    "Sail past the Sirens is done.",

B's failure was announced twice. The earlier check right after B fails ("B's failure is spoken once", 300 ms after the first announcement) passed in that run, so the second announcement came later. D52 §3 says each change is announced once and never by a replay.

This is separate from #3406 (selecting A cleared nothing) and from #3377 (Scroll to latest).

Scope

  • Find out what re-announces B's failure: a replay or reconnect re-deriving the change, a live-region re-render that the fixture's MutationObserver counts as an addition, or the announcer itself. Name it with a trace or a failing-first reproduction under load or with an injected delay.
  • Fix the real cause.

Out of scope

Acceptance criteria

  • The cause is shown with evidence: a trace, or a failing-first reproduction under load or with an injected delay.
  • The fix keeps every assertion and deadline. The case fails with the fix reverted under the same condition, and passes with it in place.
  • 30 sequential passes of the 390-phone case under load, recorded in the PR.

Verification

bun run test packages/ui-react/tests/parallel-sessions-runtime.test.ts -t '390 phone.*A and B stream' --rerun-each 30 under CPU load, plus the hosted unit shard that carries the file.

Contract impact

None.

Found while working #3406.

Readiness review: cause (2026-11-03)

This is a product defect in the tracker announcer, createTrackerAnnouncer (packages/ui-react/src/lib/tracker-announcer.ts:33-62 at the parent head b06d617bf; 42-72 after the fix). It is not a live-region re-render or a replay.

  • The case installs Playwright's fake clock, which also fakes AbortSignal.timeout. The tracker client gives each recovery read AbortSignal.timeout(10_000) (refresh, packages/ui-react/src/lib/tracker-client.ts:139-194). Under load, B's read after its failure can still be in flight when the case runs clock.fastForward("02:05") (the "a ticking age announces nothing" step). That read is aborted and settles as host_unreachable. On a real host, a read that times out or fails briefly does the same.
  • deriveTrackerView makes an unavailable read mask the failure, so B's view goes failed → can't check. The next read answers again and the view returns to failed for the same turn.
  • The announcer measures each change from the last settled view, here can't check, so it announced failed a second time. D52 §3 says each change is announced once.

Evidence (real Chromium 1243): a trace in the fixture of every tracker-view change, announcement and live-region addition. On the parent tree, with B's recovery reads held 1.5 s after B fails (temporary injection, not committed), it shows failed (announcement 1), then cant_check with host_unreachable right after the fast-forward, then failed again (announcement 2). The case fails 3 of 3 at "every change spoken once, and nothing else", with the same diff as above.

Approach: can't check and unknown say only that the work could not be read. They never become the state a change is measured from, so the same state of the same turn read again after them is not announced. Work that moved on during the gap (a new turn, a different state) is still announced. A tracker whose first settled view is can't check still announces what it then learns.

2026-11-03: added this readiness section with the cause and evidence. It replaces "Needs scoping: the cause is not known yet." The type changed from type: test to type: fix, since the fix is in product code. Scope, out-of-scope and acceptance criteria are unchanged.

Activity

  1. added
    type: test
    area: ui-react
    priority: p2
    on Nov 3, 2026
  2. self-assigned this
    on Nov 3, 2026
  3. schlessera commented on Nov 3, 2026

    @schlessera
    OwnerAuthor

    Claimed (token w3414-a7c2). Intended branch fix/3414-parallel-sessions-failure-once, stacked on #3416 (fix/3406-parallel-sessions-select-cleared). Collision note: #3409 and #3416 change the same runtime case.

  4. added
    type: fix
    agent-ready
    and removed
    type: test
    on Nov 3, 2026
  5. added this to the 0.45.0 milestone on Nov 3, 2026
  6. schlessera commented on Nov 3, 2026

    @schlessera
    OwnerAuthor

    Ready and implemented in #3437 (stacked on #3416, head ce943f3df). Cause: an unavailable recovery read (can't check) became the announcer's baseline, so the next read's same failure was announced again. The fake clock's AbortSignal.timeout aborts B's slow read at the 2:05 fast-forward. Failing first 0/3 with an injected slow read, fixed 3/3, 30/30 under load, plus a unit mutation receipt; details are in the PR. Unrelated whole-file failures under heavy host load are filed as #3436.

  7. removed their assignment
    on Nov 3, 2026
  8. self-assigned this
    on Nov 15, 2026
  9. schlessera commented on Nov 15, 2026

    @schlessera
    OwnerAuthor

    Claimed for implementation. Claim token: claim-07f12d86. Branch: test/3414-parallel-sessions-failure-once.

    Collisions: path on tracker-announcer files only against #3437 (earlier abandoned PR for this issue, superseded). The announcer guard landed on main in #3980.

  10. schlessera commented on Nov 15, 2026

    @schlessera
    OwnerAuthor

    The announcer fix for this issue is already on main through #3980 (0f6296a79), with the same guard as #3437. #3437 is closed as superseded.

    #4058 supplies this issue's acceptance on current main. It makes the condition a permanent step of the 390-phone case: B's recovery reads are held until the fake-clock fast-forward cuts them short and B reads can't check, then answered. Receipts are in the PR:

    • Issue condition (temporary 1.5 s hold) with fix(ui-react): keep tracker recovery from repeating announcements #3980's guard removed: 0/3, the duplicate "Row through Scylla's strait failed." at "every change spoken once, and nothing else". With the guard: 3/3.
    • The committed step with the guard removed: 0/2 at "a ticking age announces nothing". Restored: 2/2.
    • 30/30 under load (10 busy loops, median one-minute load 24.2).
  11. schlessera commented on Nov 16, 2026

    @schlessera
    OwnerAuthor

    Merged in #4058 as e521dcf64 through the integration lease (orchestrator merge queue for 0.45.0). Candidate confirmation passed on the exact head; the squash's own main run carries the post-merge heavy categories.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

agent-readyarea: ui-reactpriority: p2type: fix

Projects

No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions