feat(adr-0249): reader→Hamiltonian compiler — design spike + P1 quantity kernel #66

Merged
core-labs merged 2 commits from feat/reader-hamiltonian-compiler into main 2026-07-18 19:18:59 +00:00
Owner

Opens the reader→Hamiltonian compiler arc — next-arc candidate #1 from the intelligence-loop acceptance evidence. The generalized-lift instrument recorded GSM8K/NL non-ingestibility as the composition frontier; this arc builds the mechanism that crosses it. First increment: the design spike (reviewed against the live tree) plus P1, the conformal quantity kernel.

Design thesis (spike)

docs/research/reader-hamiltonian-compiler-spike-2026-07-18.mdcomposition = certified turn sequences. The compiler does not compile a problem into one large Hamiltonian; it compiles a turn program — an ordered DAG of small relation-Hamiltonians, each solvable in one lifecycle turn, chained through the merged Ring-2 residual-protocol path ledger. The ≤5-atom ceiling is structural (2⁵ = 32 = the Cl(4,1) blade basis), so composition depth must live in the certified chain, not in matrix size. This is why the intelligence-loop arc was the prerequisite.

All §8 rulings recorded RESOLVED (Shay, approved): affine-only Tier-1; >5-atom deduction is the next arc (a sequencing choice, not a math-impossibility — composition handles it deterministically); one ADR (0249); field wedge continues independently (INV-27 import-disjointness intact).

P1 — conformal quantity kernel

core/physics/quantity_kernel.py (serve-quarantined; A-04). Quantities as null points on the Cl(4,1) conformal line; add/scale by known constants as translator/dilator versor sandwiches (affine Tier-1). Projective, scale-invariant decode absorbs the dilator's conformal weight, so relation compilation (P2) can normalize losslessly.

Every algebraic claim was first verified numerically against algebra/cl41.py's own multiplication table (spike §3), then pinned as permanent tests.

Reproducibility (spike §4.6) — three tiers, honestly bounded

  • Tier 1 (content address): solved — SHA-256 over explicit <f8 LE bytes; endianness already coerced.
  • Tier 2 (matrix construction): achievable, enforced here — geometric_product is a fixed-order scatter-add (no BLAS/reduction) so IEEE-754 hardware-deterministic, but it silently truncates to float32 unless handed f64 (cl41.py:110-112). The kernel constructs everything in explicit f64 and pins a golden-bytes canary (frozen SHA-256 of embed_quantity(3.0)) as a cross-hardware drift detector.
  • Tier 3 (eigensolve): the genuine hardware bound — the affine well H = c(I − ψψᵀ) has a 31-fold-degenerate excited eigenspace whose LAPACK basis is build-dependent, so propagator bytes are not cross-hardware identical. Mitigation: recover the ground state analytically (the target is constructed, not discovered) and pin the basis-invariant phase_correlation/2 agreement to ψ, never the bytes. Recorded, not papered over.

Tests

tests/test_adr_0249_quantity_kernel.py35/35 green. Nullity, translator exactness (algebraic), dilator sign convention (e^{−α}, pinned — caught a sign error in my own composition test), projective scale-invariant round-trip, affine-chain composition, f64-dtype guards, golden-bytes canary, fail-closed refusals on non-finite input and degenerate conformal weight.

Governance

Serve-quarantined (A-04); reuses the existing HamiltonianCompileError/ProblemHamiltonian contracts rather than forking them; no self-Accept — ADR-0249 lands with acceptance evidence as the arc completes. P2–P5 stack on this branch.

[Verification]: uv run python -m pytest tests/test_adr_0249_quantity_kernel.py -q → 35 passed; uv run core test --suite smoke -q → 176 passed (1 benign engine_state warning).

