Repository navigation
tooling: refuse a missing form_coverage records directory - #2089
Merged
Merged
Conversation
tools/form_coverage.py read --records with Path.glob, which yields nothing for a path that does not exist. A mistyped directory, or the dev default used with a release JUnit file, therefore counted every shader and record-mode form as uncovered and exited 0. With --gaps or --json nothing said why. A --records path that is not a directory is now an error (exit 2). A directory whose records were all written outside the JUnit run is still measured, with a warning on stderr. An empty directory stays silent, because no recording test ran.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Change
tools/form_coverage.pyreads--recordswithPath.glob, which yields nothing for a path that does not exist. A mistyped directory, or the defaultout/build/dev/form_coverageused with areleaseJUnit file, therefore measured zero shader records, silently reported every gfx form (and the record-mode x64 fixtures) as uncovered, and exited 0. With--gapsor--jsonnothing on the output said why, so the gap list that CONTRIBUTING.md recommends for choosing a form was wrong.Measured on a full
devrun at a0bc0f9, before this change (the tool is unchanged on 489d579):--recordsout/build/dev/form_coverage(this run)out/build/release/form_coverage(241 records from an earlier run)out/build/relase/form_coverage(typo, does not exist)After this change:
--recordspath that is not a directory is an error (exit 2):form_coverage: out\build\relase\form_coverage: records directory does not exist(orrecords path is not a directory).form_coverage: out\build\release\form_coverage: none of the 241 records here was written during this JUnit run, so no record-mode or shader form is counted.devdefault after a fulldevrun, where the directory exists and the records are fresh.CONTRIBUTING.mdnow says to use the records directory of the preset that produced the JUnit file. No issue.Verification
Environment: Windows 11 10.0.26300, MSVC 14.52, Windows SDK 10.0.26100, Python 3.12 (
out/pe-env).The new
check_records_errorsruns the CLI on a synthetic JUnit file and checks five cases:--gaps: exit 2, one-line diagnostic, empty stdout;Before the change, the first case failed: exit 0, empty stderr.
Negative controls, both reverted afterwards:
check_records_errorsfail.Full suites on 489d579 plus this change (NVIDIA GeForce RTX 5080 driver 32.0.16.2124, AMD Radeon iGPU, WARP; debug layer unavailable):
The one
devtimeout wascompute_store_aot_guard_read_hardware(45 s limit), which started at the beginning of the-j8run. Rerun alone, it passed in 22.45 s, and it passed in thereleasesuite. This change does not touch it.Rebased onto 6218beb before pushing. Of the touched files, only
tests/form_coverage_check.pychanged upstream (#1971). The rebase was clean, andpython -B tests/form_coverage_check.pyandtests/docs_links_check.pypass again on 8bc3a38. The full suites were not rerun on this base.The 93 Python checks that the workflow runs without arguments pass, and so does
tests/docs_links_check.py. The other 9 listed checks take LLVM arguments and run in the LLVM 15 job.tests/rdna2_tools_check.pypasses with LLVM 15.0.7 (LLVM_LIB,LLVM_MC,LLVM_OBJCOPYset).Evidence and follow-up
No fixtures or third-party data. The warning is a heuristic for one case only: every record in the directory falls outside the run. A directory that mixes fresh and stale records (a filtered run in an existing build directory) is measured without a warning, as before.
Checklist
AI-assisted (Claude Code).