Repository navigation
Move the coordinator images and CI to Python 3.14 - #201
Merged
Merged
Conversation
PRISM is interpreter-bound on the paths that matter. #162 established that directly: once block serialization left the accept path, what remained was 16.5 us of pure interpreter work, flat across a 12,600x range of template size. Interpreter version is therefore a first-order lever on this workload, and the tree was two feature releases behind. Eight pins move: three Dockerfiles, four CI jobs, and the documented compileall validation command. No code changes. The Debian release is now pinned explicitly rather than inherited. The unsuffixed -slim tags track whatever Debian is current, so today's agreement between 3.12-slim and 3.14-slim is luck rather than contract; without the suffix a future rebuild silently becomes a distro bump that moves the apt Rust toolchain under cargo build --locked. Verified both bases resolve identically today: trixie, rustc 1.85.0+dfsg3-1, postgresql-client 17+278. Compatibility was checked rather than assumed. The coordinator image has one third-party dependency and psycopg-binary ships cp314 wheels, so the 3.2.* pin does not move -- confirmed by installing and importing psycopg 3.2.13 on 3.14.7 in the new base. Nothing in the tree imports a stdlib module removed in 3.13 or 3.14. Behaviour is unchanged on the suite. Full discovery run in both containers under identical conditions: 2,675 tests, 7 failures and 36 errors on each, and the failing test-name sets diff clean. Those 43 are environmental -- the bare container has no make or git, so the Makefile-lifecycle, source-staging and production-gate suites fail the same way on both interpreters. One consequence to record: this invalidates the absolute numbers in #143, #162 and #131, which were all measured on 3.12. The direction of every conclusion survives; the figures quoted in those issue comments should be re-baselined rather than carried forward. Closes #169. Co-Authored-By: Claude Opus 5 (1M context) <[email protected]>
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.
Why
Closes #169.
Measured: this is a small regression, not a win
The rationale below originally claimed free performance on an interpreter-bound workload. That was
reasoning, not measurement, and it is wrong. Measured with the repository's own instrument
(
tests/perf/serialize_block_share_cost.py), four rounds with the interpreter order reversed sowarm-up bias cannot favour either side, min-of-samples:
The comparison is fair: both official images are gcc, PGO, LTO, computed gotos.
Why 3.14 is slower here
No official 3.14 image has the tail-call interpreter. Checked all four variants —
python:3.14,-bookworm,-alpine,-slim— every one is gcc withPy_TAIL_CALL_INTERP = 0, andpyconfig.hsays
#undefoutright. 3.14's headline dispatch work requires clang 19+ withpreserve_none, sothese images carry the release's costs without its main win.
A custom build recovers some of it, and is not worth owning
Built CPython 3.14.7 with clang-19,
--with-tail-call-interp, PGO and LTO to match. The tail-callinterpreter does work on aarch64 (
Py_TAIL_CALL_INTERP 1). It recovers 2–4 points, but is still3–5% slower than 3.12 at every realistic template size.
The 0-tx row explains the shape: that case has the least C work, and there tail-call dispatch wins
5.2%. As template size grows and C-bound work (hex decode, hashing, join) dominates, the win
evaporates — so 3.14's regression here is evidently not in interpreter dispatch, since clang-TC
fixes that and still loses.
Against that, owning the image costs CPython security updates, a long PGO compile in CI, and two
packaging landmines already hit while building it (
llvm-aris only shipped suffixed; PGO needslibclang-rt-19-dev). Not worth 2 points.Why this still merges
The absolute magnitude is negligible. The accept path costs about 0.39% of a core at the
~273 shares/s design point, so a 5% regression on it is roughly 0.02% of a core.
So the case for 3.14 rests on the other reasons, which are unaffected: stdlib
zstd(PEP 784) for#158, a prerequisite for #150, and not sitting three feature releases behind. It does not rest on
speed, and this PR no longer claims it does.
Not measured: the window pipeline (~71 ms per materialization) is the real CPU consumer and was
not measured on 3.14.
tests/perf/window_pipeline_gil_scaling.pyis the instrument for it. A 5%swing there is ~3.5 ms per re-anchor — still small, but it is the number that would change this
recommendation if it were much worse.
What changes
Eight pins. No code changes.
lab/prism/Dockerfile:3,lab/auxpow/Dockerfile:3,lab/miner-sim/Dockerfile:1python:3.14-slim-trixie.github/workflows/ci.yml— four jobs (:23,:85,:109,:201)python-version: "3.14"docs/prism-coordinator-refactor/validation.md:83compileallcommand#169 said seven pins; a fourth CI job has been added since it was filed. Its own comment explains
why it must move with the others — "this job needs the same interpreter the unit tests run under
rather than whatever the runner image happens to ship."
The Debian release is now pinned explicitly. The unsuffixed
-slimtags track whatever Debianis current, so today's agreement between
3.12-slimand3.14-slimis luck rather than contract.Without the suffix, a future rebuild silently becomes a distro bump that moves the apt Rust
toolchain under
cargo build --locked --release -p qbit-prism— and this PR would be blamed for it.Verification
Toolchain parity — the main stated risk in #169, measured on both bases:
Byte-identical, so no MSRV movement and the apt layer is unaffected.
Dependency: the coordinator image has exactly one third-party package, and
psycopg-binaryships
cp314wheels — so the3.2.*pin does not need to move. Confirmed by installing andimporting psycopg 3.2.13 on Python 3.14.7 in the new base. Nothing in the tree imports a stdlib
module removed in 3.13 or 3.14.
Behaviour — full discovery in both containers, identical conditions:
and the failing test-name sets
diffclean — not just equal counts, the same 43 tests. Those 43are environmental: the bare container has no
makeorgit, so the Makefile-lifecycle,source-staging and production-gate suites fail the same way on both interpreters.
compilealloverdocker lab tests examples scriptsclean on the new base.One consequence worth recording
This invalidates the absolute numbers in #143, #162 and #131 — all measured on 3.12, and now
known to move by roughly 5% on the accept path. The direction of every conclusion survives, but
figures quoted in those issue comments should be re-baselined rather than carried forward.
tests/perf/has the instruments (#160/#170/#192) to dothat as a comparison rather than a rebuild.