xshader: check group shared accesses against the guest's LDS allocation #225
No reviewers
Labels
No labels
accessibility
bug
documentation
duplicate
enhancement
good first issue
help wanted
invalid
question
wontfix
No milestone
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set
Reference
github/brcly--TuxBox!225
Loading…
Reference in a new issue
No description provided.
Delete branch "github-bot/gh-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?
@ReverendOzmund on GitHub · 2026-11-26 11:40 UTC · original
ReverendOzmund:xshader-lds-bounds→main· +211 −34 · 9 files · 4 commits · merged 2026-11-26 14:39 UTCnot 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.@ReverendOzmund on GitHub · 2026-11-26 11:59 UTC · original
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.@NickStallman on GitHub · 2026-11-26 12:02 UTC · original
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.
@ReverendOzmund on GitHub · 2026-11-26 12:03 UTC · original
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.@ReverendOzmund on GitHub · 2026-11-26 12:04 UTC · original
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.@NickStallman on GitHub · 2026-11-26 13:38 UTC · original
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.
@ReverendOzmund on GitHub · 2026-11-26 13:51 UTC · original
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.