Scripts: preserve the coverage baseline on empty sweeps #2243

Open
RavenCurseBurg wants to merge 1 commit from upstream-pr/2253 into main
RavenCurseBurg commented 2026-11-25 11:26:18 +00:00 (Migrated from github.com)

Imported from ivall/xcl. Originally posted by RavenCurseBurg on 2026-11-25T11:26:18Z.


Fixes #2250. Updating from {"stages": {}} erased the stored baseline, so the next empty comparison could exit 0. An empty update now exits 2 before opening the baseline for writing.

What is in it

  • scripts/coverage_gate.py checks for shader stages before updating.
  • scripts/test_coverage_gate.py exercises the empty update, including byte-for-byte preservation, and a successful populated update.

Tested

  • Windows 11 24H2 build 26100.9711, Intel i7-13700, RTX 4060 driver 595.79, Python 3.14.3. These tests use the CPU.
  • On base 9633138 with the new tests, the empty update returned 0 where 2 was expected (10 passed, 1 failed). With the fix, python -B -m unittest discover -s scripts passed all 27 tests (0 failed, 0 skipped).
  • Four CLI checks against a temporary copy of the tracked baseline passed. Empty update exited 2 and preserved the bytes. Comparing the empty report then exited 1. Updating and comparing a populated report both exited 0.

Regression run

Only the Python script and its tests changed.

Not tested

Full Rust/GPU workspace suite, live shader packs and retail titles.

AI use

OpenAI Codex (GPT-6) reproduced the issue, wrote the patch and tests, ran the checks, and drafted this description.

