core/algebra
Shay 82b031d158 perf(adr-0244): D2 mechanical sympathy — Rust f64 GP fast-path + eigh memoization
Cohesion directive Mandates 1+2 (ADR-0244 §2.6 / §2.8).

Mandate 1 — Rust f64 geometric_product fast-path:
- core-rs/src/lib.rs: export a geometric_product_f64 PyO3 wrapper (mirrors the
  f32 one; delegates to cl41::geometric_product_f64, itself a term-for-term
  mirror of the pure-Python f64 kernel — same i-major scatter order, no FMA).
- algebra/backend.py: f64 branch in geometric_product, gated on CORE_BACKEND=rust
  + core_rs present (default stays pure-Python; older builds fall through on
  AttributeError). The directive's f32 gate was already built; the real gap was f64.
- Contract is BIT-IDENTICAL, not tol-matched: a 1-ULP divergence would move the
  f64 wave-field residual bytes and break I-02 replay under CORE_BACKEND=rust.
  Verified: test_geometric_product_f64_parity N=10000 Rust-vs-Python bit-for-bit
  + CORE_BACKEND=rust subprocess hex match (core_rs built).
- Measured M1 speedup (sixth acceptance criterion): dense f64 GP ~120x
  (Rust 4.3 us/call vs Python 520 us/call) with parity holding.

Mandate 2 — eigh memoization:
- cognitive_lifecycle.py: relax_to_ground's dense-branch np.linalg.eigh routed
  through _cached_eigh (functools.lru_cache, keyed on the frozen hamiltonian_id +
  matrix bytes), returning frozen read-only (evals, evecs) so a cache hit can
  never be mutated — every hit is bit-identical. The diagonal (propositional)
  fast path is untouched.

tests: test_adr_0244_mechanical_sympathy pins cached-eigh == fresh eigh,
read-only arrays, hit-returns-identical-objects, and relaxation determinism
through the cache; D9 extended with the N=10000 bit-identity gate and its
now-stale "f64 is Python-only" pins updated.

[Verification]: D9 22 passed (incl. bit-identity N=10000, core_rs built) +
mechanical-sympathy + cognitive_lifecycle green; smoke + fast lane below.
2026-07-17 13:58:17 -07:00
..
topological_reasoning feat(adr-0242): macro-phase V2–V5 + sensorium feed (Drive gap close) 2026-07-14 21:08:02 -07:00
__init__.py feat(algebra): incidence algebra — graded_wedge, dual, meet + honest outer_product 2026-06-04 21:43:35 -07:00
backend.py perf(adr-0244): D2 mechanical sympathy — Rust f64 GP fast-path + eigh memoization 2026-07-17 13:58:17 -07:00
cga.py feat(algebra): null-point recovery primitives + frozen CGA null constants 2026-07-12 16:28:19 -07:00
cl41.py Fix fail-closed versor construction 2026-05-14 12:13:04 -07:00
holonomy.py Fix test suite errors across core physics and generation 2026-05-14 13:02:32 -07:00
null_point.py feat(algebra): null-point recovery primitives + frozen CGA null constants 2026-07-12 16:28:19 -07:00
rotor.py fix(algebra): rotor_power smoke — α≈0 identity + simple B² float-dust tol 2026-07-13 21:29:33 -07:00
versor.py fix(ingest): close issue #300 — normalize_to_versor margin at the gate (#312) 2026-05-26 16:39:49 -07:00