feat(hex-roots): retune Phase-4 wall models and record inconclusive scientific run#8749
Merged
Conversation
…cientific run Retune the 13 parametric bench registrations in bench/HexRoots/Bench.lean from pure exact-dyadic op-counts to wall-time models (SPEC op-count contract times the family's working-bit-length B growth where that growth is asymptotically significant on the schedule), and record the scientific run, comparators, profile, and time budgets in reports/hexroots-performance.md. Cost-model derivation for the changed complexity declarations. The whole-polynomial drivers runIsolateAll and runIsolate and the three compare-group targets (runIsolateNk, runIsolatePellet, runIsolateNkThenPellet) change from n^3 to n^5. The SPEC complexity contract is O(n^3 * B^2) bit operations: n^3 is the op count (up to O(n) components each driven through O(n) subdivision levels of O(n^2)-per-witness work), and the working bit-length reaches B = Theta(n) (target precision plus the seeded n*log||p|| term plus the Taylor coefficients' Theta(prec*n) denominator growth), entering the growing-precision dyadic arithmetic (notably the invAtPrec reciprocal) as a schoolbook O(B^2) per-op factor. O(n^3 * B^2) with B = Theta(n) gives the n^5 wall model; the bit-growth is folded into the exponent because it is asymptotically significant here, unlike the flat allocation-dominated band of the primitives (runTaylor, runWitnessCheck, runNkWitnessCheck, runNewtonSquare, runRefine1, runCertify, runMahlerPrec), whose operands stay sub-word on their schedules so their op-count models (n, n^2) are unchanged, and runRefineTo, whose fixed-degree t-bit schoolbook multiply keeps t^2. Phase 4 is NOT claimed: the scientific run (commit b08a66c, chungus2) returned inconclusive verdicts for 9 of 13 registrations and two SPEC time budgets fail (degree 50 @ prec 64: 495.85 s vs < 10 s; degree 100 @ prec 128: did not complete). libraries.yml keeps HexRoots.done_through: 3. The nine inconclusive verdicts are benchmark-family / schedule / budget findings (non-integer Taylor centre transition band, startup-dominated microsecond witness benches, seeded-family non-monotonicity, Newton-doubling precision quantisation, narrow-range compare group), diagnosed per registration in the report's Concerns section; none is a wrong-asymptotic implementation bug. Co-Authored-By: Claude Fable 5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01SpYSH4swVcLJbN2Bn6NfSP
This was referenced Jul 11, 2026
The five n^5 driver declared models suppress polylog factors (a strict B = Theta(n log n) reading gives n^5 log^2 n); the cost-model comments now state that policy explicitly, matching the house convention the sibling hex-real-roots Phase-4 report uses. The flint comparator script now verifies at startup that the Lean bench family's LCG literals are still present in bench/HexRoots/Bench.lean, failing loudly if the seeded family drifts. Both from the Codex review. Co-Authored-By: Claude Fable 5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01SpYSH4swVcLJbN2Bn6NfSP
Owner
Author
|
Follow-up to the PR's Concerns: the two Phase-4 blocking findings are now tracked in #8750 (bench re-scaffolding for the nine inconclusive verdicts) and #8751 (deep-target time budgets; the SPEC-anticipated Graeffe deferral is the named candidate). The Codex review's two findings (polylog-suppression policy made explicit on the five n⁵ models; the flint comparator now fails loudly if the Lean seeded family's LCG literals drift) are addressed in the follow-up commits. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
This PR retunes the 13 parametric bench registrations in
bench/HexRoots/Bench.leanfrom pure exact-dyadic op-counts to wall-time models (the SPEC op-count contract times the family's working-bit-lengthBgrowth where that growth is asymptotically significant on the schedule), runs the Phase-4 scientific measurement onchungus2, and records it inreports/hexroots-performance.md, but does not claim Phase 4: 9 of the 13 registrations return inconclusive and two of the three SPEC time budgets fail, solibraries.ymlkeepsHexRoots.done_through: 3and the report's Concerns section is non-empty. The five model expressions that changed are the whole-polynomial drivers and the compare group (runIsolateAll,runIsolate,runIsolateNk,runIsolatePellet,runIsolateNkThenPellet): the SPEC contract isO(n³·B²)bit operations, and withB = Θ(n)(target precision plus the seededn·log‖p‖∞term plus the Taylor coefficients'Θ(prec·n)denominator growth) folding into the schoolbookO(B²)growing-precision arithmetic this gives then⁵wall model; the other registrations keep their op-counts (n,n²,t²) because their operands stay in the flat sub-word band across their schedules, with the reconciliation in each adjacent derivation comment and in the commit message.The scientific run (commit
b08a66cce522, AMD EPYC 9455, Lean 4.32.0-rc1, lean-bench 0.1.0) is consistent forrunMahlerPrec,runNkWitnessCheck,runRefine1, andrunIsolateNk, and inconclusive for the other nine; every verdict is reported verbatim in the report. The nine are benchmark-family/schedule/budget findings, not wrong-asymptotic implementation bugs, each diagnosed per registration in Concerns: the fixed non-integer Taylor centre's transition-band growth (~n^2.25, probed ton=1024), the startup-dominated microsecond band of the small-degree witness benches, the seeded family's degree-dependent (non-monotonic) root geometry,refineTo's Newton-doubling precision quantisation, and the compare group's narrow 5-rung range. The cross-strategycomparegroup passes its agreement gate (all three strategies agree on the strategy-invariant hash0x6519358031d0ea70); on the integer-root family the Pellet route is the faster one (ratiopellet/nk0.66 → 0.45across degree). The python-flintfmpz_poly.complex_rootscomparator (informational, run viascripts/bench/hexroots_flint_compare.pywith the seeded coefficients byte-verified against the Lean generator) records hex/flint ratios of315×to~30000×on the seeded ladder, expected for an integer-certified isolator against a float engine; MPSolve is informational scheduled-only with its environment stated in the bench module docstring. SPEC time budgets: degree 10 @ prec 32 is met (0.137 s < 1 s), but degree 50 @ prec 64 takes495.85 s(49.6×over the< 10 starget) and degree 100 @ prec 128 did not complete in a 19-minute window (> 19×the< 1 mintarget). Profiles (perf, one case per input family) confirm the derivations — GMP+allocation dominated for the growing-precisionseeded-densedriver, own-code (Dyadicarithmetic) dominated for the sub-wordwilkinson-linprodfamily,t-bit divrem dominated forrefine-fixed— and satisfy the Attribution rule.Helper defs not in the SPEC:
scripts/bench/hexroots_flint_compare.py(the python-flint process-call comparator driver) andscripts/plots/hex-roots-comparator.py(the seeded-dense comparator-runtime plot generator). This PR also fixes a real bug inscripts/check_phase4.py: its changed-registration diff parser treated deleted---comment lines (which render as--- …in the diff) as the--- a/<file>header and mis-counted them as context, inflating the reported line number of the followingsetup_benchmarkso that a correctly-placed derivation comment was reported missing; the fix treats all in-hunk--prefixed lines as deletions.🤖 Prepared with Claude Code