Skip to content

Blend National echo edges instead of squaring them off - #23

Merged
tcurtsinger merged 1 commit into
mainfrom
claude/national-edge-smoothing
Aug 5, 2026
Merged

tcurtsinger merged 1 commit into
mainfrom
claude/national-edge-smoothing

Conversation

@tcurtsinger

Copy link
Copy Markdown
Owner

Summary

Owner-reported: at close zoom the national mosaic looks blocky with mushy interiors. Root cause in Smooth: the shader bilinearly blended the four neighbors of a sample, but if any of them was missing or no-coverage it fell back to a hard nearest-cell block — so every echo boundary drew as a row of flat 1 km squares while the interior stayed smooth.

Now the renderer weights only the valid neighbors and renormalizes. An invalid cell still contributes no value at any weight (Smooth never bridges an invalid status), but it no longer collapses the fragment. The surviving weight is the fragment's coverage and scales palette opacity by its square root, so the outermost half-cell ring fades instead of terminating in a square, while a lone valid corner still renders at half opacity and never vanishes.

Strictly display-only and Smooth-only:

  • painted footprint unchanged — an invalid nearest cell already discards, so no coverage is invented;
  • Native remains exact nearest-cell sampling at full opacity;
  • interrogation reports the exact backend value in both modes;
  • premultiplied palette, so scaling the color scales opacity correctly.

src/national-radar/sampling.ts is the shader's testable mirror and was updated in lockstep; docs/25 records the edge contract.

Honest scope

This does not add resolution. MRMS CONUS is a 0.01° (~1 km) grid, so past roughly zoom 9 each measured cell covers many screen pixels and stays individually visible — that is the data, not the renderer. Close-range structure is the selected-site Level II product's job (250 m gates). The doc now says so explicitly.

Validation

  • npm run verify green: 318 frontend tests (sampling suite rewritten: renormalized weighting, sentinel codes provably excluded, edge softening, lone-corner floor, fade bounds), build, rustfmt, clippy, 134 Rust tests, cargo check. No Rust changes.
  • Visual confirmation is owner-run; the phase-3 packaged Native-vs-Smooth pixel-difference gate still applies and this change only increases that difference.

🤖 Generated with Claude Code

Smooth mode fell back to a hard nearest-cell block whenever any of the
four sample neighbors was missing or no-coverage, so every echo
boundary rendered as a row of flat 1 km squares against a smoothly
interpolated interior. The renderer now weights only the valid
neighbors and renormalizes: an invalid cell still contributes no value
at any weight, but it no longer collapses the fragment.

The surviving weight is the fragment's coverage and scales palette
opacity by its square root, so the outermost half-cell ring fades
rather than terminating in a square while a lone valid corner stays
visible at half opacity. Display-only and Smooth-only: the painted
footprint is unchanged because an invalid nearest cell already paints
nothing, Native stays exact nearest sampling at full opacity, and
interrogation is untouched in both modes.

sampling.ts mirrors the shader contract for unit tests; docs/25 records
the edge behavior and states plainly that neither mode adds resolution
to a 1 km mosaic.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
@tcurtsinger
tcurtsinger merged commit 007f786 into main Aug 5, 2026
1 check passed
@tcurtsinger
tcurtsinger deleted the claude/national-edge-smoothing branch August 5, 2026 18:26
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