Skip to content

Commit a806b87

Browse files
authored
Merge pull request #44 from AdaWorldAPI/claude/adr-025-probe-free-hot-path
docs(adr): add ADR-025 — Probe-free hot path completes the substrate-doctrine canon
2 parents e81a2a2 + 96d73a2 commit a806b87

1 file changed

Lines changed: 242 additions & 0 deletions

File tree

docs/ARCHITECTURAL-DECISIONS-2026-06-04.md

Lines changed: 242 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -52,6 +52,7 @@
5252
| ADR-022 | **The Firewall** — absolute inner/outer boundary; no serialization in hot path; inner = compile-time HHTL; outer = contract-trait pluggable | **Pinned** | OGAR (this PR); `docs/THE-FIREWALL.md` |
5353
| ADR-023 | **IR-as-wire-truth** — the source-language AST is *input dialect*; the canonical `Class`/`Attribute`/`Association`/`EnumDecl`/`ActionDef` IR is *wire truth*. Adapters lift dialects into IR; the IR routes everything (registry key, actor mailbox, Lance version, audit-log dimension) | **Pinned** | OGAR (this PR); `crates/ogar-vocab/`; `bardioc/substrate-b-shadow::EdgeDecoder<E>` (PR #19) |
5454
| ADR-024 | **Palette256 + HHTL codec** — the substrate's universal compression primitive. HHTL prefix establishes a frame; within the frame, values cluster; clustered values quantize to 256-index palette + const-table lookup. Names an existing primitive (Binary16K perms + bgz-tensor attention + arm-discovery aerial codebook, ρ=0.9973 vs cosine) rather than proposing one | **Pinned** | OGAR (this PR); `MedCare-rs/crates/medcare-analytics/src/{graph_contract.rs,column_mask_bridge.rs}`; `bgz-tensor/examples/compare_stacked_vs_i16.rs`; `lance-graph-arm-discovery` |
55+
| ADR-025 | **Probe-free hot path***address arithmetic (helix + HHTL) gives geometry; Jirak certificate (jc) gives error; together they give level — and the level is the only thing the hot path picks.* Closed-form LOD/level selection replaces empirical probing; the hot path takes zero data-dependent branches. Completes the substrate-doctrine canon (022 boundary / 023 IR / 024 codec / 025 selection) | **Pinned** | OGAR (this PR); runtime: `crates/helix`, `crates/jc` (`jc::weyl` + `jc::jirak`), `crates/cesium/src/{sse,implicit_tiling}.rs` |
5556

5657
## ADR-001: `State = ActionState` (lifecycle), not domain state, for Rubicon binding
5758

@@ -1347,6 +1348,247 @@ consultation with the runtime session.
13471348
§11 — runtime-side commitment to a follow-up callout on this ADR
13481349
once D-OSM-2 / D-SPLAT-4 wire.
13491350

1351+
## ADR-025: Probe-free hot path — address arithmetic + Jirak certificate give the level
1352+
1353+
**Status:** Pinned (2026-06-05). Completes the substrate-doctrine
1354+
canon (ADR-022 boundary / ADR-023 IR / ADR-024 codec / ADR-025
1355+
selection). Names an existing capability surface — three independent
1356+
address-as-geometry deployments + one independent bound machinery,
1357+
all already in production — rather than proposing a new mechanism.
1358+
1359+
**The one-sentence statement:** *Address arithmetic (helix + HHTL)
1360+
gives geometry; Jirak certificate (jc) gives error; together they
1361+
give level — and the level is the only thing the hot path picks.*
1362+
1363+
**Context.** The substrate has accumulated three independent
1364+
**address-as-geometry** surfaces:
1365+
1366+
- **Cesium 3D Tiles 1.1 implicit-tiling** (`crates/cesium/src/
1367+
implicit_tiling.rs`) — child bounds are derived from parent + child
1368+
index by closed-form arithmetic, not stored per-tile. The OGC
1369+
spec §7.3.1 already specifies this.
1370+
- **Helix half-orb placement** (`crates/helix`) — golden-stride
1371+
hemisphere; centroid + Σ at every cell are derived from the
1372+
prefix-bit-pattern's projection through the helix template; no
1373+
per-scene fit.
1374+
- **HHTL radix-prefix routing** (`NiblePath`) — identity-IS-address;
1375+
the same primitive routes actor mailbox, registry key, Lance
1376+
version, audit dimension (ADR-023 / ADR-024).
1377+
1378+
And one independent **bound machinery**:
1379+
1380+
- **`jc::weyl`** — proves 1-D `{k·φ⁻¹ mod 1}` star-discrepancy at
1381+
representative N (e.g. N=144, N=1000), supplying the constructive
1382+
certificate that golden-stride sampling achieves Jirak-grade
1383+
concentration. *[citation per runtime session — not personally
1384+
verified from the OGAR side]*
1385+
- **`jc::jirak`** — supplies the rate `n^{-(p/2-1)}` for p ∈ (2,3]
1386+
and `n^{-1/2}` in L^q for p ≥ 4 under weak dependence. Pinned as
1387+
the **`I-NOISE-FLOOR-JIRAK` iron rule** in the workspace's root
1388+
CLAUDE.md. *[citation per runtime session]*
1389+
1390+
Cross-domain analysis (runtime session, 2026-06-05) revealed: when
1391+
address arithmetic gives geometry (helix + HHTL) AND a Jirak-grade
1392+
error bound gives the level (jc), the hot path becomes **probe-free**
1393+
by construction — no residual-check branch, no metadata-fetch round-
1394+
trip, no fallback path. The empirical-probe pattern collapses into
1395+
closed-form level selection.
1396+
1397+
**Decision.** Three composable primitives form the address-and-error
1398+
substrate; their composition is **the** mechanism the hot path uses
1399+
to pick its work, with zero data-dependent branches:
1400+
1401+
```text
1402+
Address arithmetic → geometry (closed-form, branch-free)
1403+
1404+
│ (helix + HHTL)
1405+
1406+
Jirak certificate → error (predicted per-level, deployment-
1407+
│ static; not per-query)
1408+
│ (jc::weyl + jc::jirak)
1409+
1410+
Together → level (smallest L where predicted_error_L
1411+
< tolerance)
1412+
1413+
The level is the only thing the hot path picks.
1414+
1415+
Single address-arithmetic pass → single Lance column read → render.
1416+
```
1417+
1418+
**The three primitives in detail.**
1419+
1420+
1. **Helix + HHTL = bounds are addresses, not negotiations.**
1421+
At any HHTL depth L, cells are partitioned by NiblePath prefix at
1422+
depth L with identical templated geometry inside each cell.
1423+
Boundary = address-prefix change. No fuzzy edges; no overlap-and-
1424+
blend at tile borders; no per-tile metadata about where it ends.
1425+
**Tile `bounding_volume` becomes a derived field, not a stored
1426+
field** — both producer and renderer compute it from the same
1427+
NiblePath arithmetic; no float-rounding daylight between them.
1428+
1429+
2. **Jirak says which level L the cheap path will succeed at.**
1430+
For the LOD pyramid:
1431+
`n` = current sample size at level L (e.g. n ≈ 16^r for a
1432+
4-ary radix pyramid)
1433+
`predicted_error_L = C · n^{-1/2}` (L^q regime, which the
1434+
Σ-sandwich Mahalanobis distance lives in)
1435+
`r* = ⌈log₄(C/τ)⌉` for clinical tolerance τ — closed-form,
1436+
evaluated once per task class.
1437+
No per-frame probing; the LOD pick is `r*` directly.
1438+
1439+
3. **HHTL routes the prefix at the picked level.**
1440+
Standard radix-trie traversal. The hot path does the address
1441+
arithmetic to get `(prefix_at_L, cell_centroid, cell_Σ,
1442+
palette_window, predicted_error)` in one closed-form pass, then
1443+
one read of the Lance column at that prefix.
1444+
1445+
**The falsifiable property.** The hot path takes **zero data-
1446+
dependent branches**. Verified by *absence*:
1447+
1448+
- No `if residual < threshold` patterns in `crates/cesium/src/sse.rs`
1449+
after `D-CESIUM-IMPLICIT-HELIX` lands.
1450+
- No `try_then_fallback` patterns in registration solvers after
1451+
`D-JC-PREDICT-LOD` lands (the ICP-Σ-sandwich path in particular).
1452+
- No bounds-check branch / metadata-fetch round-trip in the Cesium
1453+
tileset consumer path after `D-HELIX-HHTL-BOUNDS` lands.
1454+
1455+
If the absence holds across the three sites, the substrate is doing
1456+
its job. If `if`-branches reappear on data, the substrate is leaking
1457+
probing into the codec.
1458+
1459+
**Three queued deliverables** (runtime-side; mirror ADR-024's
1460+
D-OSM-2 / D-SPLAT-4 adoption pattern):
1461+
1462+
| D-id | What | Repo |
1463+
|---|---|---|
1464+
| **D-HELIX-HHTL-BOUNDS** | `helix::bounds(nibblepath) → BoundingVolume` and `helix::centroid(nibblepath) → Vec3` as closed-form bounds/centroid derivation | `crates/helix` (ndarray-hpc feature) |
1465+
| **D-CESIUM-IMPLICIT-HELIX** | Extend `crates/cesium/src/implicit_tiling.rs` to consume the helix-bounds derivation as one of its tiling backends, alongside the OGC §7.3.1 uniform-subdivision backend already there | ndarray cesium crate |
1466+
| **D-JC-PREDICT-LOD** | `jc::predict_lod(scene_cert, tolerance) → level` — consumed by SSE, registration, and tile-pyramid LOD selectors | `crates/jc` |
1467+
1468+
Each is small (50-200 LOC); each gates only its own concern; each is
1469+
consumed by D-SPLAT-12 + D-OSM-* + the existing 3DGS-ArcGIS-Cesium
1470+
plan as additive deliverables, not redesigns. The runtime session
1471+
committed in their preceding analysis to file a §11 ADR-025 callout
1472+
on both `cesium-osm-substrate-v1.md` and `splat-native-ultrasound
1473+
-v1.md` once this ADR lands (same cross-arc symmetry pattern as
1474+
ADR-024 → §11 callouts in PR #475 + PR #476).
1475+
1476+
**Alternatives considered.**
1477+
1478+
- *Empirical calibration per scene class.* Rejected: collapses the
1479+
predictive-bound win and reverses the architectural payoff. The
1480+
whole point is the wasted-cheap-try + the failure-detection branch
1481+
going away; empirical calibration keeps both.
1482+
- *Stored bounds in tileset JSON.* Rejected: bounds drift across LOD
1483+
levels (parent must contain children; floating-point error in the
1484+
union accumulates), producer/renderer disagreement (server says
1485+
`[-1.2, 1.3]`; renderer rounds to `[-1.19, 1.29]` and the missing
1486+
strip is a visible seam), mandatory bounds-composition pass at
1487+
producer time. Derived bounds via helix+HHTL eliminate all three.
1488+
- *Per-frame LOD probing.* Rejected: the branch becomes data-
1489+
dependent on residual; branch predictor mispredicts; pipeline
1490+
stalls. Every miss is a cache-line read on the expensive path.
1491+
The Jirak-bound variant pays one constant-time check (data-
1492+
INdependent: function of L and n at that level, not of the
1493+
specific query).
1494+
1495+
**Honest scope — what this ADR does NOT do.**
1496+
1497+
- *Doesn't make the bad-case work go away.* When `predicted_error
1498+
> tolerance` the expensive path is taken directly. What's saved
1499+
is the wasted cheap-try + the fallback branch. If 95% of queries
1500+
are bad-case, the savings are noise.
1501+
- *Needs the jc certificate per scene class.* Medical splat volumes,
1502+
OSM tile aggregates, and ArcGIS scene layers each need their `p`
1503+
parameter (the moment-bound order) measured once at substrate-
1504+
build time. The certificate is deployment-static (per scene class,
1505+
not per query); but it must exist. This is what `crates/jc` is
1506+
*for* — and it's why the substrate has the certificate path
1507+
explicitly named (CLAUDE.md `I-NOISE-FLOOR-JIRAK`).
1508+
- *Doesn't help if the dependence structure changes at scale.*
1509+
Locality probe (e.g. 98.6% intra-basin at ~10³-class ontologies,
1510+
unproven at 10⁸ per the relevant tracking PR) is still the slab.
1511+
If Wikidata-scale locality degrades, the `p` parameter shifts and
1512+
the bound loosens. Separate concern; doesn't invalidate ADR-025
1513+
but does bound where it applies cleanly.
1514+
1515+
**Consequences.**
1516+
1517+
- **The substrate is probe-free in the hot path** is no longer a
1518+
slogan — it's a deliverable name (the three D-* above) and a
1519+
falsifiable property (the three absences above).
1520+
- **Cesium tileset `bounding_volume` becomes a derived field** for
1521+
helix+HHTL-shaped tilesets. Producer/renderer round-trip lossless
1522+
by construction.
1523+
- **5-12 hop range = `r* = ⌈log₄(C/τ)⌉`** evaluated against
1524+
clinical (FMA registration), pixel (Cesium SSE), and tile (OSM
1525+
pyramid) tolerances. Same formula across the three domains; the
1526+
per-domain Jirak certificate supplies `C`.
1527+
- **theta ∈ [1.45, 1.6] window** is the regime where the Jirak
1528+
bound applies cleanly to palette256 distances (ADR-024 codec).
1529+
Outside it, the bound loosens and the predictive guarantee
1530+
degrades. The window is the empirical regime the substrate's
1531+
codec is calibrated in.
1532+
- **The four ADRs form the substrate-doctrine canon**:
1533+
- **022** — boundary (no serialization in hot path)
1534+
- **023** — IR (Class is wire truth; dialects absorbed by
1535+
adapters)
1536+
- **024** — codec (palette256 + HHTL = 1-byte index, sub-µs
1537+
decode, ρ ≥ 0.99)
1538+
- **025** — selection (address gives geometry, certificate
1539+
gives error, together give level; hot path picks level only,
1540+
branch-free)
1541+
Each closes a different floor; together they describe a substrate
1542+
whose hot path is deterministic by construction.
1543+
1544+
**Change policy.** Adding a new adopter of the codec (palette256)
1545+
or of the selection mechanism (helix+HHTL+jc) is routine. Changing
1546+
the mechanism itself — adopting a different bound machinery (e.g.
1547+
moving from Jirak to a different concentration inequality), or
1548+
changing the closed-form address arithmetic at the helix or HHTL
1549+
layer — is a substrate-wide concern and requires consultation with
1550+
the runtime session.
1551+
1552+
**References.**
1553+
1554+
- ADR-022 (The Firewall) — "no serialization in hot path" sister
1555+
claim; ADR-025 closes the loop on "no probing in hot path."
1556+
- ADR-023 (IR-as-wire-truth) — semantic substrate the level picks
1557+
navigate over.
1558+
- ADR-024 (Palette256 + HHTL codec) — the codec the level decode
1559+
consumes; theta ∈ [1.45, 1.6] window is the regime where the bound
1560+
applies cleanly to palette256 distances.
1561+
- `crates/helix` (runtime) — golden-stride hemisphere placement.
1562+
*[per runtime session]*
1563+
- `crates/jc``jc::weyl` + `jc::jirak` certificate machinery.
1564+
*[per runtime session]*
1565+
- `crates/cesium/src/sse.rs` — SSE LOD math (will lose probing
1566+
branches per `D-CESIUM-IMPLICIT-HELIX`). *[per runtime session]*
1567+
- `crates/cesium/src/implicit_tiling.rs` — 3D Tiles 1.1 implicit
1568+
tiling (`D-CESIUM-IMPLICIT-HELIX` entry point). *[per runtime
1569+
session]*
1570+
- CLAUDE.md (workspace root) `I-NOISE-FLOOR-JIRAK` — the iron rule
1571+
that gates the bound machinery. *[per runtime session]*
1572+
- `bardioc` PR #18 + `lance-graph` PR #470 (BindSpace dissolution
1573+
handover) — runtime-side trie-append pattern that helix+HHTL
1574+
composes with.
1575+
- `lance-graph` PR #475 + PR #476 — the §11 ADR-024 callout
1576+
symmetry pattern (D-OSM-2 + D-SPLAT-4 both routed through ADR-024
1577+
contract); ADR-025 follows the same shape — `lance-graph` PR
1578+
#475 + #476 forthcoming amendments for §11 ADR-025 callouts on
1579+
`cesium-osm-substrate-v1.md` + `splat-native-ultrasound-v1.md`
1580+
per the runtime session's explicit commitment.
1581+
1582+
**Honest discipline note.** I have not personally verified the
1583+
runtime-side artifacts cited (`crates/jc`, `crates/helix`,
1584+
`crates/cesium/src/{sse,implicit_tiling}.rs`, CLAUDE.md
1585+
`I-NOISE-FLOOR-JIRAK`). Citations are taken as authoritative from
1586+
the runtime session's 2026-06-05 cross-session analysis (the same
1587+
verification pattern that ADR-024's three deployments + ρ = 0.9973
1588+
anchor were carried under). The §11 amendments the runtime session
1589+
will file once this ADR lands are the receipts that close the
1590+
verification loop from their side.
1591+
13501592
## Implementation receipts — ADR ↔ commit cross-reference
13511593

13521594
> **Added in follow-up addendum (2026-06-05).** Records the implementation

0 commit comments

Comments
 (0)