docs(meta): D-256 — canonical sampling convention ruling
Records the T-1174 ruling: derive(seed, absolute world metres) via the derive_at_metres family is the only derive core; the batch 64x32 pseudo-grid is re-scoped as a survey raster with a real SurveyCellPos newtype (role name, not a D-243 rung); derive_district_profile becomes a thin wrapper at survey-cell-centre positions with binding basin and riparian preservation; point-feature terrain judgments move to exact world positions; D-255 step canvases are fenced to the window family. LayerRegionOutput rebuild deferred to T-1181 (tripwire verified: sole reader is the region_grid overlay); voxel carrier deferred to Phase 5. Consults: Tyre APPROVE-WITH-CHANGES, Dudley FEASIBLE-WITH-CHANGES — both incorporated. Discharges the T-1174 blocker on D-255's T-1181 step-canvas envelope. Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
This commit is contained in:
@@ -321,6 +321,7 @@ line in place — keep the Q-record for the audit trail rather than deleting it.
|
|||||||
- [D-253: Region transient state model — seasonal/tidal/weather/snow phase functions (resolves Q-105)](decisions/architecture.md#d-253-region-transient-state-model--seasonaltidalweathersnow-phase-functions-resolves-q-105) — _architecture_
|
- [D-253: Region transient state model — seasonal/tidal/weather/snow phase functions (resolves Q-105)](decisions/architecture.md#d-253-region-transient-state-model--seasonaltidalweathersnow-phase-functions-resolves-q-105) — _architecture_
|
||||||
- [D-254: Standalone Atlas companion app — `make atlas`, dual-connection reader](decisions/architecture.md#d-254-standalone-atlas-companion-app--make-atlas-dual-connection-reader) — _architecture_
|
- [D-254: Standalone Atlas companion app — `make atlas`, dual-connection reader](decisions/architecture.md#d-254-standalone-atlas-companion-app--make-atlas-dual-connection-reader) — _architecture_
|
||||||
- [D-255: Body Map Viewer — stepped Atlas render architecture (supersedes the T-1143 continuous-ladder mechanism)](decisions/architecture.md#d-255-body-map-viewer--stepped-atlas-render-architecture-supersedes-the-t-1143-continuous-ladder-mechanism) — _architecture_
|
- [D-255: Body Map Viewer — stepped Atlas render architecture (supersedes the T-1143 continuous-ladder mechanism)](decisions/architecture.md#d-255-body-map-viewer--stepped-atlas-render-architecture-supersedes-the-t-1143-continuous-ladder-mechanism) — _architecture_
|
||||||
|
- [D-256: Canonical sampling convention — one absolute-metre derive core; the batch layer is a survey raster](decisions/architecture.md#d-256-canonical-sampling-convention--one-absolute-metre-derive-core-the-batch-layer-is-a-survey-raster) — _architecture_
|
||||||
|
|
||||||
## Open questions
|
## Open questions
|
||||||
|
|
||||||
|
|||||||
@@ -2284,4 +2284,31 @@ Technical foundation decisions that constrain implementation: engine, client-ser
|
|||||||
|
|
||||||
---
|
---
|
||||||
|
|
||||||
*109 decisions (D-001 through D-255, excluding gaps). Last updated: 2026-07-24 (D-255 — body-map-viewer stepped Atlas render architecture: server-determines-content + client-map-art-function + stepped six-level ladder (Global opener + Region→Chunk fixed rungs), tagged-envelope wire migration, three-tier cache, cache-accelerated-pure-function seed-chaining, lakes from settled hydrology; amends D-166/D-226/D-227/D-243/D-225/D-192).*
|
### D-256: Canonical sampling convention — one absolute-metre derive core; the batch layer is a survey raster
|
||||||
|
|
||||||
|
- **Date:** 2026-07-24
|
||||||
|
- **Decision:** Resolves [T-1174](../../.pql). The "batch vs window derive paths sample different world positions for the same DistrictPos" divergence is ruled a **namespace collision, not a sampling-offset bug**: batch `DistrictPos` was an index on a 64×32 heightmap pseudo-grid (8×8 working-pixel blocks, pole-anchored, ~1/64 circumference per cell on a real body, sampled at block centre), while window `DistrictPos` is the true [D-243](#d-243) 2,048 m grid (equator/lon-0 anchored, sampled at cell origin) — one `(i32, i32)` type carrying two coordinate systems. Underneath it the investigation surfaced two latent *same-position* divergences: the batch path computed **three inconsistent latitudes** for one cell (row-index linear, `pixel_to_world_m` implied, and the noise-field anchor), and keyed its region-climate baseline on pseudo-grid indices — which collapse the **entire body onto region (0,0)'s baseline** (a live residue of the Q-110 failure D-243 was written to kill). The ruling, six parts:
|
||||||
|
|
||||||
|
**(a) Canonical convention.** `derive(seed, absolute world metres)` — the `derive_at_metres` / `derive_orbital_at_metres` family is the **only** code that answers "what is at this world coordinate". `DistrictPos` canonically means the true D-243 2,048 m grid, **origin-corner quantization** (`dp * DISTRICT_M`, equator/lon-0 anchor), per the existing wrapper-contract tests; fractional positions stay legal. This is the convention every position-pinning test, every bench suite, and the [D-255](#d-255) step-canvas costing already assume — no test anywhere pinned the batch position.
|
||||||
|
|
||||||
|
**(b) The survey raster.** The batch 64×32 pseudo-grid is re-scoped as a **survey raster** — the coarse planning pass for L2/L3 (settlement placement inputs, believability, overlays, skeleton dispatch context). Its key becomes a **real newtype** (`SurveyCellPos`, not a type alias) so the compiler rejects cross-namespace passing — the collision's root cause is two semantically different `(i32,i32)` grids sharing a bare tuple type. **Vocabulary guard:** "survey" is a *role name for a coarse planning raster, not a spatial rung* (mirroring D-255's gridunit-is-not-a-rung language); the D-243 ladder gains no level. The **only** bridge between namespaces is one explicit, testable function: survey cell → its centre world-metres (the pixel-index-midpoint centre `8rx+3.5` is kept — it is the geometrically correct midpoint of the 8-point bilinear sample lattice, not an error).
|
||||||
|
|
||||||
|
**(c) One derive core.** `derive_district_profile` becomes a **thin wrapper over the shared metres-addressable core** at the survey-cell-centre world position — one derive core, two position sets. This auto-fixes both latent divergences (one inverse mapping computed once is definitionally self-consistent; region keying inherits the core's true-metre floor-divide, giving latitude-graded climate instead of the body-uniform artifact). Two preservation requirements are **binding**: (1) **`basin_direction`** — an inert pass-through field (proven: nothing in the derivation reads it) — is preserved via post-call field override with the true L1 D8 value; the window path keeps its documented North fallback. (2) **The riparian verdict** must come from `near_perennial_water_at` (on-demand course invention) exactly as today — a naive wrapper passing the empty course slice would silently regress every riverside cell to `near_perennial_water = false` and flip `vegetation_class`; the fix is an extracted private core parameterized on the pre-computed riparian boolean, leaving `derive_at_metres`'s public signature and byte-behavior untouched (window goldens must stay green unchanged).
|
||||||
|
|
||||||
|
**(d) Exact-position judgments.** Terrain judgments attached to point features (the quarter-skeleton context's `morphology_zone`, today a survey-map lookup keyed off the settlement position) move to an **exact-position derive at the feature's world metres**, server-side, resolved where the terrain cache is reachable — a survey cell spans ~hundreds of km and its centre is not the settlement's terrain. This closes the annotation-vs-canvas disagreement class ([D-255](#d-255)'s Lendel failure class) *before* T-1181/T-1182 draw batch-judged annotations onto window-derived canvases.
|
||||||
|
|
||||||
|
**(e) Fencing for D-255.** Step canvases (all six rungs) derive **exclusively** via the canonical family; survey products are never canvas sources. The survey raster is a planning input — [D-227](#d-227)-legal exactly like every cache tier (evict → recompute → byte-identical), never a second source of terrain truth.
|
||||||
|
|
||||||
|
**(f) Deferrals, tripwires discharged.** The collapsed `LayerRegionOutput`/`region_grid` rebuild defers to T-1181 rung-0 (verified: its sole production reader is the `build_region_grid` body-view overlay; no consumer reads it against `DistrictProfile` climate, so no new disagreement enters this ruling's blast radius — the overlay is visibly stale until the rung-0 Global canvas replaces it, accepted and noted). Voxel-carrier rewiring defers to Phase 5 (the carrier inherits self-consistent profiles from (c) for free, per the [D-166](#d-166) same-derivation amendment).
|
||||||
|
|
||||||
|
**Known costs (accepted):** batch-layer *values* change (latitude fix + true-region climate) → believability goldens regen and map overlays legitimately diff against screenshot baselines. **Settlement and road positions do not move** — placement positions source from Layer-1 attractor search, untouched; the T-1075 install bake is keyed by DB row identity, orthogonal on both axes. D-245 believability gates need **no threshold changes** — every gate rewards variance, which this fix strictly increases (the same direction as the T-1080 moisture amendment, one layer up).
|
||||||
|
|
||||||
|
- **Rationale:** T-1181's acceptance gate (cache-hit == cache-miss, byte-exact, every rung) and D-255(f)'s cache-accelerated pure function require a sample's identity to be `(seed, position)` and nothing else; two paths resolving different positions for the same nominal cell break that identity at the root. The evidence for the canonical choice was uniform (all position-pinning tests, all five bench suites, the D-255 measurements, and the Phase-5 streaming amendment all sit on the absolute-metre family), and the unification *deletes* reconciliation code rather than adding it — one inverse mapping replaces three latitude conventions and a collapsed climate key. The newtype is the structural fix that makes the class un-reintroducible; a rename alone would relabel the footgun without disarming it.
|
||||||
|
- **Raised by:** Found by Dudley (T-1168 integration testing, the layer_proxy design note). Ruling drafted from a four-reader code sweep; stress-tested by Tyre (APPROVE-WITH-CHANGES: basin preservation binding, exact-position judgments pulled into scope, newtype over alias, region-consumer tripwire, vocabulary guard) and Dudley (FEASIBLE-WITH-CHANGES: inert-basin proof, riparian empty-slice regression + extracted-core shape, fallout inventory, T-1075 orthogonality, sample-lattice centre ruling).
|
||||||
|
- **Implementation:** [T-1174](../../.pql) (single PR: core extraction + wrapper + `SurveyCellPos` newtype + skeleton exact-position judgment + strengthened cross-path agreement test + golden regen). Successor obligations riding existing tickets: T-1181 (rung-0 replaces the collapsed region layer), Phase 5 (voxel carrier). `RegionPos` shares the bare-tuple hazard — noted, out of scope here.
|
||||||
|
- **Cross-reference:** [D-255](#d-255) (the dependency that raised this — envelope needs derive agreement; the Lendel failure class (d) closes), [D-243](#d-243) (the true grid, the Q-110 residue this clears, vocabulary lock honoured), [D-227](#d-227) (derive-don't-store — the survey raster as planning cache; the seed-chaining purity this repairs), [D-239](#d-239) (§8/§10 basin preservation, §2 climate-as-district-tier-field made body-honest, frozen vocabulary untouched), [D-245](#d-245) (believability — the body-uniform climate artifact this removes), [D-166](#d-166) (Phase-5 same-derivation amendment this makes satisfiable). Tickets: [T-1174](../../.pql) (this ruling), [T-1181](../../.pql) (gate consumer), [T-1168](../../.pql)/[T-1170](../../.pql) (where the quirk surfaced and the invariants this strengthens).
|
||||||
|
- **Dissent:** None.
|
||||||
|
|
||||||
|
---
|
||||||
|
|
||||||
|
*110 decisions (D-001 through D-256, excluding gaps). Last updated: 2026-07-24 (D-256 — canonical sampling convention: one absolute-metre derive core (`derive_at_metres` family), batch pseudo-grid re-scoped as `SurveyCellPos` survey raster (real newtype), thin-wrapper unification fixing the three-latitude inconsistency and the region-(0,0) climate collapse, exact-position feature judgments, step-canvas fencing; discharges the T-1174 blocker on D-255's T-1181 envelope).*
|
||||||
|
|||||||
Reference in New Issue
Block a user