xshader: check group shared accesses against the guest's LDS allocation #225
Loading…
Reference in a new issue
No description provided.
Delete branch "upstream-pr/225"
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 brcly/TuxBox. Originally posted by ReverendOzmund on 2026-11-26T11:40:56Z.
not run yet. The GPU suites don't execute translated programs with out-of-range LDS addresses, so I'd value an AMD or NVIDIA run of
tools/check_translator_gpu.pyfrom someone whose host builds the full check.Imported from brcly/TuxBox. Originally posted by ReverendOzmund on 2026-11-26T11:59:44Z.
Added
tools/check_lds_bounds_gpu.pyand registered it aslds-boundsin the translator GPU checks. Each lane writes its own word and a second value 32 KiB past it, then reads both back: the lane's word must survive and the far read must return 0. With the old& 8191uindex the far write wraps onto the lane's word, so this fails on main. I can't run the translator GPU checks on my host (no lld-link for the full check); a run on any NVIDIA or AMD card withpython tools/check_translator_gpu.py --only lds-bounds ...would be appreciated.Imported from brcly/TuxBox. Originally posted by NickStallman on 2026-11-26T12:02:34Z.
AMD run of
python tuxbox.py checkon this PR's head (6f510a5):1002:13c0), Mesa RADV, Linux 7.0.0, GE-Proton11-14 (Proton backend). Host profile wave 64-64.tools/check_translator_gpu.py), "Lanes and fixtures on the GPU" and the D3D12 regression controls.The RTX 5090 is busy with a game run right now. I can add an NVIDIA run afterwards if it's still needed.
Imported from brcly/TuxBox. Originally posted by ReverendOzmund on 2026-11-26T12:03:43Z.
Also covered the lane-exchange array: tb_swizzle is sized to the group, and groups of 32 or 96 lanes (allowed by the "complete blocks of 32 lanes" check) end in half a guest wave64, so
(tb_lane & ~63u) | lanecould index past it. Those reads now go through tb_swizzle_read() and return 0 past the end. 335 translator tests pass; exec_group assertions updated for the new form.Imported from brcly/TuxBox. Originally posted by ReverendOzmund on 2026-11-26T12:04:17Z.
Thanks Nick! Since that run I pushed two more commits (head
be9055c): thelds-boundstranslator GPU check (each lane writes its word and a second value 32 KiB past it; the word must survive and the far read must be 0), and the same bounds treatment for lane reads throughtb_swizzlein 32/96-lane groups. If you get a chance after your game run,--only lds-boundson the 5090 would be the most useful one, since NVIDIA is where out-of-range shared memory can actually fault.Imported from brcly/TuxBox. Originally posted by NickStallman on 2026-11-26T13:38:35Z.
NVIDIA run of
python tuxbox.py checkonbe9055c: RTX 5090 (10de:2b85), driver 595.99.02, GE-Proton11-14, Linux 7.0.0.Everything passes except
lds-bounds(FAIL lds-bounds False 8 2048 failed 8). The shader never ran, though:lds-bounds.jsonhasguest_exit: 1anderror: "invalid compute seed lds00".The cause seems to be the seed size, not the GPU:
tools/reference/independent-shaders/compute.cpp:8hasconstexpr UINT words = 384. At lines 37–41 it rejects a.seedwhose size isn't exactly384 * 4bytes.check_lds_bounds_gpu.pywritesWORDS = 4 * LANES= 256 words (1,024 bytes).So every case is rejected before dispatch, and I'd expect the same on AMD. My earlier AMD run was on
6f510a5, before this check existed. Padding the seed to 384 words, and comparing the first 256 of the readback (or the full 384 against an expected buffer padded the same way), should let it run. I'm happy to rerun it on the 5090 once that's pushed.The other groups all passed: Lanes and fixtures on the GPU, the D3D12 regression controls, and every other translator case.
Imported from brcly/TuxBox. Originally posted by ReverendOzmund on 2026-11-26T13:51:06Z.
Thanks, that was my mistake: I missed that compute.cpp takes exactly 384 seed words and exposes a 192-word view from word 96. Pushed a fix: the whole 384-word buffer is seeded and compared, the inputs sit at word 96, and each lane writes its two results over its own inputs. With the old
& 8191uindex the far write wraps onto the lane's word, so the check still fails on main. Would appreciate the 5090 rerun when you get a chance.