Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions docs/08_DECISIONS_AND_OPEN_QUESTIONS.md
Original file line number Diff line number Diff line change
Expand Up @@ -335,3 +335,4 @@ Additional accepted prototype ADRs:
- [x] Real-time publication boundary and fallback: [`17_REALTIME_FRESHNESS_AND_FALLBACK_DECISION.md`](17_REALTIME_FRESHNESS_AND_FALLBACK_DECISION.md).
- [x] Level III N0S and visible-first context recovery: [`18_LEVEL3_N0S_AND_CONTEXT_RECOVERY_DECISION.md`](18_LEVEL3_N0S_AND_CONTEXT_RECOVERY_DECISION.md).
- [x] National numeric-grid renderer, coverage receipts, and exact interrogation: [`28_NATIONAL_STATIC_RENDERER_DECISION.md`](28_NATIONAL_STATIC_RENDERER_DECISION.md).
- [x] National native-resolution residency — quality is never traded for memory on the supported desktop floor (owner, 2026-08-04): [`29_NATIONAL_RADAR_PERFORMANCE_FINDINGS.md`](29_NATIONAL_RADAR_PERFORMANCE_FINDINGS.md) §0.2.
2 changes: 1 addition & 1 deletion docs/11_ENGINEERING_CONTRACT.md
Original file line number Diff line number Diff line change
Expand Up @@ -73,7 +73,7 @@ Mistr's normal UI follows `PRODUCT.md` and `DESIGN.md`; diagnostics remain hidde

Merged Phase 3 owns the explicit `National`/`Site` source panel because it delivers the complete National session, numeric renderer, exact interrogation, and paint-truth path. Selecting Site reveals the existing searchable station list; supporting/accessibility copy identifies National as CONUS. Keyboard, focus-return, compact-layout, painted-truth, and one-panel behavior remain mandatory.

Merged Phase 4 exposes up to 20 exact National timeline observations. It enables playback only after two complete common-level observations are resident, uses direct scrubbing without separate previous/next controls, and names partial backfill truthfully. Playback is motion-first (owner decision, 2026-08-04): motion begins immediately at the always-resident complete common level and is never held or stopped for sharpness or a camera change. A bounded all-frame factor-1/factor-2 preparation runs beside the loop as prefetch-only residency work, upgrades the quality lock between frames when complete, and is superseded silently by a newer camera. Frame selection itself remains resident-only: no acquisition, grid decode, bulk IPC, or upload ever gates a frame advance. Backfill and strictly-newer polling continue during playback; each history commit briefly pauses and resumes the loop through the existing replacement contract, and sharp preparation defers until retained history settles. Hidden `window.__MISTR_NATIONAL_PHASE2__`, `window.__MISTR_NATIONAL_PHASE3__`, and `window.__MISTR_NATIONAL_PHASE4__` evidence APIs do not become normal controls.
Merged Phase 4 exposes up to 20 exact National timeline observations. It enables playback only after two complete observations are resident, uses direct scrubbing without separate previous/next controls, and names partial backfill truthfully. Under the native-residency owner decision (2026-08-04), every retained observation is GPU-resident at the exact full-resolution grid — there is exactly one version of the data, no coarser presentation ever paints, and no level-of-detail preparation, refinement, or camera-driven quality change exists in the product path. Playback is motion-first: motion begins immediately, is never held or stopped for a camera change, and every frame selection is resident-only — no acquisition, grid decode, bulk IPC, or upload ever gates a frame advance. Backfill and strictly-newer polling continue during playback; each history commit briefly pauses and resumes the loop through the existing replacement contract. National requires roughly 1.2 GiB of free GPU memory (1,280 MiB target, 1,536 MiB hard ceiling); a lower-capability fallback is deliberately not maintained. Hidden `window.__MISTR_NATIONAL_PHASE2__`, `window.__MISTR_NATIONAL_PHASE3__`, and `window.__MISTR_NATIONAL_PHASE4__` evidence APIs do not become normal controls.

Required surfaces:

Expand Down
8 changes: 5 additions & 3 deletions docs/20_ALPHA_CURRENT_STATE.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,9 +4,9 @@

