fix(client): PR #192 review round — per-rung legend, Region coalescing + clamp boundary tests, halving-loop honesty
All Hoshe/Araminta findings addressed (Tyre approved outright), none retracted — plus a Dudley stop-and-flag discovery that improved on the asked-for fix: - Legend 100x lie (Araminta, blocking): subtitle computed via spacing_for_rung() and refreshed at all three _held_granularity_v2 write sites. Region test asserts 204.800 km/cell; the District direction needed a stale-header-aware helper — a District-only test spuriously passes against the old literal by coincidence. - Region coalescing coverage (Hoshe 1): both directions tested (Region-vs-District separate slots; Region-vs-Region coalesces). - Clamp boundary tests + dangling citations (Hoshe 2): writing the requested halving-loop-fires test surfaced that the loop is PROVABLY UNREACHABLE at current constants (per-axis clamp forecloses it — brute-forced independently on both server and client sides). Ruling: the loop stays as defensive code; the test became a property sweep pinning both the wire-cap invariant and the loop's no-op status (a future constant change breaks it loudly); doc comments on both sides drop the load-bearing framing and state the truth; the old client mirror test that claimed the loop fires (passing on the per-axis clamp alone) is replaced the same way. Client citations now name the real server tests verbatim. - Governance (Tyre): D-226 amendment note — progressive cross-rung refinement EXTENDS T-1124 §4 (not supersedes); legacy u32 field scheduled for retirement (T-1159). Server: 1818 lib tests green, clippy/fmt clean. Client: zoom_ladder 48/48, window_request 26/26, viewer 74/74; gdlint clean. Every fix revert-verified.
This commit is contained in:
@@ -1364,6 +1364,76 @@ mod tests {
|
||||
);
|
||||
}
|
||||
|
||||
/// **PR #192 review — Hoshe 1: zero coalescing coverage for
|
||||
/// `WindowGranularity::Region` before this test**, despite Region being
|
||||
/// the highest-fan-out path (progressive capped-density tiling fires
|
||||
/// multiple concurrent Region `DeriveWindow` items per pan/zoom). Mirrors
|
||||
/// `submit_window_does_not_coalesce_different_granularity`'s pattern
|
||||
/// exactly, substituting Region for Quarter: a Region request and a
|
||||
/// District request for the SAME `(connection, body)` are separate
|
||||
/// in-flight slots (the coalescing key is `(conn_id, body_id,
|
||||
/// granularity)`) and must NOT coalesce — both survive as independent
|
||||
/// pending items.
|
||||
#[test]
|
||||
fn submit_window_does_not_coalesce_region_and_district() {
|
||||
let q = GenerationQueue::with_threads(1);
|
||||
// See `submit_window_coalesces_same_connection_and_body`'s comment on
|
||||
// why the occupier must be `analyze()`, not `FillChunk`.
|
||||
q.submit(analyze("Occupier5"), GenPriority::Low);
|
||||
|
||||
let conn = ConnectionId(13);
|
||||
q.submit_window(
|
||||
derive_window_at("OrbitalGranBody", conn, (0, 0), WindowGranularity::Region),
|
||||
GenPriority::Immediate,
|
||||
);
|
||||
q.submit_window(
|
||||
derive_window_at("OrbitalGranBody", conn, (0, 0), WindowGranularity::District),
|
||||
GenPriority::Immediate,
|
||||
);
|
||||
assert_eq!(
|
||||
q.pending_count(),
|
||||
2,
|
||||
"same (connection, body) but Region vs. District must NOT coalesce — \
|
||||
separate in-flight slots, same as the existing District/Quarter pair"
|
||||
);
|
||||
}
|
||||
|
||||
/// The coalescing-DOES-happen counterpart to the test above, for Region
|
||||
/// specifically: two submissions for the SAME `(connection, body,
|
||||
/// Region)` still collapse to one pending item — confirms Region's
|
||||
/// coalescing key behaves identically to District/Quarter's, not just
|
||||
/// that it avoids cross-granularity aliasing.
|
||||
#[test]
|
||||
fn submit_window_coalesces_same_connection_body_and_region_granularity() {
|
||||
let q = GenerationQueue::with_threads(1);
|
||||
q.submit(analyze("Occupier6"), GenPriority::Low);
|
||||
|
||||
let conn = ConnectionId(15);
|
||||
q.submit_window(
|
||||
derive_window_at(
|
||||
"SameOrbitalGranBody",
|
||||
conn,
|
||||
(0, 0),
|
||||
WindowGranularity::Region,
|
||||
),
|
||||
GenPriority::Immediate,
|
||||
);
|
||||
q.submit_window(
|
||||
derive_window_at(
|
||||
"SameOrbitalGranBody",
|
||||
conn,
|
||||
(5, 5),
|
||||
WindowGranularity::Region,
|
||||
),
|
||||
GenPriority::Immediate,
|
||||
);
|
||||
assert_eq!(
|
||||
q.pending_count(),
|
||||
1,
|
||||
"same (connection, body, Region) must still coalesce to one pending item"
|
||||
);
|
||||
}
|
||||
|
||||
// -------------------------------------------------------------------
|
||||
// TerrainAnalysisCache (T-1137, PR #187 review — Tyre C1)
|
||||
// -------------------------------------------------------------------
|
||||
|
||||
Reference in New Issue
Block a user