Skip to content

TJC-1814: Python 3.14 default; numba-jitted vertex enumeration (4.2x certify-sweep) - #5

Merged
arcaputo3 merged 1 commit into
mainfrom
tjc-1814-py314-numba
Jul 23, 2026
Merged

TJC-1814: Python 3.14 default; numba-jitted vertex enumeration (4.2x certify-sweep)#5
arcaputo3 merged 1 commit into
mainfrom
tjc-1814-py314-numba

Conversation

@arcaputo3

Copy link
Copy Markdown
Contributor

Two performance asks, measured honestly:

Python 3.14: now the default (.python-version, CI matrix 3.11/3.14, workflows on 3.14; requires-python >=3.11,<3.15; regular GIL build). Verdict on speed: a wash for this workload — certify-sweep 233.8s (3.13.1) vs 232.3s (3.14.4); the runtime lives in numpy/LAPACK and tight float loops, not the interpreter.

numba: the profile showed ~99% of certify-sweep inside lp_value (batched det+solve over ~24k small systems per call, plus array assembly). Replaced with a fused @njit kernel replicating the exact semantics (lexicographic combination order, |det| > 1e-10 screen, 1e-9 feasibility slack). Results:

Metric Before After
certify-sweep 233.8s 55.3s (4.2×)
full slow suite 6:12 3:12
archived transcript byte-for-byte identical
fast suite (3.14.4 / 3.11) 17/17 17/17

Cost: numpy pinned <2.5 (numba's ceiling → 2.4.6; the old lock already forked to 2.4.6 on 3.11). Amusing detail: stock numpy 2.4.6 flips one cosmetic tie-break line vs the archive, but the jitted LU agrees with the numpy-2.5.1-generated archive — so no output regeneration was needed at all.

Paper §4/Appendix B updated to describe the jitted implementation; PDF regenerated (Typst 0.15.1, deterministic).

🤖 Generated with Claude Code

…certify-sweep)

Python: default and CI ceiling move to 3.14 (requires-python >=3.11,<3.15;
matrix 3.11/3.14; regular GIL build - the free-threaded interpreter is
deliberately not used). Measured: 3.14 alone is a wash for this workload
(certify-sweep 233.8s on 3.13 vs 232.3s on 3.14; the time is numpy/LAPACK
and tight float loops).

Dependencies: numba 0.66 + llvmlite 0.48 added; numpy pinned <2.5 (numba's
ceiling; 2.4.6 resolves - the previous lock already forked to 2.4.6 on 3.11
because numpy 2.5 dropped it).

certify_sweep: the batched-LAPACK dual-vertex enumeration (profiled at ~99%
of runtime: det+solve on ~24k small systems per call plus array assembly)
is replaced by a fused numba kernel - lexicographic combination
enumeration, partial-pivot LU with the identical |det| > 1e-10 screen,
back substitution, and the identical 1e-9 feasibility slack.

Measured on the same machine, sequentially, single runs:
- certify-sweep: 233.8s -> 55.3s (4.2x)
- full slow suite: 372s -> 192s (6:12 -> 3:12), 3/3 pass
- archived transcript reproduced BYTE-FOR-BYTE by the jitted kernel
  (stock numpy 2.4.6 flips one cosmetic tie-break line; the jit agrees
  with the numpy-2.5.1-generated archive, so no regeneration was needed)
- fast suite 17/17 on 3.14.4 and 3.11 from the same lock

Paper Section 4 and Appendix B recharacterize the sweep implementation
honestly; PDF regenerated on Typst 0.15.1 (double-compile deterministic).

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
@arcaputo3
arcaputo3 merged commit 45d8ef7 into main Jul 23, 2026
@arcaputo3
arcaputo3 deleted the tjc-1814-py314-numba branch July 23, 2026 23:45
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant