Repository navigation
boot smoke: the compute-floor tripwire goes runner-class-relative (tebako#1095) - #108
Conversation
Ratio-gate status — verified green on the proof class, and one real finding on macos-arm64/3.14What this PR now contains (3 commits)
Verified green
The finding: a persistent ~1.6x per-call gap on macos-arm64, split by python versionFull-catalog run 45349338822, per-call ratios (reference fib(30) median-of-25 vs tebako fib(35) best-of-3, normalized by call count 2·F(n+1)−1):
Not sampling noise: the 3.14.7/arm64 failure reproduces across runs (1.635 in 45349338822, 1.95 on the earlier absolute-window run, 1.608 in the targeted evidence leg 45353646257 on commit 3) with stable windows on both arms (45349338822: reference 25 runs 0.067–0.078 s, median 0.070; tebako 1.290/1.269/1.420, best 1.269). The split is by python version, not by run or silicon: every ≤ 3.13 leg on arm64 reads ≤ 1.42 while both 3.14 legs read 1.63. The tebako build is not degenerate in absolute terms (1.269 s fib(35) on arm64 is fast); the ratio moved because something on ONE side of it changed. The commit-3 diagnostics add one more datum: the reference's visible build idiom is identical across versions — 3.13.15 and 3.14.7 both report universal2 ( The evidence chain narrows it to the build toolchain
Consistent with the covenant's history: the published (clang-15) v0.3.3 pair measured worst 0.84 on macos-arm64 python (covenant run 42525964214) and stayed ≥ 0.80 on 11-18; the fresh (clang-17) build of the same recipe reads 0.61 against the same reference. Decisive cheap experiment (not run here — proposing, not acting): the current image still carries Xcode 16.3 at Downstream implication for the covenant (tamatebako/tebako#1118)The covenant's python arm pins this repo's v0.3.3 / lang 3.14.7 against the same on-system provisioner (setup-python 3.14.7), and Decision needed (owner)The two red legs are the gate surfacing a real, reproducible discrepancy, not a wiring bug. Options:
This PR deliberately does neither unilaterally: the 1.5x bound and the fail tier stay as they are, and the PR stays draft until you call it. |
|
Addendum — PR-head CI (commit Running tally for 3.14.7/macos-arm64 across runs: 1.635 (45349338822), 1.608 (45353646257), 2.133 (45352240234), plus 1.95 on the earlier absolute-window run — always ≥ 1.6 on a class where ≤ 3.13 reads ≤ 1.42. The red set on the PR head is exactly the gate surfacing the finding, nothing else. |
Resolved by experiment: the 3.14/macos-arm64 gap is CPython's tail-calling interpreter under Apple Clang 17 — fixed in
|
|
Correction to the thread above — the The confound is now measurable: the arm64 fleet is hardware-heterogeneous, and the two builds do not scale alike across it. Today's reference fib(30) medians span 0.070–0.131 s (~1.9x) across same-image legs; the tebako bests span 1.27–2.14 s; and the ratio anti-correlates with instance speed — on instances where the universal2 python.org reference runs 0.07–0.08 s, every factory variant reads ≥ 1.6 regardless of the tail-call flag (tailcall-on: 1.635 @ 0.070, 2.133 @ 0.081; tailcall-off: 1.921 @ 0.075, 1.614-jit @ 0.096), while on ~0.12 s instances the same recipes read 1.353–1.608. The 1.5x bound on this leg is currently a runner-allocation lottery. What remains cleanly established: the published v0.3.3 (clang-15) binary reads 1.099/1.122 head-to-head against the same-leg reference (two runs, both on ~0.10 s instances); whether it too climbs on fast instances, and whether a fresh current-recipe build is same-instance slower than v0.3.3 at all, is what the follow-on interleaved probe (same instance, same reference, both binaries back-to-back) is measuring now. Until that lands, the honest summary is: the tail-call flag's effect is unproven under the lottery, and this leg's red is dominated by fleet heterogeneity vs a generic arm64 no-PGO build — the re-scope-the-reference/bound path (owner's option 2) is the live decision, with the toolchain question downgraded to a component.
|
…bako#1095) tebako#1095's closing verdict exonerated every tebako layer on the current macos-15-intel fleet: the tebako pair reads fib(35) best-of-3 at 4.270 s against the same-leg on-system reference (setup-python 3.14.7, the covenant's provisioner) at 4.258 s — parity ≈1.00 — while the fleet-calibrated absolute 4.0 s ceiling is unachievable there by ANY x86_64 CPython (python.org's own build reads 4.26-6.66 s; runs 45324096740/45330380303/45338794570). An absolute ceiling is a bug on arrival after a runner-class move; the gate becomes a same-leg ratio. - tools/compute_reference_probe.py (new): the on-system reference probe — fib(30) best-of-3, timed inside the interpreter; the workflow's sibling step runs it under setup-python at the leg's base version (matrix.reference_python, the PythonVersion-owned -jit grammar) and hands best:/n: down as COMPUTE_FLOOR_REFERENCE_SECONDS / COMPUTE_FLOOR_REFERENCE_N. - tools/boot_smoke compute-floor: the per-call-rate ratio gate (<= 1.5x). The recursive fib's call count is exact per N (T(n) = 2*F(n+1) - 1), so the arms' different Ns normalize to per-call rates; the ratio is a property of the built interpreter against the reference on the same runner, never of the fleet's absolute rate. A missing/malformed reference is a named wiring failure with the local remediation, never a silently degraded gate. - COMPUTE_FLOOR_MODE=warn stays on the macos-x86_64 legs as insurance while the gate proves itself; REMOVAL CONDITION (the workflow comment): revert to fail-closed once the ratio gate reads green on two consecutive runs on the current fleet. - contract.yml: record tebako#1095's side finding as a named KNOWN-BAD — the published v0.3.0 pair (link unit v2.8.49) reproducibly wedges on the current macos-15-intel fleet, never reaching the interpreter (3/3 reproductions); the v0.2.0 (v2.3.2) and v0.3.5 (v2.8.78) pairs are unaffected. Old-line consumers on that fleet resolve v0.3.5+.
…ng falls back to the line The first full-matrix run of the ratio gate (45344792366) found two defects in the mechanism, both in the reference arm, never in the tebako measurement: - setup-python's manifest carries no 3.11.16 / 3.12.14 (it lags the factory's micro pins), so the provision step red those catalog legs before any measurement. The provisioning is now exact-micro first (continue-on-error) with a LOUD fallback to the leg's major.minor line — the same interpreter generation — and the measure step asserts the resolved interpreter's line against matrix.reference_line (a generation mismatch is a named wiring error, never a quiet ratio). A ::notice:: records every fallback. - Two healthy macos-arm64 legs false-red at ratio 1.87/1.95: their reference windows' own three runs spread 29% (0.090/0.116/0.104) while the tebako arms' seconds-scale runs held within 7%. At ~0.1 s a run, a best-of-3 MIN samples the runner's instantaneous state instead of its sustained rate — the median of 25 runs is the same statistic the covenant's cells gate on, and it costs ~3-7 s. The tebako arm keeps its fib(35) best-of-3 (tebako#1095's follow-up pins it; a 4.5 s run self-averages). Healthy-leg ratios from that run otherwise read 0.72-1.49 across linux-gnu, linux-musl, windows (both arches), and the macos legs that measured in-window — the gate's shape is right; the reference arm's sampling was not.
The ratio gate's denominator now prints the reference interpreter's CONFIGURE_ARGS and OPT/CFLAGS next to its median. A per-call gap that survives a stable 25-run window is a build difference, and the apples-to-apples read needs both builds' identities in the same leg log — the factory build already reports its own opt:/CFLAGS in the compute probe; the reference now answers in kind.
The fleet's macos-14 -> macos-15 move (aedeb62, ahead of GitHub's 2026-11-02 retirement) took the arm64 build toolchain from Apple Clang 15 (Xcode/CLT 15.4 — the published v0.3.3 exe's baked-in compiler string) to Apple Clang 17 (clang-1700.0.13.3, Xcode 16.3 and 16.4 alike — a DEVELOPER_DIR pin cannot discriminate, exp leg 45358458871). CPython 3.14's configure auto-enables the tail-calling interpreter when the compiler passes its musttail probe, and on the current fleet that shape reads a per-call compute ratio of 1.6-2.1 against the same-leg on-system 3.14.7 reference (runs 45349338822/45352240234/45353646257) — while the published clang-15 binary reads 1.099-1.122 head-to-head on the same image (run 45361240827 + rerun), and the same clang-17 build with --with-tail-call-interp=no reads 1.353 (run 45362178911). Mechanism and remedy proven on the current fleet: the 3.14 lines pin the classic interpreter on macOS, whatever toolchain the fleet carries next.
…eval" The flag is a no-op on this recipe, so the justification was wrong. CPython v3.14.7's configure.ac handles --with-tail-call-interp only as explicit yes -> AC_DEFINE(Py_TAIL_CALL_INTERP,1) / explicit no -> AC_DEFINE(...,0) / absent -> nothing; there is no musttail probe anywhere in configure.ac or the generated configure, and no header supplies a default. Every consumer (Python/ceval_macros.h, ceval.c, bytecodes.c, generated_cases.c.h, opcode_targets.h) tests the macro with #if, so an absent define and a define-to-0 compile identically. This recipe never passed =yes: v0.3.3 (clang 15) and the current clang-17 builds are all the classic computed-goto ceval already. The single green sample the flag produced (exp leg 45362178911, ratio 1.353) was a slow-instance draw: the same flag on this branch's own CI (run 45365694894) read 1.921 plain / 1.614 jit, and the unflagged recipe has drawn 1.353-1.510 passes on slow instances against 1.6-2.1 fails on fast ones. The mechanism hunt continues on exp/xcode-16.3-arm64; the pin is noise on main's recipe.
Summary
Follow-up to tebako#1095 (closed with the external verdict — every tebako layer exonerated on the current
macos-15-intelfleet; runs 45324096740/45330380303/45338794570): the compute-floor tripwire becomes runner-class-relative.The stale absolute 4.0 s ceiling was calibrated on the old fleet and is unachievable on the current
macos-15-intelclass by any x86_64 CPython — python.org's own build reads 4.26–6.66 s fib(35) there, while the tebako pair reads 4.270 s against the same-leg on-system reference's 4.258 s (parity ≈1.00). The gate is now a same-leg per-call-rate ratio, ≤ 1.5x, against an on-system reference measured in-leg.The mechanism
tools/compute_reference_probe.py(new) — the reference probe: fib(30), median of 25 runs, timed inside the interpreter (time.perf_counteraround each run; startup and the harness never enter the measurement). Printsn:/runs:/best:/median:; stdlib-only, any CPython. The median is the sustained-rate statistic at the tiny probe's scale — at ~0.1 s a run, a best-of-3 min samples the runner's instantaneous state (the first full-matrix run false-red two healthy macos-arm64 legs on exactly that, run 45344792366); the covenant's cells gate on medians for the same reason. The tebako arm keeps its fib(35) best-of-3 (tebako#1095's follow-up pins it; a 4.5 s run self-averages)._build-platform.yml— a sibling step pair on every build leg:actions/setup-python@5fda3b9…(v7.0.0 — the covenant's own pin/provisioner) at${{ matrix.reference_python }}, then a bash step times the probe on the leg's own runner and emits the median asref_secondswithref_n. The manifest lags the factory's exact micro pins for the older lines (3.11.16/3.12.14 — run 45344792366), so provisioning is exact-micro first with a loud line fallback (matrix.reference_line, a::notice::, and a generation assertion in the measure step — a major.minor mismatch is a named error, never a quiet ratio). Container legs measure on the ubuntu host (the container shares the host's silicon); the loudly-skipped windows leg skips too.scripts/compute_matrix.rbemitsreference_python(the line's base version — a jit leg's reference is the plain interpreter, the flavor is a build flag) andreference_lineper leg; the-jit/major_minorgrammar stays insidePythonVersion.tools/boot_smokecompute-floor: gates the tebako pair's fib(35) best-of-3 as a per-call-rate ratio against the reference — the naive recursive fib's call count is exact per N (T(n) = 2·F(n+1) − 1: T(30) = 2,692,537, T(35) = 29,860,703), so the arms' different Ns normalize and the ratio is a property of the built interpreter against the reference on the same runner, never of the fleet's absolute rate. A missing/malformed reference is a named wiring failure with the local remediation, never a silently degraded gate. The flags arm stays fail-closed in every mode.COMPUTE_FLOOR_MODE=warnon the macos-x86_64 legs) as insurance while the gate proves itself. REMOVAL CONDITION (implemented in the workflow comment): revert to fail-closed once the ratio gate reads green on two consecutive runs on the current fleet — the gate's own per-call-ratio log lines are the evidence.contract.ymlrecords tebako#1095's side finding as a named KNOWN-BAD in the link-unit history (the factory still builds the 0.3.x line — VERSION 0.3.5): the published v0.3.0 pair (link unit v2.8.49) reproducibly wedges on the current macos-15-intel fleet, never reaching the interpreter (3/3 reproductions — a ≥40-minute hang in run 45324096740; hard-killed at the 420 s bound in runs 45330380303/45338794570). The v0.2.0 (v2.3.2) and v0.3.5 (v2.8.78) pairs are unaffected; published pairs stay installable forever, so old-line consumers on that fleet resolve v0.3.5+.Evidence
diag/1095-x86-compute-probeson this repo, runs 45324096740, 45330380303, 45338794570) — tebako 4.270 s vs on-system reference 4.258 s fib(35) best-of-3 on a realmacos-15-intelrunner, ratio ≈1.00; Apple's/usr/bin/python37.9–12.1 s; raw C fib(40) 0.399–0.512 s.build-macosleg (tidy/x86_64) run 45344836537 — success,per-call ratio 1.438 (limit 1.5x), the fail-closed check name passing with no::warning::(first-commit mechanism; re-dispatched on the hardened arm, see the comments).bundle exec rspec— 90 examples, 0 failures;bundle exec scripts/check_contract.rb— validates (schema + parity arm);scripts/compute_matrix.rb(macos filter) — 12 legs with correctreference_python/reference_line;ruby -cclean; every workflow YAML +contract.yml+matrix.jsonparses.What CI must prove
build-macosleg (tidy/x86_64) run 45349361620 — the leg's log must show the reference median and the per-call ratio ≤ 1.5x with the warn tier unused (result in the comments).lint(contract + catalog + matrix + parse + rspec) green.Per the ecosystem rule this stays a draft — no merge until the owner calls it.