Skip to content

Commit 4923abf

Browse files
luisleo526claude
andcommitted
The hosted macOS lane gates the runtime budget again: its sample is CPU time since A40 rev 7 (R5 tooling lane E4, item 1)
A40 rev 6 made .github/workflows/ci.yml set PINEFORGE_RUNTIME_BUDGET_CANDIDATE_ONLY=1 on the hosted macOS lane, so its Release configure registered test_l4g_runtime_budget --candidate-only: one correctness sample, no ratio. The reason was wall clock (the same tree read 12.8x and 17.2x best-of-five an hour apart on that VM). Lane Q9 (A40 rev 7) made the gated sample the replay's process CPU time, which leaves out the time a leg spends descheduled; Q9's open note asked for the lane back. ci.yml now sets the variable to '0' on every lane, with the comment naming it as the escape for a runner whose CPU accounting cannot time the replay and asking for the measured reason before it is used. The mechanism is unchanged: tests/CMakeLists.txt still reads the variable at configure time (comment updated; it said the workflow sets it for macOS). docs/ci.md says which lanes gate, what the escape is, and the line the macOS job must print. Witness, scripts/test_ci_verify.py RuntimeBudgetLanes: every PINEFORGE_RUNTIME_BUDGET_CANDIDATE_ONLY assignment in ci.yml is '0', and the CMake registration still reads the variable (so the escape the comment offers exists). Before this change: AssertionError: Lists differ: ["${{ runner.os == 'macOS' && '1' || '0' }}"] != [] After: both pass. On this Mac a Release configure registers the row --candidate-only with the variable at 1 and with the relative gate at 0. actionlint 1.7.12 is clean on the three workflows. Not measured here: the hosted macOS runner's CPU ratio. The PR's build (macos-26, Release) job must show test_l4g_runtime_budget printing "runtime budget: candidate=...s ab9714b=...s ratio=...x limit=15.000x (process cpu time; ...)" and passing, not "candidate correctness sample". Ruling: CI configuration, a CMake comment, docs and a tooling test. No kernel, adapter, header or corpus change; no TradingView outcome can move; no epoch question. tests/CMakeLists.txt is outside the lane's file list: a comment-only edit, made because the comment described the old workflow. Co-Authored-By: Claude Opus 5 (1M context) <[email protected]> (cherry picked from commit 7b37d91e46b9545c5b97edf20c03b3209defbee3)
1 parent b7304c7 commit 4923abf

4 files changed

Lines changed: 56 additions & 10 deletions

File tree

‎.github/workflows/ci.yml‎

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -111,9 +111,13 @@ jobs:
111111
# scripts/ci_verify.py); debug registers a subset of those rows.
112112
- name: Verify (${{ matrix.build_type }})
113113
env:
114-
# A40 rev 6: the hosted macOS VM is not a stable timing host; the
115-
# relative runtime witness gates on Linux CI and local builds.
116-
PINEFORGE_RUNTIME_BUDGET_CANDIDATE_ONLY: ${{ runner.os == 'macOS' && '1' || '0' }}
114+
# A40 rev 7: the relative runtime witness gates on process CPU time,
115+
# so every Release lane runs it, hosted macOS included (A40 rev 6 had
116+
# exempted that VM while the gated sample was wall clock). '1' is the
117+
# escape -- the row registers --candidate-only, one sample and no
118+
# ratio -- for a runner whose CPU accounting is unusable; record the
119+
# measured reason here and in docs/ci.md before setting it.
120+
PINEFORGE_RUNTIME_BUDGET_CANDIDATE_ONLY: '0'
117121
run: python3 scripts/ci_verify.py ${{ matrix.build_type == 'Release' && 'release' || 'debug' }} --build-dir build --jobs 4 --ccache
118122

119123
- name: Stage and summarize diagnostics

‎docs/ci.md‎

Lines changed: 16 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -133,9 +133,22 @@ wall ratio of one unchanged tree rose from 12x on a quiet host to 29-35x at
133133
load average 190 while its CPU ratio stayed at 10x. On a quiet host the two
134134
clocks agree. `scripts/test_runtime_budget.py` (row
135135
`test_l4g_runtime_budget_mutations`) pins that the verdict follows CPU time
136-
and still flips when the candidate's CPU cost doubles. Debug builds and the
137-
hosted macOS lane run the candidate once for correctness only
138-
(`--candidate-only`).
136+
and still flips when the candidate's CPU cost doubles. Debug builds run the
137+
candidate once for correctness only (`--candidate-only`). Every Release lane
138+
gates the ratio, the hosted macOS one included: A40 rev 6 had registered that
139+
lane `--candidate-only` because its wall clock was no stable timing host (one
140+
tree read 12.8x and 17.2x an hour apart), and CPU time removed that reason.
141+
`PINEFORGE_RUNTIME_BUDGET_CANDIDATE_ONLY=1` in a Release configure's
142+
environment is the escape back to a correctness sample. `.github/workflows/ci.yml`
143+
sets it to `0` on every lane, and `RuntimeBudgetLanes` in
144+
`scripts/test_ci_verify.py` holds that; the one reason to set it is a runner
145+
whose CPU accounting cannot time the replay, and that reason, with the log
146+
lines that show it, belongs here. In the `build (macos-26, Release)` job the
147+
row prints `runtime budget: candidate=…s ab9714be=…s ratio=…x limit=15.000x
148+
(process cpu time; wall …; load average …)` and passes at or below 15x. The
149+
hosted macOS runner's CPU ratio has not been recorded yet (A40 rev 5 recorded
150+
its wall-clock ratio, 12.84x best-of-five); Apple Silicon reads 9.9-10.7x CPU
151+
from load average 80 to 532.
139152

