gpu: verify translated compute writes to two mips of one texture #2882
Loading…
Reference in a new issue
No description provided.
Delete branch "upstream-pr/2882"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Imported from R0Y00/Xbox2Windows. Originally posted by RonLogic on 2026-11-26T16:19:55Z.
Change
Refs #2490. This source-built fixture creates a single RGBA16_FLOAT texture with 32×8 and 16×4 mips. One translated slot-67 Dispatch writes distinct patterns through two slot-19 UAVs bound at separate table entries. After the fence the test compares all 1,280 half values, including the untouched regions in both mips. Before translation both mips retain their sentinels. Reversing the views reverses which pattern lands in which mip and changes exactly 64 half values. Failures identify the mip, coordinates, channel and the two bit patterns.
The texture runner retains the existing FP32 and D16 array-layer fixtures. #2710 is on main, and the denied, occupied and copied UAV controls remain in place.
Verification
Windows
26300.10075, MSVC x64 Release, SDK DXC1.9.2602.17, tested commit6005e991onb505c32b.24/24 passed without skips, including the FP32 and D16 array fixtures. Both two-mip runs matched 1,280/1,280 on in-box WARP (
10.0.26100.10068) and physical RTX 4070 (32.0.16.2124), with the D3D12 debug layer enabled and no error messages.git diff --checkpassed and the branch merges cleanly into currentmain.I used Codex to prepare the change and ran the verification locally.
Imported from R0Y00/Xbox2Windows. Originally posted by thepatrickworld on 2026-11-26T16:39:00Z.
Independent RDNA 4 result on
6005e991— the compute/texture family, three runs plus one mutantNot a code change; measurements only.
Environment
verprints10.0.26200.9974(Windows 11 25H2); MSVC banner19.44.35230,VCToolsVersion 14.44.35207; SDK DXC1.9.2602.17AMD Radeon RX 9070 XT, driver32.0.32029.2010(2026-11-18), as reported by the renderer; WARP10.0.26100.9818in the same logdev(aDebugbuild; the body used theReleasereleasepreset), head6005e991c4353d85c55237727f049639f40241a2,git status --porcelain --untracked-files=noemptydebug layer: unavailableCommands
three consecutive runs,
exit 0each.Observed
24 of 24 entries passed in every run, no skip, 85.1 / 85.9 / 85.5 s.
-Vprints the adapter per entry, so both backends sit in the same file:Identical in all three runs, each run printing one WARP block (entry 1280) and one hardware block (entry 1291). The array entries (
startup_compute_dispatch_array_*and..._array_d16_*, 2414-2417) are among the 24 and passed.A mutant both backends kill
Both UAV views take their
MipSlicefromswapped(467, 489); the descriptors stay written at heap bytes 64 and 128 (469, 490). Making the swap a no-op —swapped ? 1 : 0->0andswapped ? 0 : 1->1,count(old) == 1asserted on each, sha256 of the working-treetests/startup_stream_consumer.cpp(CRLF checkout)72c5a6291606569b710af6193735c0081a71059d77712e7d4c0f809b84396aa1->e5982357e06433bafdd53487e1e44c695358fb0492611c12a890523a454a9e97,M tests/startup_stream_consumer.cppingit statusduring the run — then rebuildingstartup_stream_consumer:0xbc00is -1.0 and0x3c00+1.0: the swapped leg expected the colour-1 pattern in mip 0, the mutant's readback holds the colour-0 pattern; at that first half the two differ only in the sign bit, and the next half is0x4400expected against0xc000read. The ordered leg runs in the mutant too and still passes, so what throws is the swapped comparison. Aftergit checkout --and a rebuild both entries pass again and the tracked tree is clean.Scope: the mutant pins both views at once, so what it shows is that a total no-op swap is caught, at the first half of mip 0. It does not show that a one-sided swap would be, nor that mip 1 contributes to the discrimination.
What the printed numbers rest on
check_mipscompares all 1,280 halves of the two mips against a CPU reference, sentinels outside the written 8x2 region included (mip_reference, 163-175). Thechanged == 64at 225 is computed between two readbacks of the same runtime (the ordered run and the swapped run), so on its own it proves a difference, not a correctness; the correctness comes from the twocheck_mipscalls against the reference. The manifest is asserted to readuav 0 … table 1 64anduav 1 … table 1 128(198-201).Where these entries run
startup_compute_dispatch_two_mips_${adapter}is registered atCMakeLists.txt:4640withTIMEOUT 120andSKIP_RETURN_CODE 77. The dev job's test step (.github/workflows/windows.yml:476-496) has noif:, but it branches on the event: on a pull request it runscmake --build --preset prandctest --preset pr(489), whose include list names nostartup_compute_dispatch*entry and whose target list does not buildstartup_stream_consumer, so neither leg can run there; on any other event it runsctest --preset dev -E '_hardware$'(494), so the_warpleg runs and the_hardwareleg does not.Limits
Debugpreset rather than theReleaseone the body used.sev=0/1scan inclean()(66-67) had nothing to inspect: what passes here is the half-readback path, not API validation.store()the pre-translation refusal is asserted at 90 and the no-Dispatch leg at 102; instore_two_mips()the pre-translation refusal is asserted at 210-211 and that entry has no no-Dispatch leg. None of these legs was mutated.AI-assisted.
Imported from R0Y00/Xbox2Windows. Originally posted by R0Y00 on 2026-11-27T06:30:05Z.
Review: COMMENTED
Independent validation of
6005e991againstmain98e4a2ee(0d81d265locally). I rebuiltstartup_stream_consumerandd3d12_xs_shim, then ranctest --preset <dev|release> --no-tests=error -V -R '^startup_compute_dispatch_(two_mips|texture)_(warp|hardware)$'. Debug and Release/O2each passed 4/4 with no skips. Both WARP and RTX 4060 Laptop matched all 1,280 halves, and swapping the views changed exactly 64. The missing-translation and existing texture controls passed. Windows 11 build 26200.9974, NVIDIA driver 32.0.16.1656, WARP 10.0.26100.9818, D3D12 debug layer enabled with zero errors.#2902 landed on
mainasf5204690. The integration trial conflicts intests/startup_compute_dispatch_texture_check.pyandtests/startup_stream_consumer.cpp. Please update against currentmainand retain the 1D/3D store and refusal fixtures alongsidetwo-mips. I’ll rerun the combined texture matrix on the updated head.Imported from R0Y00/Xbox2Windows. Originally posted by tedin7 on 2026-11-27T09:36:09Z.
This PR now conflicts with
main. Conflicting files:tests/startup_compute_dispatch_texture_check.pytests/startup_stream_consumer.cppCould you merge
maininto your branch (a merge commit, no force push needed) and resolve these? Thank you.AI-assisted; commands listed were executed locally. (
git merge-tree origin/main <head>)Imported from R0Y00/Xbox2Windows. Originally posted by RonLogic on 2026-11-27T10:28:56Z.
Merged current
main(98007de5) into the PR branch as requested. The merge keeps the upstream 1D and 3D mip-one stores, array fixtures and uniformimage_load_mipcoverage alongside the two-mip case. Headc6f7144be4912cc79ef81987c30342d3bec09e9dwas pushed as a fast-forward.I rebuilt
startup_stream_consumerandd3d12_xs_shimwith MSVC 19.52 x64 on Windows26300.10075. Release passed 12/12 and Debug passed 8/8, with no skips. WARP10.0.26100.10068and RTX 407032.0.16.2124both matched all 1,280 halves and detected the expected 64 changes when the UAVs were swapped, with the D3D12 debug layer enabled and no errors. The 1D, 3D and array regressions passed on both adapters.Imported from R0Y00/Xbox2Windows. Originally posted by RonLogic on 2026-11-27T12:27:54Z.
@tedin7
Imported from R0Y00/Xbox2Windows. Originally posted by R0Y00 on 2026-11-27T13:14:41Z.
Independent validation of
c6f7144be4912cc79ef81987c30342d3bec09e9dintegrated withmain801f4c3b(treec93a69036383ee89156698f24ba8ff660ebaa96f). The diff changes only the fixture, its CTest registration and experiment docs. I checked the packed readback offsets, row-pitch alignment and separate UAV descriptor slots, including that the existing single-mip volume, line and array paths keep their dimensions.Built
startup_stream_consumer d3d12_xs_shimand ranctest --test-dir <build> --no-tests=error -V -R '^startup_compute_dispatch_(two_mips|texture|array|array_d16)_(warp|hardware)$'. Debug and Release/O2each passed 8/8 with zero skips. On both adapters and builds all 1,280 half words matched after the fence, and the descriptor-swap control changed exactly 64 halves. The missing-translation case kept both subresources unchanged. The D3D12 debug layer was enabled with no reported errors. Windows 11 26200.9974, WARP 10.0.26100.9818, RTX 4060 Laptop driver 32.0.16.1656, SDK DXC 10.0.26100. The docs link check also passed.