Repository navigation
Reject NaN in sampler mip readback - #2719
Conversation
An unordered NaN never exceeded the absolute error limit, so a corrupt GPU result could pass. Require each readback channel to be within the existing tolerance.
|
Tested I also used a temporary fragment shader to write a quiet NaN at pixel (37, 19), one RGBA channel per draw. In each GPU readback, only that channel differed from the clean frame. The parent comparator accepted all four frames. This PR rejected all four and reported (37, 19) each time. AI-assisted |
|
Additional check on The RTX 4070 / Windows comment above already does the GPU NaN-frame check through a temporary shader. This adds a Linux run of the real sampler test plus an independent before/after of the comparator itself, which is the whole change. GPU: Comparator probe (independent small script, not the PR's test), clean frame and one quiet-NaN channel That is exactly the bug:
Nothing hardware-specific to qualify here: the comparator is CPU code, and the GPU run only shows real readbacks still pass. I did not repeat the temporary-shader GPU NaN injection (the comment above covers it on another part); the probe above exercises the same acceptance test directly. Verdict: LGTM. AI-assisted review. |
|
Independent verification on Windows, CPU only, Python 3.12, at
So the NaN-in-a-sampler-channel case is exactly what the change adds, and the remaining 57 tests pass either way. No game data was read. |
|
Independent sampler readback fault sweep ( AI-assisted (Codex). |
|
Tested
No game files. AI-assisted (Claude Code). |
|
Tested 6e9eb12 merged onto main ec8ec4c on an NVIDIA GeForce RTX 5070 Ti (desktop), driver 617.14, Windows 11 (build 26200), subgroup 32..32: pass.
Setup note: |
Claimed in the coordination issue as: ps_ssharp Sampler NaN readback
What and why
The S#/T# mip test could pass a render-target pixel with a NaN channel. The old comparison asked whether the difference exceeded the tolerance, which is false for NaN. Require each channel to be within the same absolute tolerance.
Tested
0x7fc00000. On the baseline the clean frame and all four corrupt frames passed. With the fix the clean frame still passes and all four corrupt frames report pixel (63,63).python -I -m unittest discover -s tests -p test_shader_checks.pypassed all 63 tests on Windows. This comparator regression used synthetic readbacks and ran on the CPU.Checklist
docs/design.md, with how it was confirmed. (Not applicable.)AI-assisted (Codex).