tooling: refuse a missing form_coverage records directory #2082

Merged
alvaroolt merged 1 commit from upstream-pr/2089 into main 2026-11-25 00:16:16 +00:00
alvaroolt commented 2026-11-25 00:07:03 +00:00 (Migrated from github.com)

Imported from R0Y00/Xbox2Windows. Originally posted by alvaroolt on 2026-11-25T00:07:03Z.


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 a0bc0f9a, before this change (the tool is unchanged on 489d5797):

--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 489d5797 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 6218beb2 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 8bc3a383. 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).

<!-- greyfinch-sync:R0Y00/Xbox2Windows:issue:6594032660 --> Imported from [R0Y00/Xbox2Windows](https://github.com/R0Y00/Xbox2Windows/pull/2089). Originally posted by [alvaroolt](https://github.com/alvaroolt) on 2026-11-25T00:07:03Z. --- ## 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 a0bc0f9a, before this change (the tool is unchanged on 489d5797): | `--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`). ```powershell 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 489d5797 plus this change (NVIDIA GeForce RTX 5080 driver 32.0.16.2124, AMD Radeon iGPU, WARP; debug layer unavailable): ```powershell 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 6218beb2 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 8bc3a383. 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 - [x] This pull request covers one reviewable behavior. - [x] I included the exact command and result for every check I ran. - [x] I considered a negative control or failure case for a new fixture. - [x] I updated README/docs when a capability or build requirement changed. - [x] I did not include game files, dumps, distribution links or secrets. AI-assisted (Claude Code).
upstream-sync closed this pull request 2026-11-25 01:01:35 +00:00
Sign in to join this conversation.
No reviewers
No labels
No milestone
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Reference
R0Y00/Xbox2Windows!2082
No description provided.