Opens the reader→Hamiltonian compiler arc — next-arc candidate #1 from the intelligence-loop acceptance evidence. The generalized-lift instrument recorded GSM8K/NL non-ingestibility as the composition frontier; this arc builds the mechanism that crosses it. First increment: the design spike (reviewed against the live tree) plus P1, the conformal quantity kernel. ## Design thesis (spike) `docs/research/reader-hamiltonian-compiler-spike-2026-07-18.md` — **composition = certified turn sequences**. The compiler does not compile a problem into one large Hamiltonian; it compiles a *turn program* — an ordered DAG of small relation-Hamiltonians, each solvable in one lifecycle turn, chained through the merged Ring-2 residual-protocol path ledger. The ≤5-atom ceiling is structural (2⁵ = 32 = the Cl(4,1) blade basis), so composition depth must live in the certified chain, not in matrix size. This is why the intelligence-loop arc was the prerequisite. All §8 rulings recorded RESOLVED (Shay, approved): affine-only Tier-1; >5-atom deduction is the *next* arc (a sequencing choice, not a math-impossibility — composition handles it deterministically); one ADR (0249); field wedge continues independently (INV-27 import-disjointness intact). ## P1 — conformal quantity kernel `core/physics/quantity_kernel.py` (serve-quarantined; A-04). Quantities as null points on the Cl(4,1) conformal line; add/scale by known constants as translator/dilator versor sandwiches (affine Tier-1). Projective, scale-invariant decode absorbs the dilator's conformal weight, so relation compilation (P2) can normalize losslessly. Every algebraic claim was first verified numerically against `algebra/cl41.py`'s own multiplication table (spike §3), then pinned as permanent tests. ## Reproducibility (spike §4.6) — three tiers, honestly bounded - **Tier 1 (content address):** solved — SHA-256 over explicit `<f8` LE bytes; endianness already coerced. - **Tier 2 (matrix construction):** achievable, enforced here — `geometric_product` is a fixed-order scatter-add (no BLAS/reduction) so IEEE-754 hardware-deterministic, but it silently truncates to float32 unless handed f64 (`cl41.py:110-112`). The kernel constructs everything in explicit f64 and pins a **golden-bytes canary** (frozen SHA-256 of `embed_quantity(3.0)`) as a cross-hardware drift detector. - **Tier 3 (eigensolve):** the genuine hardware bound — the affine well `H = c(I − ψψᵀ)` has a 31-fold-degenerate excited eigenspace whose LAPACK basis is build-dependent, so propagator bytes are not cross-hardware identical. Mitigation: recover the ground state analytically (the target is *constructed*, not discovered) and pin the basis-invariant `phase_correlation/2` agreement to ψ, never the bytes. Recorded, not papered over. ## Tests `tests/test_adr_0249_quantity_kernel.py` — **35/35 green.** Nullity, translator exactness (algebraic), dilator sign convention (`e^{−α}`, pinned — caught a sign error in my own composition test), projective scale-invariant round-trip, affine-chain composition, f64-dtype guards, golden-bytes canary, fail-closed refusals on non-finite input and degenerate conformal weight. ## Governance Serve-quarantined (A-04); reuses the existing `HamiltonianCompileError`/`ProblemHamiltonian` contracts rather than forking them; no self-Accept — ADR-0249 lands with acceptance evidence as the arc completes. P2–P5 stack on this branch. [Verification]: `uv run python -m pytest tests/test_adr_0249_quantity_kernel.py -q` → 35 passed; `uv run core test --suite smoke -q` → 176 passed (1 benign engine_state warning).
core-labs added 2 commits 2026-07-18 19:17:42 +00:00
Composition = certified turn sequences: compile problems into turn programs
of small relation-Hamiltonians chained through the Ring-2 path ledger, not
one big matrix (the ≤5-atom ceiling IS the 32-blade basis). Quantity kernel:
conformal line embedding + translator/dilator transport, verified exact
in-tree against algebra/cl41.py (dilator sign convention + projective decode
pinned). All bindings verified: ProblemHamiltonian contract, reader IRs
(MathProblemGraph, meaning_graph→to_deductive_logic), governing ADRs
(0243 §2.2/§4.2, 0244 §2.7-2.8, 0245 §2.2-2.4/§3, 0012, 0175/0191-0193),
prior art reconciled (ADR-0217 R2 front-end, field wedge INV-27 intact).
Next ADR number: 0249. Implementation P1-P5 gated on §8 rulings.
Numbers as null points on the Cl(4,1) conformal line; add/scale by known
constants as translator/dilator versor sandwiches (affine Tier-1 scope).
Projective scale-invariant decode absorbs the dilator's conformal weight.

Reproducibility (spike §4.6 Tier 2): all construction explicit f64 (guards the
cl41 silent-f32 fallback); golden-bytes canary pins embed_quantity(3.0) SHA-256
for cross-hardware drift detection. Fail-closed QuantityKernelError on
non-finite input and degenerate conformal weight.

Spike doc: §8 rulings recorded RESOLVED (all four approved); §4.6 three-tier
byte-identity analysis added (LAPACK degenerate-eigenspace bound made explicit).

35/35 pins green.

[Verification]: uv run python -m pytest tests/test_adr_0249_quantity_kernel.py -q
core-labs merged commit aca98d857d into main 2026-07-18 19:18:59 +00:00
core-labs deleted branch feat/reader-hamiltonian-compiler 2026-07-18 19:19:01 +00:00
Sign in to join this conversation.
No reviewers
No labels
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference: core-labs/core#66
No description provided.