prop/test/microwaveprop
Graham McIntire 63f25a9612
Some checks failed
Build prop-grid-rs / Test, build, push (push) Successful in 5m54s
Build and Push / Build and Push Docker Image (push) Failing after 4m44s
perf(grid-rs): dense grid, fused scoring pass, and columnar .pgrid profiles
Reworks the post-fetch half of the propagation pipeline. Fetch and GRIB2
decode were already cheap — measured against a live HRRR cycle, all 39
pressure messages decode via `wgrib2 -lola` in 0.29 s and the 31 MB
byte-range fetch takes ~3 s — so nothing here touches the decoder. All the
cost was downstream.

Also fixes a broken NOTIFY that made every chain step run up to 5 times.

pg_notify
  `NOTIFY propagation_ready, $1` is a Postgres syntax error: NOTIFY is a
  utility statement whose payload must be a literal, so a bind raises
  42601. It shared a transaction with the `status='done'` UPDATE, so every
  successful step rolled back, stayed 'running', and was requeued by
  reclaim_stale_running up to @max_reclaim_attempts times. Elixir's
  NotifyListener never fired either, so ScoreCache warm and the
  "propagation:updated" fan-out were dead.

FieldGrid
  A decoded grid was HashMap<(i32,i32), HashMap<Arc<str>, f32>> — a dense
  rectangular grid stored as ~95k nested hash maps, costing ~4.6M inserts
  on decode, ~3.7M on merge and ~14M lookups across three derivation
  passes. wgrib2 -lola already emits one dense row-major f32 block per
  message, so keep it: dense per-message planes, names hashed once per
  grid into plane ids, NaN as the missing sentinel. This is what forced
  PROP_GRID_RS_PARALLELISM=1 under a 3Gi limit.

Fused pass
  Three 95k-cell derivation passes plus 23 band-major scoring passes over
  a staged Vec<(f64,f64,Conditions,BandInvariants)> (~19MB re-streamed 23
  times) collapse into one pass: levels extracted once per cell, all 23
  bands scored while the cell is hot, scores accumulated cell-major so
  rayon chunks own disjoint slices. Scores land straight in the dense
  score-file body — no ScorePoint scatter.

.pgrid
  The profile artifact was an rmpv tree plus gzip -9, written 30x an hour,
  and ProfilesFile.read_point/3 gunzipped and unpacked the entire 95k-cell
  file to return one cell on every map click and Skew-T load. Replaced
  with a dense cell-major f32 record array carrying a self-describing
  field table. Elixir reads it via :file.pread; .mp.gz and .etf.gz remain
  readable so files written before this drain out of the 48h window.

  Measured on a full CONUS grid (95,073 cells x 48 planes x 23 bands):
    derive + score + build artifacts   0.022 s
    profile write   3.957 s -> 0.006 s (22.0 MB -> 22.4 MB on disk)
    single-cell read   whole-file decode -> 0.5 us
    23 score files     0.003 s

Also
  - hrrr_points: batched UNNEST upsert replacing one awaited INSERT per
    point. Keeps ON CONFLICT DO UPDATE — the PSKR sampler's two-pass loop
    depends on it.
  - fetcher: real semaphore capping in-flight ranges at
    MAX_PARALLEL_RANGES, which the comment claimed but the code did not do
    (it spawned all 27 while the connection pool was sized for 8).
  - metrics: per-stage histogram. Only chain-step and decode durations
    were instrumented, which is why the write cost stayed invisible.
  - profiles_file: parse_valid_time anchors on the known extension set, so
    sibling-suffixed names like <iso>.hrdps.prop no longer parse as
    <iso>.hrdps and vanish from prune and list operations.
  - PROP_GRID_RS_PARALLELISM 1 -> 3. Memory limit held at 3Gi until RSS is
    observed at the new parallelism.
  - cargo fmt over the crate; worker.rs, hrdps_fetcher.rs and nexrad.rs
    were already unformatted at HEAD and the pre-commit hook gates on it.

