Skip to content

Batch National chunk transfers and extend history to 60 frames - #25

Merged
tcurtsinger merged 5 commits into
mainfrom
claude/radar-core-optimization
Sep 28, 2026
Merged

tcurtsinger merged 5 commits into
mainfrom
claude/radar-core-optimization

Conversation

@tcurtsinger

Copy link
Copy Markdown
Owner

Summary

First implementation pass on boot-to-complete-loop latency and longer history. Full write-up in docs/31_RADAR_CORE_OPTIMIZATION.md. This branch also adds the August system audit (docs/30_RADAR_SYSTEM_AUDIT.md).

Transfer

  • National history sends up to 16 PackedGrid v1 chunks per MGB1 envelope, so a native 392-chunk frame takes 25 batch calls instead of 392 single-chunk calls.
  • A two-credit pipeline overlaps the next response and parse with ordered GPU uploads. It never admits a third request before a release acknowledgment. Every chunk still checks its hash, generation, observation and manifest.
  • Both source clients reuse process-wide HTTP connection pools.

History capacity

  • National and Site loops hold up to 60 frames (was 20). The GPU target is 3.25 GiB, the hard ceiling 3.5 GiB, and the backend target 4 GiB.
  • National backfill stops after three consecutive failures instead of starving live polling.
  • Site predecessor loading retries a failed step up to three times with 500/1000 ms backoff.

Playback

  • Fixes the missed 20-frame cap in NationalPlaybackController: frame 21 could commit and then be rejected.
  • Selection now resolves after staging, and automatic mutation pauses keep the remaining dwell. Frequent commits no longer rewind playback or starve advancement.

Chrome (owner preference, DESIGN.md 2026-09-10)

  • Notices are screen-reader only; no banner appears above the playback bar.
  • Scan times use local 12-hour time with AM/PM.

Known issues (from the 2026-09-28 audit, not fixed here)

  • Failure states have no visual signal. With the banner gone, offline, retrying and failed states show only through the age colour. Planned follow-up: a small status glyph in the telemetry slot.
  • Status can stick on "loading". After National backfill gives up, pendingBackfillCount stays above 0, so every successful poll resets the status to loading for the rest of the session.
  • Give-up is permanent for the session. A brief network blip during a long backfill leaves history short until National is re-selected.
  • Untracked CPU memory. Resident National chunks keep CPU rawCodes copies (~2.8 GiB at 60 frames), which no memory budget counts.
  • Stale defaults. waitForHistory still times out at 300 s. The single-chunk and manifest client defaults still send presentationFactor = 4, which the backend no longer serves.

Validation

  • tsc clean. 344/344 frontend tests pass in 53 files.
  • Clippy (-D warnings) clean. 135 Rust tests pass.
  • npm run public:check passed.
  • Not yet run: packaged 60-frame validation (cold boot to first paint, fully resident loop, context recovery). Doc 31 lists this as the remaining gate before either latency issue counts as resolved.

🤖 Generated with Claude Code

- National history ships up to 16 PackedGrid chunks per MGB1 envelope
  through a two-credit pipeline that overlaps parse with ordered uploads.
- National and Site history capacity rises from 20 to 60 frames, with GPU
  and backend memory budgets resized to match.
- National backfill stops after three consecutive failures instead of
  starving live polling; Site predecessor loading retries a failed step
  up to three times.
- Playback keeps its selection and remaining dwell across history commits.
- Notices move to screen-reader only; scan times use 12-hour local time.
- Adds docs 30 (system audit) and 31 (core optimization).

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 6ea5c22ed7

ℹ️ 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".

Comment thread src/live/liveHistory.ts
import { isSupportedRadarSite } from "../data/radarSites";

export const MAX_LIVE_HISTORY_FRAMES = 20;
export const MAX_LIVE_HISTORY_FRAMES = 60;

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P2 Badge Update Site acceptance gates for the 60-frame capacity

Raising this shared Site/National limit makes current Site reports expose capacity: 60 and remain partial at 20 frames, but scripts/phase5-packaged-validation.mjs still requires capacity 20, while scripts/alpha-live-soak-validation.mjs and its runner both require a 20-frame capacity and cap the target at 20. Consequently test:phase5:packaged now deterministically reports a capacity failure, and test:alpha:soak cannot validate the new full capacity and fails its capacity/partial-history gates even at its maximum target. Update those active harnesses and their tests/range validation alongside this constant.

Useful? React with 👍 / 👎.

@chatgpt-codex-connector

Copy link
Copy Markdown

Codex Review Summary

This comment shows the latest Codex review activity on this pull request.

Review Status Commit Review trigger
📝 Code Review ✅ Completed 2026-09-28T16:03:17.724392Z 6ea5c22 PR opened
ℹ️ 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" or "@codex security review".

Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings.

tcurtsinger and others added 4 commits September 28, 2026 11:07
With notice banners gone, offline, retrying and failed states had no visual
signal. A 10px mark beside the frame age now shows that a notice exists: a
hollow cyan ring for information, a solid danger dot for a problem. Hover or
keyboard focus reveals the text above the playback bar; no banner returns.

National history reported "loading" whenever the backend still listed
predecessors, even after backfill had given up, so every successful poll
reset the status for the rest of the session. Loading now also requires an
active backfill run.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
- maplibre-gl 6.1.0 -> 6.11.2 (GHSA-jrc7-96c5-q579, critical, <=6.4.0).
  The attribution control passes provider TileJSON text into innerHTML,
  so the path was reachable; the CSP already blocked script execution.
  @maplibre/maplibre-gl-style-spec 26.2.1 -> 26.4.4 to match its types.
- vitest 4.1.10 -> 4.1.11 (GHSA-82fw-gwwq-j7x9) and a lockfile refresh
  for nanoid (GHSA-2v37-7h3g-55p8); both dev-only.
- rustls 0.23.43 -> 0.23.45 (RUSTSEC-2026-0285) with aws-lc-rs/-sys and
  rustls-webpki patch updates.
- CSP adds object-src, base-uri, form-action and frame-ancestors 'none'.

Left as-is: time 0.3.45 (fix needs Rust 1.88 above the declared 1.85
rust-version) and quick-xml 0.38.4 (fix is 0.41); neither vulnerable
path is used.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
tauri:dev ran the backend unoptimized: decoding and encoding one native
National frame took ~5.0 s, so a 60-frame loop needed ~5 minutes. With
opt-level 1 for the crate and 3 for dependencies it takes ~0.35 s
(release: ~0.18 s). Rust unit tests drop from ~12 s to ~2 s. Debug info
is kept; the first dev build after this recompiles dependencies once.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
The phase 5 and Alpha soak validators still required a capacity of 20, so
test:phase5:packaged failed deterministically and test:alpha:soak could not
target full capacity. Both now read one shared LIVE_HISTORY_CAPACITY, pinned
to MAX_LIVE_HISTORY_FRAMES by a test, and the soak defaults to (and allows
up to) the full 60 frames.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@tcurtsinger
tcurtsinger merged commit 03da393 into main Sep 28, 2026
1 check passed
@tcurtsinger
tcurtsinger deleted the claude/radar-core-optimization branch September 29, 2026 23:43
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant