Shaders: lower ds_min_f32 / ds_max_f32 (and _rtn) with RDNA2's NaN rules #628

Open
github-bot wants to merge 7 commits from github-bot/gh-628 into main AGit
Owner

@⁠mercuryVM on GitHub · 2026-11-24 05:54 UTC · original
mercuryVM:impl/lds-float-minmax → main · +284 −6 · 2 files · 7 commits · open

What

ds_min_f32, ds_max_f32, ds_min_rtn_f32 and ds_max_rtn_f32 were refused (an LDS operation), so any compute or mesh program that used one failed to translate. DXIL has no float atomics on groupshared memory, so each now lowers to a compare-exchange loop. The loop reads the dword, computes what RDNA2 would write, and retries cmpxchg until no other lane changed the dword in between.

What RDNA2 writes follows @⁠Lyrnc's measurement on gfx1036, all pairs of 17 values in four modes, reported in a comment below:

  • An sNaN, data first, then memory, is written back quieted.
  • Otherwise a NaN loses to a number, whichever side it is on. Two quiet NaNs give the data.
  • Numbers compare as floats with -0 below +0. The order is computed on integers: the bits of negative floats get their magnitude reversed.
  • The _rtn forms return the dword's value from before.

The first commit used a pair of integer atomics (signed max plus unsigned min). The numbers come out the same, but that cannot express NaNs already in memory. The second commit replaces it with the loop after the measurement.

Known gap, marked shortcut: in the code: f32 denormals compare as kept. With the console's MODE flushing them, they would order as ±0 first, and the translator does not model MODE.

Helpers Lower::lds_float_min_max (the loop) and Lower::lds_float_pick (the choice) are in crates/victory-shader/src/emit/lower.rs. In valu_tests.rs, the test builder now takes a thread count and an LDS size (build_cs; build_valu_cs calls it unchanged), and run_cases_on picks the devices.

Effect on the title: none

Measured by @⁠Parakeet-Wheat on the retail 1.0.2.1 shaders, in a comment below: the title contains 0 ds_{min,max}{,_rtn}_f32; its LDS minimum and maximum are all integer (ds_max_u32, ds_min_u32, ds_max_i32). victory translate --list --validate gives the same outcome on main and on this PR: 21,736 validated, 4,003 failed, 162 rejected. So this PR only completes the instruction set. It doesn't unblock anything in the game, and it can wait behind work that does.

Overlap

I searched open and closed PRs: #164 adds the integer LDS atomics with cmpst. No PR handles the float forms; #163 lists them as refused.

Tested

Windows 11, NVIDIA RTX 5070, AMD CPU. No game data.

  • ds_min_max_f32_order_floats_and_return_the_old_value: a one-thread program, for every pair from 19 values (±0, ±1, ±2.5, ±1e-30, ±denormal, ±inf, ±MAX, plus quiet and signalling NaNs of both signs) in memory and as data, for both ops. It checks the dword afterwards (read back with ds_read_b32) and the old value returned by _rtn, against a reference that follows the measured model. Hardware only: a one-wave program with LDS declares WaveSize(32) (existing behaviour), and WARP's pipeline creation refuses it.
  • ds_min_max_f32_are_atomic_across_waves: 64 threads each apply (thread - 32) as a float to one dword after a barrier. Checks max from -inf (31), max from 100 (100), min from +inf (-32) and min from -0 (-32). Runs on hardware and WARP.
  • Mutation check: dropping the "a NaN in memory loses to a number" rule fails the first test on hardware (ds_max_f32 on NaN [0x7fc00000] with 0 gave 0x7fc00000, want 0).
  • cargo test --workspace: all passed (victory-shader 71 passed). rustfmt --edition 2024 --check on both files: clean. cargo clippy -p victory-shader --all-targets: no warnings. cargo xtask policy: 151 files ok.

Not tested

  • The title was not run, and I have no shader package, so I can't say how many of the title's programs use these instructions. None of the 12 programs embedded in the executable does.
  • No console hardware. The NaN rules come from @⁠Lyrnc's RDNA2 desktop measurement (gfx1036), not the console's silicon. Only the f32 denormals-kept mode is modelled.
  • No 64-lane (AMD) host GPU.

AI-assisted (Claude Code).

🤖 Generated with Claude Code

**@⁠mercuryVM** on GitHub · 2026-11-24 05:54 UTC · [original](https://github.com/Marvisak/VIctory/pull/628) `mercuryVM:impl/lds-float-minmax` → `main` · +284 −6 · 2 files · 7 commits · open ## What `ds_min_f32`, `ds_max_f32`, `ds_min_rtn_f32` and `ds_max_rtn_f32` were refused (`an LDS operation`), so any compute or mesh program that used one failed to translate. DXIL has no float atomics on groupshared memory, so each now lowers to a **compare-exchange loop**. The loop reads the dword, computes what RDNA2 would write, and retries `cmpxchg` until no other lane changed the dword in between. What RDNA2 writes follows @⁠Lyrnc's measurement on gfx1036, all pairs of 17 values in four modes, reported in a comment below: - An sNaN, data first, then memory, is written back quieted. - Otherwise a NaN loses to a number, whichever side it is on. Two quiet NaNs give the data. - Numbers compare as floats with -0 below +0. The order is computed on integers: the bits of negative floats get their magnitude reversed. - The `_rtn` forms return the dword's value from before. The first commit used a pair of integer atomics (signed max plus unsigned min). The numbers come out the same, but that cannot express NaNs already in memory. The second commit replaces it with the loop after the measurement. Known gap, marked `shortcut:` in the code: f32 denormals compare as kept. With the console's MODE flushing them, they would order as ±0 first, and the translator does not model MODE. Helpers `Lower::lds_float_min_max` (the loop) and `Lower::lds_float_pick` (the choice) are in `crates/victory-shader/src/emit/lower.rs`. In `valu_tests.rs`, the test builder now takes a thread count and an LDS size (`build_cs`; `build_valu_cs` calls it unchanged), and `run_cases_on` picks the devices. ## Effect on the title: none Measured by @⁠Parakeet-Wheat on the retail 1.0.2.1 shaders, in a comment below: the title contains 0 `ds_{min,max}{,_rtn}_f32`; its LDS minimum and maximum are all integer (`ds_max_u32`, `ds_min_u32`, `ds_max_i32`). `victory translate --list --validate` gives the same outcome on `main` and on this PR: 21,736 validated, 4,003 failed, 162 rejected. So this PR only completes the instruction set. It doesn't unblock anything in the game, and it can wait behind work that does. ## Overlap I searched open and closed PRs: #164 adds the integer LDS atomics with `cmpst`. No PR handles the float forms; #163 lists them as refused. ## Tested Windows 11, NVIDIA RTX 5070, AMD CPU. No game data. - `ds_min_max_f32_order_floats_and_return_the_old_value`: a one-thread program, for every pair from 19 values (±0, ±1, ±2.5, ±1e-30, ±denormal, ±inf, ±MAX, plus quiet and signalling NaNs of both signs) in memory and as data, for both ops. It checks the dword afterwards (read back with `ds_read_b32`) and the old value returned by `_rtn`, against a reference that follows the measured model. Hardware only: a one-wave program with LDS declares `WaveSize(32)` (existing behaviour), and WARP's pipeline creation refuses it. - `ds_min_max_f32_are_atomic_across_waves`: 64 threads each apply `(thread - 32)` as a float to one dword after a barrier. Checks max from -inf (31), max from 100 (100), min from +inf (-32) and min from -0 (-32). Runs on hardware and WARP. - Mutation check: dropping the "a NaN in memory loses to a number" rule fails the first test on hardware (`ds_max_f32 on NaN [0x7fc00000] with 0 gave 0x7fc00000, want 0`). - `cargo test --workspace`: all passed (victory-shader 71 passed). `rustfmt --edition 2024 --check` on both files: clean. `cargo clippy -p victory-shader --all-targets`: no warnings. `cargo xtask policy`: 151 files ok. ## Not tested - The title was not run, and I have no shader package, so I can't say how many of the title's programs use these instructions. None of the 12 programs embedded in the executable does. - No console hardware. The NaN rules come from @⁠Lyrnc's RDNA2 desktop measurement (gfx1036), not the console's silicon. Only the f32 denormals-kept mode is modelled. - No 64-lane (AMD) host GPU. AI-assisted (Claude Code). 🤖 Generated with [Claude Code](https://claude.com/claude-code)
The LDS float minimum and maximum were refused ("an LDS operation"), so
any program using one failed to translate. DXIL has no float atomics on
groupshared memory, so they become integer atomics: floats with the sign
bit clear order as signed integers, those with it set in reverse as
unsigned ones. The maximum is a signed max for non-negative data and an
unsigned min for the rest (the minimum: signed min, unsigned max). Each
lane issues both atomics, one with a value that leaves the dword as it
is, so each lane still changes it in a single atomic step; -0 orders
below +0, and NaN data leaves the dword. The _rtn forms return the old
value.

Tests: a one-thread program checks every pair of 14 values (and NaN
data) for both the dword afterwards and the returned old value; a
64-thread program checks the result under contention across waves.
The test builder now takes a thread count and an LDS size.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
A hardware measurement on the pull request (gfx1036, all pairs of 17
values in four modes) showed the NaN rules differ from the integer
atomics' order: an sNaN, data first, then memory, is written quieted;
otherwise a NaN loses to a number, also a NaN already in the dword (two
quiet NaNs give the data). No single integer atomic can express the
memory side, so the operation is now a compare-exchange loop around the
measured choice. Numbers keep the same order (-0 below +0).

The test reference follows the measured model, with quiet and
signalling NaNs of both signs in memory and as data.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
# Conflicts:
#	crates/victory-shader/src/emit/valu_tests.rs
Co-Authored-By: Claude Opus 5.5 <[email protected]>
Co-Authored-By: Claude Opus 5.5 <[email protected]>
github-bot locked as GitHub sync and limited conversation to collaborators 2026-11-26 04:10:35 +00:00
Author
Owner

@⁠Lyrnc on GitHub · 2026-11-24 06:06 UTC · original

RDNA2 hardware measurement of ds_min_f32 / ds_max_f32: the ordering of numbers, ±0 included, matches this PR. The NaN rules differ, and the hardware's rule is simpler than the gap marked shortcut: here.

Setup. AMD Radeon iGPU of a Ryzen 7 9800X3D, gfx1036 (RDNA2), AMD driver 32.0.21042.62, Windows 11 Pro 26200. In a HIP kernel (assembled by the AMD driver's amd_comgr), each lane writes a "memory" value to its own LDS dword, runs ds_{min,max}{,_rtn}_f32 with a "data" value, and reads the dword back. All 289 pairs of 17 values: ±0, ±1, ±2.5, ±smallest denormal, ±inf, ±max, ±qNaN, and three sNaNs. Each pair ran under IEEE mode on/off × f32 denormals flushed/kept. RDNA2 desktop silicon, not the console's. No game data.

This model fits 289/289 in all four modes, for min and max, with and without _rtn:

  1. Denormals follow the f32 denormal mode (flushed to ±0 first when the mode flushes). IEEE mode makes no difference.
  2. An sNaN, data first, then memory, is written back quieted: data 0x7f800001 gives 0x7fc00001.
  3. Otherwise a NaN loses to a number, whichever side it is on: data 0 with memory 0x7fc00000 writes 0, and NaN data leaves a number unchanged. With both quiet NaNs the data is kept.
  4. ±0: min gives -0 if either is -0, max gives +0 unless both are -0.
  5. Everything else is the plain float compare.
  6. _rtn returns the memory value from before, on every row.

Against this PR, with f32 denormals kept, every row without a NaN matches (182/289), including -0 < +0. The 107 others:

Case Hardware This PR
a quiet NaN already in the dword, number as data the number is written (min(0, qNaN) = 0) integer compare of the bits (the shortcut:)
sNaN data quieted sNaN written (0x7fc00001) dword unchanged
data number, sNaN in the dword quieted sNaN of the dword stays integer compare

With f32 denormals flushed there are 28 more: data 0 with memory 0x80000001 gives 0x80000000 on the hardware (the denormal flushed to -0, then -0 < +0), where the integer order keeps 0x80000001. So the integer ordering is right for numbers in the denormals-kept mode. The NaN handling could follow rules 2-3, which is two more selects rather than a float compare.

AI use: Claude Code (Claude Opus 5.5) wrote the probes, ran them on the GPU above and drafted this comment; the numbers come from the hardware run.

**@⁠Lyrnc** on GitHub · 2026-11-24 06:06 UTC · [original](https://github.com/Marvisak/VIctory/pull/628#issuecomment-7123597917) RDNA2 hardware measurement of `ds_min_f32` / `ds_max_f32`: the ordering of numbers, ±0 included, matches this PR. The NaN rules differ, and the hardware's rule is simpler than the gap marked `shortcut:` here. **Setup.** AMD Radeon iGPU of a Ryzen 7 9800X3D, **gfx1036 (RDNA2)**, AMD driver 32.0.21042.62, Windows 11 Pro 26200. In a HIP kernel (assembled by the AMD driver's amd_comgr), each lane writes a "memory" value to its own LDS dword, runs `ds_{min,max}{,_rtn}_f32` with a "data" value, and reads the dword back. All 289 pairs of 17 values: ±0, ±1, ±2.5, ±smallest denormal, ±inf, ±max, ±qNaN, and three sNaNs. Each pair ran under IEEE mode on/off × f32 denormals flushed/kept. RDNA2 desktop silicon, not the console's. No game data. This model fits **289/289 in all four modes**, for min and max, with and without `_rtn`: 1. Denormals follow the f32 denormal mode (flushed to ±0 first when the mode flushes). IEEE mode makes no difference. 2. An sNaN, data first, then memory, is written back quieted: data `0x7f800001` gives `0x7fc00001`. 3. Otherwise a NaN loses to a number, whichever side it is on: data `0` with memory `0x7fc00000` writes `0`, and NaN data leaves a number unchanged. With both quiet NaNs the data is kept. 4. ±0: min gives -0 if either is -0, max gives +0 unless both are -0. 5. Everything else is the plain float compare. 6. `_rtn` returns the memory value from before, on every row. Against this PR, with f32 denormals kept, every row without a NaN matches (182/289), including -0 < +0. The 107 others: | Case | Hardware | This PR | |---|---|---| | a quiet NaN already in the dword, number as data | the number is written (min(0, qNaN) = 0) | integer compare of the bits (the `shortcut:`) | | sNaN data | quieted sNaN written (`0x7fc00001`) | dword unchanged | | data number, sNaN in the dword | quieted sNaN of the dword stays | integer compare | With f32 denormals flushed there are 28 more: data `0` with memory `0x80000001` gives `0x80000000` on the hardware (the denormal flushed to -0, then -0 < +0), where the integer order keeps `0x80000001`. So the integer ordering is right for numbers in the denormals-kept mode. The NaN handling could follow rules 2-3, which is two more selects rather than a float compare. AI use: Claude Code (Claude Opus 5.5) wrote the probes, ran them on the GPU above and drafted this comment; the numbers come from the hardware run.
Author
Owner

@⁠mercuryVM on GitHub · 2026-11-24 06:30 UTC · original

@⁠Lyrnc thank you, that measurement settles it. I followed your model in 5d07613: the integer-atomic pair is replaced by a compare-exchange loop around rules 2-5, since no single integer atomic can let a NaN already in the dword lose to a number. Both quiet NaNs give the data, as you reported. The test now has quiet and signalling NaNs of both signs, in memory and as data (361 pairs per op, dword afterwards and _rtn value). It passes on an RTX 5070, and dropping the 'NaN in memory loses' rule makes it fail. Rule 1 (denormals following the f32 mode) is left as a marked shortcut: the translator does not model MODE, so this matches the denormals-kept mode only.

@⁠LAKSHYA-cmd-tech thanks for testing. The lowering changed after your approval (now a CAS loop), so it may be worth another look.

AI-assisted (Claude Code).

**@⁠mercuryVM** on GitHub · 2026-11-24 06:30 UTC · [original](https://github.com/Marvisak/VIctory/pull/628#issuecomment-7123999599) @⁠Lyrnc thank you, that measurement settles it. I followed your model in 5d07613: the integer-atomic pair is replaced by a compare-exchange loop around rules 2-5, since no single integer atomic can let a NaN already in the dword lose to a number. Both quiet NaNs give the data, as you reported. The test now has quiet and signalling NaNs of both signs, in memory and as data (361 pairs per op, dword afterwards and `_rtn` value). It passes on an RTX 5070, and dropping the 'NaN in memory loses' rule makes it fail. Rule 1 (denormals following the f32 mode) is left as a marked shortcut: the translator does not model MODE, so this matches the denormals-kept mode only. @⁠LAKSHYA-cmd-tech thanks for testing. The lowering changed after your approval (now a CAS loop), so it may be worth another look. AI-assisted (Claude Code).
Author
Owner

@⁠Lyrnc on GitHub · 2026-11-24 07:33 UTC · original

Tested 5d07613 merged onto main d2a4bae (clean) on both GPUs here: pass.

  • ds_min_max_f32_* tests, RTX 5080 (driver 610.88): 2 passed.
  • Same tests on the Radeon iGPU (gfx1036, driver 32.0.21042.62), through #94's VICTORY_ADAPTER=amd (local merge only): 2 passed. This is the hardware the model came from, now running the translated DXIL.
  • lds_min_max_ref is the rule set that fitted 289/289 on the hardware with f32 denormals kept: sNaN data first, then memory, quieted; a NaN loses to a number; two quiet NaNs keep the data; -0 < +0.

AI use: Claude Code (Claude Opus 5.5) ran the tests and drafted this comment.

**@⁠Lyrnc** on GitHub · 2026-11-24 07:33 UTC · [original](https://github.com/Marvisak/VIctory/pull/628#issuecomment-7125124914) Tested `5d07613` merged onto `main` `d2a4bae` (clean) on both GPUs here: **pass**. - `ds_min_max_f32_*` tests, RTX 5080 (driver 610.88): 2 passed. - Same tests on the Radeon iGPU (gfx1036, driver 32.0.21042.62), through #94's `VICTORY_ADAPTER=amd` (local merge only): 2 passed. This is the hardware the model came from, now running the translated DXIL. - `lds_min_max_ref` is the rule set that fitted 289/289 on the hardware with f32 denormals kept: sNaN data first, then memory, quieted; a NaN loses to a number; two quiet NaNs keep the data; -0 < +0. AI use: Claude Code (Claude Opus 5.5) ran the tests and drafted this comment.
Author
Owner

@⁠slint6614-dev on GitHub · 2026-11-24 07:35 UTC · original

AMD hardware check, Windows 11, Adrenalin driver: RX 9070 (RDNA4) and the Ryzen 9600X iGPU (RDNA2, gfx1036), each picked as the D3D12 device for cargo test -p victory-shader --release (local adapter-selection patch, not part of this PR).

  • Whole victory-shader suite: 71 passed, 0 failed on both GPUs; both new ds_min_max_f32_* tests pass on the hardware device.
  • Negative control: with lower.rs reverted to main both new tests fail (the opcodes are refused before reaching the GPU), as expected.
**@⁠slint6614-dev** on GitHub · 2026-11-24 07:35 UTC · [original](https://github.com/Marvisak/VIctory/pull/628#issuecomment-7125150437) AMD hardware check, Windows 11, Adrenalin driver: RX 9070 (RDNA4) and the Ryzen 9600X iGPU (RDNA2, gfx1036), each picked as the D3D12 device for `cargo test -p victory-shader --release` (local adapter-selection patch, not part of this PR). - Whole `victory-shader` suite: 71 passed, 0 failed on both GPUs; both new `ds_min_max_f32_*` tests pass on the hardware device. - Negative control: with `lower.rs` reverted to main both new tests fail (the opcodes are refused before reaching the GPU), as expected.
Author
Owner

@⁠mercuryVM on GitHub · 2026-11-24 08:48 UTC · original

Merged current main (58fed37) in a5ae95f. Only the end of valu_tests.rs conflicted; run_cases_on keeps #433's one-at-a-time lock. victory-shader: 91 passed on the RTX 5070. @⁠Lyrnc @⁠slint6614-dev thank you for the runs on RDNA2, RDNA4 and the RTX 5080.

Note for testing: cargo test -p victory-shader does not compile on current main (#719, a call to lowers without its new rsrc2 argument; @⁠LAKSHYA-cmd-tech has a fix branch). I ran the suite with that one-line fix applied locally, not committed here.

AI-assisted (Claude Code).

**@⁠mercuryVM** on GitHub · 2026-11-24 08:48 UTC · [original](https://github.com/Marvisak/VIctory/pull/628#issuecomment-7126592249) Merged current `main` (`58fed37`) in a5ae95f. Only the end of `valu_tests.rs` conflicted; `run_cases_on` keeps #433's one-at-a-time lock. `victory-shader`: 91 passed on the RTX 5070. @⁠Lyrnc @⁠slint6614-dev thank you for the runs on RDNA2, RDNA4 and the RTX 5080. Note for testing: `cargo test -p victory-shader` does not compile on current `main` (#719, a call to `lowers` without its new `rsrc2` argument; @⁠LAKSHYA-cmd-tech has a fix branch). I ran the suite with that one-line fix applied locally, not committed here. AI-assisted (Claude Code).
Author
Owner

@⁠mercuryVM on GitHub · 2026-11-24 10:20 UTC · original

@⁠catminou4 thanks for the review. Note 2 is fixed in b108d2f (one // ---- instructions ---- left). I merged current main (ffe310e) on top in 717e732; it merged without conflicts. On that head, the CI's own commands pass locally: both cargo clippy ... -D warnings runs, cargo test --workspace --locked, and victory-shader 122 passed on the RTX 5070 and WARP.

AI-assisted (Claude Code).

**@⁠mercuryVM** on GitHub · 2026-11-24 10:20 UTC · [original](https://github.com/Marvisak/VIctory/pull/628#issuecomment-7128636775) @⁠catminou4 thanks for the review. Note 2 is fixed in b108d2f (one `// ---- instructions ----` left). I merged current `main` (`ffe310e`) on top in 717e732; it merged without conflicts. On that head, the CI's own commands pass locally: both `cargo clippy ... -D warnings` runs, `cargo test --workspace --locked`, and `victory-shader` 122 passed on the RTX 5070 and WARP. AI-assisted (Claude Code).
Author
Owner

@⁠mercuryVM on GitHub · 2026-11-24 11:06 UTC · original

@⁠Parakeet-Wheat the same question as on #596, if you have time: how many ds_{min,max}{,_rtn}_f32 the retail shaders contain, and whether translate --list --validate changes any outcome with this PR. Counts only, nothing from the shaders.

AI-assisted (Claude Code).

**@⁠mercuryVM** on GitHub · 2026-11-24 11:06 UTC · [original](https://github.com/Marvisak/VIctory/pull/628#issuecomment-7129676018) @⁠Parakeet-Wheat the same question as on #596, if you have time: how many `ds_{min,max}{,_rtn}_f32` the retail shaders contain, and whether `translate --list --validate` changes any outcome with this PR. Counts only, nothing from the shaders. AI-assisted (Claude Code).
Author
Owner

@⁠Parakeet-Wheat on GitHub · 2026-11-24 11:31 UTC · original

@⁠mercuryVM here are the counts for 717e732 (which already contains main ffe310e):

  • Setup: Windows 11 26300, NVIDIA GeForce RTX 3070 (8 GB, driver 610.88), Ryzen 5 5600X, Rust 1.98.1 (x86_64-pc-windows-msvc), dxil.dll 1.8.2502, title 1.0.2.1.
  • victory shader-info --disasm over shaders.rpf and the executable: 0 ds_{min,max}{,_rtn}_f32. The title's LDS min/max are all integer: ds_max_u32 147, ds_min_u32 78, ds_max_i32 2. Its 4 "an LDS operation" refusals on main are other instructions.
  • victory translate <exe> shaders.rpf --list --validate, main vs this PR: no program changes outcome (21,736 validated, 4,003 failed, 162 rejected on both).
  • cargo test -p victory-shader --locked: 122 passed, 0 failed, 1 ignored. Both ds_min_max_f32_* tests pass, but each ran for over 60 s on this GPU (100 s for the whole suite, against about 45 s without them).

Offline translation and validation only; no shader contents or extracted data included. AI-assisted (Claude Code); run on my machine.

**@⁠Parakeet-Wheat** on GitHub · 2026-11-24 11:31 UTC · [original](https://github.com/Marvisak/VIctory/pull/628#issuecomment-7130206724) @⁠mercuryVM here are the counts for `717e732` (which already contains `main` `ffe310e`): - **Setup:** Windows 11 26300, NVIDIA GeForce RTX 3070 (8 GB, driver `610.88`), Ryzen 5 5600X, Rust 1.98.1 (`x86_64-pc-windows-msvc`), `dxil.dll` 1.8.2502, title 1.0.2.1. - `victory shader-info --disasm` over `shaders.rpf` and the executable: **0 `ds_{min,max}{,_rtn}_f32`**. The title's LDS min/max are all integer: `ds_max_u32` 147, `ds_min_u32` 78, `ds_max_i32` 2. Its 4 "an LDS operation" refusals on `main` are other instructions. - `victory translate <exe> shaders.rpf --list --validate`, `main` vs this PR: **no program changes outcome** (21,736 validated, 4,003 failed, 162 rejected on both). - `cargo test -p victory-shader --locked`: **122 passed, 0 failed, 1 ignored**. Both `ds_min_max_f32_*` tests pass, but each ran for over 60 s on this GPU (100 s for the whole suite, against about 45 s without them). *Offline translation and validation only; no shader contents or extracted data included. AI-assisted (Claude Code); run on my machine.*
Author
Owner

@⁠mercuryVM on GitHub · 2026-11-24 11:53 UTC · original

@⁠Parakeet-Wheat thank you. Zero in the title, all LDS min/max integer: noted at the top of the description. I'll also cut the semantics test's run time (one dispatch per case makes it take over 60 s on your 3070) if this PR stays open.

AI-assisted (Claude Code).

**@⁠mercuryVM** on GitHub · 2026-11-24 11:53 UTC · [original](https://github.com/Marvisak/VIctory/pull/628#issuecomment-7130689807) @⁠Parakeet-Wheat thank you. Zero in the title, all LDS min/max integer: noted at the top of the description. I'll also cut the semantics test's run time (one dispatch per case makes it take over 60 s on your 3070) if this PR stays open. AI-assisted (Claude Code).
Author
Owner

@⁠bvtterbroot on GitHub · 2026-11-24 17:54 UTC · original

AMD check at 717e732 (base ffe310e), on an RDNA3 and an RDNA2 GPU:

  • Windows 11, Rust 1.98.1. Radeon RX 7900 XTX (RDNA3, driver 32.0.32029.2010) and the Ryzen 7 7800X3D's iGPU (RDNA2, gfx1036, driver 32.0.21045.29003). I picked each as the hardware device of run_cases with a local adapter-selection patch that is not part of this PR. WARP runs in each pass as well.
  • cargo test -p victory-shader -p victory-gpu --locked: 172 passed, 0 failed, 2 ignored, on both GPUs. That includes its 2 new tests (ds_min_max_f32_are_atomic_across_waves, ds_min_max_f32_order_floats_and_return_the_old_value).

Synthetic tests only, no game files. Tested with AI assistance (Claude Code).

**@⁠bvtterbroot** on GitHub · 2026-11-24 17:54 UTC · [original](https://github.com/Marvisak/VIctory/pull/628#issuecomment-7139880733) AMD check at `717e732` (base `ffe310e`), on an RDNA3 and an RDNA2 GPU: - Windows 11, Rust 1.98.1. Radeon RX 7900 XTX (RDNA3, driver 32.0.32029.2010) and the Ryzen 7 7800X3D's iGPU (RDNA2, gfx1036, driver 32.0.21045.29003). I picked each as the hardware device of `run_cases` with a local adapter-selection patch that is not part of this PR. WARP runs in each pass as well. - `cargo test -p victory-shader -p victory-gpu --locked`: **172 passed, 0 failed**, 2 ignored, on both GPUs. That includes its 2 new tests (`ds_min_max_f32_are_atomic_across_waves`, `ds_min_max_f32_order_floats_and_return_the_old_value`). Synthetic tests only, no game files. _Tested with AI assistance (Claude Code)._
Author
Owner

@⁠Marvisak on GitHub · 2026-11-25 00:31 UTC · original

Automated triage for the maintainers.

Needs rebase. This PR does not merge cleanly into current main (ac2525d). Conflicting files: crates/victory-shader/src/emit/valu_tests.rs.

The content has not been reviewed yet; it will be once the branch is rebased onto main.


Generated by Claude Code

**@⁠Marvisak** on GitHub · 2026-11-25 00:31 UTC · [original](https://github.com/Marvisak/VIctory/pull/628#issuecomment-7148593130) <!-- victory-triage v1 head=717e732f68c5aaea2c855ed253a6c35b48bd953c verdict=needs-rebase at=2026-11-25T00:13:20Z --> Automated triage for the maintainers. **Needs rebase.** This PR does not merge cleanly into current `main` (ac2525d). Conflicting files: `crates/victory-shader/src/emit/valu_tests.rs`. The content has not been reviewed yet; it will be once the branch is rebased onto `main`. --- _Generated by [Claude Code](https://claude.ai/code)_
This pull request has changes conflicting with the target branch.
  • crates/victory-shader/src/emit/lower.rs
  • crates/victory-shader/src/emit/valu_tests.rs
View command line instructions

Manual merge helper

Use this merge commit message when completing the merge manually.

Checkout

From your project repository, check out a new branch and test the changes.
git fetch -u origin '+refs/pull/628/head:github-bot/gh-628'
git switch 'github-bot/gh-628'

Merge

Merge the changes and update on Forgejo.
git switch 'main'
git merge --no-ff 'github-bot/gh-628'
git switch 'github-bot/gh-628'
git rebase 'main'
git switch 'main'
git merge --ff-only 'github-bot/gh-628'
git switch 'github-bot/gh-628'
git rebase 'main'
git switch 'main'
git merge --no-ff 'github-bot/gh-628'
git switch 'main'
git merge --squash 'github-bot/gh-628'
git switch 'main'
git merge --ff-only 'github-bot/gh-628'
git switch 'main'
git merge 'github-bot/gh-628'
git push origin 'main'
This discussion has been locked. Commenting is limited to contributors.
No reviewers
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!628
No description provided.