Skip to content

Scripts: the coverage gate's sweep runs the validator - #2202

Open
NWProgramming00 wants to merge 1 commit into
xcl-dev:mainfrom
NWProgramming00:fix/coverage-gate-validate
Open

NWProgramming00 wants to merge 1 commit into
xcl-dev:mainfrom
NWProgramming00:fix/coverage-gate-validate

Conversation

@NWProgramming00

Copy link
Copy Markdown

Fixes #2196.

scripts/coverage_gate.py ran xcl shaders <pack> --direct --sample 0 --json without --validate. In a release build direct_sweep (crates/xcl/src/shaders.rs) passes validate to coverage::translate_mode only when --validate is given, and only then does DXC's validator run on the direct DXIL. So validator_failed was 0 in every sweep the gate ran, and its check for stages that gained validator failures (#1999) could never fire.

What is in it

  • scripts/coverage_gate.py: the sweep command is built by a new sweep_command(), which passes --validate. The docstring says why.
  • scripts/test_coverage_gate.py: two unit tests that pin the command, --validate included, and the --threads pass-through.

Tested

  • Windows 11, NVIDIA GeForce RTX 5070 Ti, Python 3.14. py -m unittest test_coverage_gate -v in scripts/: 11 passed (9 existing, 2 new).
  • With --validate removed from sweep_command, test_sweep_validates_every_program fails. With it back, all 11 pass.
  • target\release\xcl.exe shaders tests\data\testgame\data --direct --sample 0 --validate --json (release build of 568e7db) exits 0 and prints the JSON report that sweep_json reads. That folder holds no console shaders, so this shows only that xcl accepts the gate's new command line.

Not tested

  • A full gate run on a shader pack.
  • I did not regenerate tests/data/coverage-baseline.json. Its validator_failed counts are 0 because the validator never ran when it was made. If the validator rejects programs today, the next gate run will report them against that baseline, and --update on a known-good build rewrites it.

AI use

  • Claude Code (Claude Opus 5.5) checked the issue against the code, wrote the change and the tests, ran them, and wrote this description.

🤖 Generated with Claude Code

coverage_gate.py ran `xcl shaders <pack> --direct --sample 0 --json` without
`--validate`. A release xcl only runs DXC's validator on a direct translation
when `--validate` is given (direct_sweep -> coverage::translate_mode), so
`validator_failed` was 0 in every sweep and the gate could never report the
validator regressions it checks for (xcl-dev#2196).

The command is built by `sweep_command` and passes `--validate`; a unit test
pins it.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@raylitebull

Copy link
Copy Markdown
Member

Code review on 9b834ce:

  • Extracting sweep_command(xcl, rpf, threads) in scripts/coverage_gate.py with --validate and SweepCommandTests cleanly ensures release coverage sweeps run DXC validation.
  • Note overlap with #2204 (17f5284), which adds --validate to the same coverage_gate.py command.
  • Diff audited and CI workflow approved (running).

Remaining before merge: Build and test finishing green plus independent verification on 9b834ce.

@ettehn

ettehn commented Nov 25, 2026

Copy link
Copy Markdown

Independent Windows verification for #2196. I downloaded the gate, its tests and the baseline at exact #2202 head 9b834ce and checked the files against their Git blob IDs. python -B -m unittest discover -s scripts -p test_coverage_gate.py passed 11/11.

The exact #2202 script ran live against a complete local shader pack using xcl.exe from main 629a30b (Windows 11 build 26200.9974, DXC/DXIL 1.8.2502.11, four threads). python scripts/coverage_gate.py --xcl <bin> --rpf <pack> --threads 4 exited 0 and printed coverage gate: no regressions. CPU only, 541.6 MiB peak job commit.

A separate validated sweep with the same binary and input returned 22,445 translated programs (CS 1,636, GS 390, MS 8,724, PS 9,511, VS 2,184), zero validator failures, panics or timeouts. Its regenerated baseline was byte-identical to the committed one. I also checked #2204’s exact gate and tests at 17f5284: 10/10 unit tests passed, the saved validated report passed the gate, and its live single-record sweep validated successfully.

AI use — OpenAI Codex (GPT-6.2 Sol) ran the checks 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
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 never runs the validator, so its validator_failed check can't fire

4 participants