**Merged baseline:** [PR #18 - National Phase 4 bounded rolling history and playback](https://github.com/tcurtsinger/Mistr/pull/18), merge commit `4a4da19`

**Active change:** Focused National playback correction: prepare the finest complete all-frame regional viewport level before playback, preserve uniform quality through camera moves, keep the prior paint visible during bounded preparation, and leave already-usable transport enabled during background history staging
**Active change:** National native-resolution residency (owner decision, 2026-08-04): every retained observation stays GPU-resident at the exact full-resolution grid, the level-of-detail/refinement machinery is removed from the product path, point lookups read the retained native frame, and playback controls stay live through history commits

**Branch:** `codex/mistr-national-visual-fidelity`
**Branch:** `claude/national-native-residency` ([PR #22](https://github.com/tcurtsinger/Mistr/pull/22))

This document is the durable starting point for the next Mistr development session. Verify the active branch, worktree, and any future pull-request checks or threads before acting because repository state can change after this checkpoint.

Expand Down Expand Up @@ -244,7 +244,9 @@ Release readiness also corrects a demonstrated installer defect: prior bundles d

Owner-reported National symptoms — slow startup, full restaging on every pan/zoom, and repeated pixelate/sharpen cycles — were diagnosed in [National radar performance findings](29_NATIONAL_RADAR_PERFORMANCE_FINDINGS.md) and remediated on `claude/national-performance-fixes` (merged, PR #20): the selected observation now refines to a camera-independent complete-domain factor-1 presentation at any zoom, history commits preserve that detail instead of resetting to the overview, and GPU uploads share a measured 4 ms frame budget instead of one fixed 32-row band per vsync.

The owner's packaged retest showed the playing path still failed: camera changes stopped the loop for a full viewport re-preparation, supersession surfaced as a `could not change scans` notice, playback starved backfill, and home-view playback deleted the refined presentation. Round 2 (findings §0.1, `claude/national-playback-continuity`) makes playback motion-first as an owner decision dated 2026-08-04: motion starts immediately on the resident commons and never stops for sharpness or a camera change, quality preparation is prefetch-only beside the loop, supersession never reaches the operator, and backfill/polling continue during playback. Packaged before/after evidence remains to be captured on the validation machine.
The owner's packaged retest showed the playing path still failed: camera changes stopped the loop for a full viewport re-preparation, supersession surfaced as a `could not change scans` notice, playback starved backfill, and home-view playback deleted the refined presentation. Round 2 (findings §0.1, `claude/national-playback-continuity`, merged PR #21) made playback motion-first: motion starts immediately, never stops for sharpness or a camera change, supersession never reaches the operator, and backfill/polling continue during playback.

Round 3 (findings §0.2, `claude/national-native-residency`) removes the two-level model entirely as an owner decision dated 2026-08-04: every retained observation is GPU-resident at the exact native grid (~1 GiB for the 20-frame loop; 1,280 MiB target / 1,536 MiB ceiling; backend target 2 GiB), the quality-preparation/refinement machinery is deleted from the product path, and blur is impossible by construction. National's supported-device floor is roughly 1.2 GiB of free GPU memory. Packaged phase-3 and phase-4 evidence PASSED on the validation machine on 2026-08-04 (findings §0.2).

## Pull-request checkpoint

Expand Down
15 changes: 15 additions & 0 deletions docs/29_NATIONAL_RADAR_PERFORMANCE_FINDINGS.md
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,21 @@ The owner retested the packaged build after PR #20 merged: pan/zoom **while play

Deferred with reason: pipelining backfill downloads against GPU commits requires a staged-frame queue in Rust (`national_history.rs` holds a single `staged` slot); backfill remains serial per frame. The engineering-contract playback sentence was updated for the motion-first model as an owner decision dated 2026-08-04.

## 0.2 Round 3 — native-resolution residency (owner decision, 2026-08-04)

The owner's second packaged retest still showed blur-then-sharpen around playback and camera changes. Round 2 had made motion continuous, but the two-level model remained: sharp frames were built per viewport on demand, and every build window was visible as blur. The owner's machine is an RTX 4090 (24 GiB VRAM) with 64 GiB of system memory, and the owner directed that quality is never traded for memory on this product.

**Decision:** every retained National observation is GPU-resident at the exact native grid, permanently. There is exactly one version of the data.

- Rust `OVERVIEW_FACTOR` is 1: the retained presentation for every observation is the full 7,000 x 3,500 grid (~49 MiB encoded). `HISTORY_BACKEND_TARGET_BYTES` rises to 2 GiB for the ~1 GiB of retained native encodings.
- The GPU budget rises to a 1,280 MiB target / 1,536 MiB hard ceiling: 21 native frames (20 retained + 1 staged) ≈ 1,029 MB plus halos and fixed resources. The receipt, generation, credit, and ledger contracts are unchanged.
- The renderer routes staging to residency slots explicitly instead of inferring the slot from the manifest factor.
- Deleted from the product path: playback quality preparation, the sharp-zoom gate, selected-frame refinement, camera-key memos, and the moveend playback handler. Blur is impossible by construction — pan, zoom, play, scrub, and source-follow all paint the same native-resolution presentation.
- Supported-device floor: National now requires roughly 1.2 GiB of free GPU memory. A lower-capability fallback (the retired level-of-detail model) is deliberately not maintained; reintroducing one is a future product decision.
- Startup cost: each observation now transfers ~49 MiB (392 chunks) instead of ~3 MiB, so backfill to 20 frames takes longer; the newest observation still paints first and playback is usable throughout. Backfill download pipelining (the single Rust staged slot) remains the open follow-up.

**Packaged evidence (validation machine, 2026-08-04):** phase-3 and phase-4 packaged runs PASS against live NOAA. Twenty native observations resident (~38-minute span), 1,000 playback transitions at presentation factor 1 with zero hot-path network/decode/IPC/upload/point-lookup activity, peak GPU 1,044,645,112 bytes (~996 MiB, inside the 1,280 MiB target), retained backend ~1.01 GB (inside the 2 GiB target), maximum upload slice 33.1 ms (inside the 50 ms long-task ceiling), real context recovery, and a clean National-to-Site handoff. Interactive point lookups now read the retained native frame in constant time, and playback controls stay live through history commit windows with operator intent owning the final playback state.

## 1. Reported symptoms

1. **Initial National load takes far too long** before the timeline feels usable.
Expand Down
2 changes: 1 addition & 1 deletion docs/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ The merged National path is:
fixed NOAA MRMS host -> strict chronological history -> exact u16/value-aware levels -> PackedGrid v1 -> shared two-credit IPC -> all-frame common GPU residency -> quality-locked playback/scrub -> coverage-aware GPU receipt
```

It paints the newest observation first, backfills up to 19 strictly older observations, then polls for strictly newer inventory — including while playback runs. Every retained frame keeps a complete factor-4 GPU presentation, and the selected observation refines to a complete-domain factor-1 presentation that is camera-independent: pan and zoom never restage, refetch, or degrade the paused view at any zoom, and history commits preserve the selected frame's detail. Playback is motion-first: the loop starts immediately on the resident commons and is never stopped by a camera change or by sharpness — regional factor-1/factor-2 preparation runs beside it as prefetch-only work and upgrades the quality lock between frames. GPU uploads share a measured 4 ms per-frame budget rather than one fixed row band per vsync.
It paints the newest observation first, backfills up to 19 strictly older observations, then polls for strictly newer inventory — including while playback runs. Under the native-residency owner decision (2026-08-04), every retained observation is GPU-resident at the exact full-resolution 7,000 x 3,500 grid: there is one version of the data, no coarser presentation ever paints, and pan, zoom, play, scrub, and follow-newest are all the same native-resolution pixels with zero restaging. Playback is motion-first and never stops for a camera change. GPU uploads share a measured 4 ms per-frame budget; the complete loop costs about 1 GiB of GPU memory, sized for the supported desktop floor rather than a minimal device.

## Alpha direction

Expand Down
47 changes: 27 additions & 20 deletions scripts/national-phase3-packaged-validation.mjs
Original file line number Diff line number Diff line change
@@ -1,5 +1,13 @@
const TARGET_BYTES = 200 * 1024 * 1024;
const HARD_CEILING_BYTES = 256 * 1024 * 1024;
// Native-residency contract (owner decision, 2026-08-04): every retained
// observation is one complete-domain full-resolution presentation — 392
// chunks at factor 1. There is no coarser level, no viewport refinement, and
// no fallback presentation in the product path.
const TARGET_BYTES = 1280 * 1024 * 1024;
const HARD_CEILING_BYTES = 1536 * 1024 * 1024;
const NATIVE_CHUNKS = 392;
// Individual upload slices adapt to measured throughput; a cold first slice
// may overshoot the 4 ms pacing budget, but no slice may become a long task.
const UPLOAD_SLICE_LONG_TASK_CEILING_MS = 50;

export function validateNationalPhase3Acceptance(report) {
const failures = [];
Expand All @@ -10,32 +18,32 @@ export function validateNationalPhase3Acceptance(report) {
const overviewRenderer = overview?.renderer;
if (!/^CONUS\/MergedBaseReflectivityQC_00\.50\/\d{8}\/MRMS_MergedBaseReflectivityQC_00\.50_\d{8}-\d{6}\.grib2\.gz$/.test(preparation?.objectKey ?? "")) failures.push("exact NOAA object identity");
if (!/^[0-9a-f]{64}$/.test(preparation?.compressedSha256 ?? "")) failures.push("compressed content hash");
if (JSON.stringify(preparation?.presentationFactors) !== JSON.stringify([1, 2, 4])) failures.push("static presentation levels");
if (!(preparation?.compressedBytes > 0 && preparation?.retainedBackendBytes >= 49_000_000)) failures.push("bounded retained exact grid");
if (overviewWorkingSet?.manifest?.presentationFactor !== 4 || overviewWorkingSet?.manifest?.chunks?.length !== 28) failures.push("complete overview manifest");
if (overviewWorkingSet?.coverage?.kind !== "complete_domain" || overviewWorkingSet?.chunkCount !== 28) failures.push("complete overview coverage");
if (overviewReceipt?.presentationFactor !== 4 || overviewReceipt?.coverageKind !== "complete_domain" || overviewReceipt?.requiredChunkCount !== 28) failures.push("overview paint receipt");
if (overviewRenderer?.status !== "painted" || overviewRenderer?.coverageComplete !== true || overviewRenderer?.residentChunkCount !== 28) failures.push("overview renderer completion");
if (overviewReceipt?.generation !== preparation?.generation || overviewReceipt?.observationTimeUnixMs !== preparation?.observationTimeUnixMs || overviewReceipt?.contentSha256 !== preparation?.compressedSha256) failures.push("overview identity chain");
if (overviewWorkingSet?.manifest?.presentationFactor !== 1 || overviewWorkingSet?.manifest?.chunks?.length !== NATIVE_CHUNKS) failures.push("complete native manifest");
if (overviewWorkingSet?.coverage?.kind !== "complete_domain" || overviewWorkingSet?.chunkCount !== NATIVE_CHUNKS) failures.push("complete native coverage");
if (overviewReceipt?.presentationFactor !== 1 || overviewReceipt?.coverageKind !== "complete_domain" || overviewReceipt?.requiredChunkCount !== NATIVE_CHUNKS) failures.push("native paint receipt");
if (overviewRenderer?.status !== "painted" || overviewRenderer?.coverageComplete !== true || overviewRenderer?.residentChunkCount !== NATIVE_CHUNKS) failures.push("native renderer completion");
if (overviewReceipt?.generation !== preparation?.generation || overviewReceipt?.observationTimeUnixMs !== preparation?.observationTimeUnixMs || overviewReceipt?.contentSha256 !== preparation?.compressedSha256) failures.push("native identity chain");
if (!(overviewRenderer?.gpuResourceBytes > 0 && overviewRenderer.gpuResourceBytes < TARGET_BYTES && overviewRenderer.peakGpuResourceBytes < HARD_CEILING_BYTES)) failures.push("GPU memory ceiling");
if (!(overviewRenderer?.maximumUploadSliceMs >= 0 && overviewRenderer.maximumUploadSliceMs <= 4)) failures.push("four millisecond upload budget");
if (!(overviewRenderer?.maximumUploadSliceMs >= 0 && overviewRenderer.maximumUploadSliceMs <= UPLOAD_SLICE_LONG_TASK_CEILING_MS)) failures.push("upload slice long-task ceiling");

const peak = report.peak;
if (peak?.status !== "valid" || !Number.isFinite(peak?.valueDbz) || !Number.isInteger(peak?.rawCode)) failures.push("exact peak point lookup");
if (peak?.generation !== overviewReceipt?.generation || peak?.observationTimeUnixMs !== overviewReceipt?.observationTimeUnixMs || peak?.contentSha256 !== overviewReceipt?.contentSha256) failures.push("point lookup painted identity");

// refineForCamera is report-only under native residency: the presentation
// after a camera move is the same complete-domain native frame, untouched.
const detail = report.detail;
const detailReceipt = detail?.workingSet?.receipt;
if (detail?.workingSet?.manifest?.presentationFactor !== 1 || detail?.workingSet?.coverage?.kind !== "viewport") failures.push("exact viewport presentation");
if (!(detail?.workingSet?.chunkCount > 0 && detail.workingSet.chunkCount < 392)) failures.push("bounded viewport chunk set");
if (detailReceipt?.presentationFactor !== 1 || detailReceipt?.coverageKind !== "viewport" || detailReceipt?.requiredChunkCount !== detail?.workingSet?.chunkCount) failures.push("viewport paint receipt");
if (detail?.workingSet?.manifest?.presentationFactor !== 1 || detail?.workingSet?.coverage?.kind !== "complete_domain") failures.push("camera-independent native presentation");
if (detail?.workingSet?.chunkCount !== NATIVE_CHUNKS) failures.push("complete native chunk set");
if (detailReceipt?.presentationFactor !== 1 || detailReceipt?.coverageKind !== "complete_domain" || detailReceipt?.requiredChunkCount !== NATIVE_CHUNKS) failures.push("camera-move paint receipt stability");
if (detailReceipt?.observationId !== overviewReceipt?.observationId || detailReceipt?.generation !== overviewReceipt?.generation) failures.push("refinement identity stability");
if (
detail?.renderer?.residentChunkCount !== detail?.workingSet?.chunkCount + 28
|| detail?.renderer?.fallbackPresentationFactor !== 4
|| detail?.renderer?.fallbackChunkCount !== 28
detail?.renderer?.residentChunkCount !== NATIVE_CHUNKS
|| detail?.renderer?.fallbackChunkCount !== 0
|| detail?.renderer?.coverageComplete !== true
) failures.push("resident complete overview fallback");
) failures.push("single native presentation without fallback");

const modes = report.modeEvidence;
if (modes?.native?.displayMode !== "native" || modes?.smooth?.displayMode !== "smooth") failures.push("Smooth and Native controls");
Expand All @@ -46,10 +54,9 @@ export function validateNationalPhase3Acceptance(report) {
if (reset?.receipt?.contextEpoch !== (reset?.before?.contextEpoch ?? 0) + 1 || reset?.after?.status !== "painted") failures.push("real context recovery epoch");
if (reset?.receipt?.observationId !== detailReceipt?.observationId || reset?.receipt?.presentationFactor !== detailReceipt?.presentationFactor || reset?.receipt?.coverageVersion !== detailReceipt?.coverageVersion) failures.push("visible-first context recovery identity");
if (
reset?.after?.fallbackPresentationFactor !== 4
|| reset?.after?.fallbackChunkCount !== 28
|| reset?.after?.residentChunkCount !== detail?.workingSet?.chunkCount + 28
|| !(reset?.after?.maximumUploadSliceMs <= 4)
reset?.after?.fallbackChunkCount !== 0
|| reset?.after?.residentChunkCount !== NATIVE_CHUNKS
|| !(reset?.after?.maximumUploadSliceMs <= UPLOAD_SLICE_LONG_TASK_CEILING_MS)
) failures.push("time-sliced context recovery residency");

const sourceUi = report.sourceUi;
Expand Down
Loading