Byte and halfword LDS: the four open PRs compared (#101, #571, #632, #116) #1343

Open
opened 2026-11-26 04:28:13 +00:00 by github-bot · 5 comments
Owner

@⁠dragoso on GitHub · 2026-11-24 17:33 UTC · original

Four open PRs lower the same instructions (ds_read_{u,i}{8,16}[_d16[_hi]], ds_write_b{8,16}[_d16_hi]). All four are based on main ffe310e. I measured them the same way so review can pick one and close the others. I wrote #116, so I tried to measure all four by the same rules.

On a retail dump (victory translate --validate --list, dxil.dll 10.0.26100)

validated gained vs main lost
main ffe310e 21,736
#101 21,752 +16 0
#571 21,752 +16 0
#632 21,750 +14 0
#116 21,752 +16 0
  • All the gains are compute programs: 9 were refused for ds_write_b16, 7 for ds_read_u16.
  • #101, #571 and #116 gain the same 16 programs.
  • #632's 14 are a subset. The other 2 use ds_read_u16_d16_hi, which #632 refuses on purpose ("an LDS read into half a register").
  • No PR loses a program that validates on main.

On hardware, one form at a time

I ran #116's lds_tests against each PR's lowering, with the same tests and a per-form filter. This ran on an RTX 5060 Ti and on WARP, 64 lanes. The tests check:

  • each read form at every byte or halfword address of two dwords, and that _d16/_d16_hi keep the other half of the register;
  • each write form, with the dword read back;
  • 64 lanes writing their own bytes or halves of shared dwords, where no write may be lost.
4 plain reads 6 d16 reads 4 writes shared dwords
#101 pass pass pass pass
#571 pass pass pass pass
#632 pass refused (by design) pass pass
#116 pass pass pass pass

Each PR's own tests (cargo test -p victory-shader)

  • main: 120 passed.
  • #101: does not compile on ffe310e. Its test calls resource::track with 3 arguments; main now takes the structure as a 4th.
  • #571: 124 passed.
  • #632: 123 passed.
  • #116: 125 passed.

Differences that the numbers don't show

  • Unaligned halfwords. #571 handles a halfword at byte 3 of a dword: it reads across into the next dword, and writes into it with a second pair of atomics. The other three assume halfwords are 2-aligned. The cost in #571 is that every 16-bit access goes through 64-bit arithmetic (flags::INT64) and a second load. Every ds_write_b16 becomes four atomics, aligned or not.
  • Concurrent writes. All four write with an atomic and to clear the bits, then an atomic or to set them. So lanes that write other bytes of the same dword keep theirs, and the shared-dword test passes for all four.
  • d16 reads. #632 refuses them, so it misses 2 programs in the dump. The other three keep the other half through inst.read of the destination. That works on main because the IR already records every vector instruction's destination as a read. The extra read #116 adds in ir.rs is redundant, and I'll drop it from #116.

No game data, shader bytes or shader names are included here. The counts come from a local dump.

AI-assisted (Claude Code).

**@⁠dragoso** on GitHub · 2026-11-24 17:33 UTC · [original](https://github.com/Marvisak/VIctory/issues/1343) Four open PRs lower the same instructions (`ds_read_{u,i}{8,16}[_d16[_hi]]`, `ds_write_b{8,16}[_d16_hi]`). All four are based on main `ffe310e`. I measured them the same way so review can pick one and close the others. I wrote #116, so I tried to measure all four by the same rules. ### On a retail dump (`victory translate --validate --list`, dxil.dll 10.0.26100) | | validated | gained vs main | lost | |---|---:|---:|---:| | main `ffe310e` | 21,736 | | | | #101 | 21,752 | +16 | 0 | | #571 | 21,752 | +16 | 0 | | #632 | 21,750 | +14 | 0 | | #116 | 21,752 | +16 | 0 | - All the gains are compute programs: 9 were refused for `ds_write_b16`, 7 for `ds_read_u16`. - #101, #571 and #116 gain the same 16 programs. - #632's 14 are a subset. The other 2 use `ds_read_u16_d16_hi`, which #632 refuses on purpose ("an LDS read into half a register"). - No PR loses a program that validates on main. ### On hardware, one form at a time I ran #116's `lds_tests` against each PR's lowering, with the same tests and a per-form filter. This ran on an RTX 5060 Ti and on WARP, 64 lanes. The tests check: - each read form at every byte or halfword address of two dwords, and that `_d16`/`_d16_hi` keep the other half of the register; - each write form, with the dword read back; - 64 lanes writing their own bytes or halves of shared dwords, where no write may be lost. | | 4 plain reads | 6 d16 reads | 4 writes | shared dwords | |---|---|---|---|---| | #101 | pass | pass | pass | pass | | #571 | pass | pass | pass | pass | | #632 | pass | refused (by design) | pass | pass | | #116 | pass | pass | pass | pass | ### Each PR's own tests (`cargo test -p victory-shader`) - main: 120 passed. - #101: does not compile on `ffe310e`. Its test calls `resource::track` with 3 arguments; main now takes the structure as a 4th. - #571: 124 passed. - #632: 123 passed. - #116: 125 passed. ### Differences that the numbers don't show - **Unaligned halfwords.** #571 handles a halfword at byte 3 of a dword: it reads across into the next dword, and writes into it with a second pair of atomics. The other three assume halfwords are 2-aligned. The cost in #571 is that every 16-bit access goes through 64-bit arithmetic (`flags::INT64`) and a second load. Every `ds_write_b16` becomes four atomics, aligned or not. - **Concurrent writes.** All four write with an atomic and to clear the bits, then an atomic or to set them. So lanes that write other bytes of the same dword keep theirs, and the shared-dword test passes for all four. - **d16 reads.** #632 refuses them, so it misses 2 programs in the dump. The other three keep the other half through `inst.read` of the destination. That works on main because the IR already records every vector instruction's destination as a read. The extra read #116 adds in `ir.rs` is redundant, and I'll drop it from #116. No game data, shader bytes or shader names are included here. The counts come from a local dump. AI-assisted (Claude Code).
github-bot locked as GitHub sync and limited conversation to collaborators 2026-11-26 04:28:13 +00:00
Author
Owner

@⁠matheusfermiano-source on GitHub · 2026-11-24 18:06 UTC · original

Same comparison on two more GPUs, under Proton on Linux: a Radeon 660M (RDNA2) and an RTX 3050 Laptop. The results match the tables above.

Setup. Each PR's head with #116's lds_tests.rs added (plus its two lines in emit/mod.rs). Built on Linux with llvm-mingw for x86_64-pc-windows-gnullvm (Rust 1.98.1). Run under Proton Experimental 11.0-20261027b with its vkd3d-proton 3.1.0, one GPU at a time, with dxil.dll from DXC 1.9.2609 loaded. Radeon 660M: RADV, Mesa 26.3.1, waves 32..64. RTX 3050 Laptop: NVIDIA 620.73.04.

opcodes byte_and_halfword_reads byte_and_halfword_writes lanes_share_dwords whole victory-shader suite, 660M
#101 9fbd7e9* pass pass pass pass 124 passed, 1 failed
#571 8ad9d9f pass pass pass pass 127 passed, 1 failed
#632 3bd8232 pass refused: "an LDS read into half a register" pass pass 125 passed, 2 failed
#116 8e39c10 pass pass pass pass 124 passed, 1 failed
  • The four lds_tests results are the same on both GPUs.
  • In each suite, the one other failure is emit::tests::stub_pipeline_is_created. It fails on main here too, because vkd3d-proton accepts a zeroed DXIL hash (see #1218).
  • *#101 needed the fix you mention: its test in lower.rs calls resource::track with 3 arguments. I moved structure::structure above it and passed Some(&st), as main's other tests do. Nothing else was changed.

So on an AMD GPU as well, #101, #571 and #116 give the same results on these tests, and #632 differs only by refusing the d16 reads. These tests use waves of 32, so they say nothing about native wave64 on RDNA2.

Synthetic tests only, no game files. AI-assisted (Claude Code, Opus 5.5); every run was on this machine.

**@⁠matheusfermiano-source** on GitHub · 2026-11-24 18:06 UTC · [original](https://github.com/Marvisak/VIctory/issues/1343#issuecomment-7140156904) Same comparison on two more GPUs, under Proton on Linux: a Radeon 660M (RDNA2) and an RTX 3050 Laptop. The results match the tables above. **Setup.** Each PR's head with #116's `lds_tests.rs` added (plus its two lines in `emit/mod.rs`). Built on Linux with llvm-mingw for `x86_64-pc-windows-gnullvm` (Rust 1.98.1). Run under Proton Experimental 11.0-20261027b with its vkd3d-proton 3.1.0, one GPU at a time, with `dxil.dll` from DXC 1.9.2609 loaded. Radeon 660M: RADV, Mesa 26.3.1, waves 32..64. RTX 3050 Laptop: NVIDIA 620.73.04. | | `opcodes` | `byte_and_halfword_reads` | `byte_and_halfword_writes` | `lanes_share_dwords` | whole `victory-shader` suite, 660M | |---|---|---|---|---|---| | #101 `9fbd7e9`* | pass | pass | pass | pass | 124 passed, 1 failed | | #571 `8ad9d9f` | pass | pass | pass | pass | 127 passed, 1 failed | | #632 `3bd8232` | pass | refused: "an LDS read into half a register" | pass | pass | 125 passed, 2 failed | | #116 `8e39c10` | pass | pass | pass | pass | 124 passed, 1 failed | - The four `lds_tests` results are the same on both GPUs. - In each suite, the one other failure is `emit::tests::stub_pipeline_is_created`. It fails on `main` here too, because vkd3d-proton accepts a zeroed DXIL hash (see #1218). - *#101 needed the fix you mention: its test in `lower.rs` calls `resource::track` with 3 arguments. I moved `structure::structure` above it and passed `Some(&st)`, as `main`'s other tests do. Nothing else was changed. So on an AMD GPU as well, #101, #571 and #116 give the same results on these tests, and #632 differs only by refusing the d16 reads. These tests use waves of 32, so they say nothing about native wave64 on RDNA2. Synthetic tests only, no game files. AI-assisted (Claude Code, Opus 5.5); every run was on this machine.
Author
Owner

@⁠MoonYueya on GitHub · 2026-11-24 18:20 UTC · original

Useful comparison — the per-form hardware runs are the part that decides between #101, #571 and #116, which the validated counts alone cannot.

One implementation choice that is orthogonal to which PR you pick, in case it helps settle the write side. ds_write_b8 / ds_write_b16 update part of a dword, so a plain store clobbers the neighbouring bytes; and ds_read_u8 / ds_read_i16 and friends read a sub-range and sign-extend for the i forms. We express the partial write as a masked read-modify-write:

shift = (address & 3) * 8;   mask = (1 << bits) - 1;
InterlockedAnd(slot, ~(mask << shift));
InterlockedOr (slot, (value & mask) << shift);

and the read side as (slot >> shift) & mask, sign-extended for the signed forms. The atomics are not for concurrency — they are the portable way to say "write these bits, leave the others" on a groupshared slot without a second pass.

Two things we would check in whichever PR wins, because both are easy to get subtly wrong and neither shows up in a validated-program count:

  • _d16 / _d16_hi must leave the other half of the destination register untouched. #1343 already notes #632 refuses ds_read_u16_d16_hi on purpose — that is the right call for a partial implementation, but it means the winning PR needs the "keep the other half" test as a first-class case, not a rounding-up.
  • Sixty-four lanes writing their own byte or half of shared dwords, with no write lost. #1343 lists this test and it is the one that would catch an implementation that serialises per wave by accident.

(AI-assisted write-up, checked against our own LDS lowering.)

Context: failure measurements in #1481.

**@⁠MoonYueya** on GitHub · 2026-11-24 18:20 UTC · [original](https://github.com/Marvisak/VIctory/issues/1343#issuecomment-7140513719) Useful comparison — the per-form hardware runs are the part that decides between #101, #571 and #116, which the validated counts alone cannot. One implementation choice that is orthogonal to which PR you pick, in case it helps settle the write side. `ds_write_b8` / `ds_write_b16` update *part* of a dword, so a plain store clobbers the neighbouring bytes; and `ds_read_u8` / `ds_read_i16` and friends read a sub-range and sign-extend for the `i` forms. We express the partial write as a masked read-modify-write: ``` shift = (address & 3) * 8; mask = (1 << bits) - 1; InterlockedAnd(slot, ~(mask << shift)); InterlockedOr (slot, (value & mask) << shift); ``` and the read side as `(slot >> shift) & mask`, sign-extended for the signed forms. The atomics are not for concurrency — they are the portable way to say "write these bits, leave the others" on a `groupshared` slot without a second pass. Two things we would check in whichever PR wins, because both are easy to get subtly wrong and neither shows up in a validated-program count: - **`_d16` / `_d16_hi` must leave the other half of the destination register untouched.** #1343 already notes #632 refuses `ds_read_u16_d16_hi` on purpose — that is the right call for a partial implementation, but it means the winning PR needs the "keep the other half" test as a first-class case, not a rounding-up. - **Sixty-four lanes writing their own byte or half of shared dwords, with no write lost.** #1343 lists this test and it is the one that would catch an implementation that serialises per wave by accident. *(AI-assisted write-up, checked against our own LDS lowering.)* Context: failure measurements in #1481.
Author
Owner

@⁠wildheathen on GitHub · 2026-11-24 18:59 UTC · original · edited 2026-11-24 19:04 UTC

Independent re-run on an RTX 5080: the tables above hold. I'm not the author of any of the four PRs. Same heads as in this issue: #101 9fbd7e9, #571 8ad9d9f, #632 3bd8232, #116 8e39c10, all on main ffe310e. (#116 has since moved to c853a6a; see the update at the end.)

Setup: Windows 11, RTX 5080 (driver 32.0.16.2124, the default D3D12 adapter here) plus WARP, dxil.dll 10.0.26100, Rust 1.98.1 MSVC. Release builds, each in its own target dir.

Retail dump (victory translate --validate --list)

validated gained vs main lost
main 21,736
#101 21,752 +16 0
#571 21,752 +16 0
#632 21,750 +14 0
#116 21,752 +16 0
  • Checked program by program, not only the totals. #101, #571 and #116 gain the same 16 compute programs. #632's 14 are a subset of them.
  • The 2 that #632 misses are now refused as an LDS read into half a register. That is its deliberate _d16_hi refusal.

#116's lds_tests run against each PR's lowering (RTX 5080, then WARP)

lds_tests.rs copied from #116 into each branch, with nothing changed in it.

reads (incl. d16) writes lanes share dwords opcodes
#101 pass pass pass pass
#571 pass pass pass pass
#632 fails: an LDS read into half a register (by design) pass pass pass
#116 pass pass pass pass

Totals for cargo test -p victory-shader, each PR's own tests plus the four lds_tests: #101 125, #571 128, #632 126 (+1 failure, as above), #116 125.

Notes

  • #101's own test doesn't compile on main, as stated above: resource::track now takes the structure as a 4th argument. To run it I moved structure::structure(&p) up and passed Some(&st). That's one line in the test, not in the lowering. With that change #101 behaves like the others. This is also the CI failure on #101.
  • CI failures on #571 and #632 are a different case. Their own new GPU tests fail on the GitHub runner with hardware: compute_pipeline failed: The parameter is incorrect (valu_tests.rs:208 / :212). The runner's "hardware" device has no GPU behind it. The same tests pass here on the 5080 and on WARP, and main's GPU tests pass on that runner. So this looks like the runner's device refusing these pipelines rather than a lowering bug, but I haven't found which feature it is. #571's 64-bit arithmetic would be my first guess.
  • cargo fmt --check reports differences on all four, but also on main itself, so that's not on these PRs.

That leaves the choice where this issue put it. #571 and, since c853a6a, #116 handle a halfword straddling two dwords; #571 does it with 64-bit arithmetic and four atomics per ds_write_b16. #632 drops _d16_hi reads and so misses 2 programs. At 8e39c10, #101 and #116 behaved the same on everything measured here; the update below shows where they now differ.

No game data, shader bytes or shader names are included; counts come from a local dump.

Update: #116 at c853a6a

Edited after posting: #116 moved to c853a6a while I was writing this, and it now handles straddling halfwords too.

Re-run at #116 c853a6a, same machine (RTX 5080, then WARP):

  • Retail dump: still 21,752 validated, the same 16 gained, 0 lost.
  • cargo test -p victory-shader: 125 passed, the four lds_tests included.
  • The new commit only touches lower.rs and lds_tests.rs, and adds no process, network or file access.

#116's updated lds_tests (they now cover every byte from 2 to 7, odd and straddling halfwords included), run against each PR's lowering:

reads writes lanes share dwords opcodes
#101 fails at a straddling halfword (ds_read_i16 at 1+2: 0xffff8281, want 0xffff9882) fails pass pass
#571 pass pass pass pass
#632 fails at the same address (0x00000082, want 0xffff9882) fails pass pass
#116 c853a6a pass pass pass pass

So on the straddling case, #571 and #116 now agree with the tests' model (which #116 says was measured on RDNA2), and #101 and #632 don't. On the dump none of this changes a count. Whether the title ever issues a straddling halfword is something only a runtime trace would tell.

AI-assisted (Claude Code).

**@⁠wildheathen** on GitHub · 2026-11-24 18:59 UTC · [original](https://github.com/Marvisak/VIctory/issues/1343#issuecomment-7141436694) · edited 2026-11-24 19:04 UTC **Independent re-run on an RTX 5080: the tables above hold.** I'm not the author of any of the four PRs. Same heads as in this issue: #101 `9fbd7e9`, #571 `8ad9d9f`, #632 `3bd8232`, #116 `8e39c10`, all on main `ffe310e`. (#116 has since moved to `c853a6a`; see the update at the end.) Setup: Windows 11, RTX 5080 (driver 32.0.16.2124, the default D3D12 adapter here) plus WARP, dxil.dll 10.0.26100, Rust 1.98.1 MSVC. Release builds, each in its own target dir. ### Retail dump (`victory translate --validate --list`) | | validated | gained vs main | lost | |---|---:|---:|---:| | main | 21,736 | | | | #101 | 21,752 | +16 | 0 | | #571 | 21,752 | +16 | 0 | | #632 | 21,750 | +14 | 0 | | #116 | 21,752 | +16 | 0 | - Checked program by program, not only the totals. #101, #571 and #116 gain **the same 16** compute programs. #632's 14 are a subset of them. - The 2 that #632 misses are now refused as `an LDS read into half a register`. That is its deliberate `_d16_hi` refusal. ### #116's `lds_tests` run against each PR's lowering (RTX 5080, then WARP) `lds_tests.rs` copied from #116 into each branch, with nothing changed in it. | | reads (incl. d16) | writes | lanes share dwords | opcodes | |---|---|---|---|---| | #101 | pass | pass | pass | pass | | #571 | pass | pass | pass | pass | | #632 | **fails: `an LDS read into half a register`** (by design) | pass | pass | pass | | #116 | pass | pass | pass | pass | Totals for `cargo test -p victory-shader`, each PR's own tests plus the four `lds_tests`: #101 125, #571 128, #632 126 (+1 failure, as above), #116 125. ### Notes - **#101's own test doesn't compile on main**, as stated above: `resource::track` now takes the structure as a 4th argument. To run it I moved `structure::structure(&p)` up and passed `Some(&st)`. That's one line in the test, not in the lowering. With that change #101 behaves like the others. This is also the CI failure on #101. - **CI failures on #571 and #632 are a different case.** Their own new GPU tests fail on the GitHub runner with `hardware: compute_pipeline failed: The parameter is incorrect` (`valu_tests.rs:208` / `:212`). The runner's "hardware" device has no GPU behind it. The same tests pass here on the 5080 and on WARP, and main's GPU tests pass on that runner. So this looks like the runner's device refusing these pipelines rather than a lowering bug, but I haven't found which feature it is. #571's 64-bit arithmetic would be my first guess. - `cargo fmt --check` reports differences on all four, but also on main itself, so that's not on these PRs. That leaves the choice where this issue put it. #571 and, since `c853a6a`, #116 handle a halfword straddling two dwords; #571 does it with 64-bit arithmetic and four atomics per `ds_write_b16`. #632 drops `_d16_hi` reads and so misses 2 programs. At `8e39c10`, #101 and #116 behaved the same on everything measured here; the update below shows where they now differ. No game data, shader bytes or shader names are included; counts come from a local dump. ### Update: #116 at `c853a6a` Edited after posting: #116 moved to `c853a6a` while I was writing this, and it now handles straddling halfwords too. Re-run at #116 `c853a6a`, same machine (RTX 5080, then WARP): - Retail dump: still 21,752 validated, the same 16 gained, 0 lost. - `cargo test -p victory-shader`: 125 passed, the four `lds_tests` included. - The new commit only touches `lower.rs` and `lds_tests.rs`, and adds no process, network or file access. #116's **updated** `lds_tests` (they now cover every byte from 2 to 7, odd and straddling halfwords included), run against each PR's lowering: | | reads | writes | lanes share dwords | opcodes | |---|---|---|---|---| | #101 | fails at a straddling halfword (`ds_read_i16` at 1+2: `0xffff8281`, want `0xffff9882`) | fails | pass | pass | | #571 | pass | pass | pass | pass | | #632 | fails at the same address (`0x00000082`, want `0xffff9882`) | fails | pass | pass | | #116 `c853a6a` | pass | pass | pass | pass | So on the straddling case, #571 and #116 now agree with the tests' model (which #116 says was measured on RDNA2), and #101 and #632 don't. On the dump none of this changes a count. Whether the title ever issues a straddling halfword is something only a runtime trace would tell. AI-assisted (Claude Code).
Author
Owner

@⁠tumbubu on GitHub · 2026-11-24 22:10 UTC · original

The four byte/halfword LDS PRs on AMD's Windows driver (RDNA3)

These are the same measurements as the hardware table above (RTX 5060 Ti and WARP), now on AMD:

  • AMD Radeon RX 7900 XT, driver 32.0.31036.15, D3D12 waves 32..64
  • Windows 11 Pro 26300, dxil.dll from SDK 10.0.26100

#116's current lds_tests (c853a6a) run against each PR's lowering, with the file copied onto each head along with its two mod.rs lines. Since c853a6a the tests also cover a halfword at byte 3, which straddles two dwords:

byte reads halfword reads d16 reads byte writes halfword writes shared dwords opcodes
#116 c853a6a pass pass pass pass pass pass pass
#571 8ad9d9f pass pass pass pass pass pass pass
#101 9fbd7e9 pass fails at byte 3 not reached pass fails at byte 3 pass pass
#632 3bd8232 pass fails at byte 3 not reached pass fails at byte 3 pass pass

The failures are all on the straddling halfword. The aligned halfword at byte 2 passes on every head.

PR ds_read_i16 at 1+2 (want 0xffff9882) ds_write_b16 at 3
#101 0xffff8281 lane 0 reads back 0x56787f01, want 0x78817f01
#632 0x00000082 lane 1 reads back the next dword unchanged, 0xfedcba98, want 0xfedcba56

Each test stops at its first wrong lane, so later forms in the same test are not reached.

With #116's earlier tests (8e39c10, aligned halfwords only), every PR passed every column on this card. The one exception was #632's d16 reads, which it refuses by design ("an LDS read into half a register"). So the straddling halfword is the only difference between the four PRs, on AMD as on NVIDIA. Whether the console's titles issue such accesses is the question #116's "measured on RDNA2" comment answers. This run only shows which lowerings model them.

Each PR's own tests, cargo test -p victory-shader --locked -- --test-threads=1:

PR Result
main 120 passed
#101 Still does not compile on ffe310e. Its test at lower.rs:7471 calls resource::track with 3 arguments; building st first and passing Some(&st) as the 4th argument, as main's other tests do, is enough. With that local fix: 121 passed.
#571 124 passed; 128 with lds_tests
#632 123 passed
#116 c853a6a 125 passed

Synthetic tests only, no game files. AI-assisted (Claude Code); every run was on this machine.

**@⁠tumbubu** on GitHub · 2026-11-24 22:10 UTC · [original](https://github.com/Marvisak/VIctory/issues/1343#issuecomment-7145901299) **The four byte/halfword LDS PRs on AMD's Windows driver (RDNA3)** These are the same measurements as the hardware table above (RTX 5060 Ti and WARP), now on AMD: - AMD Radeon RX 7900 XT, driver 32.0.31036.15, D3D12 waves 32..64 - Windows 11 Pro 26300, `dxil.dll` from SDK 10.0.26100 **#116's current `lds_tests` (`c853a6a`) run against each PR's lowering**, with the file copied onto each head along with its two `mod.rs` lines. Since `c853a6a` the tests also cover a halfword at byte 3, which straddles two dwords: | | byte reads | halfword reads | d16 reads | byte writes | halfword writes | shared dwords | `opcodes` | |---|---|---|---|---|---|---|---| | #116 `c853a6a` | pass | pass | pass | pass | pass | pass | pass | | #571 `8ad9d9f` | pass | pass | pass | pass | pass | pass | pass | | #101 `9fbd7e9` | pass | **fails at byte 3** | not reached | pass | **fails at byte 3** | pass | pass | | #632 `3bd8232` | pass | **fails at byte 3** | not reached | pass | **fails at byte 3** | pass | pass | The failures are all on the straddling halfword. The aligned halfword at byte 2 passes on every head. | PR | `ds_read_i16` at 1+2 (want `0xffff9882`) | `ds_write_b16` at 3 | |---|---|---| | #101 | `0xffff8281` | lane 0 reads back `0x56787f01`, want `0x78817f01` | | #632 | `0x00000082` | lane 1 reads back the next dword unchanged, `0xfedcba98`, want `0xfedcba56` | Each test stops at its first wrong lane, so later forms in the same test are not reached. With #116's earlier tests (`8e39c10`, aligned halfwords only), every PR passed every column on this card. The one exception was #632's d16 reads, which it refuses by design ("an LDS read into half a register"). So the straddling halfword is the only difference between the four PRs, on AMD as on NVIDIA. Whether the console's titles issue such accesses is the question #116's "measured on RDNA2" comment answers. This run only shows which lowerings model them. **Each PR's own tests, `cargo test -p victory-shader --locked -- --test-threads=1`:** | PR | Result | |---|---| | `main` | 120 passed | | #101 | Still does not compile on `ffe310e`. Its test at `lower.rs:7471` calls `resource::track` with 3 arguments; building `st` first and passing `Some(&st)` as the 4th argument, as `main`'s other tests do, is enough. With that local fix: 121 passed. | | #571 | 124 passed; 128 with `lds_tests` | | #632 | 123 passed | | #116 `c853a6a` | 125 passed | Synthetic tests only, no game files. AI-assisted (Claude Code); every run was on this machine.
Author
Owner

@⁠Marvisak on GitHub · 2026-11-25 10:16 UTC · original

Automated triage for the maintainers.

Thanks for the comparison and the hardware runs on NVIDIA, AMD and WARP. Since then, main lowers these forms itself (0b35b7f): the ds_read and ds_write arms of the LDS lowering in crates/victory-shader/src/emit/lower.rs handle _u8/_i8/_u16/_i16, _d16 and _d16_hi reads (keeping the other half) and b8/b16 writes through atomic AND/OR. #101, #571, #632 and #116 have all been closed.

What main does not cover is the halfword that straddles two dwords: it reads and writes only the dword holding the address (a comment there takes LDS addresses as aligned to what they access). That is the case where #101 and #632 failed in the runs above. Open PR #1795 carries it with the hardware tests, so review of the remaining part can continue there.


Generated by Claude Code

**@⁠Marvisak** on GitHub · 2026-11-25 10:16 UTC · [original](https://github.com/Marvisak/VIctory/issues/1343#issuecomment-7159464297) <!-- victory-issue-triage v1 verdict=tracked seen=2026-11-24T22:10:34Z at=2026-11-25T09:50:38Z --> Automated triage for the maintainers. Thanks for the comparison and the hardware runs on NVIDIA, AMD and WARP. Since then, `main` lowers these forms itself (0b35b7f): the `ds_read` and `ds_write` arms of the LDS lowering in `crates/victory-shader/src/emit/lower.rs` handle `_u8`/`_i8`/`_u16`/`_i16`, `_d16` and `_d16_hi` reads (keeping the other half) and `b8`/`b16` writes through atomic AND/OR. #101, #571, #632 and #116 have all been closed. What `main` does not cover is the halfword that straddles two dwords: it reads and writes only the dword holding the address (a comment there takes LDS addresses as aligned to what they access). That is the case where #101 and #632 failed in the runs above. Open PR #1795 carries it with the hardware tests, so review of the remaining part can continue there. --- _Generated by [Claude Code](https://claude.ai/code)_
This discussion has been locked. Commenting is limited to contributors.
No milestone
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set

Reference
github/Marvisak--VIctory#1343
No description provided.