<!-- greyfinch-sync:ivall/xcl:issue:5490428058 --> Imported from [ivall/xcl](https://github.com/xcl-dev/xcl/pull/2253). Originally posted by [RavenCurseBurg](https://github.com/RavenCurseBurg) on 2026-11-25T11:26:18Z. --- Fixes #2250. Updating from `{"stages": {}}` erased the stored baseline, so the next empty comparison could exit 0. An empty update now exits 2 before opening the baseline for writing. **What is in it** - `scripts/coverage_gate.py` checks for shader stages before updating. - `scripts/test_coverage_gate.py` exercises the empty update, including byte-for-byte preservation, and a successful populated update. **Tested** - Windows 11 24H2 build 26100.9711, Intel i7-13700, RTX 4060 driver 595.79, Python 3.14.3. These tests use the CPU. - On base `9633138` with the new tests, the empty update returned 0 where 2 was expected (10 passed, 1 failed). With the fix, `python -B -m unittest discover -s scripts` passed all 27 tests (0 failed, 0 skipped). - Four CLI checks against a temporary copy of the tracked baseline passed. Empty update exited 2 and preserved the bytes. Comparing the empty report then exited 1. Updating and comparing a populated report both exited 0. **Regression run** Only the Python script and its tests changed. **Not tested** Full Rust/GPU workspace suite, live shader packs and retail titles. **AI use** OpenAI Codex (GPT-6) reproduced the issue, wrote the patch and tests, ran the checks, and drafted this description.
DavidM1911 commented 2026-11-25 17:07:32 +00:00 (Migrated from github.com)

Imported from ivall/xcl. Originally posted by DavidM1911 on 2026-11-25T16:58:42Z.


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

  • cargo test -p xcl --lib: 1038 passed, 1 failed in one parallel run; the failing test passes on a single-threaded rerun (1039/0). Intermittent single-test flake / 0xc0000005 abort under parallel scheduling — tracked in #1978; clean on single-threaded rerun.

Thanks!

<!-- greyfinch-sync:ivall/xcl:comment:7168817181 --> Imported from [ivall/xcl](https://github.com/xcl-dev/xcl/pull/2253#issuecomment-7168817181). Originally posted by [DavidM1911](https://github.com/DavidM1911) on 2026-11-25T16:58:42Z. --- Verification on RTX 3060 Ti (Windows 11), branch merged with current `main`: - `cargo test -p xcl --lib`: 1038 passed, 1 failed in one parallel run; the failing test passes on a single-threaded rerun (1039/0). Intermittent single-test flake / 0xc0000005 abort under parallel scheduling — tracked in #1978; clean on single-threaded rerun. Thanks!
RavenCurseBurg commented 2026-11-25 18:04:31 +00:00 (Migrated from github.com)

Imported from ivall/xcl. Originally posted by RavenCurseBurg on 2026-11-25T17:10:35Z.


Thanks for the RTX 3060 Ti results. I checked the script change from 4b29d00cbeaa88b8b15c68f8d5f6bdca023ee5b0 after a clean local merge with main 68a284a596bd558b6bd9db6eedda6d6aa178c360. The merge tree differs from main only in scripts/coverage_gate.py and its test. All 11 focused Python tests passed on Windows 11 26100.9711, Python 3.14.3. I also invoked the merged script with --update --run-json <empty-sweep.json> --baseline <temporary-baseline.json>: it exited 2 and preserved the existing baseline byte for byte.

I did not rerun the Rust library suite here. The parallel failure and single-threaded rerun are recorded in your report above. OpenAI Codex (GPT-6) ran the script checks and prepared this reply.

<!-- greyfinch-sync:ivall/xcl:comment:7169118218 --> Imported from [ivall/xcl](https://github.com/xcl-dev/xcl/pull/2253#issuecomment-7169118218). Originally posted by [RavenCurseBurg](https://github.com/RavenCurseBurg) on 2026-11-25T17:10:35Z. --- Thanks for the RTX 3060 Ti results. I checked the script change from `4b29d00cbeaa88b8b15c68f8d5f6bdca023ee5b0` after a clean local merge with main `68a284a596bd558b6bd9db6eedda6d6aa178c360`. The merge tree differs from main only in `scripts/coverage_gate.py` and its test. All 11 focused Python tests passed on Windows 11 26100.9711, Python 3.14.3. I also invoked the merged script with `--update --run-json <empty-sweep.json> --baseline <temporary-baseline.json>`: it exited 2 and preserved the existing baseline byte for byte. I did not rerun the Rust library suite here. The parallel failure and single-threaded rerun are recorded in your report above. OpenAI Codex (GPT-6) ran the script checks and prepared this reply.
github-actions[bot] commented 2026-12-01 02:33:52 +00:00 (Migrated from github.com)

Imported from ivall/xcl. Originally posted by github-actions[bot] on 2026-12-01T02:33:52Z.


Nothing has happened on this PR for 3 days, so it is marked stale and will be closed in 4 days. A push or a comment takes the mark off: rebase it onto main if it conflicts, and say in one line what it still fixes. If it only waits for a maintainer, a comment saying so is enough.

<!-- greyfinch-sync:ivall/xcl:comment:7298751388 --> Imported from [ivall/xcl](https://github.com/xcl-dev/xcl/pull/2253#issuecomment-7298751388). Originally posted by [github-actions[bot]](https://github.com/apps/github-actions) on 2026-12-01T02:33:52Z. --- Nothing has happened on this PR for 3 days, so it is marked `stale` and will be closed in 4 days. A push or a comment takes the mark off: rebase it onto `main` if it conflicts, and say in one line what it still fixes. If it only waits for a maintainer, a comment saying so is enough.
Foniass commented 2026-12-01 07:40:49 +00:00 (Migrated from github.com)

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


Triage (#1607) – head 4b29d00

No open or merged PR refuses --update on a sweep with no stages. #2265 rejects a sweep that exits with a nonzero code, and #2650 decodes the sweep as UTF-8. Those are different failure modes in the same main() of coverage_gate.py, so they will conflict but none of them covers this one. #2645 (atomic baseline write) changes the same --update block. No problems found in the diff: the check runs before the baseline is touched, and both tests go through main().
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:7304350734 --> Imported from [ivall/xcl](https://github.com/xcl-dev/xcl/pull/2253#issuecomment-7304350734). Originally posted by [Foniass](https://github.com/Foniass) on 2026-12-01T07:40:49Z. --- **Triage (#1607)** – head 4b29d00 No open or merged PR refuses `--update` on a sweep with no stages. #2265 rejects a sweep that exits with a nonzero code, and #2650 decodes the sweep as UTF-8. Those are different failure modes in the same `main()` of `coverage_gate.py`, so they will conflict but none of them covers this one. #2645 (atomic baseline write) changes the same `--update` block. No problems found in the diff: the check runs before the baseline is touched, and both tests go through `main()`. 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/2253:upstream-pr/2253'
git switch 'upstream-pr/2253'

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/2253'
git switch 'upstream-pr/2253'
git rebase 'main'
git switch 'main'
git merge --ff-only 'upstream-pr/2253'
git switch 'upstream-pr/2253'
git rebase 'main'
git switch 'main'
git merge --no-ff 'upstream-pr/2253'
git switch 'main'
git merge --squash 'upstream-pr/2253'
git switch 'main'
git merge --ff-only 'upstream-pr/2253'
git switch 'main'
git merge 'upstream-pr/2253'
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!2243
No description provided.