shader: lower wave prefixes of min and max #470

Open
Loggerten wants to merge 11 commits from upstream-pr/470 into main
Loggerten commented 2026-11-24 03:47:53 +00:00 (Migrated from github.com)

Imported from Marvisak/VIctory. Originally posted by Loggerten on 2026-11-24T03:47:53Z.


What

The wave prefix path lowered wavePrefixOp for sums only. Every other operation fell out at a wave prefix of an operation other than a sum, even though the active-reduction arm right below it already mapped min and max.

This widens the prefix arm to MinU/MaxU/MinI/MaxI/MinF/MaxF, with a (kind, sop) table that mirrors the active-reduction one. Exclusive prefixes pass through. Inclusive min/max fold the lane's own term back in with an ordering compare plus select, because wavePrefixOp excludes it.

Bitwise prefixes stay refused, with a corrected message: DXIL WaveOpKind has no bitwise member (Sum/Product/Min/Max), so wavePrefixOp cannot express them at all.

Signature verified against the DXIL spec: dx.op.wavePrefixOp.<i32|f32>(121, value, i8 kind, i8 sop).

Verified

  • New test emit::lower::tests::a_wave_prefix_of_min_lowers: a wave32 whole-wave section that leaves a per-lane inclusive MinU prefix, consumed by an ds_write_b32. Without the fix the store reads the missing value and the program fails with a wave prefix of an operation other than a sum (offset 160). With the fix it lowers.
  • cargo test -p victory-shader: 57 passed, 0 failed (56 baseline + 1).
  • cargo fmt --check -p victory-shader clean; cargo clippy -p victory-shader --all-targets no new warnings.
  • cargo xtask policy: 151 files ok.
  • Checked against open PR #308 (lane writes and scalar steps in whole-wave sections): it changes emit/wave.rs tracking, not this refusal arm, so no overlap.

AI-assisted (Hermes Agent); I reviewed the diff and ran the tests and gates myself.

