Skip to content

Commit 90a062a

Browse files
committed
docs(cesium-osm): address coderabbit review on #475 (prefix unification + coordinate-fidelity metric)
Addresses two CodeRabbit Major findings on #475: ## Fix 1 — Prefix form unification (CR Major @ line 14) §11 step 1 used `qk:<level>/<x>/<y_tms>` while §2 Q2 declares the full identity as `osm/qk:<level>/<x>/<y>/<type>/<id>`. The two are not competing formats — the §11 form is the **tile-frame quadkey prefix portion** of the §2 Q2 form (truncated to what ADR-024 calls "the prefix" for palette purposes; §2 Q2 is the **full identity path** including namespace + element-type/ID suffix). Adds an explicit clarification noting this two-layer addressing distinction. Also clarifies that §2 Q2's bare `<y>` means `<y_tms>` — the Q3-converted Y coordinate after the OSM-XYZ → TMS ingest boundary flip. §11 spells `<y_tms>` for explicitness; §2 Q2 leaves it bare because the ingest boundary normalizes to TMS before any consumer reads the identity. Result: downstream implementers see one canonical full-identity form (§2 Q2) and one canonical tile-frame prefix form (§11) that are the same key at different layers of detail — not two incompatible prefixes to split on. ## Fix 2 — Coordinate-fidelity metric (CR Major @ lines 17 + 320-333) §11 acceptance criteria measured ρ only for tag equality. The palette domain ALSO covers tile-local 16-bit quantized coordinates (called out in step 2), but coordinate fidelity could silently regress with no falsifiable gate. Adds a **coordinate-decode-error budget** alongside tag ρ in the §11 falsifiable adoption contract: - **Coordinate fidelity** target: **max ≤ 5 cm AND p95 ≤ 1 cm at zoom 21** (tile bounds ~4 m; 16-bit quantization theoretical resolution ~0.06 mm per axis — the 5 cm / 1 cm thresholds leave ~3 orders of magnitude headroom for projection round-trip error). Report max + p95 + p99 over all decoded coordinates. - **New escape hatch** (mirrors the per-tile palette escalation pattern): 24-bit-per-axis quantization OR per-tile floating- point fallback if max budget is breached. The escalation policy now triggers on EITHER ρ < 0.99 OR coordinate-budget breach — two falsifiable gates, both reported, neither silently regressing. Also tightened step 2's "sub-cm precision" claim to the more accurate "~0.06 mm per-axis resolution at zoom 21 — sub-mm" matching the theoretical floor. ## What this PR does NOT do - No source code; docs/plan only. - Does not duplicate work from #474 (other session's D-OSM-2 ownership-boundary fix) — purely additive in §11. - Does not touch §3 (carrier-shape contract) — coordinate fidelity is a §11 codec-contract concern per the §11-vs-§3 framing the initial PR pinned. ## Test plan - [x] Docs/plan only — no source code; no build/test invoked. - [x] Both findings addressed in single commit on the open #475 branch. - [x] Prefix-form unification preserves the §2 Q2 / §11 distinction (full identity vs tile-frame prefix); no breaking change to §2 Q2's existing form. - [x] Coordinate-fidelity budget is measurable at D-OSM-2 implementation time (per-country PBF run reports max + p95 + p99). - [ ] CodeRabbit re-review on this commit.
1 parent f886615 commit 90a062a

1 file changed

Lines changed: 8 additions & 7 deletions

File tree

.claude/plans/cesium-osm-substrate-v1.md

