Scripts: reject failed sweeps before updating the coverage baseline #2265

Open
github-bot wants to merge 1 commit from github-bot/gh-2265 into main AGit
Owner

@⁠Creaa on GitHub · 2026-11-25 11:51 UTC · original
Creaa:scripts/coverage-gate-exit-2260 → main · +28 −1 · 2 files · 1 commits · open

A failed shader sweep can print valid JSON before it exits. The coverage gate used to accept that report and could overwrite the baseline with partial counts. Fixes #2260.

What is in it

  • Check the sweep process exit code before reading its report. On failure, print the exit code and the tail of stderr and return 2.
  • Exercise both comparison and --update with a valid report from a failed sweep. The test checks the baseline byte for byte.

Tested

  • Commit cc2f28a60f5ef079af7b9f359e5887a9f22f793a, Windows 11 build 26300, i7-13700F, RTX 4070 (617.14), rustc 1.100.0, debug.
  • python -B -m unittest discover -s scripts -p test_*.py passed all 26 tests. Both regression cases failed on the parent. With a real fixture subprocess, exit codes 0 and 7 produced gate exit codes 0 and 2 in both CLI modes.
  • .\scripts\test.ps1 --show-output built the workspace and ran cargo test --workspace -- --test-threads=4 --show-output. Cargo reported 1250 passed, 0 failed, 46 ignored. The suite logged 27 GPU skips within the passing tests (20 wave64, 3 unsupported wave32 per-lane cases, 2 debug-layer cases, 1 heap-window case and 1 driver-cache case).

Not tested

  • Retail shader packs and AMD hardware. The failure-path test uses synthetic JSON and a controlled exit code.

AI use

  • OpenAI Codex (GPT-6, exact variant unknown) wrote the script change and regression test, ran the checks and drafted this description.
