Repository navigation
ps_sweep: a readback the tool cannot open is a class, not a traceback - #7886
evilclanker9000 wants to merge 4 commits into
Conversation
… a traceback classify_pair caught only FileNotFoundError, so a folder named <i>.raw or a permission failure on the output ended the whole compare with PermissionError/IsADirectoryError. Catch OSError after it and report the same class with a reason of its own.
…ible exact_pair returned missing for FileNotFoundError and let every other OSError escape, so --exact stopped on the first folder or unreadable .raw instead of classifying it.
Both depth reads and the two-clear control reads let a PermissionError or IsADirectoryError through, so --depth ended with a traceback where it should have said incompatible.
… an abort ps_sweep compare now reports a folder or a permission failure where a .raw file should be as invalid readback (incompatible for --exact and --depth); say so where the classes are described.
|
Windows, Python 3.13.7, synthetic inputs. Tested 12d09c4 with the same focused tests against the implementation at dde82f2. All four focused readback tests passed. Unreadable input reached the invalid-readback classification, and exact, depth and two-clear-depth comparisons returned incompatible. The earlier implementation failed the same suite. These were filesystem and classification checks on CPU. AI-assisted verification · GPT-6.2 Astra Medium |
|
I checked the CLI report path on Windows at 12d09c4d, in addition to the focused tests above. A directory at an expected readback path raised One wording detail in Synthetic inputs only. AI-assisted. |
|
Tested 12d09c4 on Arch Linux, Python 3.14.10, CPU only: pass — first Linux check. tests/test_ps_sweep.py 27/27 (3 skipped) OK. Negative control: base tool → 4 errors (IsADirectoryError tracebacks instead of classified invalid-readback); restored, green again. No game files. AI-assisted. |
|
Tested 12d09c4 on Windows 11, Python 3.15.2, NVIDIA RTX 4060 Ti (driver 621.24; CPU-only checks, no game files, no GPU/llvm-mc/MSVC used): pass. Ran the test files this PR adds or changes, from a clean checkout of the PR head: AI-assisted (Claude Code). |
ps_sweep.py comparereads each draw's.rawreadback to classify it, and all four readers caught onlyFileNotFoundError. Anything else — a folder where the readback should be (IsADirectoryErroron Linux,PermissionErroron Windows), or a permission failure on the file itself — escaped as a traceback and ended thewhole compare before any report was written. That is exactly the damaged or incomplete readback the classes exist
for, so it should be a class and not an abort.
What changed in
tools/ps_sweep.py:classify_pair(tolerance compare)FileNotFoundError->invalid readback, every otherOSError-> tracebackOSError->invalid readback, reason<tag>: unreadable outputexact_pair(--exact)FileNotFoundError->missing, otherOSError-> tracebackOSError->incompatibledepth_measurements(--depth)FileNotFoundError->depth_class: missing, otherOSError-> tracebackOSError->depth_class: incompatibledepth_measurements, two-clear control readsA missing file keeps its existing class, so nothing that classified before changes.
docs/shader_validation.mdnames the new case next to the classes it describes.
Test
tests/test_ps_sweep.pygains one case per reader (5 new tests). Each makes a temp folder named<i>.raw,<i>.raw.depthor<i>.raw.zero.depthwhere the tool expects a file, so the open raisesPermissionErroronWindows and
IsADirectoryErroron Linux — bothOSError, neitherFileNotFoundError.Before (tests added, tool unchanged):
The first version of the case file had one test covering
exact_pairand the first depth read; I split those perreader for the three commits, so the final file has 5 new cases and 27 tests.
After:
End to end with the same damaged output, both modes now report instead of raising:
python -m compileall -q tools tests,python -I scripts/check_no_game_data.py tools/ps_sweep.py tests/test_ps_sweep.py docs/shader_validation.mdandpython -I tests/test_docs_links.pyalso run here; the lastone fails only on the pre-existing
docs/dev-tools.md->runtime/README.md#a-600-frame-headless-guest-sceneanchor (an unclosed fence on
main, open PR #7351), not on this change.No GPU needed: the readers are pure file I/O with synthetic readbacks. Everything above ran on Windows 11 with
Python 3.12.
Notes
incompatiblerather thanmissingfor the non-FileNotFoundErrorcases of--exactand--depth: the pathexists but is not a usable readback, which is what those classes already mean for a wrong length.
classify_pairgets a reason of its own (unreadable output) so the existingmissing outputstill means thefile is absent.
load_resultsor the result-log readers: those parse what this tool itself wrote, so a folderthere is a different failure, not a damaged worker readback. Say so if you want the same treatment.
Task: EGEN-PSSWEEP-OSERROR in #7804 (posted there as a
finding:first).AI-assisted.