Skip to content

Scripts: reject failed live coverage sweeps - #2732

Closed
luckyteagirl wants to merge 1 commit into
xcl-dev:mainfrom
luckyteagirl:codex/coverage-gate-live-exit
Closed

luckyteagirl wants to merge 1 commit into
xcl-dev:mainfrom
luckyteagirl:codex/coverage-gate-live-exit

Conversation

@luckyteagirl

Copy link
Copy Markdown
Contributor

The coverage gate could accept a live shader sweep that exited nonzero if it printed valid JSON first. In update mode that output could replace the baseline. Check the child’s exit status before reading its report. A successful sweep still reaches the existing comparison, which reports regressions in the stage counts.

What is in it

  • scripts/coverage_gate.py exits 2 on a failed live sweep and prints the child’s exit status and the tail of both output streams.
  • scripts/test_coverage_gate.py covers comparison and update with a nonzero child that prints valid JSON. A rejected update preserves the baseline bytes. Exit-zero fixtures cover a matching report and a translation regression.

Tested

  • Windows 11 Home build 26200, AMD Ryzen 9 5980HX, Python 3.11.9, synthetic subprocess results.
  • Failing first on main b49be183: python -B -m unittest discover -s scripts -p test_coverage_gate.py -v reported two failing subtests. Compare and update both returned 0 instead of 2.
  • With the fix, python -B -m unittest discover -s scripts -p 'test_*.py' passed all 27 tests, and git diff --check passed.

Regression run

  • Generator and runtime code are outside the diff. This is a Python checker change.

Not tested

AI use

  • OpenAI Codex (GPT-6.2 Sol) traced the process exit path, wrote the patch and failing-first tests, ran the Python checks, and drafted this description.

Check the shader child status before parsing its report or updating the baseline. Cover a nonzero exit with valid-looking JSON in both modes.

Assisted-by: OpenAI Codex (GPT-6.2 Sol)
@luckyteagirl

Copy link
Copy Markdown
Contributor Author

Closing this draft in favor of #2265. Independent review found that #2265 already checks a nonzero live sweep before parsing valid-looking JSON and covers both comparison and baseline update. The extra diagnostic tail and exit-zero controls here do not justify a competing PR. Thanks to the author of #2265 for covering the issue first. AI-assisted duplicate check (OpenAI Codex, GPT-6).

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

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant