Scripts: the coverage gate's sweep runs the validator #2192

Open
NWProgramming00 wants to merge 1 commit from upstream-pr/2202 into main
NWProgramming00 commented 2026-11-25 09:23:26 +00:00 (Migrated from github.com)

Imported from ivall/xcl. Originally posted by NWProgramming00 on 2026-11-25T09:23:26Z.


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

<!-- greyfinch-sync:ivall/xcl:issue:5488572338 --> Imported from [ivall/xcl](https://github.com/xcl-dev/xcl/pull/2202). Originally posted by [NWProgramming00](https://github.com/NWProgramming00) on 2026-11-25T09:23:26Z. --- 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](https://claude.com/claude-code)
raylitebull commented 2026-11-25 11:09:21 +00:00 (Migrated from github.com)

Imported from ivall/xcl. Originally posted by raylitebull on 2026-11-25T10:46:11Z.


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.

<!-- greyfinch-sync:ivall/xcl:comment:7160147739 --> Imported from [ivall/xcl](https://github.com/xcl-dev/xcl/pull/2202#issuecomment-7160147739). Originally posted by [raylitebull](https://github.com/raylitebull) on 2026-11-25T10:46:11Z. --- 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 commented 2026-11-25 11:09:45 +00:00 (Migrated from github.com)

Imported from ivall/xcl. Originally posted by ettehn on 2026-11-25T11:02:25Z.


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.

<!-- greyfinch-sync:ivall/xcl:comment:7160506074 --> Imported from [ivall/xcl](https://github.com/xcl-dev/xcl/pull/2202#issuecomment-7160506074). Originally posted by [ettehn](https://github.com/ettehn) on 2026-11-25T11:02:25Z. --- 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.
raylitebull commented 2026-11-25 19:09:05 +00:00 (Migrated from github.com)

Imported from ivall/xcl. Originally posted by raylitebull on 2026-11-25T18:28:29Z.


Review note on 9b834ce: sweep_command(xcl, rpf, threads) cleanly extracts and tests --validate without any MagicMock.returncode fragility.

Remaining before merge: Overlap with #2204 (both fix #2196 in scripts/coverage_gate.py) should be coordinated, and #2202 still needs an AMD verification pass on 9b834ce.

<!-- greyfinch-sync:ivall/xcl:comment:7170956695 --> Imported from [ivall/xcl](https://github.com/xcl-dev/xcl/pull/2202#issuecomment-7170956695). Originally posted by [raylitebull](https://github.com/raylitebull) on 2026-11-25T18:28:29Z. --- Review note on `9b834ce`: `sweep_command(xcl, rpf, threads)` cleanly extracts and tests `--validate` without any `MagicMock.returncode` fragility. **Remaining before merge:** Overlap with `#2204` (both fix `#2196` in `scripts/coverage_gate.py`) should be coordinated, and `#2202` still needs an **AMD** verification pass on `9b834ce`.
thiagocalile commented 2026-11-25 20:08:30 +00:00 (Migrated from github.com)

Imported from ivall/xcl. Originally posted by thiagocalile on 2026-11-25T19:11:54Z.


Independent test report for head 9b834ce6f85cdd1cc62b311dd075f6c3cd468fb2 on a Windows 11 host with an AMD Radeon RX 6600 (8 GB VRAM, RDNA2, native wave64).

Tested

  • Hardware: AMD Radeon RX 6600 (8146 MiB VRAM, RDNA2, driver 32.0.21045.29003), AMD Ryzen 7 5700X3D, 47.9 GB RAM, Windows 11 (10.0.26200.0), Python 3.14.
  • python -m unittest discover -s scripts -p "test_coverage_gate.py" -v: 11 passed, 0 failed (0.001 s, OK).

Not tested: live scripts/coverage_gate.py sweep against a retail shader pack, Linux/Wine, or cargo test (Python-only PR).

AI use: Antigravity (Gemini 4 Neon) ran the unit tests and drafted this report; the account owner reviewed and approved posting.

<!-- greyfinch-sync:ivall/xcl:comment:7171953699 --> Imported from [ivall/xcl](https://github.com/xcl-dev/xcl/pull/2202#issuecomment-7171953699). Originally posted by [thiagocalile](https://github.com/thiagocalile) on 2026-11-25T19:11:54Z. --- Independent test report for head `9b834ce6f85cdd1cc62b311dd075f6c3cd468fb2` on a Windows 11 host with an **AMD Radeon RX 6600** (8 GB VRAM, RDNA2, native wave64). **Tested** - Hardware: AMD Radeon RX 6600 (8146 MiB VRAM, RDNA2, driver `32.0.21045.29003`), AMD Ryzen 7 5700X3D, 47.9 GB RAM, Windows 11 (`10.0.26200.0`), Python 3.14. - `python -m unittest discover -s scripts -p "test_coverage_gate.py" -v`: **11 passed, 0 failed** (`0.001 s`, `OK`). **Not tested:** live `scripts/coverage_gate.py` sweep against a retail shader pack, Linux/Wine, or `cargo test` (Python-only PR). **AI use:** Antigravity (Gemini 4 Neon) ran the unit tests and drafted this report; the account owner reviewed and approved posting.
RavenCurseBurg commented 2026-11-25 22:06:39 +00:00 (Migrated from github.com)

Imported from ivall/xcl. Originally posted by RavenCurseBurg on 2026-11-25T21:07:30Z.


Tested #2202 at 9b834ce6f85cdd1cc62b311dd075f6c3cd468fb2 together with #2265 at cc2f28a60f5ef079af7b9f359e5887a9f22f793a. Windows 11 build 26100.9711, Core i7-13700, Python 3.14.3.

Git's three-way merge from the common base 568e7db has two text conflicts: the subprocess call in scripts/coverage_gate.py and one import in scripts/test_coverage_gate.py. The resolved #2265 change on top of #2202 retains the original author, the validator-enabled command, the child status check and both test classes.

I ran the CLI with a fixture executable that recorded its arguments and printed a valid synthetic report. Both versions passed --direct --sample 0 --validate --json --threads 3. With #2202 alone, an exit-7 child could still update a baseline. With the combined change, comparison and --update both returned 2, included the child's diagnostic and preserved the original baseline bytes. A clean report returned 0, a validator regression returned 1, and a successful update wrote the new counts.

python -B -m unittest discover -s scripts -p test_coverage_gate.py passed 11/11 on #2202 and 12/12 on the candidate. The complete Python script suite passed 28/28 on the resolved combined scripts.

Not tested — A real shader pack, DXC validation, the Rust workspace or GPU execution. OpenAI Codex (GPT-6) resolved the two edits, prepared and ran the fixtures, and wrote this report.

<!-- greyfinch-sync:ivall/xcl:comment:7174644413 --> Imported from [ivall/xcl](https://github.com/xcl-dev/xcl/pull/2202#issuecomment-7174644413). Originally posted by [RavenCurseBurg](https://github.com/RavenCurseBurg) on 2026-11-25T21:07:30Z. --- **Tested** #2202 at `9b834ce6f85cdd1cc62b311dd075f6c3cd468fb2` together with #2265 at `cc2f28a60f5ef079af7b9f359e5887a9f22f793a`. Windows 11 build 26100.9711, Core i7-13700, Python 3.14.3. Git's three-way merge from the common base `568e7db` has two text conflicts: the subprocess call in `scripts/coverage_gate.py` and one import in `scripts/test_coverage_gate.py`. The [resolved #2265 change on top of #2202](https://github.com/RavenCurseBurg/xcl/commit/b91820413f0d5539d44e9b889b2b85fd3ecb75b3) retains the original author, the validator-enabled command, the child status check and both test classes. I ran the CLI with a fixture executable that recorded its arguments and printed a valid synthetic report. Both versions passed `--direct --sample 0 --validate --json --threads 3`. With #2202 alone, an exit-7 child could still update a baseline. With the combined change, comparison and `--update` both returned 2, included the child's diagnostic and preserved the original baseline bytes. A clean report returned 0, a validator regression returned 1, and a successful update wrote the new counts. `python -B -m unittest discover -s scripts -p test_coverage_gate.py` passed 11/11 on #2202 and 12/12 on the candidate. The complete Python script suite passed 28/28 on the resolved combined scripts. **Not tested** — A real shader pack, DXC validation, the Rust workspace or GPU execution. OpenAI Codex (GPT-6) resolved the two edits, prepared and ran the fixtures, and wrote this report.
NWProgramming00 commented 2026-11-26 16:54:19 +00:00 (Migrated from github.com)

Imported from ivall/xcl. Originally posted by NWProgramming00 on 2026-11-26T16:54:19Z.


Status of the two open points from the review:

  • Overlap with #2204: #2204 is closed without a merge, so this is the only open fix for #2196.
    • #2265 (for #2260) changes the same call. It conflicts textually with this PR. @RavenCurseBurg resolved the conflict and tested the combined change in the comment above, so the two can go in one after the other.
  • AMD verification: @thiagocalile ran this head (9b834ce) on an RX 6600 (RDNA2, native wave64) in the report above.

The head is unchanged and still merges cleanly into main.

AI use: Claude Code (Claude Opus 5.5) checked the PR states and wrote this.

<!-- greyfinch-sync:ivall/xcl:comment:7198243107 --> Imported from [ivall/xcl](https://github.com/xcl-dev/xcl/pull/2202#issuecomment-7198243107). Originally posted by [NWProgramming00](https://github.com/NWProgramming00) on 2026-11-26T16:54:19Z. --- Status of the two open points from the review: - **Overlap with #2204:** #2204 is closed without a merge, so this is the only open fix for #2196. - #2265 (for #2260) changes the same call. It conflicts textually with this PR. @RavenCurseBurg resolved the conflict and tested the combined change in the comment above, so the two can go in one after the other. - **AMD verification:** @thiagocalile ran this head (`9b834ce`) on an RX 6600 (RDNA2, native wave64) in the report above. The head is unchanged and still merges cleanly into `main`. AI use: Claude Code (Claude Opus 5.5) checked the PR states and wrote this.
Foniass commented 2026-12-01 07:34:40 +00:00 (Migrated from github.com)

Imported from ivall/xcl. Originally posted by Foniass on 2026-12-01T07:34:40Z.


Triage (#1607) – head 9b834ce

#2204 made the same change (--validate in the coverage gate's sweep) and was closed. #2206's commit 2d76b7f adds the same flag as part of a larger set of changes. Main still runs the sweep without --validate (coverage_gate.py), and xcl shaders on main accepts the flag. The sweep_command helper and its test are fine.
No problems found in the diff.
Recommendation: keep open.

AI review: Claude Code (Claude Opus 5.5), diffs read only, not built or run; not checked by a human.

<!-- greyfinch-sync:ivall/xcl:comment:7304227655 --> Imported from [ivall/xcl](https://github.com/xcl-dev/xcl/pull/2202#issuecomment-7304227655). Originally posted by [Foniass](https://github.com/Foniass) on 2026-12-01T07:34:40Z. --- **Triage (#1607)** – head 9b834ce #2204 made the same change (--validate in the coverage gate's sweep) and was closed. #2206's commit 2d76b7f adds the same flag as part of a larger set of changes. Main still runs the sweep without --validate (coverage_gate.py), and `xcl shaders` on main accepts the flag. The sweep_command helper and its test are fine. No problems found in the diff. Recommendation: keep open. AI review: Claude Code (Claude Opus 5.5), diffs read only, not built or run; not checked by a human.
This pull request cannot be merged automatically due to conflicts.
Merge manually to resolve the conflicts.
View command line instructions

Checkout

From your project repository, check out a new branch and test the changes.
git fetch -u origin 'upstream-pr/2202:upstream-pr/2202'
git switch 'upstream-pr/2202'

Merge

Merge the changes and update on Forgejo.

Warning: The "Autodetect manual merge" setting is not enabled for this repository, you will have to mark this pull request as manually merged afterwards.

git switch 'main'
git merge --no-ff 'upstream-pr/2202'
git switch 'upstream-pr/2202'
git rebase 'main'
git switch 'main'
git merge --ff-only 'upstream-pr/2202'
git switch 'upstream-pr/2202'
git rebase 'main'
git switch 'main'
git merge --no-ff 'upstream-pr/2202'
git switch 'main'
git merge --squash 'upstream-pr/2202'
git switch 'main'
git merge --ff-only 'upstream-pr/2202'
git switch 'main'
git merge 'upstream-pr/2202'
git push origin 'main'
Sign in to join this conversation.
No reviewers
No labels
No milestone
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Reference
xcl-dev/xcl!2192
No description provided.