feat(kernel): back irrational numbers with FLINT qqbar #41

Merged
toph merged 9 commits from feat/qqbar-kernel into main 2026-07-03 13:07:13 +00:00
Owner

For #33. Replaces the kernel's Alg representation (resultant arithmetic) with a FLINT qqbar backend behind the unchanged Num API; Rat and same-generator Field stay pure OCaml fast paths. Drops the H(Y)/certify pipeline (candidate roots are verified by exact qqbar evaluation instead), swaps Mpoly.resultant's Laplace determinant for evaluation+interpolation, and — new in the last commit — bumps FLINT to 3.6.0 to use _qqbar_roots_poly_squarefree (roots of polynomials with algebraic coefficients) as the primary path for the axiom-6/7 cubics, with the elimination pipeline as fallback behind an exact discriminant guard.

Measured: cross-field compare >120s → 1ms; axiom 7 with √2/4 input >120s → 5ms; (√2+√3)/8 never completed → 0.113s; stacked cubics round 3 at 0.068s, round 4 walls (intrinsic — canonical degree-81 minimal polynomials are heavy even for FLINT; documented). Full history and verdict in notes/2026-07-03-33-verdict.md, decision in ADR 0013 (supersedes the Alg part of 0012). New dependency: flint 3.6.0 (LGPL, flake source override until nixpkgs catches up — first build compiles FLINT, ~10 min). The num suite drops from 76s to 0.5s; goldens: cube-root.fold re-baselined (qqbar to_float is correctly rounded; old value was the midpoint of a 1e-12 interval, deltas ~4e-13).

For #33. Replaces the kernel's `Alg` representation (resultant arithmetic) with a FLINT `qqbar` backend behind the unchanged `Num` API; `Rat` and same-generator `Field` stay pure OCaml fast paths. Drops the H(Y)/certify pipeline (candidate roots are verified by exact qqbar evaluation instead), swaps `Mpoly.resultant`'s Laplace determinant for evaluation+interpolation, and — new in the last commit — bumps FLINT to 3.6.0 to use `_qqbar_roots_poly_squarefree` (roots of polynomials with algebraic coefficients) as the primary path for the axiom-6/7 cubics, with the elimination pipeline as fallback behind an exact discriminant guard. Measured: cross-field compare >120s → 1ms; axiom 7 with √2/4 input >120s → 5ms; (√2+√3)/8 never completed → 0.113s; stacked cubics round 3 at 0.068s, round 4 walls (intrinsic — canonical degree-81 minimal polynomials are heavy even for FLINT; documented). Full history and verdict in `notes/2026-07-03-33-verdict.md`, decision in ADR 0013 (supersedes the Alg part of 0012). New dependency: flint 3.6.0 (LGPL, flake source override until nixpkgs catches up — first build compiles FLINT, ~10 min). The num suite drops from 76s to 0.5s; goldens: `cube-root.fold` re-baselined (qqbar `to_float` is correctly rounded; old value was the midpoint of a 1e-12 interval, deltas ~4e-13).
toph added 29 commits 2026-07-03 07:17:27 +00:00
Combined design: first-class faces/edges entity in Fold_state, material
creases resolved per-flap (bent -> error), #(.a .b .c) flap operand as the
escape hatch. Staged as two PRs (entity plumbing + principled #27; then
material-crease semantics + area syntax). Retires the #27 tactical patch.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01Jfw5BuRgc2vq3j6zckY867
Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01Jfw5BuRgc2vq3j6zckY867
Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01Jfw5BuRgc2vq3j6zckY867
Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01Jfw5BuRgc2vq3j6zckY867
Version-tagged v0.10-dev preface: point/crease/flap as material paper
geometry, creases carried as per-flap pieces (bent → error), the #(…)
and --(--d #(…)) operands. Entity-model altitude; §3/§4 reconciliation
deferred to #28 PR 2.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01QJW3X1XNaTL81UmjD5dm5m
Per Task 2 implementer's flag: edges must persist and split across folds for
emit-from-edges to keep multi-fold goldens byte-identical. Merged into Task 3.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01Jfw5BuRgc2vq3j6zckY867
Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
toph force-pushed feat/qqbar-kernel from dfaa422e18 to 03acbc9b72 2026-07-03 07:21:58 +00:00 Compare
Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
toph force-pushed feat/qqbar-kernel from 9ed72cbf79 to 10d2c2642e 2026-07-03 13:06:52 +00:00 Compare
toph merged commit 8dca67316b into main 2026-07-03 13:07:13 +00:00
toph deleted branch feat/qqbar-kernel 2026-07-03 13:07:13 +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
toph/beloch!41
No description provided.