Three ready branches: v_mad_u64/i64, ldexp/frexp, wave64 on NVIDIA (PRs are collaborator-only) #734
Labels
No labels
accessibility
area: build
area: formats
area: gpu
area: loader
area: runtime
area: shader
bug
documentation
duplicate
enhancement
good first issue
gpu: amd
gpu: intel
gpu: nvidia
help wanted
host: wine
invalid
out of scope
question
request
run report
triage: confirmed
triage: has patch
triage: merge candidate
triage: needs info
triage: needs rebase
triage: needs work
triage: proposed close
wontfix
No milestone
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set
Reference
github/Marvisak--VIctory#734
Loading…
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
@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 warningswith and without--all-features,cargo test --workspace --locked) on Windows 11 with an RTX 4060 and WARP.shader-mad-64v_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, GPUv_mad_u64_u32_and_v_mad_i64_i32_match_rdna2shader-ldexp-frexpv_ldexp_f32(any i32 exponent, three normal power-of-two factors) andv_frexp_mant_f32/v_frexp_exp_i32_f32(on the bits: denormals normalized whatever the host float mode)ldexp_and_frexp_translate, GPUv_frexp_mant_and_exp_f32_match_rdna2,v_ldexp_f32_scales_by_any_exponentwave64-emulationWaveSize(64), so those dispatches were dropped (likely related to #8 and #11).victory-gpureads 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_readfirstlaneand 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, GPUwave64_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 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!
@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, againstmain8e79c80.Setup
cargo build --profile diag -p victory --features diagnosticsat each commit.VICTORY_KEYS. One run each; the shader cache was warm after the first (main) run.main8e79c80wave64-emulation61b04f70x80070057)What the translator refuses with the branch, by message:
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
AI use
@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'sHostat device creation.victory translate --pipelinesmakes its ownvictory_shader::emit::host::Hostand never callsemit::set_host_wave64, so the tool still emitsWaveSize(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)inapps/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'sOPTIONS1: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).
@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.mainnow lowersv_mad_u64_u32/v_mad_i64_i32incrates/victory-shader/src/emit/lower.rs, from commit27c3dc9. 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 inmain:v_ldexp_f32andv_frexp_*_f32appear 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 inmain:lower.rsdeclaresWaveSize(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 saysvictory translatenever sets the host lane counts on your branch, so the offline counts do not reflect it.Generated by Claude Code