Skip to content

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

Open
Creaa wants to merge 1 commit into
xcl-dev:mainfrom
Creaa:scripts/coverage-gate-exit-2260
Open

Creaa wants to merge 1 commit into
xcl-dev:mainfrom
Creaa:scripts/coverage-gate-exit-2260

Conversation

@Creaa

@Creaa Creaa commented Nov 25, 2026

Copy link
Copy Markdown

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 xcl-dev#2260.
@RavenCurseBurg

RavenCurseBurg commented Nov 25, 2026 •

Copy link
Copy Markdown

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

Tested

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.

@S1m0ne1997

S1m0ne1997 commented Nov 25, 2026 •

Copy link
Copy Markdown

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 gpu: direct RDNA2 -> DXIL backend (no HLSL / DXC), behind XCL_DIRECT_DXIL #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.

@oni-swr

oni-swr commented Nov 25, 2026

Copy link
Copy Markdown
Contributor

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.

@throny throny added the off-goal Does not bear on the current goal (world loading); waits until it is reached label Nov 25, 2026
@safesearch77

Copy link
Copy Markdown

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.

@DavidM1911

Copy link
Copy Markdown
Contributor

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

Thanks!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

off-goal Does not bear on the current goal (world loading); waits until it is reached

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Scripts: coverage_gate.py ignores the sweep's exit code, so a failed sweep passes and --update can lower the baseline to match it

7 participants