Skip to content

Scripts: preserve the coverage baseline on empty sweeps - #2253

Open
RavenCurseBurg wants to merge 1 commit into
xcl-dev:mainfrom
RavenCurseBurg:scripts/keep-baseline-on-empty-sweep
Open

RavenCurseBurg wants to merge 1 commit into
xcl-dev:mainfrom
RavenCurseBurg:scripts/keep-baseline-on-empty-sweep

Conversation

@RavenCurseBurg

Copy link
Copy Markdown

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.

An empty stage table could replace a populated baseline and make the next empty comparison pass. Reject the update before touching the file and cover both empty and populated reports.

Fixes xcl-dev#2250

Assisted-by: OpenAI Codex (GPT-6)
@DavidM1911

Copy link
Copy Markdown
Contributor

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

Thanks!

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

Copy link
Copy Markdown
Author

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.

@RavenCurseBurg
RavenCurseBurg marked this pull request as ready for review November 26, 2026 10:37
@github-actions

github-actions Bot commented Dec 1, 2026

Copy link
Copy Markdown

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.

@github-actions github-actions Bot added the stale No activity for 3 days; closed 4 days later unless something happens label Dec 1, 2026
@Foniass

Foniass commented Dec 1, 2026

Copy link
Copy Markdown
Contributor

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.

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 stale No activity for 3 days; closed 4 days later unless something happens

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Scripts: an empty sweep can erase the coverage baseline

4 participants