**@⁠Creaa** on GitHub · 2026-11-25 11:51 UTC · [original](https://github.com/xcl-dev/xcl/pull/2265) `Creaa:scripts/coverage-gate-exit-2260` → `main` · +28 −1 · 2 files · 1 commits · open A failed shader sweep can print valid JSON before it exits. The coverage gate used to accept that report and could overwrite the baseline with partial counts. Fixes #2260. **What is in it** - Check the sweep process exit code before reading its report. On failure, print the exit code and the tail of stderr and return 2. - Exercise both comparison and `--update` with a valid report from a failed sweep. The test checks the baseline byte for byte. **Tested** - Commit `cc2f28a60f5ef079af7b9f359e5887a9f22f793a`, Windows 11 build 26300, i7-13700F, RTX 4070 (617.14), rustc 1.100.0, debug. - `python -B -m unittest discover -s scripts -p test_*.py` passed all 26 tests. Both regression cases failed on the parent. With a real fixture subprocess, exit codes 0 and 7 produced gate exit codes 0 and 2 in both CLI modes. - `.\scripts\test.ps1 --show-output` built the workspace and ran `cargo test --workspace -- --test-threads=4 --show-output`. Cargo reported 1250 passed, 0 failed, 46 ignored. The suite logged 27 GPU skips within the passing tests (20 wave64, 3 unsupported wave32 per-lane cases, 2 debug-layer cases, 1 heap-window case and 1 driver-cache case). **Not tested** - Retail shader packs and AMD hardware. The failure-path test uses synthetic JSON and a controlled exit code. **AI use** - OpenAI Codex (GPT-6, exact variant unknown) wrote the script change and regression test, ran the checks and drafted this description.
A failed xcl process can leave a valid JSON report on stdout. Check its exit status before accepting the report so a partial result cannot pass the gate or replace a known-good baseline. Fixes #2260.
github-bot locked as GitHub sync and limited conversation to collaborators 2026-11-26 05:25:00 +00:00
Author
Owner

@⁠RavenCurseBurg on GitHub · 2026-11-25 13:05 UTC · original · edited 2026-11-25 13:09 UTC

Tested cc2f28a60f5ef079af7b9f359e5887a9f22f793a on Windows 11 24H2 (26100.9711), Python 3.14.3, i7-13700.

Tested

  • python -B -m unittest discover -s scripts -p test_coverage_gate.py: 10 passed, 0 failed, 0 skipped.
  • I used a real fixture child process that printed the same valid five-stage JSON on both exits. With exit 0, both compare and update returned 0. With exit 7, both returned 2. The temporary baseline remained byte-identical in both rejection cases.
  • I also combined this production script with the changes in #2253 and #2204. The same four cases passed with --validate present in the child arguments. For an empty stage map, updates returned 2 with either child exit 0 or 7 and preserved the baseline bytes in both cases. All six CLI expectations passed.
  • The independent test-fixture interaction I found in #2204 is documented on that PR.

Not tested

Real shader sweeps, Rust/GPU workspace tests or retail titles.

AI use

OpenAI Codex (GPT-6) ran the upstream tests, wrote the CLI integration fixture, compared the baseline bytes, and drafted this report.

**@⁠RavenCurseBurg** on GitHub · 2026-11-25 13:05 UTC · [original](https://github.com/xcl-dev/xcl/pull/2265#issuecomment-7163281677) · edited 2026-11-25 13:09 UTC Tested `cc2f28a60f5ef079af7b9f359e5887a9f22f793a` on Windows 11 24H2 (26100.9711), Python 3.14.3, i7-13700. **Tested** - `python -B -m unittest discover -s scripts -p test_coverage_gate.py`: 10 passed, 0 failed, 0 skipped. - I used a real fixture child process that printed the same valid five-stage JSON on both exits. With exit 0, both compare and update returned 0. With exit 7, both returned 2. The temporary baseline remained byte-identical in both rejection cases. - I also combined this production script with the changes in #2253 and #2204. The same four cases passed with `--validate` present in the child arguments. For an empty stage map, updates returned 2 with either child exit 0 or 7 and preserved the baseline bytes in both cases. All six CLI expectations passed. - The independent test-fixture interaction I found in #2204 is documented [on that PR](https://git.gtahub.st/github/xcl-dev--xcl/pulls/2204). **Not tested** Real shader sweeps, Rust/GPU workspace tests or retail titles. **AI use** OpenAI Codex (GPT-6) ran the upstream tests, wrote the CLI integration fixture, compared the baseline bytes, and drafted this report.
Author
Owner

@⁠S1m0ne1997 on GitHub · 2026-11-25 14:00 UTC · original

Test report for cc2f28a60f5ef079af7b9f359e5887a9f22f793a (this PR's head), for #1607.

Tested

  • NVIDIA GeForce RTX 4090 24 GB (driver 621.40), AMD Ryzen 9 9950X3D, 47 GB RAM, Windows 11 Home 10.0.26300, rustc 1.100.0 (0ef1bc386 2026-11-09) x86_64-pc-windows-msvc, debug.
  • cargo build --workspace, then cargo test --workspace -- --test-threads=4 at the head: 1250 passed, 0 failed, 46 ignored.
  • SKIPPED (17): a_2d_or_3d_group_agrees_with_the_hlsl_path_on_the_gpu (no wave64), coalesced_guarded_runs_agree_with_the_hlsl_path_on_the_gpu (no wave64), cross_lane_reads_agree_with_the_hlsl_path_on_the_gpu (no wave64), the_wave64_lowering_agrees_with_the_hlsl_path_on_the_gpu (no wave64), a_per_lane_2d_or_3d_group_runs_on_the_gpu (no wave64), const_and_null_mask_operands_agree_with_hlsl_on_the_gpu (const_mask, wave64: no wave64), f16_programs_on_the_gpu (f16 arithmetic, wave32, per-lane form: refused (unsupported V_MUL_F16 (its #1426 semantics differ from the console's)); f16 arithmetic, wave64: no wave64), f32_programs_on_the_gpu (f32 arithmetic, wave64: no wave64; f32 compares, wave64: no wave64), f64_programs_on_the_gpu (f64, wave64: no wave64), integer_programs_on_the_gpu (integer arithmetic, wave64: no wave64; integer carries, wave64: no wave64), mask_ff0_and_flbit_agree_with_hlsl_on_the_gpu (mask_ff0_flbit, wave64: no wave64), gpu_geometry_wave32_prefix_count_over_a_mask (no wave64), gpu_wave32_program_in_wave64_hardware (no wave64), heap_window_out_of_memory_falls_back_to_the_switch_form (no heap windows), pso_measurement_compiles_an_exact_synthetic_record (cannot disable the driver cache (Windows Developer Mode is required): L'applicazione ha richiesto un'operazione che dipende da un componente SDK mancante o non corrispondente. (0x887A002D)), test_title_draws_with_a_root_signature_under_the_debug_layer (no d3d12SDKLayers.dll), uploads_start_from_each_subresources_state (no D3D12 debug layer (L'applicazione ha richiesto un'operazione che dipende da un componente SDK mancante o non corrispondente. (0x887A002D))).

Not tested

  • No smoke pair: the PR changes no runtime code (scripts/coverage_gate.py, scripts/test_coverage_gate.py).
  • AMD, other NVIDIA cards and drivers, Linux. I did not review the diff; this report is the build, the suite and the regression run only.

AI use: Claude Code with Claude Opus 5.5 ran the build, the suite and the regression run and wrote this report at my request.

**@⁠S1m0ne1997** on GitHub · 2026-11-25 14:00 UTC · [original](https://github.com/xcl-dev/xcl/pull/2265#issuecomment-7164612287) Test report for `cc2f28a60f5ef079af7b9f359e5887a9f22f793a` (this PR's head), for #1607. **Tested** - NVIDIA GeForce RTX 4090 24 GB (driver 621.40), AMD Ryzen 9 9950X3D, 47 GB RAM, Windows 11 Home 10.0.26300, `rustc 1.100.0 (0ef1bc386 2026-11-09)` `x86_64-pc-windows-msvc`, debug. - `cargo build --workspace`, then `cargo test --workspace -- --test-threads=4` at the head: **1250 passed, 0 failed, 46 ignored**. - SKIPPED (17): `a_2d_or_3d_group_agrees_with_the_hlsl_path_on_the_gpu` (no wave64), `coalesced_guarded_runs_agree_with_the_hlsl_path_on_the_gpu` (no wave64), `cross_lane_reads_agree_with_the_hlsl_path_on_the_gpu` (no wave64), `the_wave64_lowering_agrees_with_the_hlsl_path_on_the_gpu` (no wave64), `a_per_lane_2d_or_3d_group_runs_on_the_gpu` (no wave64), `const_and_null_mask_operands_agree_with_hlsl_on_the_gpu` (const_mask, wave64: no wave64), `f16_programs_on_the_gpu` (f16 arithmetic, wave32, per-lane form: refused (unsupported V_MUL_F16 (its #1426 semantics differ from the console's)); f16 arithmetic, wave64: no wave64), `f32_programs_on_the_gpu` (f32 arithmetic, wave64: no wave64; f32 compares, wave64: no wave64), `f64_programs_on_the_gpu` (f64, wave64: no wave64), `integer_programs_on_the_gpu` (integer arithmetic, wave64: no wave64; integer carries, wave64: no wave64), `mask_ff0_and_flbit_agree_with_hlsl_on_the_gpu` (mask_ff0_flbit, wave64: no wave64), `gpu_geometry_wave32_prefix_count_over_a_mask` (no wave64), `gpu_wave32_program_in_wave64_hardware` (no wave64), `heap_window_out_of_memory_falls_back_to_the_switch_form` (no heap windows), `pso_measurement_compiles_an_exact_synthetic_record` (cannot disable the driver cache (Windows Developer Mode is required): L'applicazione ha richiesto un'operazione che dipende da un componente SDK mancante o non corrispondente. (0x887A002D)), `test_title_draws_with_a_root_signature_under_the_debug_layer` (no d3d12SDKLayers.dll), `uploads_start_from_each_subresources_state` (no D3D12 debug layer (L'applicazione ha richiesto un'operazione che dipende da un componente SDK mancante o non corrispondente. (0x887A002D))). **Not tested** - No smoke pair: the PR changes no runtime code (scripts/coverage_gate.py, scripts/test_coverage_gate.py). - AMD, other NVIDIA cards and drivers, Linux. I did not review the diff; this report is the build, the suite and the regression run only. *AI use: Claude Code with Claude Opus 5.5 ran the build, the suite and the regression run and wrote this report at my request.*
Author
Owner

@⁠oni-swr on GitHub · 2026-11-25 14:09 UTC · original

CPU-only check of cc2f28a60f5ef079af7b9f359e5887a9f22f793a (this PR's head), for #1607. This is a third report, after the two above.

Tested

  • Windows 11 build 26200, AMD Ryzen 7 5700X3D, Python 3.13.5. No GPU, no Rust build, no smoke run.
  • Read the full diff (scripts/coverage_gate.py, scripts/test_coverage_gate.py, 2 files).
  • python -B -m unittest discover -s scripts -p "test_*.py": 26 ran, 26 OK, on the exact head and on a no-commit merge of the head with main 06c9f55 (the merge is clean and does not touch coverage_gate.py).
  • -p test_coverage_gate.py: 10 OK.
  • Negative control: the PR's test file with main's coverage_gate.py gives 10 run, 2 failures (the compare and the --update case: the baseline is rewritten and the exit code is not 2). With the PR's script they pass.

Not tested

  • Real shader sweeps, Rust or GPU tests, retail titles, AMD or NVIDIA hardware. The test mocks subprocess.run, so the gate's behaviour with a real failing xcl process is covered by the other reports only.

AI use

  • Claude Code (Claude Sonnet 5.5) ran the commands and wrote this report.
**@⁠oni-swr** on GitHub · 2026-11-25 14:09 UTC · [original](https://github.com/xcl-dev/xcl/pull/2265#issuecomment-7164841153) CPU-only check of `cc2f28a60f5ef079af7b9f359e5887a9f22f793a` (this PR's head), for #1607. This is a third report, after the two above. **Tested** - Windows 11 build 26200, AMD Ryzen 7 5700X3D, Python 3.13.5. No GPU, no Rust build, no smoke run. - Read the full diff (`scripts/coverage_gate.py`, `scripts/test_coverage_gate.py`, 2 files). - `python -B -m unittest discover -s scripts -p "test_*.py"`: 26 ran, 26 OK, on the exact head and on a no-commit merge of the head with `main` `06c9f55` (the merge is clean and does not touch `coverage_gate.py`). - `-p test_coverage_gate.py`: 10 OK. - Negative control: the PR's test file with `main`'s `coverage_gate.py` gives 10 run, 2 failures (the compare and the `--update` case: the baseline is rewritten and the exit code is not 2). With the PR's script they pass. **Not tested** - Real shader sweeps, Rust or GPU tests, retail titles, AMD or NVIDIA hardware. The test mocks `subprocess.run`, so the gate's behaviour with a real failing `xcl` process is covered by the other reports only. **AI use** - Claude Code (Claude Sonnet 5.5) ran the commands and wrote this report.
Author
Owner

@⁠safesearch77 on GitHub · 2026-11-25 16:28 UTC · original

Tested commit cc2f28a60f5ef079af7b9f359e5887a9f22f793a cleanly merged against main (0829441).

Tested

  • CachyOS Linux (Linux 7.3.5-2-cachyos x86_64), 13th Gen Intel Core i9-13900HX, NVIDIA GeForce RTX 4070 Laptop GPU (driver 620.73.04), Python 3.14.10 (CPU-only script tests).
  • python3 -B -m unittest discover -s scripts -p 'test_*.py' -v: 26 passed, 0 failed, 0 skipped.
  • Verified FailedSweepTests fails both subtests (compare and --update, failures=2) when run against main's scripts/coverage_gate.py.
  • Verified live subprocess CLI execution (--update with unmocked helper executables emitting valid stage JSON before sys.exit(7) and before SIGSEGV -11): both returned exit code 2, reported the exit code (7 / -11) and stderr tail, and preserved baseline.json byte-for-byte.
  • python3 scripts/pr_check.py --local on this PR's description and file list: description ok (exit 0).

Not tested

  • Windows PowerShell scripts, Rust/Cargo workspace build (cargo test --workspace), D3D12 runtime, and retail shader packs (this PR modifies scripts/coverage_gate.py and scripts/test_coverage_gate.py only).

AI use

  • Antigravity (Gemini 4 Carbon): checked merge cleanliness, ran the unit test suite and unmocked non-zero/signal subprocess edge-case checks in an isolated worktree, and drafted this report; reviewed by me.
**@⁠safesearch77** on GitHub · 2026-11-25 16:28 UTC · [original](https://github.com/xcl-dev/xcl/pull/2265#issuecomment-7168030760) Tested commit `cc2f28a60f5ef079af7b9f359e5887a9f22f793a` cleanly merged against `main` (`0829441`). **Tested** - CachyOS Linux (`Linux 7.3.5-2-cachyos x86_64`), 13th Gen Intel Core i9-13900HX, NVIDIA GeForce RTX 4070 Laptop GPU (driver 620.73.04), Python 3.14.10 (CPU-only script tests). - `python3 -B -m unittest discover -s scripts -p 'test_*.py' -v`: 26 passed, 0 failed, 0 skipped. - Verified `FailedSweepTests` fails both subtests (compare and `--update`, `failures=2`) when run against `main`'s `scripts/coverage_gate.py`. - Verified live subprocess CLI execution (`--update` with unmocked helper executables emitting valid stage JSON before `sys.exit(7)` and before `SIGSEGV` `-11`): both returned exit code `2`, reported the exit code (`7` / `-11`) and stderr tail, and preserved `baseline.json` byte-for-byte. - `python3 scripts/pr_check.py --local` on this PR's description and file list: `description ok` (exit `0`). **Not tested** - Windows PowerShell scripts, Rust/Cargo workspace build (`cargo test --workspace`), D3D12 runtime, and retail shader packs (this PR modifies `scripts/coverage_gate.py` and `scripts/test_coverage_gate.py` only). **AI use** - Antigravity (Gemini 4 Carbon): checked merge cleanliness, ran the unit test suite and unmocked non-zero/signal subprocess edge-case checks in an isolated worktree, and drafted this report; reviewed by me.
Author
Owner

@⁠DavidM1911 on GitHub · 2026-11-25 16:53 UTC · original

Verification on RTX 3060 Ti (Windows 11), branch merged with current main:

  • cargo test -p xcl --lib: all passed, 0 failed, ~26 ignored. (Intermittent single-test flake / 0xc0000005 abort under parallel scheduling — tracked in #1978; clean on single-threaded rerun.)

Thanks!

**@⁠DavidM1911** on GitHub · 2026-11-25 16:53 UTC · [original](https://github.com/xcl-dev/xcl/pull/2265#issuecomment-7168689937) Verification on RTX 3060 Ti (Windows 11), branch merged with current `main`: - `cargo test -p xcl --lib`: all passed, 0 failed, ~26 ignored. (Intermittent single-test flake / 0xc0000005 abort under parallel scheduling — tracked in #1978; clean on single-threaded rerun.) Thanks!
This pull request can be merged automatically.
This branch is out-of-date with the base branch
You are not authorized to merge this pull request.
View command line instructions

Checkout

From your project repository, check out a new branch and test the changes.
git fetch -u origin '+refs/pull/2265/head:github-bot/gh-2265'
git switch 'github-bot/gh-2265'

Merge

Merge the changes and update on Forgejo.
git switch 'main'
git merge --no-ff 'github-bot/gh-2265'
git switch 'github-bot/gh-2265'
git rebase 'main'
git switch 'main'
git merge --ff-only 'github-bot/gh-2265'
git switch 'github-bot/gh-2265'
git rebase 'main'
git switch 'main'
git merge --no-ff 'github-bot/gh-2265'
git switch 'main'
git merge --squash 'github-bot/gh-2265'
git switch 'main'
git merge --ff-only 'github-bot/gh-2265'
git switch 'main'
git merge 'github-bot/gh-2265'
git push origin 'main'
This discussion has been locked. Commenting is limited to contributors.
No description provided.