<!-- greyfinch-sync:Marvisak/VIctory:issue:5465705095 --> Imported from [Marvisak/VIctory](https://github.com/Marvisak/VIctory/pull/470). Originally posted by [Loggerten](https://github.com/Loggerten) on 2026-11-24T03:47:53Z. --- ## What The wave prefix path lowered `wavePrefixOp` for sums only. Every other operation fell out at `a wave prefix of an operation other than a sum`, even though the active-reduction arm right below it already mapped min and max. This widens the prefix arm to `MinU`/`MaxU`/`MinI`/`MaxI`/`MinF`/`MaxF`, with a `(kind, sop)` table that mirrors the active-reduction one. Exclusive prefixes pass through. Inclusive min/max fold the lane's own term back in with an ordering compare plus select, because `wavePrefixOp` excludes it. Bitwise prefixes stay refused, with a corrected message: DXIL `WaveOpKind` has no bitwise member (`Sum`/`Product`/`Min`/`Max`), so `wavePrefixOp` cannot express them at all. Signature verified against the DXIL spec: `dx.op.wavePrefixOp.<i32|f32>(121, value, i8 kind, i8 sop)`. ## Verified - New test `emit::lower::tests::a_wave_prefix_of_min_lowers`: a wave32 whole-wave section that leaves a per-lane inclusive `MinU` prefix, consumed by an `ds_write_b32`. Without the fix the store reads the missing value and the program fails with `a wave prefix of an operation other than a sum` (offset 160). With the fix it lowers. - `cargo test -p victory-shader`: 57 passed, 0 failed (56 baseline + 1). - `cargo fmt --check -p victory-shader` clean; `cargo clippy -p victory-shader --all-targets` no new warnings. - `cargo xtask policy`: 151 files ok. - Checked against open PR #308 (lane writes and scalar steps in whole-wave sections): it changes `emit/wave.rs` tracking, not this refusal arm, so no overlap. AI-assisted (Hermes Agent); I reviewed the diff and ran the tests and gates myself.
towiice commented 2026-11-24 03:50:08 +00:00 (Migrated from github.com)

Imported from Marvisak/VIctory. Originally posted by towiice on 2026-11-24T03:50:08Z.

Review: COMMENTED


Tested:

  • Hardware: NVIDIA GeForce GTX 1650 SUPER (Turing TU116, 4 GB VRAM, 32-wide subgroups / wave32, driver 610.88), Windows 11 x64 (26H2 / 10.0.26300), toolchain stable-x86_64-pc-windows-gnullvm (llvm-mingw 23.1.6).
  • Test command: cargo +stable-x86_64-pc-windows-gnullvm test -p victory-shader
  • Result: 70 passed, 0 failed (6.55 s).
    • Verified emit::lower::tests::a_wave_prefix_of_min_lowers passes cleanly and lowers the wave32 inclusive min prefix without the previous refusal panic.
      Clean diff, well-scoped mapping matching the DXIL WaveOpKind specification.
<!-- greyfinch-sync:Marvisak/VIctory:review:6033375420 --> Imported from [Marvisak/VIctory](https://github.com/Marvisak/VIctory/pull/470#pullrequestreview-6033375420). Originally posted by [towiice](https://github.com/towiice) on 2026-11-24T03:50:08Z. **Review:** COMMENTED --- **Tested:** - Hardware: NVIDIA GeForce GTX 1650 SUPER (Turing TU116, 4 GB VRAM, 32-wide subgroups / wave32, driver 610.88), Windows 11 x64 (26H2 / 10.0.26300), toolchain `stable-x86_64-pc-windows-gnullvm` (llvm-mingw 23.1.6). - Test command: `cargo +stable-x86_64-pc-windows-gnullvm test -p victory-shader` - Result: **70 passed, 0 failed** (6.55 s). - Verified `emit::lower::tests::a_wave_prefix_of_min_lowers` passes cleanly and lowers the wave32 inclusive min prefix without the previous refusal panic. Clean diff, well-scoped mapping matching the DXIL `WaveOpKind` specification.
mercuryVM commented 2026-11-24 06:28:14 +00:00 (Migrated from github.com)

Imported from Marvisak/VIctory. Originally posted by mercuryVM on 2026-11-24T06:28:14Z.

Review: APPROVED


Tested 6dd6d5f on Windows 11, RTX 5070, MSVC: cargo test --workspace --no-fail-fast passes (265 passed, 0 failed).

  • (kind, sop) matches the DXIL enums: Sum 0, Product 1, Min 2, Max 3, and signed 0, unsigned 1. Inclusive min and max fold the lane's own term back with the right compare for each type (ULT/UGT, SLT/SGT, OLT/OGT). For floats, select(olt(r, arg), r, arg) returns arg when r is NaN. That differs from fmin's NaN rule, but matches what a scan built from v_min_f32 sees only if the input is NaN-free. That's acceptable.
  • HLSL only has WavePrefixSum and WavePrefixProduct, so DXC never emits wavePrefixOp with Min or Max. I checked whether the validator accepts it anyway. I temporarily made the test's lowers_with run the emitted container through dxil.dll, and a_wave_prefix_of_min_lowers validated OK. Validation is not execution, though: drivers have never seen prefix Min/Max from DXC, so a GPU test (valu_tests::run_cases) comparing lanes on hardware and WARP would be the real proof.

AI-assisted (Claude Code).

<!-- greyfinch-sync:Marvisak/VIctory:review:6034667087 --> Imported from [Marvisak/VIctory](https://github.com/Marvisak/VIctory/pull/470#pullrequestreview-6034667087). Originally posted by [mercuryVM](https://github.com/mercuryVM) on 2026-11-24T06:28:14Z. **Review:** APPROVED --- Tested 6dd6d5f on Windows 11, RTX 5070, MSVC: `cargo test --workspace --no-fail-fast` passes (265 passed, 0 failed). - `(kind, sop)` matches the DXIL enums: Sum 0, Product 1, Min 2, Max 3, and signed 0, unsigned 1. Inclusive min and max fold the lane's own term back with the right compare for each type (ULT/UGT, SLT/SGT, OLT/OGT). For floats, `select(olt(r, arg), r, arg)` returns `arg` when `r` is NaN. That differs from `fmin`'s NaN rule, but matches what a scan built from `v_min_f32` sees only if the input is NaN-free. That's acceptable. - HLSL only has `WavePrefixSum` and `WavePrefixProduct`, so DXC never emits `wavePrefixOp` with Min or Max. I checked whether the validator accepts it anyway. I temporarily made the test's `lowers_with` run the emitted container through `dxil.dll`, and `a_wave_prefix_of_min_lowers` validated OK. Validation is not execution, though: drivers have never seen prefix Min/Max from DXC, so a GPU test (`valu_tests::run_cases`) comparing lanes on hardware and WARP would be the real proof. AI-assisted (Claude Code).
DaviTostes commented 2026-11-24 06:55:33 +00:00 (Migrated from github.com)

Imported from Marvisak/VIctory. Originally posted by DaviTostes on 2026-11-24T03:51:03Z.


Verified 6dd6d5f on Arch Linux x86_64 (rustc 1.98.1, cargo test -p victory-shader): 57 passed, 0 failed, 0 ignored.

Not covered: wave-prefix min/max on real hardware and title shaders (no game data).

<!-- greyfinch-sync:Marvisak/VIctory:comment:7121480263 --> Imported from [Marvisak/VIctory](https://github.com/Marvisak/VIctory/pull/470#issuecomment-7121480263). Originally posted by [DaviTostes](https://github.com/DaviTostes) on 2026-11-24T03:51:03Z. --- Verified `6dd6d5f` on **Arch Linux x86_64** (rustc 1.98.1, `cargo test -p victory-shader`): **57 passed, 0 failed, 0 ignored**. Not covered: wave-prefix min/max on real hardware and title shaders (no game data).
upipibi commented 2026-11-24 06:56:02 +00:00 (Migrated from github.com)

Imported from Marvisak/VIctory. Originally posted by upipibi on 2026-11-24T05:30:48Z.


Two things on 6dd6d5f, from reading the code (not run):

  1. NaN in the inclusive fold (lower.rs:797-799). The float min/max fold uses select(r < arg, r, arg) (OLT / OGT), so when either side is NaN the compare is false and arg wins. The sequence this replaces is built from v_min_f32 / v_max_f32, which return the non-NaN operand. Example, inclusive min: lane 0 = 1.0, lane 1 = NaN → lane 1 should be 1.0, this gives NaN. If arg is the one that isn't NaN, r (NaN) is dropped the right way only by luck of the order. Using the same FMin / FMax the translator already emits for v_min_f32 / v_max_f32 would match.

  2. wavePrefixOp with kind 2 / 3 (Min / Max). DXIL documents WavePrefixOp only for Sum and Product (HLSL has no WavePrefixMin / WavePrefixMax), so drivers have never been handed this, and the validator or a driver may refuse it. a_wave_prefix_of_min_lowers only checks that the program lowers. Running that module through dxil.dll validation and on a GPU, as the valu_tests harness does, would show whether it's accepted. If it isn't, an exclusive prefix min/max can be built from WaveReadLaneAt / a log-step scan instead.

AI-assisted (Claude Code), read-only review.

<!-- greyfinch-sync:Marvisak/VIctory:comment:7123017397 --> Imported from [Marvisak/VIctory](https://github.com/Marvisak/VIctory/pull/470#issuecomment-7123017397). Originally posted by [upipibi](https://github.com/upipibi) on 2026-11-24T05:30:48Z. --- Two things on `6dd6d5f`, from reading the code (not run): 1. **NaN in the inclusive fold** (`lower.rs:797-799`). The float min/max fold uses `select(r < arg, r, arg)` (`OLT` / `OGT`), so when either side is NaN the compare is false and `arg` wins. The sequence this replaces is built from `v_min_f32` / `v_max_f32`, which return the non-NaN operand. Example, inclusive min: lane 0 = 1.0, lane 1 = NaN → lane 1 should be 1.0, this gives NaN. If `arg` is the one that isn't NaN, `r` (NaN) is dropped the right way only by luck of the order. Using the same `FMin` / `FMax` the translator already emits for `v_min_f32` / `v_max_f32` would match. 2. **`wavePrefixOp` with kind 2 / 3 (Min / Max).** DXIL documents `WavePrefixOp` only for Sum and Product (HLSL has no `WavePrefixMin` / `WavePrefixMax`), so drivers have never been handed this, and the validator or a driver may refuse it. `a_wave_prefix_of_min_lowers` only checks that the program lowers. Running that module through `dxil.dll` validation and on a GPU, as the `valu_tests` harness does, would show whether it's accepted. If it isn't, an exclusive prefix min/max can be built from `WaveReadLaneAt` / a log-step scan instead. AI-assisted (Claude Code), read-only review.
Halfect commented 2026-11-24 12:04:41 +00:00 (Migrated from github.com)

Imported from Marvisak/VIctory. Originally posted by Halfect on 2026-11-24T11:52:43Z.


Independent validation of current head 95212d9 on Windows:

  • cargo test --locked -p victory-shader --lib -- --test-threads=1: 121 passed, 0 failed, 1 ignored.
  • I locally extended a_wave_prefix_of_min_lowers to pass the generated container through dxil.dll validation, create a compute pipeline on the default hardware D3D12 adapter, and dispatch one synthetic group. Validation, pipeline creation, and dispatch all succeeded.
  • cargo clippy --locked -p victory-shader --all-targets -- -D warnings: passed.
  • cargo xtask policy: 154 files ok.

This confirms that the existing synthetic MinU module is accepted by the validator and this driver; it does not establish numerical correctness for all six min/max operations. In particular, the earlier floating-point NaN concern remains untested: the current inclusive float fold still uses OLT/OGT plus select, while this test has no result readback and does not exercise NaN inputs. A float NaN readback case is still needed to clear that part.

<!-- greyfinch-sync:Marvisak/VIctory:comment:7130667678 --> Imported from [Marvisak/VIctory](https://github.com/Marvisak/VIctory/pull/470#issuecomment-7130667678). Originally posted by [Halfect](https://github.com/Halfect) on 2026-11-24T11:52:43Z. --- Independent validation of current head `95212d9` on Windows: - `cargo test --locked -p victory-shader --lib -- --test-threads=1`: **121 passed, 0 failed, 1 ignored**. - I locally extended `a_wave_prefix_of_min_lowers` to pass the generated container through `dxil.dll` validation, create a compute pipeline on the default hardware D3D12 adapter, and dispatch one synthetic group. Validation, pipeline creation, and dispatch all succeeded. - `cargo clippy --locked -p victory-shader --all-targets -- -D warnings`: passed. - `cargo xtask policy`: **154 files ok**. This confirms that the existing synthetic **MinU** module is accepted by the validator and this driver; it does not establish numerical correctness for all six min/max operations. In particular, the earlier floating-point NaN concern remains untested: the current inclusive float fold still uses `OLT`/`OGT` plus select, while this test has no result readback and does not exercise NaN inputs. A float NaN readback case is still needed to clear that part.
Loggerten commented 2026-11-24 12:04:42 +00:00 (Migrated from github.com)

Imported from Marvisak/VIctory. Originally posted by Loggerten on 2026-11-24T11:57:29Z.


@upipibi Pushed a754127 (on top of the merge with main ffe310e).

1. NaN in the inclusive fold — fixed. You were right. The inclusive fold now calls max_min(false/true, r, arg), which is the same FMin/FMax plus signed-zero fix the translator already emits for v_min_f32/v_max_f32. Integer min/max keep the compare and select, where a false compare is the right answer. So inclusive min of lane 0 = 1.0 and lane 1 = NaN now yields 1.0, and the NaN is dropped whichever side it is on.

2. WavePrefixOp kind 2/3 — half answered, and it is the weaker half. Your reading of the producers is correct: LLVM's DXIL.td defines WaveOpKind_Min = 2 and WaveOpKind_Max = 3, but the only intrinsics on opcode 121 are sum, usum, product and uproduct. Nothing emits prefix min/max.

What I could settle from source: dxil.dll has no kind rule to reject them with. lib/DxilValidation/DxilValidation.cpp in the DXC tree (main) contains no WavePrefixOp handling at all; the kind operand is only type-checked as i8. So validation passing would tell us the module is well formed, not that anything supports the instruction.

The part I have not settled is the driver, and I have no hardware run here. I have not claimed it works.

I added a validation step to a_wave_prefix_of_min_lowers: it lowers the module again, and where dxil.dll is loadable it validates it, asserting success and the container hash. That runs on the Windows CI job and on any Windows tester's box, and would catch a malformed instruction even though it cannot catch an unsupported one.

If you think an undocumented kind should not ship at all, the fix is a WaveReadLaneAt scan instead of wavePrefixOp, which rewrites the lowering rather than correcting it. I would want a hardware result before choosing that.

<!-- greyfinch-sync:Marvisak/VIctory:comment:7130770086 --> Imported from [Marvisak/VIctory](https://github.com/Marvisak/VIctory/pull/470#issuecomment-7130770086). Originally posted by [Loggerten](https://github.com/Loggerten) on 2026-11-24T11:57:29Z. --- @upipibi Pushed `a754127` (on top of the merge with main `ffe310e`). **1. NaN in the inclusive fold — fixed.** You were right. The inclusive fold now calls `max_min(false/true, r, arg)`, which is the same `FMin`/`FMax` plus signed-zero fix the translator already emits for `v_min_f32`/`v_max_f32`. Integer min/max keep the compare and select, where a false compare is the right answer. So inclusive min of lane 0 = 1.0 and lane 1 = NaN now yields 1.0, and the NaN is dropped whichever side it is on. **2. `WavePrefixOp` kind 2/3 — half answered, and it is the weaker half.** Your reading of the producers is correct: LLVM's `DXIL.td` defines `WaveOpKind_Min = 2` and `WaveOpKind_Max = 3`, but the only intrinsics on opcode 121 are sum, usum, product and uproduct. Nothing emits prefix min/max. What I could settle from source: `dxil.dll` has no kind rule to reject them with. `lib/DxilValidation/DxilValidation.cpp` in the DXC tree (main) contains no `WavePrefixOp` handling at all; the kind operand is only type-checked as `i8`. So validation passing would tell us the module is well formed, not that anything supports the instruction. The part I have not settled is the driver, and I have no hardware run here. I have not claimed it works. I added a validation step to `a_wave_prefix_of_min_lowers`: it lowers the module again, and where `dxil.dll` is loadable it validates it, asserting success and the container hash. That runs on the Windows CI job and on any Windows tester's box, and would catch a malformed instruction even though it cannot catch an unsupported one. If you think an undocumented kind should not ship at all, the fix is a `WaveReadLaneAt` scan instead of `wavePrefixOp`, which rewrites the lowering rather than correcting it. I would want a hardware result before choosing that.
catminou4 commented 2026-11-24 12:38:29 +00:00 (Migrated from github.com)

Imported from Marvisak/VIctory. Originally posted by catminou4 on 2026-11-24T12:38:29Z.

Review: COMMENTED


Test-merge with current main (ffe310e) conflicts — needs a rebase. Main moved recently (PR #566 waterfall loops touched lower.rs/resource.rs/valu_tests.rs), so shader PRs opened before it need rebasing. I'll re-review once it merges cleanly.

<!-- greyfinch-sync:Marvisak/VIctory:review:6039322505 --> Imported from [Marvisak/VIctory](https://github.com/Marvisak/VIctory/pull/470#pullrequestreview-6039322505). Originally posted by [catminou4](https://github.com/catminou4) on 2026-11-24T12:38:29Z. **Review:** COMMENTED --- Test-merge with current main (`ffe310e`) **conflicts** — needs a rebase. Main moved recently (PR #566 waterfall loops touched `lower.rs`/`resource.rs`/`valu_tests.rs`), so shader PRs opened before it need rebasing. I'll re-review once it merges cleanly.
rouges78 commented 2026-11-24 16:05:30 +00:00 (Migrated from github.com)

Imported from Marvisak/VIctory. Originally posted by rouges78 on 2026-11-24T16:05:17Z.


Hardware readback for a754127, from a synthetic test (no game data), on two GPUs.

Setup. One group of 32 threads, WaveSize(32) declared, dxil.dll validation on. Each lane loads its own dword from a structured buffer, a whole-wave section shaped like the one in a_wave_prefix_of_min_lowers scans it (sums use row_shr 1, 2, 4, 8), and each lane stores the result to a raw UAV over a sentinel. Compared lane by lane with the section's instructions run on the CPU. Inputs are non-monotonic, never zero and order differently as signed and unsigned; float sets add NaNs in lanes 9 and 20, and in lane 0. An exclusive form is built too: it stores the raw wavePrefixOp result, with no fold.

  • NVIDIA: RTX 4080, driver 621.14 (32.0.16.2114), waves of 32 to 32.
  • AMD: Radeon iGPU of a Ryzen 7 7700X, driver 32.0.21030.2001, waves of 32 to 64.
operation kind, sign RTX 4080 Radeon iGPU
sum u32 (control) 0, 1 exact exact
sum f32 (control) 0, 0 exact exact (see the note on NaN)
min, max u32 2 / 3, 1 exact wrong
min, max i32 2 / 3, 0 wrong: the unsigned result wrong
min, max f32 2 / 3, 0 pipeline refused wrong

Each cell holds for both the inclusive and the exclusive form.

  • RTX 4080, signed: the sign operand is ignored. The exclusive readback equals the unsigned prefix on all 32 lanes of both input sets, with 0xFFFFFFFF (min) and 0 (max) in lane 0.
  • RTX 4080, float: CreateComputePipelineState fails with E_OUTOFMEMORY on every run, and later tests in the same run pass. With kind 0 in place of 2 or 3 the same programs create and run.
  • Radeon: every pipeline is created, but kinds 2 and 3 return nothing usable for any type. The exclusive form stores 0 in all 32 lanes. The inclusive form gives values unrelated to the inputs that change from run to run.
  • Radeon, float sum: with a NaN input, that lane's own exclusive prefix reads NaN instead of the sum of the lanes below. That is the sum kind already on main, not this PR.
  • Not a driver matter: with a NaN in lane 0, the console keeps the NaN there for an inclusive float min/max (no scan step folds lane 0), while FMin/FMax(prefix, term) returns the prefix. Neither driver could show it.
  • WARP is skipped: it has no wave of 32 lanes.

So on these two drivers only the unsigned min/max on the RTX 4080 work as lowered. This is one GPU and one driver version per vendor, and the Radeon driver dates from September 2025.

Test: wave_prefix_tests.rs (16 tests on top of a754127, run on every hardware adapter; 13 fail on this machine).

AI-assisted (Claude Code), run on my own hardware.

<!-- greyfinch-sync:Marvisak/VIctory:comment:7137097592 --> Imported from [Marvisak/VIctory](https://github.com/Marvisak/VIctory/pull/470#issuecomment-7137097592). Originally posted by [rouges78](https://github.com/rouges78) on 2026-11-24T16:05:17Z. --- Hardware readback for `a754127`, from a synthetic test (no game data), on two GPUs. **Setup.** One group of 32 threads, `WaveSize(32)` declared, `dxil.dll` validation on. Each lane loads its own dword from a structured buffer, a whole-wave section shaped like the one in `a_wave_prefix_of_min_lowers` scans it (sums use `row_shr` 1, 2, 4, 8), and each lane stores the result to a raw UAV over a sentinel. Compared lane by lane with the section's instructions run on the CPU. Inputs are non-monotonic, never zero and order differently as signed and unsigned; float sets add NaNs in lanes 9 and 20, and in lane 0. An exclusive form is built too: it stores the raw `wavePrefixOp` result, with no fold. - **NVIDIA:** RTX 4080, driver 621.14 (32.0.16.2114), waves of 32 to 32. - **AMD:** Radeon iGPU of a Ryzen 7 7700X, driver 32.0.21030.2001, waves of 32 to 64. | operation | kind, sign | RTX 4080 | Radeon iGPU | |---|---|---|---| | sum u32 (control) | 0, 1 | exact | exact | | sum f32 (control) | 0, 0 | exact | exact (see the note on NaN) | | min, max u32 | 2 / 3, 1 | exact | wrong | | min, max i32 | 2 / 3, 0 | wrong: the unsigned result | wrong | | min, max f32 | 2 / 3, 0 | pipeline refused | wrong | Each cell holds for both the inclusive and the exclusive form. - **RTX 4080, signed:** the sign operand is ignored. The exclusive readback equals the unsigned prefix on all 32 lanes of both input sets, with `0xFFFFFFFF` (min) and `0` (max) in lane 0. - **RTX 4080, float:** `CreateComputePipelineState` fails with `E_OUTOFMEMORY` on every run, and later tests in the same run pass. With kind 0 in place of 2 or 3 the same programs create and run. - **Radeon:** every pipeline is created, but kinds 2 and 3 return nothing usable for any type. The exclusive form stores 0 in all 32 lanes. The inclusive form gives values unrelated to the inputs that change from run to run. - **Radeon, float sum:** with a NaN input, that lane's own exclusive prefix reads NaN instead of the sum of the lanes below. That is the sum kind already on main, not this PR. - **Not a driver matter:** with a NaN in lane 0, the console keeps the NaN there for an inclusive float min/max (no scan step folds lane 0), while `FMin`/`FMax(prefix, term)` returns the prefix. Neither driver could show it. - WARP is skipped: it has no wave of 32 lanes. So on these two drivers only the unsigned min/max on the RTX 4080 work as lowered. This is one GPU and one driver version per vendor, and the Radeon driver dates from September 2025. Test: [`wave_prefix_tests.rs`](https://github.com/rouges78/VIctory/blob/50b8fe2c936e076a1269cdc11f9bd62738ef55d4/crates/victory-shader/src/emit/wave_prefix_tests.rs) (16 tests on top of `a754127`, run on every hardware adapter; 13 fail on this machine). AI-assisted (Claude Code), run on my own hardware.
Marvisak commented 2026-11-25 01:07:40 +00:00 (Migrated from github.com)

Imported from Marvisak/VIctory. Originally posted by Marvisak on 2026-11-25T00:19:50Z.


Automated triage for the maintainers.

This pull request no longer merges cleanly into main (conflicts in crates/victory-shader/src/emit/lower.rs). It will be reviewed once it is rebased onto the current main. The earlier verdict (needs-work) was for an older state of main.


Generated by Claude Code

<!-- greyfinch-sync:Marvisak/VIctory:comment:7148395938 --> Imported from [Marvisak/VIctory](https://github.com/Marvisak/VIctory/pull/470#issuecomment-7148395938). Originally posted by [Marvisak](https://github.com/Marvisak) on 2026-11-25T00:19:50Z. --- <!-- victory-triage v1 head=265c736dcc72181f55d12d36c16f0b045b02ed15 verdict=needs-rebase at=2026-11-25T15:57:10Z --> Automated triage for the maintainers. This pull request no longer merges cleanly into `main` (conflicts in `crates/victory-shader/src/emit/lower.rs`). It will be reviewed once it is rebased onto the current `main`. The earlier verdict (needs-work) was for an older state of `main`. --- _Generated by [Claude Code](https://claude.ai/code)_
Loggerten commented 2026-11-26 20:08:36 +00:00 (Migrated from github.com)

Imported from Marvisak/VIctory. Originally posted by Loggerten on 2026-11-26T20:08:36Z.


Rebased onto current main (63bcca4, merged as 73e01c5). The lower.rs conflict resolves onto main's current test helpers (lowers(words, rsrc2) with structure::structure + four-arg resource::track); no branch copies of helpers were kept, and prefix_scans/heap_handles both survive in the lowered struct. Windows run: cargo test -p victory-shader 303 passed / 3 ignored; cargo clippy --workspace --all-targets --locked -- -D warnings clean.

<!-- greyfinch-sync:Marvisak/VIctory:comment:7202347297 --> Imported from [Marvisak/VIctory](https://github.com/Marvisak/VIctory/pull/470#issuecomment-7202347297). Originally posted by [Loggerten](https://github.com/Loggerten) on 2026-11-26T20:08:36Z. --- Rebased onto current main (63bcca4, merged as 73e01c5). The `lower.rs` conflict resolves onto main's current test helpers (`lowers(words, rsrc2)` with `structure::structure` + four-arg `resource::track`); no branch copies of helpers were kept, and `prefix_scans`/`heap_handles` both survive in the lowered struct. Windows run: `cargo test -p victory-shader` 303 passed / 3 ignored; `cargo clippy --workspace --all-targets --locked -- -D warnings` clean.
Loggerten commented 2026-11-26 20:21:08 +00:00 (Migrated from github.com)

Imported from Marvisak/VIctory. Originally posted by Loggerten on 2026-11-26T20:21:08Z.


CI caught the asset-policy size cap: the merged lower.rs was 530501 bytes, over the 512 KiB limit (main itself sits at 520563). ed2d2c8 moves the test module to emit/lower_tests.rs unchanged, so lower.rs is 476269 bytes and cargo xtask policy reports 192 files ok. Merged-tree Windows run after the move: 303 passed / 3 ignored.

<!-- greyfinch-sync:Marvisak/VIctory:comment:7202571592 --> Imported from [Marvisak/VIctory](https://github.com/Marvisak/VIctory/pull/470#issuecomment-7202571592). Originally posted by [Loggerten](https://github.com/Loggerten) on 2026-11-26T20:21:08Z. --- CI caught the asset-policy size cap: the merged `lower.rs` was 530501 bytes, over the 512 KiB limit (main itself sits at 520563). ed2d2c8 moves the test module to `emit/lower_tests.rs` unchanged, so `lower.rs` is 476269 bytes and `cargo xtask policy` reports 192 files ok. Merged-tree Windows run after the move: 303 passed / 3 ignored.
andrewpozdnakov7-jpg commented 2026-11-26 20:57:28 +00:00 (Migrated from github.com)

Imported from Marvisak/VIctory. Originally posted by andrewpozdnakov7-jpg on 2026-11-26T20:57:28Z.


This head and #395 both move the same lowering test module. I resolved that conflict in ec7c106 with both exact PR heads as parents. The min-prefix scan test and both restrictions on compressed target formats are retained. The DXIL validator accepted the prefix scan, and the new independent compressed-export draw read all four channels correctly on WARP. The focused lowering suite passed in three runs, with strict Clippy and the asset policy check passing too.

Full test details in #395. If either PR lands first, the same resolution applies to the other. If you fold the resolution into another commit, please keep the Git author or use Co-authored-by: andrewpozdnakov7-jpg <[email protected]>.

<!-- greyfinch-sync:Marvisak/VIctory:comment:7203242311 --> Imported from [Marvisak/VIctory](https://github.com/Marvisak/VIctory/pull/470#issuecomment-7203242311). Originally posted by [andrewpozdnakov7-jpg](https://github.com/andrewpozdnakov7-jpg) on 2026-11-26T20:57:28Z. --- This head and #395 both move the same lowering test module. I resolved that conflict in [`ec7c106`](https://github.com/andrewpozdnakov7-jpg/VIctory/commit/ec7c106a55309f0793931bb9ed73f11aff3a9403) with both exact PR heads as parents. The min-prefix scan test and both restrictions on compressed target formats are retained. The DXIL validator accepted the prefix scan, and the new independent compressed-export draw read all four channels correctly on WARP. The focused lowering suite passed in three runs, with strict Clippy and the asset policy check passing too. [Full test details in #395](https://github.com/Marvisak/VIctory/pull/395#issuecomment-7203218470). If either PR lands first, the same resolution applies to the other. If you fold the resolution into another commit, please keep the Git author or use `Co-authored-by: andrewpozdnakov7-jpg <[email protected]>`.
This pull request cannot be merged automatically due to conflicts.
Merge manually to resolve the conflicts.
View command line instructions

Checkout

From your project repository, check out a new branch and test the changes.
git fetch -u origin 'upstream-pr/470:upstream-pr/470'
git switch 'upstream-pr/470'

Merge

Merge the changes and update on Forgejo.

Warning: The "Autodetect manual merge" setting is not enabled for this repository, you will have to mark this pull request as manually merged afterwards.

git switch 'main'
git merge --no-ff 'upstream-pr/470'
git switch 'upstream-pr/470'
git rebase 'main'
git switch 'main'
git merge --ff-only 'upstream-pr/470'
git switch 'upstream-pr/470'
git rebase 'main'
git switch 'main'
git merge --no-ff 'upstream-pr/470'
git switch 'main'
git merge --squash 'upstream-pr/470'
git switch 'main'
git merge --ff-only 'upstream-pr/470'
git switch 'main'
git merge 'upstream-pr/470'
git push origin 'main'
Sign in to join this conversation.
No reviewers
No labels
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.

Reference
Marvisak/VIctory!470
No description provided.