Scripts: fail a shader coverage regression against a committed baseline #1989
Loading…
Reference in a new issue
No description provided.
Delete branch "upstream-pr/1999"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Imported from ivall/xcl. Originally posted by brandostrong on 2026-11-25T00:34:39Z.
A sibling project lost 323 shader translations to a refactor and nobody noticed until users saw black menus. The tool to catch that exists (
xcl shaders --direct --sample 0 --jsonreports per-stage outcome counts) but had no baseline.coverage_gate.pyruns the sweep (or compares a saved report) and fails when a stage translates fewer programs than the baseline or gains validator failures, panics or timeouts; totals that move are printed as notes, not failures, so a changed corpus is visible without blocking. Part of the validation line claimed on #1269.What is in it
scripts/coverage_gate.py: sweep + compare +--update(counts only — no program names, no game data)scripts/test_coverage_gate.py: 9 unit tests for the compare and report-parse logic (no game needed)tests/data/coverage-baseline.json: generated withxcl shaders <pack> --direct --sample 0 --json --threads 8on a contributor's shader pack at62265d3: 22 445 programs, all translated (CS 1 636, GS 390, MS 8 724, PS 9 511, VS 2 184)Tested
python scripts/test_coverage_gate.py: 9 tests, OK--updateon the pack above (exit 0); gate re-run against the written baseline: "coverage gate: no regressions"Not tested
AI use
🤖 Generated with Claude Code
Imported from ivall/xcl. Originally posted by futurepro62 on 2026-11-25T00:54:25Z.
Tested exact head
3229445, script tests only, since this PR has no test report yet.Tested
python -m pytest scripts/test_coverage_gate.pyat the head: 9 passed.7994cd1): not applicable:coverage_gate.pyis new in this PR, so on main the test stops atModuleNotFoundError: No module named 'coverage_gate'.Not tested
xcl coveragerun (only its unit tests), the CI workflow itself.AI use
Imported from ivall/xcl. Originally posted by raylitebull on 2026-11-25T00:56:56Z.
Code review on
3229445:scripts/coverage_gate.pycleanly parses the trailing JSON line fromxcl shaders --direct --sample 0 --json, fails ontranslateddrops, missing stages, or increases invalidator_failed/panicked/timeout, and treats corpus total changes or new stages as informational notes. All 9 unit tests inscripts/test_coverage_gate.pylook solid.What is still needed before merge: Independent second-reviewer / cross-machine verification of
test_coverage_gate.py(and optionally--run-jsonagainst a real sweep).Imported from ivall/xcl. Originally posted by JJAutoCompare on 2026-11-25T01:09:18Z.
I verified the saved-report CLI on exact PR head
3229445bb27ce02a6710495d972a58f4eee49aa2with a clean worktree.Tested
Windows 11 Enterprise Evaluation x64 (build 26200.9974), AMD Ryzen 7 3800X, CPython 3.13.7 x64 (portable NuGet package).
python -B scripts/coverage_gate.py --baseline <baseline.json> --run-json <report.json>with small synthetic saved reports. All 8 cases passed, with 0 failed, 0 ignored, and 0 skipped. A matching report and a report with a corpus-size change plus a new stage returned0. A translated-count drop, a missing stage, and individual increases invalidator_failed,panicked, andtimeouteach returned1with the expected diagnostic. A missing baseline returned2with a diagnostic on stderr.python -B -m unittest discover -s scripts -p test_coverage_gate.py -vpassed 9 tests, with 0 failed, 0 ignored, and 0 skipped.Not tested
Live
xcl shaderssweeps, game assets, GPU execution, the Cargo workspace suite, and the CI workflow.AI use
Codex (gpt-6.2-sol) ran the tests, wrote the temporary CLI harness, and wrote this report.
Imported from ivall/xcl. Originally posted by DavidM1911 on 2026-11-25T03:42:45Z.
Verification on RTX 3060 Ti (Windows 11), branch merged with current
main:cargo test -p xcl --lib: all passed, 0 failed, ~26 ignored. (Intermittent single-test flake / 0xc0000005 abort under parallel scheduling — tracked in #1978; clean on single-threaded rerun.)Thanks!