Repository navigation
Model M driver probe: distinct values per lane and element - #14
Merged
Merged
Conversation
native_driver_probe multiplied an all-ones A by an all-twos B and added C = the lane number in every element, then checked 32 + lane. Because A and B were uniform and C and D share one layout, any element layout of A, B or the accumulator gave the same result, so a driver or translation layer that lays the WMMA fragments out differently still passed. The probe now reads A, B and C from its buffer. The host fills them in the fragment layout of clean/FORMATS.md (clean/runtime/wmma_probe.h): A and B are small nonzero integers whose 256 products A x B are all distinct, C = (32 v + lane) / 512 is distinct per element, every value is exact in FP32, and the expected FP16 and FP8 results are computed on the CPU in the same header. A different lane, element or half order of A, B or the accumulator, A and B swapped or transposed, or the other accumulator row table now changes at least one checked value. The cost at create stays one launch of one wave (4.5 KiB upload, 2 KiB readback). WG_TEST_DRIVER_PROBE_FAIL=1 still reports a mismatch at float 7. clean/runtime/tests/test_wmma_probe.cpp checks this on any host: a model of the instruction runs the probe's buffer under 17 named wrong layouts and every lane-pair and element-pair swap of A, B and C/D (1,572 more); the new probe fails each one and the old probe passes each one. clean/dx12/tests/native_probe_test.cpp runs the probe on the GPU through make_d3d12_device_on. Reported by @j0nsh1n in #10. Refs #10. Signed-off-by: phantoslayer21 <156617979+phantoslayer21@users.noreply.github.com>
phantoslayer21
marked this pull request as ready for review
November 13, 2026 15:31
phantoslayer21
force-pushed
the
fix/model-m-probe-lanes
branch
from
November 13, 2026 15:31
7a4d410 to
6aef466
Compare
This was referenced Nov 13, 2026
Open
phantoslayer21
added a commit
that referenced
this pull request
Nov 13, 2026
- Version defaults 0.6.0 -> 0.6.1: the front end and WrongGPU.asi (src/version.h), the launcher (WRONGGPU_VERSION), WrongGPU-RR.asi (release_version of the 2.7, 2.8 and 2.14 binding tables) and the RR runtime's reported version. - One version source for a release build: CMake -DWG_VERSION=x.y.z for the front end and WrongGPU.asi (writes wg_version_override.h), build.py --release-version x.y.z for the RR plugin. Without them the defaults are used. - clean/installer/RELEASE-NOTES.md for 0.6.1: the fixes since 0.6.0 (#7, #8, #9, #14 and the launcher issues), thanks to j0nsh1n for the reports, and the 0.6.0 notes carried over without performance figures (no 0.6.1 measurement backs them). Signed-off-by: phantoslayer21 <156617979+phantoslayer21@users.noreply.github.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What changed and why
At device creation on a borrowed (game) device, Model M runs
native_driver_probeto check the driver's matrixinstructions. The probe multiplied an all-ones A by an all-twos B and added C = the lane number, then checked
32 + lanefor every result. Because A and B were uniform, and C and D share one layout, it gave the same result forany element layout of A, B or the accumulator: a driver or translation layer that lays the fragments out differently
would still pass.
Now:
clean/runtime/wmma_probe.h(new, header only): the probe's operands, buffer layout and expected results. A and Bare 16 x 16 tables of small nonzero integers (exact in FP16 and FP8 E4M3) whose 256 products A x B are all distinct;
C = (32 v + lane) / 512 is distinct per element. Every value and partial sum is exact in FP32, so the result does not
depend on the order of the hardware's additions. The host writes A, B and C in the fragment layout of
clean/FORMATS.mdand computes the expected FP16 and FP8 results on the CPU.native_driver_probe(clean/dx12/kernels/native_game_helpers.hlsl) reads A, B and C from its buffer instead ofusing constants; same two matrix calls, same output layout.
device_d3d12.cpp: uploads the filled buffer and checks every result withwmma_probe::first_mismatch. The errortext is unchanged ("probe mismatch at float N"), and
WG_TEST_DRIVER_PROBE_FAIL=1still reports float 7.Tests
clean/runtime/tests/test_wmma_probe.cpp(CPU, any host, any C++17 compiler; BUILDING.md section 6). A model ofthe matrix instruction reads the probe's buffer with a given fragment layout, computes D = A x B + C and writes D back
in that layout. Results with MSVC and with clang++ (no warnings with
/W4or-Wall -Wextra):clean/FORMATS.mdboth the new and the old probe pass;bytes of each dword swapped; A, B or C/D transposed; A and B swapped; accumulator rows
2v + h): the new probefails every one, the old probe passes every one;
fails all of them, the old probe passes all of them;
clean/dx12/tests/native_probe_test.cpp(GPU): creates a D3D12 device and queue on the RX 9070 / 9060 adapter andcalls
make_d3d12_device_on, which runs the probe. On an RX 9070 XT (Windows) with the rebuilt probe kernel: PASS,so all 512 results matched the CPU's values. With
WG_TEST_DRIVER_PROBE_FAIL=1: create fails with"probe mismatch at float 7", as before.
Not tested: Proton / vkd3d-proton (the reporter's setup), RX 9060 boards.
Reported by @j0nsh1n in #10.
Refs #10.