Three ready branches: v_mad_u64/i64, ldexp/frexp, wave64 on NVIDIA (PRs are collaborator-only) #734

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

@⁠9hvn9yt2vk-netizen on GitHub · 2026-11-24 08:46 UTC · original

Hi Marvis,

PRs are limited to collaborators right now, so I'm bringing this here. Three branches on today's main (8e79c80), stacked in this order, each passing your new CI locally (clippy -D warnings with and without --all-features, cargo test --workspace --locked) on Windows 11 with an RTX 4060 and WARP.

Branch What Tests
shader-mad-64 lowers v_mad_u64_u32 / v_mad_i64_i32 (64-bit pair; the unsigned carry as a lane mask; the signed carry untracked, so reading it is refused) mad_64_of_32_bit_operands_translates, GPU v_mad_u64_u32_and_v_mad_i64_i32_match_rdna2
shader-ldexp-frexp lowers v_ldexp_f32 (any i32 exponent, three normal power-of-two factors) and v_frexp_mant_f32 / v_frexp_exp_i32_f32 (on the bits: denormals normalized whatever the host float mode) ldexp_and_frexp_translate, GPU v_frexp_mant_and_exp_f32_match_rdna2, v_ldexp_f32_scales_by_any_exponent
wave64-emulation wave64 compute on hosts without 64-lane waves (NVIDIA, Intel), which refuse WaveSize(64), so those dispatches were dropped (likely related to #8 and #11). victory-gpu reads the lane counts at device creation (the shader cache keys on it); a group of one console wave declares no wave size and runs lane reads, DPP, swizzles, ballots, v_mbcnt, v_readfirstlane and wave reductions through group-shared slots between barriers, plus a barrier before each LDS access. Barriers only where every lane gets there; anything else (divergent code, groups of several waves) is refused with a reason. AMD translates exactly as before. emit::wave64_fixtures, GPU wave64_lane_reads_ballots_and_lds_run_without_64_lane_waves, wave64_dpp_first_lane_and_swizzle_run_without_64_lane_waves (64 threads, every lane checked)

All three were refused before as "… is not supported" (or as a pipeline the host rejects), which drops every draw or dispatch that uses them.

Could I be added as a collaborator? I work in cloud and cybersecurity and develop software; I've had 5 PRs merged here already (#14, #15, #43, #46, #56). I keep PRs small, with a test that fails before and passes after. Otherwise feel free to cherry-pick the branches.

Thanks for VIctory!

**@⁠9hvn9yt2vk-netizen** on GitHub · 2026-11-24 08:46 UTC · [original](https://github.com/Marvisak/VIctory/issues/734) Hi Marvis, PRs are limited to collaborators right now, so I'm bringing this here. Three branches on today's main (8e79c80), stacked in this order, each passing your new CI locally (clippy `-D warnings` with and without `--all-features`, `cargo test --workspace --locked`) on Windows 11 with an **RTX 4060** and WARP. | Branch | What | Tests | |---|---|---| | [`shader-mad-64`](https://github.com/9hvn9yt2vk-netizen/VIctory/commits/shader-mad-64) | lowers `v_mad_u64_u32` / `v_mad_i64_i32` (64-bit pair; the unsigned carry as a lane mask; the signed carry untracked, so reading it is refused) | `mad_64_of_32_bit_operands_translates`, GPU `v_mad_u64_u32_and_v_mad_i64_i32_match_rdna2` | | [`shader-ldexp-frexp`](https://github.com/9hvn9yt2vk-netizen/VIctory/commits/shader-ldexp-frexp) | lowers `v_ldexp_f32` (any i32 exponent, three normal power-of-two factors) and `v_frexp_mant_f32` / `v_frexp_exp_i32_f32` (on the bits: denormals normalized whatever the host float mode) | `ldexp_and_frexp_translate`, GPU `v_frexp_mant_and_exp_f32_match_rdna2`, `v_ldexp_f32_scales_by_any_exponent` | | [`wave64-emulation`](https://github.com/9hvn9yt2vk-netizen/VIctory/commits/wave64-emulation) | wave64 compute on hosts without 64-lane waves (NVIDIA, Intel), which refuse `WaveSize(64)`, so those dispatches were dropped (likely related to #8 and #11). `victory-gpu` reads the lane counts at device creation (the shader cache keys on it); a group of one console wave declares no wave size and runs lane reads, DPP, swizzles, ballots, `v_mbcnt`, `v_readfirstlane` and wave reductions through group-shared slots between barriers, plus a barrier before each LDS access. Barriers only where every lane gets there; anything else (divergent code, groups of several waves) is refused with a reason. AMD translates exactly as before. | `emit::wave64_fixtures`, GPU `wave64_lane_reads_ballots_and_lds_run_without_64_lane_waves`, `wave64_dpp_first_lane_and_swizzle_run_without_64_lane_waves` (64 threads, every lane checked) | All three were refused before as "… is not supported" (or as a pipeline the host rejects), which drops every draw or dispatch that uses them. **Could I be added as a collaborator?** I work in cloud and cybersecurity and develop software; I've had 5 PRs merged here already (#14, #15, #43, #46, #56). I keep PRs small, with a test that fails before and passes after. Otherwise feel free to cherry-pick the branches. Thanks for VIctory!
github-bot locked as GitHub sync and limited conversation to collaborators 2026-11-26 04:13:54 +00:00
Author
Owner

@⁠9hvn9yt2vk-netizen on GitHub · 2026-11-24 09:28 UTC · original

@⁠Marvisak quick ping in case this got buried under the PR flood. The three branches above are all green on your new CI (clippy -D warnings with and without --all-features, cargo test --workspace) and tested on an RTX 4060 + WARP. The wave64 one should unblock wave64 compute on NVIDIA and Intel, which currently drops every such dispatch.

Could you add me as a collaborator? Then I can open these as normal PRs and keep sending fixes the same way: small, focused, each with a test that fails before and passes after. You stay in control of what gets merged, of course.

A bit about me: I work in cloud and cybersecurity and develop software. I've had 5 PRs merged here already (#14, #15, #43, #46, #56), several from a random-input harness I wrote that found crashes in the shader, XMA and texture code.

Happy to adjust anything in the branches. Thanks for VIctory!

**@⁠9hvn9yt2vk-netizen** on GitHub · 2026-11-24 09:28 UTC · [original](https://github.com/Marvisak/VIctory/issues/734#issuecomment-7127459296) @⁠Marvisak quick ping in case this got buried under the PR flood. The three branches above are all green on your new CI (clippy -D warnings with and without --all-features, cargo test --workspace) and tested on an RTX 4060 + WARP. The wave64 one should unblock wave64 compute on NVIDIA and Intel, which currently drops every such dispatch. Could you add me as a collaborator? Then I can open these as normal PRs and keep sending fixes the same way: small, focused, each with a test that fails before and passes after. You stay in control of what gets merged, of course. A bit about me: I work in cloud and cybersecurity and develop software. I've had 5 PRs merged here already (#14, #15, #43, #46, #56), several from a random-input harness I wrote that found crashes in the shader, XMA and texture code. Happy to adjust anything in the branches. Thanks for VIctory!
Author
Owner

@⁠Xeltax on GitHub · 2026-11-24 09:58 UTC · original

A retail-title run of wave64-emulation (61b04f7, which includes the two branches below it) on an NVIDIA RTX 4080, against main 8e79c80.

Setup

  • RTX 4080 16 GB (driver 621.01, 32-lane waves only), Ryzen 9 9900X, 32 GB, Windows 11 Pro 26200.
  • cargo build --profile diag -p victory --features diagnostics at each commit.
  • Title 1.0.2.1, Enter every 3 s through VICTORY_KEYS. One run each; the shader cache was warm after the first (main) run.
main 8e79c80 wave64-emulation 61b04f7
compute pipelines the host refuses (0x80070057) 114 distinct shaders 0
compute shaders the translator refuses for wave64 – 115 distinct
world reached yes yes
end device removed in the world (DEVICE_HUNG message) the same

What the translator refuses with the branch, by message:

  • 90: "a step across lanes in lane-dependent code on a host without 64-lane waves is not supported"
  • 25: "a compute group of several 64-lane waves that reads across lanes on a host without 64-lane waves is not supported"

So on this title the branch mostly turns the host's refusals into the translator's own. Of the 114 shaders the host refused on main, 17 no longer show up as refused with the branch: translated, or not reached in its shorter run. The rest hit the two cases the branch leaves out, and the lane-dependent step is most of them.

The device removal happens either way. With one run each and different times spent in the world, I can't say whether the branch moves it.

Not tested

  • More runs, WARP, AMD.
  • The two lower branches on their own.

AI use

  • Claude Code (Claude Opus 5.5) built both commits, ran the title on my machine, counted the log lines and wrote this.
**@⁠Xeltax** on GitHub · 2026-11-24 09:58 UTC · [original](https://github.com/Marvisak/VIctory/issues/734#issuecomment-7128136787) A retail-title run of `wave64-emulation` (`61b04f7`, which includes the two branches below it) on an NVIDIA RTX 4080, against `main` `8e79c80`. **Setup** - RTX 4080 16 GB (driver 621.01, 32-lane waves only), Ryzen 9 9900X, 32 GB, Windows 11 Pro 26200. - `cargo build --profile diag -p victory --features diagnostics` at each commit. - Title 1.0.2.1, Enter every 3 s through `VICTORY_KEYS`. One run each; the shader cache was warm after the first (`main`) run. | | `main` `8e79c80` | `wave64-emulation` `61b04f7` | |---|---|---| | compute pipelines the host refuses (`0x80070057`) | 114 distinct shaders | 0 | | compute shaders the translator refuses for wave64 | – | 115 distinct | | world reached | yes | yes | | end | device removed in the world (DEVICE_HUNG message) | the same | **What the translator refuses with the branch**, by message: - 90: "a step across lanes in lane-dependent code on a host without 64-lane waves is not supported" - 25: "a compute group of several 64-lane waves that reads across lanes on a host without 64-lane waves is not supported" So on this title the branch mostly turns the host's refusals into the translator's own. Of the 114 shaders the host refused on `main`, 17 no longer show up as refused with the branch: translated, or not reached in its shorter run. The rest hit the two cases the branch leaves out, and the lane-dependent step is most of them. The device removal happens either way. With one run each and different times spent in the world, I can't say whether the branch moves it. **Not tested** - More runs, WARP, AMD. - The two lower branches on their own. **AI use** - Claude Code (Claude Opus 5.5) built both commits, ran the title on my machine, counted the log lines and wrote this.
Author
Owner

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

A note on wave64-emulation (61b04f7), found while comparing the wave64 branches on an RTX 3090 (numbers in #439):

The branch learns the host's lane counts only in victory-gpu's Host at device creation. victory translate --pipelines makes its own victory_shader::emit::host::Host and never calls emit::set_host_wave64, so the tool still emits WaveSize(64) on a 32-lane card. There the driver refuses all 319 programs it emits (The parameter is incorrect), and the tool reports none of the emulation's work.

With one line after Host::new(false) in apps/victory/src/translate.rs, the same set gives 71 pipelines. The line hard-codes 32..32 for the local test; the real fix would read the device's OPTIONS1:

victory_shader::emit::set_host_wave64(32, 32);

The remaining refusals: 212 "a step across lanes in lane-dependent code", 36 "a compute group of several 64-lane waves". In the game itself the host path does set the lanes, so this only affects the offline tool's counts.

AI-assisted (Claude Code).

**@⁠JFIREonFIRE** on GitHub · 2026-11-24 18:18 UTC · [original](https://github.com/Marvisak/VIctory/issues/734#issuecomment-7140468348) A note on `wave64-emulation` (`61b04f7`), found while comparing the wave64 branches on an RTX 3090 (numbers in https://git.gtahub.st/github/Marvisak--VIctory/pulls/439): The branch learns the host's lane counts only in `victory-gpu`'s `Host` at device creation. `victory translate --pipelines` makes its own `victory_shader::emit::host::Host` and never calls `emit::set_host_wave64`, so the tool still emits `WaveSize(64)` on a 32-lane card. There the driver refuses all 319 programs it emits (`The parameter is incorrect`), and the tool reports none of the emulation's work. With one line after `Host::new(false)` in `apps/victory/src/translate.rs`, the same set gives 71 pipelines. The line hard-codes 32..32 for the local test; the real fix would read the device's `OPTIONS1`: ```rust victory_shader::emit::set_host_wave64(32, 32); ``` The remaining refusals: 212 "a step across lanes in lane-dependent code", 36 "a compute group of several 64-lane waves". In the game itself the host path does set the lanes, so this only affects the offline tool's counts. AI-assisted (Claude Code).
Author
Owner

@⁠Marvisak on GitHub · 2026-11-25 01:49 UTC · original

Automated triage for the maintainers.

Thanks for the branches. Pull requests are open to everyone now, so they can go in as PRs. Collaborator access is the maintainer's call. Where each branch stands against current main:

  • shader-mad-64. main now lowers v_mad_u64_u32/v_mad_i64_i32 in crates/victory-shader/src/emit/lower.rs, from commit 27c3dc9. The unsigned carry is a lane mask and the signed carry is not written. Unless your branch adds something beyond that (your GPU test, for example), this one is covered.
  • shader-ldexp-frexp. Still missing in main: v_ldexp_f32 and v_frexp_*_f32 appear only in the opcode tables and are not lowered. Open PRs cover the same instructions: #1341 (v_ldexp_f32), and #1190 and #1659 (v_frexp_*). A PR from you, or a review of those with your GPU tests, would help.
  • wave64-emulation. Still missing in main: lower.rs declares WaveSize(64) for console wave64 compute that needs it, and 32-lane hosts refuse those pipelines. Several open PRs compete here, including #439, #189, #233, #1890 and #1929. JFIREonFIRE's note above says victory translate never sets the host lane counts on your branch, so the offline counts do not reflect it.

Generated by Claude Code

**@⁠Marvisak** on GitHub · 2026-11-25 01:49 UTC · [original](https://github.com/Marvisak/VIctory/issues/734#issuecomment-7149991435) <!-- victory-issue-triage v1 verdict=tracked seen=2026-11-24T18:18:53Z at=2026-11-25T02:04:00Z --> Automated triage for the maintainers. Thanks for the branches. Pull requests are open to everyone now, so they can go in as PRs. Collaborator access is the maintainer's call. Where each branch stands against current `main`: - **`shader-mad-64`.** `main` now lowers `v_mad_u64_u32`/`v_mad_i64_i32` in `crates/victory-shader/src/emit/lower.rs`, from commit `27c3dc9`. The unsigned carry is a lane mask and the signed carry is not written. Unless your branch adds something beyond that (your GPU test, for example), this one is covered. - **`shader-ldexp-frexp`.** Still missing in `main`: `v_ldexp_f32` and `v_frexp_*_f32` appear only in the opcode tables and are not lowered. Open PRs cover the same instructions: #1341 (`v_ldexp_f32`), and #1190 and #1659 (`v_frexp_*`). A PR from you, or a review of those with your GPU tests, would help. - **`wave64-emulation`.** Still missing in `main`: `lower.rs` declares `WaveSize(64)` for console wave64 compute that needs it, and 32-lane hosts refuse those pipelines. Several open PRs compete here, including #439, #189, #233, #1890 and #1929. JFIREonFIRE's note above says `victory translate` never sets the host lane counts on your branch, so the offline counts do not reflect it. --- _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#734
No description provided.