Repository navigation
feat(coverage): use the owner's station values in predicted reach and the terrain profile (#1017 M4) - #1093
feat(coverage): use the owner's station values in predicted reach and the terrain profile (#1017 M4)#1093adminopenclaw8-sketch wants to merge 6 commits into
Conversation
… the terrain profile (#1017 M4) - coverage: a `station` block (owner TX power, gain, cable loss, aim) added at serve time from the claim snapshot, never cached; the server counts the nodes in reach with the owner's budget and the yagi/panel pattern (owner decision 8); every node carries bearingDeg - profile: Link (the reach's PathLoss over the profile's samples, margins A→B and B→A at the operator's sensitivity and environment loss) and each endpoint's Radio (owner, else operator); shape pin and the two profile goldens updated on purpose (only radio/link added); the share card does not render them - panel: owner values as starting values (slider > owner > operator), marked "(owner)", a per-viewer "Use the owner's values" switch, the pattern through 0.5° bearing bins built once per raster and a 720×256 colour table; the profile shows a link line - Am 20 dB and default beamwidths (yagi 60°, panel 90°) are operator constants, pinned client = server; customizer later (rule 8) Relates to #1017 Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…CHECKs are (#1017 M4, M3 nit 1) onTenths allowed 1e-9 outside each bound, so 37.0000000005 dBm passed Validate, answered 202 and then failed the ingestor's INSERT. Every bound is an exact float64; the 0.1 grid keeps its float tolerance. Relates to #1017 Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…s before /station answers (#1017 M4, M3 nit 3) The M3 values have no inputs, so they are now taken from /station whatever the timing; addKept still applies their rules on submit. The visible fields are pre-filled only while the owner has not typed. Relates to #1017 Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Rapport — CS-Macmini PR#1093 #1017 — head e2ae840Status: Draft, all 15 CI jobs green on the first attempt (3 skipped by design); every requirement has a red-before/green-after test; 35/35 mutants killed; nothing open that blocks review. Evidence: [T] test or command I ran, [A] read in the code or the plan, [K] CI log or PR state. What was built (the M4 row of §10)Three commits: Requirements, tests and mutants
Red before. On Invariants
Local runs
CI (run 46912560646, attempt 1) [K]
No re-run was needed. The known flaky test #271 did not appear. Choices made without asking
Leftovers (not blocking)
|
Review — CS-Minimax PR#1093 — head e2ae840Dom: REQUEST CHANGES An independent, read-only review of #1017 M4 at head Evidence: [T] I ran it, [A] I read it in the code or the plan, [K] CI log or PR state. The models, precedence, hidden/stale handling, profile link and card are right, and the test coverage is good: 8 of my 8 mutants were killed. One blocker: the M4 perf criterion (a directional recolour at most 1.5× omni) is not met on a current V8. The PR's own perf test fails locally and fails Findings
The author's own leftover 1 also shows in my desktop screenshot: an owner TX power of 30.5 dBm leaves the TX power slider handle at its 30 dBm end. This is acknowledged in the PR, and I do not count it as a finding. Answers to the review points
Tests and mutants
My own mutants (8/8 killed) [T]:
(R1 also had a first version that did not build; that attempt is not counted.) I also tried a CI (run 46912560646, attempt 1) [K]
The known flaky tests #256 and #267 did not appear. CI's JS job runs on Node 22, which is why F1 does not show there. Not verified
|
… values only (#1017 M4) Review round on #1093: - F1: directionalTable no longer classes 720 × 256 cells per recolour. Each row is keyed by its rowCuts (a binary search over byteClass's own margin expression, so the classes are identical); each distinct row is filled once and copied; the last table is kept. The legend's shares come from per-bin running sums (binCounts) instead of a 184 K-cell pass. Table 24.5 ms -> 0.5 ms; directional/omni at 1008² ×17.7 -> ×1.00 (Node 25), ×3.5 -> ×0.68 (Node 22); at 7.1 M px ×3.5 -> ×0.81 (Node 25), ×1.07 -> ×0.66 (Node 22). The perf test measures the steady-state recolour at 1008² and 7.1 M px; a cell-for-cell test pins the table and shares to buildLut/byteClass. - F2: EndpointRadio carries ownerStated; the profile line names only the values the owner stated as the owner's. - F3: the reach panel's header line says "Owner's radio in use". - F4: E2E cold start on a phone with real taps (Home -> node -> Predicted reach / Terrain profile -> tap B). - F5: linkText moved below verdictChip and its doc comment. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
#1017 M4 fix round) Adds what the independent fix round (72aedb26, not pushed) tested and 02f57b5 did not: - A walk of successive directionalTable calls, all 720 rows and the shares checked against buildLut/byteClass, where each step changes one thing the kept table depends on: the beamwidth alone, noData alone (255, 256, 300, 0, unset), non-finite budgets (NaN, Infinity) and a 230 dB budget at which the clamped byte must still be 'none'. Four mutants of 02f57b5 survived the sampled test and are killed by this one: the table key without the beamwidth, the key without noData, the clamped-byte guard at noData 256, and rowCuts without its finite check. - E2E cold start: picking B sends exactly one profile request, with the node as A, and the header line with "Owner's radio in use" is on top. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Brings in #1099 (the TestHiddenFilterPacketsNoExtraAllocs flake fix) and the rest of master since the branch point. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Fix round — CS-Macmini PR#1093Review feedback addressed (commit This round came from two sessions by mistake (a double dispatch).
Nit, left unchanged: F3 rebuilds the header line on every slider input, and that includes Local checks on the merged head
CI (run 46975569213): all green on
|
Relates to #1017
What
#1017 M4 — the owner's approved station values (M3) are now used by the models, exactly the M4 row of the revised M0 §10:
stationblock.GET /api/terrain/coveragefor a node centre with approved, in-force, non-stale station details carriesstation: CoverageStationRadio{txPowerDbm, antennaGainDbi, lossDb, azimuthDeg, beamwidthDeg, beamwidthAssumed}— only stated values. It is added at serve time from the claim snapshot, never cached with the result (a cache hit still reflects a new approval).(owner). A slider or a link value still wins.mc-reach-owner, like the opacity). Off returns the operator's values and omni colouring, with no request.A(φ) = −min(12·(φ/θ3dB)², Am),Am= 20 dB; a yagi/panel without a beamwidth uses 60°/90°, shown as assumed (never stored).Uint16Arrayof 0.5° bearing bins (720) per pixel, built once per raster and only for a directional station, plus a (bin, byte) histogram; each recolour builds a 720 × 256 colour table and paints with one lookup per pixel.bearingDeg; the browser adds the pattern to the margin, and the server applies it to the counts too (owner decision 8 as corrected on 2026-11-29), with the owner's values over the operator's inbudgetDb.TerrainProfileResponse.link: TerrainLink{lossDb, model, sensitivityDbm, environmentLossDb, marginABDb, marginBADb}andTerrainEndpoint.radio: EndpointRadio{txPowerDbm, gainDbi, cableLossDb, azimuthDeg, beamwidthDeg, beamwidthAssumed, patternDb, source}(ownerelseoperator). The loss isdhm.Link.PathLoss— the function every node in reach uses — over the profile's own samples, under the reach's model (map.coverage.model, default delta). The panel shows one line:Path loss … · margin A→B …, B→A … (sensitivity …, … environment loss)plus the owner's radio and aim. The share card does not render the new fields (byte-identical, tested).onTenthsbounds are exact, like the SQL CHECKs (no 1e-9 slack), so 37.0000000005 dBm is a 400 rather than a 202 that the ingestor's INSERT then refuses;/stationanswers.Plan (milestones inside this PR)
stationblock, directional counts, profilelink+ endpointradio(shape pin updated on purpose).test-issue-1017-m4-station-e2e.js(desktop + 375×560 touch), registered inscripts/e2e-shards.json; nit 3 step added totest-issue-1017-m2-e2e.js.Customizer / config (rule 8)
Am(20 dB) and the default beamwidths (yagi 60°, panel 90°) are operator constants instation_radio.goandcoverage.jsPATTERN, pinned to each other byTestStationPattern1017M4_MatchesTheClient. Customizer later.Perf
Recolour, directional vs omni (budget ≤ 1.5×) — reworked in the review round (F1). The 720 × 256 colour table used to class every cell on each recolour, a fixed ~24 ms. Now each row is keyed by its cuts: a binary search over
byteClass's own margin expression, so the classes are identical. Each distinct row is filled once and copied, and the last table is kept. The legend's shares come from per-bin running sums (binCounts) instead of a 184 K-cell pass. A cell-for-cell test pins the table and the shares tobuildLut/byteClass(9 raster metas × 3 colour sets × 5 budgets × 4 patterns, > 1 M cells).Steady-state recolour (a slider move; warmed up, best of 9 or 15, fresh budgets), Apple M-series:
test-issue-1017-m4-station-models.jsnow asserts ≤ 1.5× at both 1008² and 7.1 M px. Bins + running counts are built once per raster (asserted not rebuilt on a slider move): 15.0 MB and ~1.2 s at 7.1 M px, 2.8 MB and ~0.17 s at 1008². They exist only for a directional station and are dropped with the raster.Independent check on the merged head (CS-Macmini, same machine class,
02f57b53code): Node 25.9.0 ×0.97 at 1008² and ×0.79 at 7.1 M px; Node 22.22.1 ×0.58 and ×0.56; Chromium 145 in a real page ×0.77 at 1008² and ×0.66 at 7.1 M px (before the fix: ×2.85 and ×0.94). A second table test (9941951d) walks successive calls through beamwidth-only, noData-only (255/256/300/0/unset), NaN/Infinity and 230 dB budgets on all 720 rows. It kills four mutants that the sampled test missed: the kept-table key without the beamwidth, the key without noData, the clamped byte at noData 256, androwCutswithout its finite check.Server: station block O(1) per request (existing 30 s snapshot); counts O(nodes) with one bearing each; profile link O(samples) on samples already held, 0 upstream calls (tested on a cache hit, and a linearity check 400 → 3200 samples).
Follow-up (not in this PR)
Invariants
cmd/serverstays read-only: SELECT-free change, snapshot reads only.map[string]interface{}; all new response types are named structs.🤖 Generated with Claude Code