Repository navigation
Keep National resident behind a displayed Site (seamless handoff, Phase A) - #26
Conversation
The transfer broker and client held one global generation and one pool of two credits, so any Site acquisition invalidated in-flight National work and the reverse. Each lane now owns its generation, cancellation token, and two credits; generations stay unique across lanes so a release still finds its owner from (session, generation). Commands pick their lane server-side. Behavior is unchanged for now: starting one source still cancels the other lane explicitly (beginExclusiveLane), matching the former single generation. This is the groundwork for keeping National resident while a Site is shown. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
setVisibility("resident") keeps every frame on the GPU and lets staging,
history commits, and context recovery complete on GPU fences, but draws
nothing. Such receipts carry presented: false and land in residentReceipt;
paintReceipt stays reserved for frames that were actually drawn. A draw
that completes after hide is downgraded, frame selection is refused while
hidden, and revealAndWait() resolves only after a real visible draw.
Adds a fake-WebGL state-machine test covering hidden commits, reveal,
downgrade, a hidden fence finishing after reveal, and recovery while hidden.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
National no longer tears down when a Site paints. Its layer turns resident (frames stay on the GPU, commits complete on fences, nothing is drawn or claimed), its backfill and polling keep running on the National lane, and switching back is one fenced paint under the original generation. - Coordinator: transitions can reveal a resident source under its existing generation; NationalMrmsSession chooses acquire or reveal. - App: Site requests no longer cancel National; ownership checks follow the National lane; hidden work cannot overwrite the Site timeline, status, error notice, or inspection; a failed Site leaves National as it was and resumes its playback; Smooth/Native applies to both layers. - Site layer gains a 320 MiB GPU ceiling (combined bound 3,904 MiB). - Packaged diagnostics: proveFailedSiteKeepsNational replaces the restart proof, and proveResidentHandoff requires a zero-acquisition reveal within 250 ms. - docs/32 records the decisions and marks the superseded credit rules. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
The previous commit described both fixes but did not include them: selectDisplayMode now sets the mode on the Site and National layers, so a resident layer can never reverse-sync an older mode into the UI; and a National reveal removes the Site before restoring the history status, because the Site teardown resets that shared status. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
A background National commit briefly pauses playback for its atomic residency swap and then resumes on its own. The controller now reports that hold as resumingAfterReplacement, the chrome keeps showing Pause for it, and toggling during the hold still pauses. The packaged chrome gate samples the visible Play/Pause control instead of the raw controller flag. The packaged scrub checks also targeted index 19, a leftover of the 20-frame history; they now scrub the last of the 60 frames. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Codex Review SummaryThis comment shows the latest Codex review activity on this pull request.
ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings. |
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: c5bbbf9173
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
| resumeNationalPlaybackAfterSiteFailure = playbackToSettle | ||
| ? await playbackToSettle.pauseAndWait(false) | ||
| : false; |
There was a problem hiding this comment.
Preserve playback intent across superseded Site requests
When National is playing and a user starts a second Site selection before the first finishes, the first invocation records true and pauses playback, but the second invocation sees the already-paused controller and overwrites this shared flag with false. If the second Site request then fails, restoreNationalAfterSiteFailure reads false and leaves National paused rather than restoring its pre-transition playback state. Preserve the original resume intent across superseding Site requests, for example by accumulating it until a Site handoff succeeds or the final request fails.
Useful? React with 👍 / 👎.
There was a problem hiding this comment.
Fixed in d4e5eca: the resume intent now accumulates (||=) across superseding Site requests, is consumed by the final failure, cleared when a Site paints, and cleared when a fresh National session replaces the controller.
A second Site pick found National already paused and overwrote the first request's "was playing" flag with false, so a failed second request left National paused. Accumulate the intent until a Site paints or the last request fails, and drop it when a fresh National session replaces the controller it belonged to. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Summary
Phase A of the seamless National ↔ Site handoff (decisions in
docs/32_SEAMLESS_RADAR_HANDOFF.md). Switching to a Site no longer destroys National. It stays resident: frames stay on the GPU, backfill and polling keep running, and nothing is drawn or claimed. Switching back is one fenced paint under the original generation. Before this, returning meant a new generation, a backend reset, and a full 60-frame rebuild.Transfer lanes (Rust + TS). The broker and client held one global generation and one two-credit pool, so every Site acquisition invalidated National's in-flight work. Each source now owns a lane with its own generation, cancellation token, and two credits. Generations stay unique across lanes, so releases still find their owner from
(session, generation). Commands pick their lane server-side.Resident renderer mode.
NationalGridLayer.setVisibility("resident")lets staging, history commits, and context recovery complete on GPU fences without drawing. Those receipts carrypresented: falseand live inresidentReceipt;paintReceiptstays reserved for frames actually drawn, so the truth contract is unchanged.revealAndWait()lets an in-progress hidden commit finish, then resolves only after a real draw.App and coordinator.
Also fixed.
resumingAfterReplacement, and the chrome keeps showing Pause.Validation
npm run verifyis green: 363 frontend tests, 133 Rust tests, build, fmt, clippy.npm run test:national:phase4:packaged: PASS, 0 failures. This is the first packaged run at 60 frames, so it also covers Batch National chunk transfers and extend history to 60 frames #25.Changed from the approved plan
App.tsx(about 290 changed lines) instead of first moving into aNationalRadarEnginemodule. Doing both at once would mix a large code move with behavior changes. The extraction is a separate follow-up.Not in Phase A
🤖 Generated with Claude Code