tests: start the slowest ctest cases first #2478
Loading…
Reference in a new issue
No description provided.
Delete branch "upstream-pr/2486"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Imported from R0Y00/Xbox2Windows. Originally posted by tedin7 on 2026-11-25T18:14:29Z.
Part of #1149 (no open CI-time issue found; nearest orchestration issue)
What this unblocks: shorter Windows checks per merge.
Sets the CTest
COSTproperty on the 25 slowest cases (about 26 to 56 s each in the Windows CI log), soctest --parallelstarts them first and the workers do not wait on a 50 s case at the very end. Scheduling order only: no test, argument, flag or assertion changes, no names added or removed (form_coverage name pins are untouched). Names that do not exist in a configuration are skipped withif(TEST ...). Expected saving: about 60 to 120 s of wall time per ctest job.Verification:
git diff --stat origin/main: CMakeLists.txt only, 40 insertions, 0 deletions.find_program(DXC_EXECUTABLE)fails before and after this change). I configured the new block alone in a minimal CMake project withstartup_debugandother: the generated CTestTestfile hasCOST "56"onstartup_debugand nothing onother; absent names were skipped without error.add_testlines are untouched; the diff contains no removed lines, so the test name set and commands are identical.AI-assisted; commands listed were executed locally.
Imported from R0Y00/Xbox2Windows. Originally posted by ChazY11 on 2026-11-25T18:41:29Z.
The guard that makes this safe is there, and the list checks out against a real configuration
set_tests_propertieson a name that does not exist is a hard CMake error, and this list names GPU tests that are absent in some configurations, so the one thing that had to be right is the guard:if(TEST …)is the right predicate here (if(TARGET)would be wrong — these are tests, not targets). Without it,cmake --preset devon a host without a GPU or on the Linux job would fail at configure time rather than skipping the entry.Checked mechanically against a configured build
So on this configuration every name resolves, the pairs are well-formed (50 items = 25 name/cost pairs), the costs are integers, and the list is already in descending order — which is what makes the scheduling intent readable. The
0 missingresult is not evidence the guard is unnecessary: this configuration has both WARP and hardware adapters, so it registers more tests than the Linux job or a GPU-less host would.Two things worth pinning
The ordering property is unasserted. "Slowest first" is the whole point, and nothing checks that the list stays descending. A later edit that inserts a new entry in the middle would silently degrade the schedule with no signal. A three-line check in an existing Python check (read
CMakeLists.txt, parse this list, assertcosts == sorted(costs, reverse=True)andlen(items) % 2 == 0) would make the invariant explicit — I ran exactly that by hand above, so it is cheap.The costs are measurements with no provenance. The header says "Measured seconds (Windows CI, approx.)" — good — but a stale cost is worse than no cost, because it produces a confidently wrong order. If these came from a specific CI run, naming it (commit or run date) lets the next person decide when to re-measure rather than guessing.
Effect on correctness
None:
COSTonly affects scheduling under--parallel, as the comment says, and no test gains or loses a dependency. The change is safe to merge on that basis; the two notes above are about keeping it honest over time.AI-assisted; the parse and the
ctest -Ncomparison were run locally on Windows 11 build 26300.9974 (1782 registered tests, 25 cost entries all present).Imported from R0Y00/Xbox2Windows. Originally posted by tedin7 on 2026-11-25T18:53:47Z.
Thanks. Both points are addressed in
ce0dd308e.FATAL_ERRORif the list has an odd length, a non-integer cost, or a cost larger than the one before it.a6c8d80dc), with a note to re-measure when the order looks wrong.Commands run locally (Linux, minimal CMake project that
include()s the exact block fromCMakeLists.txt, withstartup_debugandotherregistered):COST "56"onstartup_debugonly.startup_debug 56changed to10: configure fails with "must be in descending cost order".git diff --check: clean.Win2025 dev+release on the new head is still pending.
AI-assisted; commands listed were executed locally.
Imported from R0Y00/Xbox2Windows. Originally posted by tedin7 on 2026-11-25T19:27:03Z.
Verified on Windows Server 2025 (Build 26100, MSVC 14.44.35207 + D3D12 WARP) at commit
ce0dd308eb3ff5379db617f789f0e29bad1bbc50:--preset dev):cmake --build --preset dev -- -j 2):593.91s(configure2.15s)ctest --preset dev -R '^(startup_debug|startup_run_ps1|cpu_aot_xchg)' --parallel 2 --no-tests=error --output-on-failure): 3/3 passed (101.88s:startup_run_ps115.31s,startup_debug66.75s,cpu_aot_xchg86.31s)/O2(--preset release):cmake --build --preset release -- -j 2):669.82s(configure3.68s)ctest --preset release -R '^(startup_debug|startup_run_ps1|cpu_aot_xchg)' --parallel 2 --no-tests=error --output-on-failure): 3/3 passed (46.96s:startup_run_ps18.02s,cpu_aot_xchg31.16s,startup_debug46.84s)sccache: -15/-34 hits; wall1331.0sImported from R0Y00/Xbox2Windows. Originally posted by tedin7 on 2026-11-25T20:53:07Z.
Verified on Windows Server 2025 (Build 26100, MSVC 14.44.35207 + D3D12 WARP) at commit
99199941f08ac87ca41ff6be3c098272ce630b8b:--preset dev):cmake --build --preset dev -- -j 2):87.88s(configure1.99s)ctest --preset dev -R '^(startup_debug|startup_run_ps1|cpu_aot_xchg)' --parallel 2 --no-tests=error --output-on-failure): 3/3 passed (70.31s:startup_run_ps19.46s,cpu_aot_xchg58.55s,startup_debug70.18s)/O2(--preset release):cmake --build --preset release -- -j 2):82.81s(configure1.94s)ctest --preset release -R '^(startup_debug|startup_run_ps1|cpu_aot_xchg)' --parallel 2 --no-tests=error --output-on-failure): 3/3 passed (58.41s:startup_run_ps18.82s,cpu_aot_xchg37.50s,startup_debug58.29s)sccache: 193/398 hits; wall242.9sImported from R0Y00/Xbox2Windows. Originally posted by chatgpt-codex-connector[bot] on 2026-11-25T20:53:25Z.
Codex Review Summary: ✅ Completed
This comment shows the latest Codex review activity on this pull request.
9919994ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings.