Shaders: join straddling global 16-bit loads across dwords #565
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/Belobug--VIctory-Belobug-AMD!565
Loading…
Reference in a new issue
No description provided.
Delete branch "github-bot/gh-565"
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?
@DecayingEagle on GitHub · 2026-11-27 11:41 UTC · original
DecayingEagle:fix/global-half-straddle→a-publier· +252 −3 · 4 files · 2 commits · draftA root-SRV
global_load_ushortorglobal_load_sshortat byte 3 modulo 4 loses its high byte. On the RX 7900 XT, the new test reads0x00f2where the input contains0x17f2. Bytes at offsets 0, 1 and 2 already follow unaligned semantics.Join the next dword's low byte for a straddling half; otherwise read the first dword again. Keep the existing sign extension and byte loads. Bump
TRANSLATOR_VERSIONfrom 2 to 3 so an older cached translation cannot hide the fix. The common path also serves code-constant-table loads, although the new hardware test covers root SRVs.The join follows Marvisak/VIctory#3333 (
80e8cede), applied to this branch's separate global-load path. Its buffer-load path already handles straddling halves.Validation
RX 7900 XT, Mesa 26.3.1 RADV, Wine 11.22, vkd3d-proton
71cae09; Rust 1.98.1, MSVC cross-target:62fd607: added the same coverage through a code-constant table addressed bys_getpc_b64, explicitly asserting CODE resource tracking and no root SRV. The new route also fails before the fix at byte 3 and passes afterward (8 more configurations, 384 lane results). Both tests, both Clippy configurations and policy pass on the RX 7900 XT/Wine setup. The new code-table case has not yet been run on native Windows.3edb877: 304 shader tests passed, 0 failed, 4 ignored.-D warnings: passed.Limits
A later manual gameplay run failed after 606.5 seconds with the previously observed null command-allocator access at title
+0x4e9b578; no matching GPU reset was recorded. This predates this shader change and remains unresolved. Full setup and a descriptor-fallback control are recorded in #583.The console driver's alignment mode is still unconfirmed; this makes byte 3 consistent with the unaligned behavior already used at byte 1 and by this branch's buffer loads. Bounds/host-copy crossings and the separate arbitrary-title-address path are unchanged. Native Windows full-suite CI is pending. Synthetic test data only; no title assets attached.
Implementation, tests and this description were assisted by OpenAI Codex.
@gut0to on GitHub · 2026-11-27 13:03 UTC · original · reviewed
AI-assisted review. I checked the unaligned-load fix and left one coverage suggestion inline.
@ -2299,3 +2298,4 @@// A half at byte 3 continues in the next dword.let (not3, three) = (self.s.m.i32(!3), self.s.m.i32(3));let at = self.s.m.bin(c, Bin::And, off, not3);let w = dword(self, at)?;@gut0to on GitHub · 2026-11-27 13:03 UTC · original
AI-assisted review: The PR notes that this shared path also serves code-constant-table loads, while the new hardware regression exercises only a root SRV. Could you add a byte-3 straddling case through the constant-table route too? That would protect both callers of the newly added second-dword read.
@MamaLeVrai on GitHub · 2026-11-27 15:56 UTC · original
Tested on an RX 6950 XT (RDNA 2), driver 32.0.21045.29003, Windows 11 build 26300, Rust 1.98.1, release. At
3edb877:victory-shader304 passed, 0 failed, 4 ignored.AI-assisted (Claude Code); no game data.
@ -2299,3 +2298,4 @@// A half at byte 3 continues in the next dword.let (not3, three) = (self.s.m.i32(!3), self.s.m.i32(3));let at = self.s.m.bin(c, Bin::And, off, not3);let w = dword(self, at)?;@DecayingEagle on GitHub · 2026-11-27 16:39 UTC · original
Added in
62fd6072450e1b0c54cfd60c6c92c8f4521840e1.The new
code_table_subdword_loads_read_all_bytes_and_extend_the_signappends synthetic bytes to the program, addresses them throughs_getpc_b64, asserts resource tracking selectedCODE, and dispatches without a root SRV. It covers signed/unsigned bytes and halves at every byte alignment in wave32 and wave64.On RX 7900 XT / RADV / Wine 11.22, reverting only the production lowering makes the new case fail at byte 3 in the unsigned-half check; restoring it passes all eight configurations (384 lane results). The existing root-SRV test passes too. Both workspace/all-target Clippy configurations (
-D warnings) and policy pass. DXVK maps the WARP request to the same hardware here, so independent WARP/native Windows coverage of this new case remains unverified.No production lowering changed in this follow-up. Assisted by OpenAI Codex.
View command line instructions
Checkout
From your project repository, check out a new branch and test the changes.Merge
Merge the changes and update on Forgejo.