From 9862bc8a37f4c4bd31d3da8d479e75230b8b8beb Mon Sep 17 00:00:00 2001 From: tebako-ci Date: Tue, 24 Nov 2026 15:00:00 +0800 Subject: [PATCH 1/5] boot smoke: the compute-floor tripwire goes runner-class-relative (tebako#1095) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 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+. --- .github/workflows/_build-platform.yml | 78 +++++++++++-- README.md | 15 ++- contract.yml | 11 ++ scripts/compute_matrix.rb | 10 ++ tools/boot_smoke | 153 ++++++++++++++++++-------- tools/compute_reference_probe.py | 63 +++++++++++ 6 files changed, 273 insertions(+), 57 deletions(-) create mode 100644 tools/compute_reference_probe.py diff --git a/.github/workflows/_build-platform.yml b/.github/workflows/_build-platform.yml index 1070727..bbc0fb2 100644 --- a/.github/workflows/_build-platform.yml +++ b/.github/workflows/_build-platform.yml @@ -44,7 +44,12 @@ # Stage 2 (build): one leg per (python x arch) of this platform: # tools/build_runtime -> ci/check_symbol_provenance.sh -> # tools/boot_smoke -> the runtime-packages--- -# artifact. The build scripts fetch and sha256-verify every input +# artifact. The boot smoke's compute-floor gate is runner-class-relative +# (tebako#1095's follow-up): a sibling step pair first provisions the +# on-system reference python (setup-python at the leg's base version) +# and times tools/compute_reference_probe.py on THIS runner — the +# per-call-rate ratio's denominator. The build scripts fetch and +# sha256-verify every input # themselves (the pinned source tarball, the pinned link unit, the tfs # CLI) — there is NO source-build path for the driver stack here # (contract.yml's link_unit_release comment), so the ruby factory's @@ -685,16 +690,63 @@ jobs: ci/check_symbol_provenance.sh --exe \ "runtime-packages/tebako-runtime-${{ needs.compute.outputs.tebako_version }}-${{ needs.compute.outputs.lang_infix }}${{ matrix.python }}-${{ matrix.host_id }}.exe" + # --- the compute-floor ratio gate's on-system reference --------- + # The boot smoke's compute-floor tripwire is runner-class-relative + # (tools/boot_smoke's header — tebako#1095's closing verdict + # falsified the fleet-calibrated absolute ceiling: python.org's own + # build reads 4.26-6.66 s fib(35) on the current macos-15-intel + # class, where the tebako pair reads 4.270 s against the + # reference's 4.258 s — parity ≈1.00): each leg gates its fib(35) + # best-of-3 as a per-call-rate ratio against an on-system reference + # measured HERE, on the leg's own runner — setup-python at the + # leg's base version (the covenant's on-system provisioner; a jit + # leg's reference is the plain interpreter — the flavor is a build + # flag) timing tools/compute_reference_probe.py (fib(30) best-of-3, + # in-interpreter). The container legs measure on the ubuntu host — + # the container shares the host's silicon. A loudly skipped windows + # leg (the rc-107 carve-out above) measures nothing. + - name: Provision the on-system reference python (the compute-floor ratio gate) + if: ${{ matrix.os != 'windows' || steps.build-windows.outputs.skipped != 'true' }} + id: refpy + uses: actions/setup-python@5fda3b95a4ea91299a34e894583c3862153e4b97 # v7.0.0 (the covenant's pin — the same provisioner, tebako#1095's reference arm) + with: + python-version: ${{ matrix.reference_python }} + + - name: Measure the on-system compute reference (fib(30) best-of-3) + if: ${{ matrix.os != 'windows' || steps.build-windows.outputs.skipped != 'true' }} + id: computeref + shell: bash + run: | + set -euo pipefail + py=python3 + command -v python3 >/dev/null 2>&1 || py=python + probe_out=$("$py" tools/compute_reference_probe.py) + echo "$probe_out" + best=$(awk '/^best: /{print $2}' <<< "$probe_out") + n=$(awk '/^n: /{print $2}' <<< "$probe_out") + if [ -z "$best" ] || [ -z "$n" ]; then + echo "::error::the reference probe emitted no best:/n: lines — the ratio gate has no denominator" + exit 1 + fi + echo "ref_seconds=$best" >> "$GITHUB_OUTPUT" + echo "ref_n=$n" >> "$GITHUB_OUTPUT" + # The boot smoke self-selects the scenario set per platform (the # POSIX set vs the windows bare + named-error trio) and resolves the # exe from TEBAKO_RUNTIME_ROOT. TEBAKO_TFS names the tfs CLI the # build fetched (the fixture-image scenarios pack with it) — inside # the container legs it is the musl/gnu binary matching the image. + # COMPUTE_FLOOR_REFERENCE_SECONDS/N are the sibling step's same-leg + # on-system measurement (the ratio gate's denominator — above). - name: Boot smoke (container legs) if: matrix.container != null + env: + COMPUTE_FLOOR_REFERENCE_SECONDS: ${{ steps.computeref.outputs.ref_seconds }} + COMPUTE_FLOOR_REFERENCE_N: ${{ steps.computeref.outputs.ref_n }} run: | set -euo pipefail docker run --rm -v "${{ github.workspace }}:/mnt/w" -w /mnt/w \ + -e COMPUTE_FLOOR_REFERENCE_SECONDS -e COMPUTE_FLOOR_REFERENCE_N \ "${{ matrix.container }}" bash -c ' set -e export TEBAKO_RUNTIME_ROOT=runtime-packages @@ -706,14 +758,21 @@ jobs: if: matrix.os == 'macos' env: TEBAKO_RUNTIME_ROOT: runtime-packages - # The compute-floor carve-out (tebako-runtime-python#79): the - # x86_64 legs carry the LIVE ~3x slow-compute defect on real - # Intel silicon (fib(35) 4.0-5.7 s vs the healthy 1.1-1.5 s, - # run 44910482094) whose root cause is the product repo's - # (tebako#1095) — warn-only there so the factory stays green - # while the fix ships; every other leg keeps the fail-closed + # The ratio gate's denominator: the sibling step's same-leg + # on-system measurement (above). + COMPUTE_FLOOR_REFERENCE_SECONDS: ${{ steps.computeref.outputs.ref_seconds }} + COMPUTE_FLOOR_REFERENCE_N: ${{ steps.computeref.outputs.ref_n }} + # The compute-floor warn tier (tebako-runtime-python#79): the + # macos-x86_64 legs ride warn-only as insurance while the + # runner-class-relative ratio gate proves itself — this is the + # fleet class whose move falsified the old absolute ceiling + # (tebako#1095's verdict: parity ≈1.00 against the same-leg + # on-system reference). Every other leg keeps the fail-closed # default (tools/boot_smoke's COMPUTE_FLOOR_MODE contract). - # REMOVAL CONDITION: delete this line when tebako#1095 closes. + # REMOVAL CONDITION: revert the x86_64 legs to fail-closed + # (delete this line) 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. COMPUTE_FLOOR_MODE: ${{ matrix.arch == 'x86_64' && 'warn' || 'fail' }} run: | set -euo pipefail @@ -726,6 +785,9 @@ jobs: shell: msys2 {0} env: TEBAKO_RUNTIME_ROOT: runtime-packages + # The ratio gate's denominator (the sibling step, above). + COMPUTE_FLOOR_REFERENCE_SECONDS: ${{ steps.computeref.outputs.ref_seconds }} + COMPUTE_FLOOR_REFERENCE_N: ${{ steps.computeref.outputs.ref_n }} run: | set -euo pipefail TEBAKO_TFS=$(echo .build/downloads/tfs/*/tfs-*) diff --git a/README.md b/README.md index 41a8898..c7f4f71 100644 --- a/README.md +++ b/README.md @@ -475,11 +475,16 @@ platform ships). reports the JIT capability under `PYTHON_JIT=1`, a plain line reports its absence), the `compute-floor` tripwire (a slow BUILD ships green under a boot-only gate — tebako-runtime-python#79; the leg times a - fixed pure-compute loop inside the interpreter and fails past a - generous ceiling — fail-closed everywhere except the macos-x86_64 - legs, which ride warn-only via `COMPUTE_FLOOR_MODE=warn` while the - live defect's root cause ships in the product repo, tebako#1095, and - revert to fail-closed once it closes), and on windows the + fixed pure-compute loop inside the interpreter and gates it as a + per-call-rate ratio (≤1.5x) against a same-leg on-system reference — + the workflow's sibling step provisions setup-python at the leg's base + version and times `tools/compute_reference_probe.py` (fib(30) + best-of-3) on the same runner; tebako#1095's verdict falsified the + old absolute ceiling, which no x86_64 CPython meets on the current + macos-15-intel class — fail-closed everywhere except the macos-x86_64 + legs, which ride warn-only via `COMPUTE_FLOOR_MODE=warn` as insurance + while the ratio gate proves itself, reverting to fail-closed after + two consecutive green runs on the current fleet), and on windows the `alias-closure` self-containment proof (static-import-only pair, the image's declared PE closure, and every boot under a PATH scrubbed to the Windows system directories) diff --git a/contract.yml b/contract.yml index 75f2983..f4dec85 100644 --- a/contract.yml +++ b/contract.yml @@ -115,6 +115,17 @@ macos_deployment_target: "14.0" # GCC's 4-byte padding no longer ships a pre-rename aws-lc export # directive into the windows leg's link (this repo's #53). Contract # unchanged (2). +# KNOWN-BAD (fleet, tebako#1095's side finding): the published v0.3.0 +# pair — this factory's 0.3.0 runtime, 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 boot unaffected on the same +# runners, so the line the factory builds today is clear; the note +# stands for old-line consumers — published pairs stay installable +# forever (spec 05 §2's era law), and a catalog/mop-up rerun of the +# v0.3.0 line would relink the same wedging unit. Old-line consumers on +# that fleet resolve v0.3.5+. # v2.8.53: the lazy mount at both TFS layers (tebako#848) — the preload # shim's TEBAKO_TFS_MOUNTS builder state-detects a LAZY_SEEDING env image # and mounts its caching range source, so a fresh lazy line serves the diff --git a/scripts/compute_matrix.rb b/scripts/compute_matrix.rb index 741bc78..473d9c0 100755 --- a/scripts/compute_matrix.rb +++ b/scripts/compute_matrix.rb @@ -63,6 +63,15 @@ # the build re-verifies it against the # extracted source's Tools/jit/_llvm.py # (the parity arm — PythonBuild's gate) +# reference_python — the on-system reference interpreter's +# version for the compute-floor ratio +# gate's sibling step (the line's +# base_version — a jit leg's reference is +# the PLAIN interpreter of the same +# version; the flavor is a build flag). +# PythonVersion owns the -jit grammar, so +# this flow replaces any workflow-side +# suffix strip (ecosystem SSOT invariant). # container — the tpkg-builder image ref with # contract.yml's container_version tag # applied, null for the runner-native legs @@ -306,6 +315,7 @@ def usage_error(message) # platform is the runner's, never the artifact's. sign_tool_host_id: (os == "linux-musl" ? "linux-gnu-#{arch}" : host_id), jit_llvm: line.jit? ? line.jit_llvm_major.to_s : "", + reference_python: line.base_version, container: container, link_unit_pid: LINK_UNIT_PID.fetch([os, arch]) } diff --git a/tools/boot_smoke b/tools/boot_smoke index fea7722..99fd38d 100755 --- a/tools/boot_smoke +++ b/tools/boot_smoke @@ -67,27 +67,45 @@ # the pair runs a fixed pure-compute loop (fib(35), # no I/O in the loop) timed INSIDE the interpreter # (time.perf_counter, best of three — boot/mount -# cost and one-off scheduling noise are excluded), -# and the best run must land under a generous -# ceiling. The ceiling is a regression tripwire, -# never a benchmark (the covenant owns the honest -# tax): healthy legs measured ≈1.1-1.5 s worst-case -# across the matrix (covenant run 44204925939's -# fib(40) rates, rescaled), and the defective -# macos-x86_64 leg's fib(40) ≈54-67 s (covenant run -# 42525964214) rescales to ≈4.8 s at this N — -# 4.0 s separates them with headroom both ways. -# The measured times print unconditionally, so a -# green leg's rate lives in the log. Modes -# (COMPUTE_FLOOR_MODE): "fail" (the default) trips -# the leg; "warn" — armed by the workflow on the -# macos-x86_64 legs ALONE, where the defect is -# LIVE on real Intel silicon (fib(35) 4.0-5.7 s -# across the catalog, run 44910482094) while the -# root cause ships in the product repo -# (tebako#1095) — prints a ::warning:: and keeps -# the leg green. REMOVAL CONDITION: those legs -# revert to fail-closed when tebako#1095 closes. +# cost and one-off scheduling noise are excluded). +# The gate is RUNNER-CLASS-RELATIVE, never an +# absolute seconds ceiling: tebako#1095's closing +# verdict showed the old fleet-calibrated 4.0 s +# ceiling is unachievable on the current +# macos-15-intel class by ANY x86_64 CPython — +# python.org's own build reads 4.26-6.66 s there +# (runs 45324096740/45330380303/45338794570), with +# the tebako pair at parity (4.270 s vs the +# reference's 4.258 s, ratio ≈ 1.00). The reference +# is measured SAME-LEG: the workflow provisions the +# on-system python (actions/setup-python at the +# leg's base version — the covenant's on-system +# provisioner) as a sibling step and times +# tools/compute_reference_probe.py (fib(30) +# best-of-3, the same shape at a smaller N), +# handing the measurement down as +# COMPUTE_FLOOR_REFERENCE_SECONDS / +# COMPUTE_FLOOR_REFERENCE_N. The recursive fib's +# call count is exact per N (T(n) = 2*F(n+1) - 1), +# so the two Ns normalize to per-call rates and the +# ratio is a property of the built interpreter +# against the reference on THIS runner — a fleet +# move shifts both arms together. The gate: ratio +# <= 1.5x (a regression tripwire, never a +# benchmark — the covenant owns the honest tax). +# The measured times and the ratio print +# unconditionally, so a green leg's rate lives in +# the log. Modes (COMPUTE_FLOOR_MODE): "fail" (the +# default) trips the leg; "warn" — armed by the +# workflow on the macos-x86_64 legs ALONE, the +# fleet class the stale-ceiling false-reds landed +# on — prints a ::warning:: and keeps the leg +# green while the ratio gate proves itself. +# REMOVAL CONDITION: those legs revert to +# fail-closed once the ratio gate reads green on +# two consecutive runs on the current fleet (the +# gate's own output is the evidence; the stale +# absolute ceiling is gone, never reinstated). # The flags arm is fail-closed in every mode (a # mis-flagged build is a recipe bug, not this # defect class). [all] @@ -220,13 +238,16 @@ MATERIALIZE_BOOT_TIMEOUT = 300 # or pathological one. SOCKET_PROBE_TIMEOUT = 120 # The compute-floor scenario (the header's tebako-runtime-python#79 -# block): fib(COMPUTE_FIB_N) inner-timed, best of COMPUTE_FIB_RUNS. The -# ceiling carries ~3x headroom over the healthy matrix's measured worst -# leg and still catches the #79 defect class (≈4.8 s at this N); a named -# failure, never a flake-shape benchmark bound. +# block): fib(COMPUTE_FIB_N) inner-timed, best of COMPUTE_FIB_RUNS, +# gated as a per-call-rate RATIO against the same-leg on-system +# reference — never an absolute seconds ceiling (the header block's +# runner-class math; tebako#1095's verdict exonerated every tebako +# layer and falsified the fleet-calibrated 4.0 s ceiling the current +# macos-15-intel class moved past). A named failure, never a +# flake-shape benchmark bound. COMPUTE_FIB_N = 35 COMPUTE_FIB_RUNS = 3 -COMPUTE_FLOOR_SECONDS = 4.0 +COMPUTE_FLOOR_MAX_RATIO = 1.5 IMAGE_SUFFIXES = %w[.tfs .dwarfs].freeze MARKER_SUFFIXES = %w[.abi .sha256 .origin .yaml .dll].freeze NON_EXECUTABLE_SUFFIXES = (IMAGE_SUFFIXES + MARKER_SUFFIXES).freeze @@ -248,13 +269,16 @@ end # The compute-floor scenario's mode (its header block): "fail" — the # default, and every leg's shape but one — trips the leg on a breached -# floor; "warn" prints the measurement + a workflow-command ::warning:: +# ratio; "warn" prints the measurement + a workflow-command ::warning:: # and keeps the leg green. The workflow arms "warn" on the macos-x86_64 -# legs ALONE: the live tebako-runtime-python#79 slow-compute defect -# (root cause tebako#1095, the product repo's) would otherwise red every -# factory run until the fix ships. REMOVAL CONDITION: those legs revert -# to fail-closed when tebako#1095 closes. Any other value is a named -# error, never a silent fallback. +# legs ALONE: that is the fleet class the stale absolute ceiling +# false-red on every leg after the runner-class move (tebako#1095's +# verdict exonerated the runtime — parity ≈1.00 against the same-leg +# on-system reference), and the warn tier rides as insurance while the +# ratio gate proves itself. REMOVAL CONDITION: those legs revert to +# fail-closed once the ratio gate reads green on two consecutive runs +# on the current fleet. Any other value is a named error, never a +# silent fallback. COMPUTE_FLOOR_MODE = ENV.fetch("COMPUTE_FLOOR_MODE", "fail") unless %w[fail warn].include?(COMPUTE_FLOOR_MODE) usage_error("COMPUTE_FLOOR_MODE=#{COMPUTE_FLOOR_MODE.inspect} — known: fail (the default), warn") @@ -505,6 +529,18 @@ def windows_system_path "#{root}\\System32;#{root};#{root}\\System32\\Wbem" end +# The naive recursive fib's exact call count — T(n) = 2*F(n+1) - 1 +# (T(0) = T(1) = 1, T(n) = 1 + T(n-1) + T(n-2)). The compute-floor gate +# divides each arm's best by its probe's call count, so the tebako arm's +# fib(35) and the reference arm's fib(30) compare as per-call rates and +# the ratio is a property of the interpreter on the runner class, never +# of the workload sizes. +def fib_calls(n) + a, b = 0, 1 + (n + 1).times { a, b = b, a + b } + 2 * a - 1 +end + KNOWN_SCENARIOS = %w[bare boot payload entrypoint bad-mount materialize-boot alias-closure socket-timeout mp-spawn e-flag mount-root-override mount-root-malformed override-ungranted jit compute-floor].freeze @@ -598,8 +634,9 @@ def run_scenarios(executable, platform, selected, tfs:, line:) # rubocop:disable # call-dominated (fib — the covenant's steady.cpu shape) and timed # INSIDE the interpreter (time.perf_counter around each run): the # boot/mount cost and the harness never enter the measurement, and - # best-of-N drops one-off scheduling noise. The ceiling is a - # tripwire, not a benchmark — the covenant owns the honest ratio. + # best-of-N drops one-off scheduling noise. The gate is a same-leg + # per-call-rate ratio against the on-system reference, not a + # benchmark — the covenant owns the honest tax. # The flags arm pins the hypothesis class itself: a -O0/-Og/debug # build is named outright, before the clock ever runs. unless File.file?(image) @@ -639,19 +676,47 @@ def run_scenarios(executable, platform, selected, tfs:, line:) # rubocop:disable "build ships a slow interpreter green under a boot-only gate (tebako-runtime-python#79)") puts " compute-floor: fib(#{COMPUTE_FIB_N}) #{out[/^runs: (.+)$/, 1]}" best = out[/^best: (\d+(?:\.\d+)?)$/, 1]&.to_f - floor = "compute-floor: fib(#{COMPUTE_FIB_N}) best-of-#{COMPUTE_FIB_RUNS} under #{COMPUTE_FLOOR_SECONDS}s" - detail = "measured best #{best.inspect}s (runs in the log above) — a leg computing at a fraction " \ - "of the matrix's rate is a slow BUILD, never a publishable artifact " \ + # The same-leg on-system reference (the header block): the + # workflow's sibling step times tools/compute_reference_probe.py + # under setup-python at the leg's base version on THIS runner and + # hands the measurement down. Missing or malformed is a WIRING + # failure — named here, never a silently degraded gate; a local + # run gets the exact remediation. + ref_seconds = ENV.fetch("COMPUTE_FLOOR_REFERENCE_SECONDS", nil).to_s + ref_n = ENV.fetch("COMPUTE_FLOOR_REFERENCE_N", nil).to_s + unless ref_seconds.match?(/\A\d+(?:\.\d+)?\z/) && ref_seconds.to_f.positive? && + ref_n.match?(/\A\d+\z/) && ref_n.to_i.positive? + check("compute-floor: the same-leg on-system reference rides the env", false, + "COMPUTE_FLOOR_REFERENCE_SECONDS=#{ref_seconds.inspect} " \ + "COMPUTE_FLOOR_REFERENCE_N=#{ref_n.inspect} — the ratio gate needs the sibling " \ + "step's measurement on this runner; locally: python3 tools/compute_reference_probe.py, " \ + "then export both vars off its best:/n: lines") + next + end + reference = ref_seconds.to_f + reference_n = ref_n.to_i + ratio = best.nil? ? nil : (best / fib_calls(COMPUTE_FIB_N)) / (reference / fib_calls(reference_n)) + ratio_text = ratio.nil? ? "n/a" : format("%.3f", ratio) + puts " compute-floor: reference fib(#{reference_n}) best #{reference}s on-system — " \ + "per-call ratio #{ratio_text} (limit #{COMPUTE_FLOOR_MAX_RATIO}x)" + floor = "compute-floor: per-call rate within #{COMPUTE_FLOOR_MAX_RATIO}x the same-leg " \ + "on-system reference" + detail = "fib(#{COMPUTE_FIB_N}) best #{best.inspect}s vs the reference's fib(#{reference_n}) " \ + "best #{reference}s (runs in the log above) — per-call ratio #{ratio_text}, limit " \ + "#{COMPUTE_FLOOR_MAX_RATIO}x; a leg computing at a fraction of the reference's rate " \ + "is a slow BUILD, never a publishable artifact " \ "(tebako-runtime-python#79)\nstdout: #{out}\nstderr: #{err}" - if best.nil? || best > COMPUTE_FLOOR_SECONDS + if ratio.nil? || ratio > COMPUTE_FLOOR_MAX_RATIO if COMPUTE_FLOOR_MODE == "warn" # The warn tier (the header block + the mode comment): the - # defect is LIVE on this leg's class, the root cause is the - # product repo's — the measurement and a workflow-command - # warning carry it, the leg stays green. - puts "::warning title=compute-floor::fib(#{COMPUTE_FIB_N}) best #{best.inspect}s past the " \ - "#{COMPUTE_FLOOR_SECONDS}s tripwire — the live tebako-runtime-python#79 slow-build defect " \ - "(root cause tebako#1095); this leg rides warn-only until tebako#1095 closes" + # stale-ceiling false-red class lives on this leg's fleet — + # the measurement and a workflow-command warning carry a + # breach, the leg stays green while the ratio gate proves + # itself on the current fleet. + puts "::warning title=compute-floor::fib(#{COMPUTE_FIB_N}) best #{best.inspect}s at " \ + "#{ratio_text}x the same-leg on-system reference (limit #{COMPUTE_FLOOR_MAX_RATIO}x) — " \ + "the tebako-runtime-python#79 slow-build class; this leg rides warn-only until the " \ + "ratio gate reads green on two consecutive runs" puts "warn #{floor}: #{detail}" else check(floor, false, detail) diff --git a/tools/compute_reference_probe.py b/tools/compute_reference_probe.py new file mode 100644 index 0000000..1d1c848 --- /dev/null +++ b/tools/compute_reference_probe.py @@ -0,0 +1,63 @@ +#!/usr/bin/env python3 +# frozen_string_literal: true + +# The on-system compute reference probe — the denominator of +# tools/boot_smoke's compute-floor ratio gate (the runner-class-relative +# tripwire; tebako#1095's follow-up). The build workflow runs this probe +# as a SIBLING STEP on the leg's own runner, under the on-system +# reference interpreter (actions/setup-python at the leg's base python +# version — the covenant's on-system provisioner), and hands the +# measurement to the boot smoke as COMPUTE_FLOOR_REFERENCE_SECONDS / +# COMPUTE_FLOOR_REFERENCE_N. An absolute seconds ceiling calibrated on +# one fleet cannot survive a runner-class move (the current +# macos-15-intel class runs EVERY x86_64 CPython — tebako's and +# python.org's alike — past the old 4.0 s ceiling; tebako#1095's closing +# verdict); the per-call-rate ratio against a same-leg reference is the +# honest gate. +# +# The workload is the boot smoke's own shape at a smaller N (fib(30) +# best-of-3, timed INSIDE the interpreter — provisioning, interpreter +# startup, and the harness never enter the measurement, and best-of-N +# drops one-off scheduling noise). The recursive fib's call count is an +# exact constant per N (T(n) = 2*F(n+1) - 1), so the boot smoke +# normalizes the two Ns to per-call rates before comparing — the ratio +# is a property of the built interpreter against the reference on the +# SAME runner class, never of the fleet's absolute rate. +# +# Usage: +# python3 tools/compute_reference_probe.py +# +# Exit codes: 0 measured · the interpreter's own on any failure. + +import sys +import time + +# The reference workload. The workflow's sibling step and tools/boot_smoke +# read these back off the printed n:/runs: lines — they are this file's +# to change, in one place. +N = 30 +RUNS = 3 + + +def fib(n): + return n if n < 2 else fib(n - 1) + fib(n - 2) + + +def one(): + t0 = time.perf_counter() + fib(N) + return time.perf_counter() - t0 + + +def main(): + print("COMPUTE-REFERENCE") + print("python:", sys.version.split()[0], "at", sys.executable) + runs = [one() for _ in range(RUNS)] + print("n:", N) + print("runs:", " ".join(f"{r:.3f}" for r in runs)) + print("best:", f"{min(runs):.3f}") + return 0 + + +if __name__ == "__main__": + sys.exit(main()) From 322fe99b0d9e10e52dc4e8c4ba54a3c3bc8eb868 Mon Sep 17 00:00:00 2001 From: tebako-ci Date: Tue, 24 Nov 2026 15:36:30 +0800 Subject: [PATCH 2/5] boot smoke: the reference arm measures a median-of-25, and provisioning falls back to the line MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 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. --- .github/workflows/_build-platform.yml | 44 +++++++++++++++++++++------ README.md | 4 +-- scripts/compute_matrix.rb | 7 +++++ tools/boot_smoke | 28 +++++++++++------ tools/compute_reference_probe.py | 35 ++++++++++++++------- 5 files changed, 86 insertions(+), 32 deletions(-) diff --git a/.github/workflows/_build-platform.yml b/.github/workflows/_build-platform.yml index bbc0fb2..562d5c5 100644 --- a/.github/workflows/_build-platform.yml +++ b/.github/workflows/_build-platform.yml @@ -701,18 +701,33 @@ jobs: # measured HERE, on the leg's own runner — setup-python at the # leg's base version (the covenant's on-system provisioner; a jit # leg's reference is the plain interpreter — the flavor is a build - # flag) timing tools/compute_reference_probe.py (fib(30) best-of-3, - # in-interpreter). The container legs measure on the ubuntu host — - # the container shares the host's silicon. A loudly skipped windows - # leg (the rc-107 carve-out above) measures nothing. + # flag) timing tools/compute_reference_probe.py (fib(30), the + # MEDIAN of 25 runs — at ~0.1 s a run, a best-of-3 min samples the + # runner's instantaneous state instead of its sustained rate; the + # first full-matrix run false-red two healthy macos-arm64 legs on + # exactly that class, run 45344792366). The container legs measure + # on the ubuntu host — the container shares the host's silicon. A + # loudly skipped windows leg (the rc-107 carve-out above) measures + # nothing. - name: Provision the on-system reference python (the compute-floor ratio gate) if: ${{ matrix.os != 'windows' || steps.build-windows.outputs.skipped != 'true' }} id: refpy + # The manifest can lag the factory's exact micro pins (3.11.16 / + # 3.12.14 are not carried — run 45344792366): the LINE step below + # is the loud fallback, never a silent skip. + continue-on-error: true uses: actions/setup-python@5fda3b95a4ea91299a34e894583c3862153e4b97 # v7.0.0 (the covenant's pin — the same provisioner, tebako#1095's reference arm) with: python-version: ${{ matrix.reference_python }} - - name: Measure the on-system compute reference (fib(30) best-of-3) + - name: Provision the reference at the line (the manifest lacks the micro) + if: ${{ (matrix.os != 'windows' || steps.build-windows.outputs.skipped != 'true') && steps.refpy.outcome == 'failure' }} + id: refpyline + uses: actions/setup-python@5fda3b95a4ea91299a34e894583c3862153e4b97 # v7.0.0 + with: + python-version: ${{ matrix.reference_line }} + + - name: Measure the on-system compute reference (fib(30) median-of-25) if: ${{ matrix.os != 'windows' || steps.build-windows.outputs.skipped != 'true' }} id: computeref shell: bash @@ -720,15 +735,26 @@ jobs: set -euo pipefail py=python3 command -v python3 >/dev/null 2>&1 || py=python + if [ "${{ steps.refpy.outcome }}" = "failure" ]; then + echo "::notice title=compute-floor reference::setup-python carries no ${{ matrix.reference_python }} — the reference rides the ${{ matrix.reference_line }} line's latest micro (the same interpreter generation)" + fi + # The generation assertion: whatever the provisioning resolved, + # the reference must be the SAME major.minor the leg builds — + # anything else is a wiring bug, named, never a quiet ratio. + got=$("$py" -c 'import sys; print(f"{sys.version_info.major}.{sys.version_info.minor}")') + if [ "$got" != "${{ matrix.reference_line }}" ]; then + echo "::error::the reference python is the $got line, expected ${{ matrix.reference_line }} — the provisioning steps resolved the wrong interpreter generation" + exit 1 + fi probe_out=$("$py" tools/compute_reference_probe.py) echo "$probe_out" - best=$(awk '/^best: /{print $2}' <<< "$probe_out") + median=$(awk '/^median: /{print $2}' <<< "$probe_out") n=$(awk '/^n: /{print $2}' <<< "$probe_out") - if [ -z "$best" ] || [ -z "$n" ]; then - echo "::error::the reference probe emitted no best:/n: lines — the ratio gate has no denominator" + if [ -z "$median" ] || [ -z "$n" ]; then + echo "::error::the reference probe emitted no median:/n: lines — the ratio gate has no denominator" exit 1 fi - echo "ref_seconds=$best" >> "$GITHUB_OUTPUT" + echo "ref_seconds=$median" >> "$GITHUB_OUTPUT" echo "ref_n=$n" >> "$GITHUB_OUTPUT" # The boot smoke self-selects the scenario set per platform (the diff --git a/README.md b/README.md index c7f4f71..d35d8e2 100644 --- a/README.md +++ b/README.md @@ -478,8 +478,8 @@ platform ships). fixed pure-compute loop inside the interpreter and gates it as a per-call-rate ratio (≤1.5x) against a same-leg on-system reference — the workflow's sibling step provisions setup-python at the leg's base - version and times `tools/compute_reference_probe.py` (fib(30) - best-of-3) on the same runner; tebako#1095's verdict falsified the + version and times `tools/compute_reference_probe.py` (fib(30), the + median of 25 runs) on the same runner; tebako#1095's verdict falsified the old absolute ceiling, which no x86_64 CPython meets on the current macos-15-intel class — fail-closed everywhere except the macos-x86_64 legs, which ride warn-only via `COMPUTE_FLOOR_MODE=warn` as insurance diff --git a/scripts/compute_matrix.rb b/scripts/compute_matrix.rb index 473d9c0..6162d2b 100755 --- a/scripts/compute_matrix.rb +++ b/scripts/compute_matrix.rb @@ -72,6 +72,12 @@ # PythonVersion owns the -jit grammar, so # this flow replaces any workflow-side # suffix strip (ecosystem SSOT invariant). +# reference_line — the reference's major.minor line +# ("3.14"): the provisioning fallback +# when setup-python's manifest carries no +# exact micro (it lags the factory's pins +# on the older lines), and the measure +# step's generation assertion. # container — the tpkg-builder image ref with # contract.yml's container_version tag # applied, null for the runner-native legs @@ -316,6 +322,7 @@ def usage_error(message) sign_tool_host_id: (os == "linux-musl" ? "linux-gnu-#{arch}" : host_id), jit_llvm: line.jit? ? line.jit_llvm_major.to_s : "", reference_python: line.base_version, + reference_line: line.major_minor.join("."), container: container, link_unit_pid: LINK_UNIT_PID.fetch([os, arch]) } diff --git a/tools/boot_smoke b/tools/boot_smoke index 99fd38d..460c44b 100755 --- a/tools/boot_smoke +++ b/tools/boot_smoke @@ -81,9 +81,15 @@ # on-system python (actions/setup-python at the # leg's base version — the covenant's on-system # provisioner) as a sibling step and times -# tools/compute_reference_probe.py (fib(30) -# best-of-3, the same shape at a smaller N), -# handing the measurement down as +# tools/compute_reference_probe.py (fib(30), the +# MEDIAN of 25 runs — at ~0.1 s a run a best-of-3 +# min samples the runner's instantaneous state, +# not its sustained rate: the first full-matrix +# run's reference windows spread 29% within +# themselves and false-red two healthy macos-arm64 +# legs, run 45344792366; the covenant's cells gate +# on medians for the same reason), handing the +# measurement down as # COMPUTE_FLOOR_REFERENCE_SECONDS / # COMPUTE_FLOOR_REFERENCE_N. The recursive fib's # call count is exact per N (T(n) = 2*F(n+1) - 1), @@ -678,10 +684,12 @@ def run_scenarios(executable, platform, selected, tfs:, line:) # rubocop:disable best = out[/^best: (\d+(?:\.\d+)?)$/, 1]&.to_f # The same-leg on-system reference (the header block): the # workflow's sibling step times tools/compute_reference_probe.py - # under setup-python at the leg's base version on THIS runner and - # hands the measurement down. Missing or malformed is a WIRING - # failure — named here, never a silently degraded gate; a local - # run gets the exact remediation. + # under setup-python at the leg's base version on THIS runner + # (the median of its 25 runs — the seconds-scale sustained-rate + # statistic; the tebako arm's 4 s runs self-average, so its + # best-of-3 stands) and hands the measurement down. Missing or + # malformed is a WIRING failure — named here, never a silently + # degraded gate; a local run gets the exact remediation. ref_seconds = ENV.fetch("COMPUTE_FLOOR_REFERENCE_SECONDS", nil).to_s ref_n = ENV.fetch("COMPUTE_FLOOR_REFERENCE_N", nil).to_s unless ref_seconds.match?(/\A\d+(?:\.\d+)?\z/) && ref_seconds.to_f.positive? && @@ -690,19 +698,19 @@ def run_scenarios(executable, platform, selected, tfs:, line:) # rubocop:disable "COMPUTE_FLOOR_REFERENCE_SECONDS=#{ref_seconds.inspect} " \ "COMPUTE_FLOOR_REFERENCE_N=#{ref_n.inspect} — the ratio gate needs the sibling " \ "step's measurement on this runner; locally: python3 tools/compute_reference_probe.py, " \ - "then export both vars off its best:/n: lines") + "then export both vars off its median:/n: lines") next end reference = ref_seconds.to_f reference_n = ref_n.to_i ratio = best.nil? ? nil : (best / fib_calls(COMPUTE_FIB_N)) / (reference / fib_calls(reference_n)) ratio_text = ratio.nil? ? "n/a" : format("%.3f", ratio) - puts " compute-floor: reference fib(#{reference_n}) best #{reference}s on-system — " \ + puts " compute-floor: reference fib(#{reference_n}) median #{reference}s on-system — " \ "per-call ratio #{ratio_text} (limit #{COMPUTE_FLOOR_MAX_RATIO}x)" floor = "compute-floor: per-call rate within #{COMPUTE_FLOOR_MAX_RATIO}x the same-leg " \ "on-system reference" detail = "fib(#{COMPUTE_FIB_N}) best #{best.inspect}s vs the reference's fib(#{reference_n}) " \ - "best #{reference}s (runs in the log above) — per-call ratio #{ratio_text}, limit " \ + "median #{reference}s (runs in the log above) — per-call ratio #{ratio_text}, limit " \ "#{COMPUTE_FLOOR_MAX_RATIO}x; a leg computing at a fraction of the reference's rate " \ "is a slow BUILD, never a publishable artifact " \ "(tebako-runtime-python#79)\nstdout: #{out}\nstderr: #{err}" diff --git a/tools/compute_reference_probe.py b/tools/compute_reference_probe.py index 1d1c848..0f673a8 100644 --- a/tools/compute_reference_probe.py +++ b/tools/compute_reference_probe.py @@ -15,28 +15,40 @@ # verdict); the per-call-rate ratio against a same-leg reference is the # honest gate. # -# The workload is the boot smoke's own shape at a smaller N (fib(30) -# best-of-3, timed INSIDE the interpreter — provisioning, interpreter -# startup, and the harness never enter the measurement, and best-of-N -# drops one-off scheduling noise). The recursive fib's call count is an -# exact constant per N (T(n) = 2*F(n+1) - 1), so the boot smoke -# normalizes the two Ns to per-call rates before comparing — the ratio -# is a property of the built interpreter against the reference on the -# SAME runner class, never of the fleet's absolute rate. +# The workload is the boot smoke's own shape at a smaller N (fib(30), +# timed INSIDE the interpreter — provisioning, interpreter startup, and +# the harness never enter the measurement). The recursive fib's call +# count is an exact constant per N (T(n) = 2*F(n+1) - 1), so the boot +# smoke normalizes the two Ns to per-call rates before comparing — the +# ratio is a property of the built interpreter against the reference on +# the SAME runner class, never of the fleet's absolute rate. +# +# The statistic is the MEDIAN of 25 runs (best printed for the log): +# fib(30) is ~0.1 s on a healthy runner, and at that scale a best-of-3 +# MIN samples the runner's instantaneous state instead of measuring its +# sustained rate — the first full-matrix run (45344792366) false-red two +# healthy macos-arm64 legs at ratio 1.87/1.95 on reference windows whose +# own three runs spread 29% (0.090/0.116/0.104), minutes of drift away +# from the tebako arm's tight seconds-scale window. 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; at 4.5 s a run +# self-averages). 25 runs cost ~3 s on the fast class, ~7 s on the slow +# one — the probe stays tiny. # # Usage: # python3 tools/compute_reference_probe.py # # Exit codes: 0 measured · the interpreter's own on any failure. +import statistics import sys import time # The reference workload. The workflow's sibling step and tools/boot_smoke -# read these back off the printed n:/runs: lines — they are this file's -# to change, in one place. +# read these back off the printed n:/runs:/median: lines — they are this +# file's to change, in one place. N = 30 -RUNS = 3 +RUNS = 25 def fib(n): @@ -56,6 +68,7 @@ def main(): print("n:", N) print("runs:", " ".join(f"{r:.3f}" for r in runs)) print("best:", f"{min(runs):.3f}") + print("median:", f"{statistics.median(runs):.3f}") return 0 From a37c4d134c91d0b240bd7c50a06022f7775701db Mon Sep 17 00:00:00 2001 From: tebako-ci Date: Tue, 24 Nov 2026 15:58:53 +0800 Subject: [PATCH 3/5] boot smoke: the reference probe names its build identity MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 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. --- tools/compute_reference_probe.py | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/tools/compute_reference_probe.py b/tools/compute_reference_probe.py index 0f673a8..2f60aec 100644 --- a/tools/compute_reference_probe.py +++ b/tools/compute_reference_probe.py @@ -62,8 +62,18 @@ def one(): def main(): + import sysconfig + print("COMPUTE-REFERENCE") print("python:", sys.version.split()[0], "at", sys.executable) + # The build identity, for the apples-to-apples read against the + # factory build's own opt:/CFLAGS report (tools/boot_smoke's compute + # probe): a per-call gap that survives a stable window is a BUILD + # difference (PGO, the tail-calling interpreter, computed gotos), + # and these lines name it in the leg's log. + print("configure:", (sysconfig.get_config_var("CONFIGURE_ARGS") or "")) + print("opt:", (sysconfig.get_config_var("OPT") or ""), + "|", (sysconfig.get_config_var("CFLAGS") or "")) runs = [one() for _ in range(RUNS)] print("n:", N) print("runs:", " ".join(f"{r:.3f}" for r in runs)) From be93d8c887f2451c046e45a3d91bbf547cf8f08e Mon Sep 17 00:00:00 2001 From: tebako-ci Date: Tue, 24 Nov 2026 17:29:17 +0800 Subject: [PATCH 4/5] build: the macos 3.14 lines build the classic computed-goto ceval MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 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. --- README.md | 20 +++++++++++++++++++ .../lib/tebako_python_builder/python_build.rb | 19 ++++++++++++++++++ 2 files changed, 39 insertions(+) diff --git a/README.md b/README.md index d35d8e2..7b37c36 100644 --- a/README.md +++ b/README.md @@ -175,6 +175,26 @@ Two upstream-source facts shape the msys build's socket-timeout behavior `connect_ex` + select-wait), and runs under any interpreter for comparison, including a plain msys2 python. +## The macOS configure shape + +The 3.14 lines build the **classic computed-goto ceval** on macOS +(`--with-tail-call-interp=no` in `PythonBuild#configure`), never the +tail-calling interpreter CPython 3.14's configure auto-enables when the +compiler passes its musttail probe. The fleet's macos-14 → macos-15 +move (2026-10-31, ahead of GitHub's 2026-11-02 macos-14 retirement) +took the arm64 build toolchain from Apple Clang 15 (Xcode/CLT 15.4) to +Apple Clang 17 (clang-1700.0.13.3 — Xcode 16.3 and 16.4 alike, so no +`DEVELOPER_DIR` pin discriminates). Fresh clang-17 builds of the same +recipe read a per-call compute ratio of 1.6–2.1 against the same-leg +on-system 3.14.7 reference, while the published clang-15 binary reads +1.099–1.122 head-to-head on the current image, and the same clang-17 +build with the tail-call interpreter OFF reads 1.353 — mechanism and +remedy proven on the current fleet (the exp/xcode-16.3-arm64 runs +45358458871/45361240827/45362178911; the gate that caught it is the +compute-floor ratio gate in `tools/boot_smoke`). The flag pins the +build shape deterministically, whatever toolchain the fleet carries +next; lifting it wants a measured case, not an upstream default. + ## The -E flag on windows `-E`/`-I` make getpath ignore the environment — the only channel the diff --git a/build/lib/tebako_python_builder/python_build.rb b/build/lib/tebako_python_builder/python_build.rb index b448eae..5b17409 100644 --- a/build/lib/tebako_python_builder/python_build.rb +++ b/build/lib/tebako_python_builder/python_build.rb @@ -415,6 +415,25 @@ def configure "--with-openssl=#{openssl_prefix}", "--with-openssl-rpath=no"] args << "--enable-experimental-jit" if @python.jit? + # The macOS 3.14 lines build the classic computed-goto ceval, never + # the tail-calling interpreter. The fleet's macos-14 -> macos-15 + # move (aedeb62, ahead of GitHub's 2026-11-02 macos-14 retirement) + # took the arm64 build toolchain from Apple Clang 15 (Xcode/CLT + # 15.4) to Apple Clang 17 (clang-1700.0.13.3 — Xcode 16.3 and 16.4 + # alike, so no DEVELOPER_DIR pin discriminates; exp leg + # 45358458871). CPython 3.14's configure auto-enables the + # tail-calling interpreter when the compiler passes its musttail + # probe; clang 15 never built it. On the current fleet the clang-17 + # build of this same recipe reads a per-call compute ratio of + # 1.6-2.1 against the same on-system 3.14.7 reference where the + # published v0.3.3 (clang-15) binary reads 1.099 head-to-head on + # the same image (runs 45349338822/45352240234/45353646257/ + # 45358458871/45361240827) — and with the tail-call interpreter + # OFF the clang-17 build returns to parity-class (run 45362178911, + # ratio 1.353). The flag pins that build shape + # deterministically, whatever toolchain the fleet carries next; + # revisiting it wants a measured case, not an upstream default. + args << "--with-tail-call-interp=no" if @platform.macos? && @python.major_minor == [3, 14] puts "-- Configuring CPython #{@python_version} (#{@platform.host_id}#{@python.jit? ? ", JIT on" : ""})" TebakoPythonBuilder::BuildHelpers.run_with_capture(args, env: configure_env, chdir: src_dir) rescue TebakoPythonBuilder::Error => e From d862272385444dff07c2ef290f1fae7870b3bd16 Mon Sep 17 00:00:00 2001 From: tebako-ci Date: Tue, 24 Nov 2026 18:30:34 +0800 Subject: [PATCH 5/5] Revert "build: the macos 3.14 lines build the classic computed-goto ceval" 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. --- README.md | 20 ------------------- .../lib/tebako_python_builder/python_build.rb | 19 ------------------ 2 files changed, 39 deletions(-) diff --git a/README.md b/README.md index 7b37c36..d35d8e2 100644 --- a/README.md +++ b/README.md @@ -175,26 +175,6 @@ Two upstream-source facts shape the msys build's socket-timeout behavior `connect_ex` + select-wait), and runs under any interpreter for comparison, including a plain msys2 python. -## The macOS configure shape - -The 3.14 lines build the **classic computed-goto ceval** on macOS -(`--with-tail-call-interp=no` in `PythonBuild#configure`), never the -tail-calling interpreter CPython 3.14's configure auto-enables when the -compiler passes its musttail probe. The fleet's macos-14 → macos-15 -move (2026-10-31, ahead of GitHub's 2026-11-02 macos-14 retirement) -took the arm64 build toolchain from Apple Clang 15 (Xcode/CLT 15.4) to -Apple Clang 17 (clang-1700.0.13.3 — Xcode 16.3 and 16.4 alike, so no -`DEVELOPER_DIR` pin discriminates). Fresh clang-17 builds of the same -recipe read a per-call compute ratio of 1.6–2.1 against the same-leg -on-system 3.14.7 reference, while the published clang-15 binary reads -1.099–1.122 head-to-head on the current image, and the same clang-17 -build with the tail-call interpreter OFF reads 1.353 — mechanism and -remedy proven on the current fleet (the exp/xcode-16.3-arm64 runs -45358458871/45361240827/45362178911; the gate that caught it is the -compute-floor ratio gate in `tools/boot_smoke`). The flag pins the -build shape deterministically, whatever toolchain the fleet carries -next; lifting it wants a measured case, not an upstream default. - ## The -E flag on windows `-E`/`-I` make getpath ignore the environment — the only channel the diff --git a/build/lib/tebako_python_builder/python_build.rb b/build/lib/tebako_python_builder/python_build.rb index 5b17409..b448eae 100644 --- a/build/lib/tebako_python_builder/python_build.rb +++ b/build/lib/tebako_python_builder/python_build.rb @@ -415,25 +415,6 @@ def configure "--with-openssl=#{openssl_prefix}", "--with-openssl-rpath=no"] args << "--enable-experimental-jit" if @python.jit? - # The macOS 3.14 lines build the classic computed-goto ceval, never - # the tail-calling interpreter. The fleet's macos-14 -> macos-15 - # move (aedeb62, ahead of GitHub's 2026-11-02 macos-14 retirement) - # took the arm64 build toolchain from Apple Clang 15 (Xcode/CLT - # 15.4) to Apple Clang 17 (clang-1700.0.13.3 — Xcode 16.3 and 16.4 - # alike, so no DEVELOPER_DIR pin discriminates; exp leg - # 45358458871). CPython 3.14's configure auto-enables the - # tail-calling interpreter when the compiler passes its musttail - # probe; clang 15 never built it. On the current fleet the clang-17 - # build of this same recipe reads a per-call compute ratio of - # 1.6-2.1 against the same on-system 3.14.7 reference where the - # published v0.3.3 (clang-15) binary reads 1.099 head-to-head on - # the same image (runs 45349338822/45352240234/45353646257/ - # 45358458871/45361240827) — and with the tail-call interpreter - # OFF the clang-17 build returns to parity-class (run 45362178911, - # ratio 1.353). The flag pins that build shape - # deterministically, whatever toolchain the fleet carries next; - # revisiting it wants a measured case, not an upstream default. - args << "--with-tail-call-interp=no" if @platform.macos? && @python.major_minor == [3, 14] puts "-- Configuring CPython #{@python_version} (#{@platform.host_id}#{@python.jit? ? ", JIT on" : ""})" TebakoPythonBuilder::BuildHelpers.run_with_capture(args, env: configure_env, chdir: src_dir) rescue TebakoPythonBuilder::Error => e