Repository navigation
Conversation
|
I found a false pass in As a negative control I changed only the expected CPU word in MRT0[0] before calling this PR’s
The low halves RTX 3080 Ti, NVIDIA 620.73.04, CachyOS Linux. Synthetic shader and deliberately perturbed expectation; this measures comparator sensitivity. AI-assisted. |
whattheflop
left a comment
There was a problem hiding this comment.
Independent Windows CPU verification, AI-assisted, with uv CPython 3.12.13. All nine stock tests passed. Two additional synthetic cases affect verdicts:
- In a translated shader,
v_rsq_f32reaches MRT0[0], while MRT0[1] is an unrelated exact constant and a separate integer store writes0x20to heap offset0x20. Keeping the RSQ result exact and changing only MRT0[1] by one ULP, or only the heap word to0x21, givesapprox. A mocked readback with all three changed reports oneapproxand exits 0. Restrict ULP tolerance to results with a known approximate source and float representation. The RSQ-only controls classified +1/+2 ULP asapproxand +3 asdiff. - Related to the MRT0 NaN finding above, the untyped predicate also accepts a raw integer heap change
0xa55a7e00 → 0xa55a7e01. And a genuine packed-f16 NaN-payload-only change0x7e000000 → 0x7f800000reportsdiff, because the latter looks like binary32 infinity. Compare unclassified heap words bitwise and allow NaN equivalence only at an established float width.
These canaries use the interpreter and mocked readback. No GPU or game data.
|
The first-draw check can hide GPU/CPU differences on a working device. On an Intel UHD 770 (Windows 11, driver I ran the unmodified CLI and harness at
The two differences are real readbacks: both gave In a local trial I kept per-case 77 results, wrote the report, and returned 77 when every collected case was unsupported. Both orders then exited 1 with the same 12 verdicts. A separate FP64-only selection still exited 77 and reported all 12 unsupported cases. If you want a fast whole-device skip, probing once with a known baseline shader would avoid making the first selected test determine the result. AI-assisted testing with repository-owned synthetic shaders. |
|
Thanks for the measurements that found this. On Windows 11 / RTX 5070 / 610.88, I reproduced the original For the separate sticky-bit check with AI-assisted. |
|
Tested on Windows 11, Python 3.15.2, RTX 5090 (driver 617.42), Vulkan SDK 1.4.363.0, MSVC+Ninja. HEAD 71a5656. Setup: built vk_harness via runtime/build (ninja), spirv-as from Vulkan SDK Bin on PATH. Commands run:
Diffs found (all in test_alu_div_fmas.py / test_valu_rcp_fdiv.py): denormal flush vs preserve (gpu=0x00000000 cpu=0x26800000), 1-ulp overflow/sticky-bit (0x65c00004 vs 0x65c00005), subnormal quotient -> gpu inf 0x7f800000 vs cpu 0x7f000000. These look like genuine NVIDIA-vs-model disagreements the script is designed to surface (FTZ/denormal handling), not harness failures — vk_harness drew every run. Red controls:
AI-assisted (Devin); no game files. |
|
Follow-up on the remaining sticky-bit rows from
In the four default/immediate failures, the small addend had the product's sign. The result was the even word Separately, the subnormal-divisor case in AI-assisted. Synthetic inputs only. |
|
Verified against main 3faac55 (clean merge): compileall clean, tests/test_semantic_on_gpu.py passes 9/9 under python -I (CPU parts: replayability filter, NaN/ulp comparison, classify, collect on a synthetic folder), and all ten docs guards pass with the new testing.md section. The GPU replay itself needs vk_harness and was not run here, so the RTX 2060 SUPER numbers are unverifiable from a CPU-only run — and the three diffs it documents (NVIDIA f32-subnormal flush in v_div_fmas_f32) are an honest non-clean result. Two nits: the --json output (scripts/semantic_on_gpu.py:251, verified) and the fixture write should pin newline="\n" per the repo convention. CI was pending. AI-assisted: yes. Tested on Linux (RTX 5080 host, CPU-only run). |
|
Tested
|
Claimed in #4683 as: #4683 (comment)
What and why
tests/semanticchecks the translator's SPIR-V onspirv_mini_interp, a CPU model of Vulkan. A test can pass there and still give other words on a driver, either because the translator relies on something the model does and the driver doesn't, or because the model is wrong. #4181, #4128 and #3889 were model bugs found by reading.scripts/semantic_on_gpu.pychecks the model against a real GPU instead.run_fragmentwrapped and keeps the runs that one pixel can repeat, up to--per-testdistinct runs per test (25 by default). A run qualifies when:%UserDatapush-constant block carries the heap base);It skips runs made while a test had swapped a function of the interpreter:
test_fma_exactsplitsFmaon purpose to model another driver.vk_harness, with the push constants inVKH_SGPRSand the memory inVKH_HEAP, and the heap is read back throughVKH_HEAP_DUMP.approx.spirv-asrejects isinvalid.diff, and the script exits 1. It exits 77 whenvk_harnesscan't draw on the machine.It needs no game files, and you can run it on any driver. The useful runs are on Intel ANV, RADV, AMD Windows and MoltenVK, where the translator's assumptions are least checked.
First result (RTX 2060 SUPER, driver 620.70.06, Linux, main 98fa503): 12,305 runs, 32 min with
--jobs 4.v_rsq_f32, 1 ulptest_valu_rcp_fdiv's pipeline-sabotage negative controlv_div_fmas_f32with an f32 subnormal input:test_denormal_inputs_kept_and_output_flushed_denorm32_0(2^-130 * 2^80gives 0, gfx1036 gives 2^-50) and the twoS2 = 0x00000010rows oftest_overflow_prevention_and_sticky_bit(0x65c00004, gfx1036 gives 0x65c00005)The three diffs have one cause, described in the finding. docs/design.md's div_fmas row keeps subnormal inputs under the game MODE, but the modules declare no 32-bit denormal mode (only
DenormPreserve 16). TheFmatherefore reads its inputs under the driver's default, and NVIDIA flushes them. The interpreter never flushes f32, so these rows pass on the CPU only. This PR doesn't change the translator.Commits:
scripts/semantic_on_gpu.pytests/test_semantic_on_gpu.py(CPU only, standard library):approxrule;collect()on a synthetic test folder (a repeated run kept once, a swapped interpreter left out, the--per-testcap);vk_harness.Tested
Linux, Python 3.14, rebased on main de67135:
python3 -I tests/test_semantic_on_gpu.py: 9 tests, OK. With pytest, together withtests/test_run_gpu_tests.py: all pass.--files 'test_alu_div_fmas.py': 41 runs, 3 diff, 38 ok, in 4 s.Checklist