140153
CTest writes `settlement-abi-receipt.json`, `script-abi-receipt.json`, and
141154
`aggregate-abi-receipt.json` for the real v16/v17 controls, plus

‎scripts/test_ci_verify.py‎

Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -688,6 +688,34 @@ def test_native_live_on_tutorial_off(self):
688688
self.assertIn('Ninja', argv)
689689

690690

691+
class RuntimeBudgetLanes(unittest.TestCase):
692+
"""Every Release lane of the CI build matrix runs the relative runtime gate.
693+
694+
A Release configure whose environment sets
695+
PINEFORGE_RUNTIME_BUDGET_CANDIDATE_ONLY=1 registers test_l4g_runtime_budget
696+
--candidate-only: one correctness sample, no ratio. A40 rev 6 set it for the
697+
hosted macOS lane because wall clock was no stable timing host there; since
698+
A40 rev 7 (lane Q9) the gated sample is process CPU time, and no lane is
699+
exempt. Setting it again is the escape for a runner whose CPU accounting is
700+
unusable, and needs its reason in ci.yml, in docs/ci.md and here.
701+
"""
702+
WORKFLOW = ROOT / '.github/workflows/ci.yml'
703+
SETTING = re.compile(r'^\s*PINEFORGE_RUNTIME_BUDGET_CANDIDATE_ONLY:(.*)$', re.MULTILINE)
704+
705+
def test_no_ci_lane_registers_the_runtime_budget_candidate_only(self):
706+
values = [value.strip().strip('\'"')
707+
for value in self.SETTING.findall(self.WORKFLOW.read_text())]
708+
self.assertEqual([value for value in values if value != '0'], [],
709+
'a ci.yml job sets PINEFORGE_RUNTIME_BUDGET_CANDIDATE_ONLY to other than '
710+
'0, so a Release lane registers test_l4g_runtime_budget --candidate-only')
711+
712+
def test_the_escape_the_workflow_names_still_reaches_the_row(self):
713+
# The ci.yml comment offers the variable as the escape; it only is one
714+
# while the row's registration still reads it.
715+
self.assertRegex((ROOT / 'tests/CMakeLists.txt').read_text(),
716+
r'"\$ENV\{PINEFORGE_RUNTIME_BUDGET_CANDIDATE_ONLY\}" STREQUAL "1"')
717+
718+
691719
class CopyCacheIdentity(unittest.TestCase):
692720
def test_copy_cache_includes_version_source_and_launchers(self):
693721
self.assertIn('PINEFORGE_VERSION_SOURCE', COPY_CACHE)

‎tests/CMakeLists.txt‎

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1269,10 +1269,11 @@ if(TARGET test_l4g_runtime_budget)
12691269
if(NOT CMAKE_BUILD_TYPE STREQUAL "Release")
12701270
set(_pf_runtime_budget_mode --candidate-only)
12711271
elseif("$ENV{PINEFORGE_RUNTIME_BUDGET_CANDIDATE_ONLY}" STREQUAL "1")
1272-
# A40 rev 6: hosted macOS runners are not stable timing hosts (the same
1273-
# tree measured 12.8x and 17.2x best-of-five an hour apart), so the CI
1274-
# workflow sets this for its macOS lane. The relative gate still runs on
1275-
# every local Release build and on the Linux CI lane.
1272+
# The escape for a CI lane whose host cannot time the replay. A40 rev 6
1273+
# set it for hosted macOS while the gated sample was wall clock (the
1274+
# same tree measured 12.8x and 17.2x best-of-five an hour apart); since
1275+
# A40 rev 7 the sample is process CPU time and the CI workflow sets it
1276+
# to 0 on every lane, so the relative gate runs on every Release build.
12761277
set(_pf_runtime_budget_mode --candidate-only)
12771278
endif()
12781279
add_test(NAME test_l4g_runtime_budget

0 commit comments

Comments
 (0)