Lines changed: 8 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -316,20 +316,21 @@ The cesium-osm arc adopts **ADR-024** (Palette256 + HHTL codec — universal com
316316

317317
Per `OGAR/docs/ARCHITECTURAL-DECISIONS-2026-06-04.md § ADR-024` adoption checklist:
318318

319-
1. **Identify the prefix.** For D-OSM-2: the Cesium TMS quadkey path `qk:<level>/<x>/<y_tms>` (Q2 ruling §2). The prefix is the per-tile spatial frame.
320-
2. **Identify the palette domain.** For D-OSM-2: OSM tag-values clustered per tile (~95% body covered by ≤256 distinct values at zoom 21 per ADR-024 § 256-ceiling escape hatches) **and** tile-local 16-bit quantized coordinates (tile bounds ~4 m at zoom 21, sub-cm precision).
319+
1. **Identify the prefix.** For D-OSM-2: the **tile-frame quadkey prefix** `qk:<level>/<x>/<y_tms>` — this is the per-tile spatial-frame portion derived from the **full identity path** `osm/qk:<level>/<x>/<y_tms>/<type>/<id>` declared in §2 Q2. (Note: `<y_tms>` is the Q3-converted Y coordinate after the OSM-XYZ → TMS boundary flip; §2 Q2 uses bare `<y>` to mean `<y_tms>` since the ingest boundary normalizes to TMS. The forms are not two competing prefixes — the §11 form is the §2 Q2 form truncated to the spatial-frame portion, which is what ADR-024 calls "the prefix" for palette purposes.)
320+
2. **Identify the palette domain.** For D-OSM-2: OSM tag-values clustered per tile (~95% body covered by ≤256 distinct values at zoom 21 per ADR-024 § 256-ceiling escape hatches) **and** tile-local 16-bit quantized coordinates (tile bounds ~4 m at zoom 21; 16-bit quantization gives ~0.06 mm per-axis resolution — sub-mm at this zoom).
321321
3. **Build the palette + measure ρ-vs-reference.** For D-OSM-2: the reference is exact-match tag equality; ρ for the per-tile tag palette is the proportion of correctly-decoded tag values vs ground truth. Per ADR-024 target: **ρ ≥ 0.99** matching the `lance-graph-arm-discovery` aerial-codebook anchor (ρ = 0.9973 vs cosine).
322322
4. **Decode = const-table lookup.** Per-tile palette is runtime const-table; decode path is zero-allocation. Compile-time HHTL where the palette is shared across tiles (e.g. the global ~100 most-common OSM keys: `highway`, `building`, `name`, `addr:*`).
323323

324324
### Falsifiable adoption contract for D-OSM-2
325325

326-
**D-OSM-2 implementation MUST report:**
326+
**D-OSM-2 implementation MUST report (two metrics — tag fidelity AND coordinate fidelity; both falsifiable):**
327327

328-
- Empirical ρ-vs-reference on the **first per-country PBF run** (default candidate: Liechtenstein PBF — smallest tractable corpus; per §6 OQ-OSM-4).
329-
- Per-tile palette cardinality distribution (mean / p95 / p99). The 256-ceiling escape hatch (per-tile, hierarchical, or palette-64K) is selected on the basis of measured cardinality, not speculation.
330-
- Decode bandwidth: target ≥ 10⁸ palette-decodes/sec on AVX-512 (gather + table-lookup), matching the bgz-tensor `AttentionTable` throughput regime.
328+
- **Tag fidelity** — empirical ρ-vs-reference on the **first per-country PBF run** (default candidate: Liechtenstein PBF — smallest tractable corpus; per §6 OQ-OSM-4). Target: **ρ ≥ 0.99**.
329+
- **Coordinate fidelity** — empirical per-tile coordinate decode-error budget on the same first-per-country run, in meters: **max ≤ 5 cm and p95 ≤ 1 cm at zoom 21** (tile bounds ~4 m; 16-bit quantization theoretical resolution ~0.06 mm per axis — the 5 cm / 1 cm thresholds are ~3 orders of magnitude above the theoretical floor, leaving headroom for projection round-trip error). Report max + p95 + p99 over all decoded coordinates. If max exceeds the budget, the 16-bit quantization regime is undersized for the target use case and must escalate to 24-bit-per-axis OR per-tile floating-point fallback (the latter is a per-tile escape hatch analogous to per-tile palettes).
330+
- **Per-tile palette cardinality distribution** (mean / p95 / p99). The 256-ceiling escape hatch (per-tile, hierarchical, or palette-64K) is selected on the basis of measured cardinality, not speculation.
331+
- **Decode bandwidth** — target ≥ 10⁸ palette-decodes/sec on AVX-512 (gather + table-lookup), matching the bgz-tensor `AttentionTable` throughput regime.
331332

332-
If the ρ-vs-reference falls below 0.99 on the first per-country run, **D-OSM-2 must document the gap before proceeding** to multi-country ingest — either by (a) escalating to per-tile palettes if the global palette undercovers, (b) escalating to palette-64K if cardinality genuinely exceeds 256, or (c) accepting the gap with rationale (e.g. ρ = 0.96 may be acceptable for navigation-style queries where exact tag equality is not load-bearing).
333+
If the ρ-vs-reference falls below 0.99 OR the coordinate-decode max/p95 budget is breached on the first per-country run, **D-OSM-2 must document the gap before proceeding** to multi-country ingest — either by (a) escalating to per-tile palettes if the global palette undercovers, (b) escalating to palette-64K if cardinality genuinely exceeds 256, (c) escalating to 24-bit-per-axis quantization if the coordinate budget is breached, or (d) accepting the gap with rationale (e.g. ρ = 0.96 may be acceptable for navigation-style queries where exact tag equality is not load-bearing).
333334

334335
### Cross-arc ADR-024 adopters (the codec spreads)
335336

0 commit comments

Comments
 (0)