Skip to content

tooling: refuse a missing form_coverage records directory - #2089

Merged
R0Y00 merged 1 commit into
R0Y00:mainfrom
alvaroolt:tooling/form-coverage-records-dir
Nov 25, 2026
Merged

R0Y00 merged 1 commit into
R0Y00:mainfrom
alvaroolt:tooling/form-coverage-records-dir

Conversation

@alvaroolt

Copy link
Copy Markdown
Contributor

Change

tools/form_coverage.py reads --records with Path.glob, which yields nothing for a path that does not exist. A mistyped directory, or the default out/build/dev/form_coverage used with a release JUnit file, therefore measured zero shader records, silently reported every gfx form (and the record-mode x64 fixtures) as uncovered, and exited 0. With --gaps or --json nothing on the output said why, so the gap list that CONTRIBUTING.md recommends for choosing a form was wrong.

Measured on a full dev run at a0bc0f9, before this change (the tool is unchanged on 489d579):

--records gfx1013 covered x64_zen2 covered exit
out/build/dev/form_coverage (this run) 1347 / 1968 899 / 948 0
out/build/release/form_coverage (241 records from an earlier run) 0 / 1968 884 / 948 0
out/build/relase/form_coverage (typo, does not exist) 0 / 1968 884 / 948 0

After this change:

  • A --records path that is not a directory is an error (exit 2):
    form_coverage: out\build\relase\form_coverage: records directory does not exist (or records path is not a directory).
  • A directory whose records were all written outside the JUnit run is still measured as before, with one warning on stderr:
    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.
  • An empty directory stays silent, because then no recording test ran.
  • The CI dashboard step is unchanged: it uses the dev default after a full dev run, where the directory exists and the records are fresh.

CONTRIBUTING.md now 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).

python -B tests/form_coverage_check.py   # form coverage checks passed

The new check_records_errors runs the CLI on a synthetic JUnit file and checks five cases:

  • a missing directory, in report mode and with --gaps: exit 2, one-line diagnostic, empty stdout;
  • a file instead of a directory, in the same two modes: exit 2, one-line diagnostic, empty stdout;
  • an empty directory: exit 0, no stderr;
  • a record written within the run window: exit 0, no stderr, and the record is counted;
  • the same record dated an hour before the run, in both modes: exit 0, the warning, and the normal output.

Before the change, the first case failed: exit 0, empty stderr.

Negative controls, both reverted afterwards:

  • Removing the stale-record warning makes check_records_errors fail.
  • Warning even when a fresh record exists makes it fail on the fresh-record case.

Full suites on 489d579 plus this change (NVIDIA GeForce RTX 5080 driver 32.0.16.2124, AMD Radeon iGPU, WARP; debug layer unavailable):

ctest --preset dev --no-tests=error -j8 --output-junit <...>       # 1294 tests: 1261 passed, 1 timeout, 32 capability skips
cmake --preset release; cmake --build --preset release
ctest --preset release --no-tests=error -j8 --output-junit <...>   # 1294 tests: 1262 passed, 0 failed, 32 capability skips
python -B tools/form_coverage.py <dev junit> --records out/build/dev/form_coverage          # gfx1013 1347/1968, exit 0, no warning
python -B tools/form_coverage.py <release junit> --records out/build/release/form_coverage  # gfx1013 1347/1968, exit 0, no warning

The one dev timeout was compute_store_aot_guard_read_hardware (45 s limit), which started at the beginning of the -j8 run. Rerun alone, it passed in 22.45 s, and it passed in the release suite. This change does not touch it.

Rebased onto 6218beb before pushing. Of the touched files, only tests/form_coverage_check.py changed upstream (#1971). The rebase was clean, and python -B tests/form_coverage_check.py and tests/docs_links_check.py pass 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.py passes with LLVM 15.0.7 (LLVM_LIB, LLVM_MC, LLVM_OBJCOPY set).

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

  • This pull request covers one reviewable behavior.
  • I included the exact command and result for every check I ran.
  • I considered a negative control or failure case for a new fixture.
  • I updated README/docs when a capability or build requirement changed.
  • I did not include game files, dumps, distribution links or secrets.

AI-assisted (Claude Code).

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.
@R0Y00
R0Y00 merged commit b9f5ef9 into R0Y00:main Nov 25, 2026
5 checks passed
@alvaroolt
alvaroolt deleted the tooling/form-coverage-records-dir branch November 25, 2026 00:19
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.

2 participants