Skip to content

Deep correctness, reliability & UX hardening pass#13

Merged
SysAdminDoc merged 1 commit into
mainfrom
hardening/deep-audit-correctness-ux
Jun 2, 2026
Merged

Deep correctness, reliability & UX hardening pass#13
SysAdminDoc merged 1 commit into
mainfrom
hardening/deep-audit-correctness-ux

Conversation

@SysAdminDoc
Copy link
Copy Markdown
Owner

A broad, production-minded hardening pass across the Rust physics/solver, the IPC trust boundary, the React/Cesium frontend, and build/config. No version bump — corrects the stale v0.2.1 app string to match the existing 0.4.0 everywhere.

Highlights

Physics correctness

  • Synolakis run-up fixed — it multiplied by amplitude instead of offshore depth, under-predicting every run-up/inundation value by d/H. The bundled Carrier-Greenspan validation (feature-gated) was failing 100% and now passes; added a non-gated closed-form regression. ⚠️ This increases reported run-up/inundation app-wide.
  • Floored seismic-Mw (zero-drop landslide no longer emits -inf to the UI); guarded latent NaN in asteroid cavity scaling, nuclear cavity radius, and the Lamb-wave envelope.

Reliability & safety

  • simulate_grid: combined cells × steps compute budget (the two caps were independent → a request could wedge the worker for minutes); off-pole box clamp; longitude normalisation; unified ±180° lon contract.
  • GPU: fixed a missing bytemuck dep (the gpu feature never compiled); readback failure no longer advances time over a garbage field (clean CPU fallback); all-wet-only dispatch to the land-mask-free kernel.
  • Sponge on small grids; preset input-bounds test; cached preset registry.

UX & accessibility

  • Scenario number fields editable again (draft-on-blur); previously-silent IPC/export failures now show toasts/inline status; modal focus traps (WCAG 2.4.3/2.1.2); Globe NaN-proofing; dev StrictMode blank-globe fix.

Security & DX

  • Production build fails if a personal VITE_CESIUM_TOKEN would be inlined; tightened shell:allow-open; read-only settings probe; export filename + video-recorder hardening.

Verification

  • cargo test 61 pass · cargo clippy --all-targets -D warnings clean · tsc clean · vite build clean · --features gpu compiles · browser smoke test (preset load, zero console errors, working focus trap).

Known residuals (deferred, documented)

  • Pre-existing feature-gated stoker_… validation benchmark fails (mis-scaled test IC, not a solver bug).
  • Coarse offline bathymetry rectangles mark marginal seas as land (degrades flagship presets with use_real_bathymetry).
  • CSP keeps 'unsafe-inline' (needed for inline theme bootstrap + Vite HMR).

Physics correctness:
- Fix Synolakis run-up to scale by offshore depth, not amplitude. It was
  under-predicting every run-up/inundation figure by d/H and the bundled
  Carrier-Greenspan validation benchmark was failing 100%; both now pass.
- Floor seismic-Mw energy so a zero-drop-height landslide can no longer emit
  -inf across the IPC boundary; guard NaN sources in asteroid/nuclear/lamb-wave.

Reliability & safety:
- simulate_grid: add a combined cells*steps compute budget (the two caps were
  independent, so one request could wedge the worker for minutes), clamp the
  box off the poles, normalise longitude, and unify the +/-180 lon contract.
- GPU: fix the missing bytemuck dep so the feature compiles at all; don't
  advance sim time over a failed/garbage readback (clean CPU fallback); only
  route all-wet grids to the land-mask-free kernel.
- Apply the sponge on small grids; add a preset input-bounds test; cache the
  preset registry.

UX & accessibility:
- Scenario number fields are editable again (draft-on-blur instead of
  clamp-per-keystroke).
- Surface previously-silent failures (preset/scenario IPC, preset-list load,
  PNG/share/video export) as toasts/inline status.
- Add modal focus traps (WCAG 2.4.3/2.1.2); NaN-proof Globe labels and the SWE
  imagery bbox; fix the dev StrictMode blank-globe; misc play/cancel/save state.

Security & DX:
- Fail production builds that would inline a personal VITE_CESIUM_TOKEN; tighten
  the shell-open allow-list; read-only settings probe; export filename and
  video-recorder hardening; correct the stale app version string to 0.4.0.
@SysAdminDoc SysAdminDoc merged commit 37117e7 into main Jun 2, 2026
5 checks passed
@SysAdminDoc SysAdminDoc deleted the hardening/deep-audit-correctness-ux branch June 2, 2026 05:15
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