HRDPS still runs at 0.5 degrees. wgrib2 -lola scales linearly in output
points on rotated lat/lon (12.5 s wall, 202 s CPU for one message at
0.125 degrees) because it has no inverse projection for those grids; a raw
native dump is 0.32 s. The fix is decode-once plus a closed-form
rotated-pole index, left for a follow-up.
2026-08-01 08:23:36 -05:00
..
accounts fix: resolve 391 Credo issues across codebase 2026-06-12 13:51:32 -05:00
aprs fix: resolve all 281 credo issues across source and test files 2026-07-29 09:04:21 -05:00
backtest fix: resolve 391 Credo issues across codebase 2026-06-12 13:51:32 -05:00
beacons fix: resolve all 281 credo issues across source and test files 2026-07-29 09:04:21 -05:00
buildings fix: resolve all 281 credo issues across source and test files 2026-07-29 09:04:21 -05:00
canopy test: PromEx + Canopy.BulkFetch + Maidenhead.valid? coverage 2026-05-08 10:06:36 -05:00
commercial fix: resolve all 281 credo issues across source and test files 2026-07-29 09:04:21 -05:00
ionosphere fix: resolve all 281 credo issues across source and test files 2026-07-29 09:04:21 -05:00
propagation perf(grid-rs): dense grid, fused scoring pass, and columnar .pgrid profiles 2026-08-01 08:23:36 -05:00
pskr fix: two test issues causing 37 failures 2026-07-22 16:37:17 -05:00
qrz test: cover qrz/client 2026-04-16 14:10:50 -05:00
radio fix: resolve all 281 credo issues across source and test files 2026-07-29 09:04:21 -05:00
rover fix: resolve all 281 credo issues across source and test files 2026-07-29 09:04:21 -05:00
rover_planning update credo 2026-06-12 16:14:14 -05:00
space_weather fix: resolve all 281 credo issues across source and test files 2026-07-29 09:04:21 -05:00
terrain fix: resolve all 281 credo issues across source and test files 2026-07-29 09:04:21 -05:00
valkey fix: resolve 391 Credo issues across codebase 2026-06-12 13:51:32 -05:00
weather fix: resolve all 281 credo issues across source and test files 2026-07-29 09:04:21 -05:00
workers fix: resolve all 281 credo issues across source and test files 2026-07-29 09:04:21 -05:00
accounts_api_token_test.exs fix(security): mass-assignment on owner edit + 3 minor hardening fixes 2026-05-11 19:04:16 -05:00
accounts_test.exs fix: resolve all 281 credo issues across source and test files 2026-07-29 09:04:21 -05:00
application_test.exs test: lift coverage to 85% and pin threshold 2026-05-08 13:59:56 -05:00
aprs_repo_test.exs fix: resolve 391 Credo issues across codebase 2026-06-12 13:51:32 -05:00
aprs_test.exs fix: resolve all 281 credo issues across source and test files 2026-07-29 09:04:21 -05:00
backtest_test.exs fix: resolve all 281 credo issues across source and test files 2026-07-29 09:04:21 -05:00
beacon_measurements_test.exs feat(api): ingest endpoint for propmonitor beacon measurements 2026-05-13 16:07:04 -05:00
beacon_monitors_test.exs feat(admin): beacon monitor reassign, token regen, assigned_by display, user monitor management 2026-07-22 16:27:21 -05:00
beacons_test.exs fix(security,test): viewer-aware profile queries + create_contact ordering + valkey test isolation 2026-05-12 08:49:08 -05:00
cache_test.exs fix: resolve 7 pre-existing test failures and ScoreCache DateTime bug 2026-06-10 13:50:24 -05:00
callsign_location_test.exs fix: resolve 391 Credo issues across codebase 2026-06-12 13:51:32 -05:00
canopy_test.exs test: 100% coverage push — Valkey.RedixAdapter, Buildings.BulkFetch, AprsRepo, Maidenhead, Canopy 2026-05-08 10:01:28 -05:00
commercial_test.exs fix: resolve all 281 credo issues across source and test files 2026-07-29 09:04:21 -05:00
format_property_test.exs test: cover Format.number/bytes, Instrument.span, SolarClient edges 2026-04-23 14:09:13 -05:00
format_test.exs fix: resolve 27 security, architecture, test, and performance audit findings 2026-07-27 18:19:37 -05:00
geo_property_test.exs test(property): add property tests for terrain + atmospheric math 2026-04-21 13:56:39 -05:00
geo_test.exs test: cover geo, qrz record, callsign client 2026-04-16 14:09:44 -05:00
geocoder_test.exs Drop gridmap.org dependency, resolve callsigns locally 2026-04-12 17:43:29 -05:00
instrument_test.exs test: cover Format.number/bytes, Instrument.span, SolarClient edges 2026-04-23 14:09:13 -05:00
logger_format_test.exs update credo 2026-06-12 16:14:14 -05:00
mailer_test.exs Add test coverage for Mailer and AboutLive 2026-05-29 17:56:03 -05:00
markdown_test.exs fix(docs): render API reference bullets correctly + tighter reading column 2026-05-09 09:46:45 -05:00
moon_test.exs feat(eme): add /eme Earth-Moon-Earth calculator 2026-04-23 16:18:20 -05:00
oban_error_reporter_test.exs fix: resolve 18 bugs across LiveViews, schemas, tests, and logic 2026-07-29 07:46:54 -05:00
partition_manager_property_test.exs perf+test: cache nearest_hrrr per cell, batch pg_inherits, +property tests 2026-05-05 17:40:13 -05:00
partition_manager_test.exs fix: resolve all 281 credo issues across source and test files 2026-07-29 09:04:21 -05:00
prom_ex_test.exs fix: resolve 158/183 credo --strict warnings 2026-06-12 15:47:15 -05:00
propagation_test.exs fix: resolve all 281 credo issues across source and test files 2026-07-29 09:04:21 -05:00
pskr_test.exs fix: accept 4-char Maidenhead grids in PSK Reporter spots 2026-07-20 13:54:32 -05:00
qrz_test.exs Drop gridmap.org dependency, resolve callsigns locally 2026-04-12 17:43:29 -05:00
radio_refinement_test.exs fix: resolve 391 Credo issues across codebase 2026-06-12 13:51:32 -05:00
radio_test.exs fix: resolve all 281 credo issues across source and test files 2026-07-29 09:04:21 -05:00
release_test.exs test: push line coverage from 71.7% → 78.67% 2026-04-23 18:43:18 -05:00
repo_listener_test.exs fix: resolve 18 bugs across LiveViews, schemas, tests, and logic 2026-07-29 07:46:54 -05:00
rover_planning_test.exs fix: resolve all 281 credo issues across source and test files 2026-07-29 09:04:21 -05:00
rover_test.exs fix: resolve all 281 credo issues across source and test files 2026-07-29 09:04:21 -05:00
terrain_test.exs Rename qsos table to contacts, qso_id to contact_id 2026-04-02 15:52:19 -05:00
valkey_test.exs fix: resolve all 281 credo issues across source and test files 2026-07-29 09:04:21 -05:00
weather_extra_test.exs fix: resolve all 281 credo issues across source and test files 2026-07-29 09:04:21 -05:00
weather_grid_test.exs fix: resolve all 281 credo issues across source and test files 2026-07-29 09:04:21 -05:00
weather_test.exs fix: resolve all 281 credo issues across source and test files 2026-07-29 09:04:21 -05:00