Repository navigation
Conversation
|
Tested d0fd9bf on Windows 10, RTX 3060 Ti, driver 610.88, with Agility SDK 620 exports added to the probe executable for this OS. I used four locally held compute shaders from first-story loading, including three large-group programs previously rejected by CreateComputePipelineState. On the build with #54 only the small-group program created a pipeline. With this change, three of the four passed the Windows SDK DXIL validator and created native D3D12 compute pipelines. Two previously refused large-group shaders now work at pipeline creation. The remaining program (02384a60fda6f2d0) returned the translator diagnostic |
|
Tested on an RTX 5070 (Blackwell, 12 GB, driver 621.14, 32-lane waves only), Windows 11, diag build of d0fd9bf (main d2a4bae + this PR), own 1.0.2.1 copy. Synthetic tests: all 14 World run (
Matching by hash: of the 88 refused before, 35 now build and 53 no longer translate. 107 shaders that translated and built before now fail with Likely cause: in The world hang itself is unchanged with or without this PR. AI-assisted (Claude Code); no game files attached. |
|
Tested
No game data used. |
|
Validated PR #189 ( Environment
Results
SummaryAll 14 Wave64 translation and GPU execution tests pass on NVIDIA GTX 1660 SUPER (Wave32) under Wine 11.21 + vkd3d-proton 3.1.0. One minor test-harness issue: No game data used. |
|
Tested Setup: RTX 3070 8 GB (Ampere, 32-lane waves only), driver 610.88, i7-12700, 32 GB, Windows 11 26300. Release build of Tests: In the title:
World time varies between 40 s and 2 min 20 s from run to run on this machine without any change, so I read the difference in world time as noise. Where the refusals went: of the 111 programs refused on
So on this title a large share of the wave64 compute programs still does not run on a 32-lane host, now as dropped dispatches instead of refused pipelines. That matches what others reported in #71: refusals are not what hangs the world. No game files, captures or logs attached. AI-assisted (Claude Code). |
|
I ran the 128-thread For the first lane of a row, Causeway change. This was software-only. Gameplay and hardware-driver effects remain unmeasured. AI-assisted testing. |
|
Data point from an RTX 5070 Ti (D3D12 wave range 32..32), diag build, retail title:
So #189 fixes the compute half of the wave64 problem; mesh needs the same two-halves-per-console-wave emulation through groupshared memory. No game data attached, only the header flag, instruction names and counts. |
|
Independent synthetic test of head Wine/DXVK reported that |
|
Tested head
So this improves the Wave64 path here but does not by itself close #97. Menus and first-boot rendering remained stable. Only counts and error classes are shared. AI-assisted (Kimi Code). |
|
Tested the PR head at |
|
Test report on a machine with a 32-lane and a 64-lane adapter. Tested
The two refusals are
The two refused programs are the kind #233 / #320 run in their console flow (both halves take every branch together, so an exchange inside a divergent branch or loop is reached by both). The approaches fit together: this PR's exchanges for what the whole group reaches, including groups of several console waves, LDS and reductions, which #233 does not do; the console flow for exchanges in divergent code. Not tested: the LDS case is exact in five runs with two groups, which does not rule out a race; release build; the title (no game files used). AI-assisted. |
|
Tested on a real RTX 5070 Laptop GPU (32-lane) with a GTA VI dump. With this PR applied (on The world still doesn't render yet, but for a different reason now: ~395 compute shaders still fail translation on divergent lane ops ( |
A wave64 program split over two 32-lane waves took the DPP row index from the host lane, so the upper half (console rows 2 and 3) read row_mask bits 0 and 1. The row now comes from the console lane there. New test: v_mov_b32_dpp with row_mask:0x3 writes lanes 0 to 31 only, exact on an RTX 5070 (split) and a Radeon iGPU (native). Found in review against #189 and #192, which both get this right. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
|
An in-game data point on Linux and NVIDIA: with this PR ( Setup: CachyOS (Linux 7.3.6), RTX 5080 (driver 620.73.04, 32-lane waves). GE-Proton11-14's
The runs reach the first playable section, and camera input moves the view. I can't tell you which effects looked wrong before, since the scene's lighting changed between the two runs. But the refusals that #1107 and #2725 describe on Windows NVIDIA hosts are all gone here too. The only conflict carrying this onto AI-assisted (Claude), runs and numbers from my own hardware. |
|
I tested the original Wave64 patch on the Wine-free Linux runtime with native VKD3D-Proton. Auto-selection chose software emulation on an eight-lane Lavapipe device. During Series S loading, fixed Wave64 pipeline rejections went from 128 to zero. The 96 fixed Wave32 rejections remained. The local native test build passed 14 cases, including nine compute readback fixtures. These results cover the original patch adapted to the native runtime. Follow-up with Wave32. I generalized the original port to keep a separate ballot and scratch region for each 32-lane wave. The fallback applies to compute shaders that already needed a fixed wave size. Matching shader identities across two Series S loading runs, two of the original 96 host-refused Wave32 shaders built a host pipeline. Eight still required Wave32 and 86 stopped during translation because their collectives were in control flow where a group barrier could not be proven safe. The previous working compute shaders in the comparison kept translating. The native shader library suite passed 94 tests, including a two-wave readback with a partial second wave and lane-select wrapping. Native test commit I also verified the empty-EXEC lane-zero rule and a branch controlled by an emulated first-lane read on a single virtual wave. The native shader suite passed 96 tests, and the Series S loading comparison had the same translated and rejected shader sets. The remaining divergent collectives still need a different control-flow lowering, as in #233. Native first-lane commit Tested-on: Fedora Linux 45, Intel Xeon E5-2670 v3, Mesa Lavapipe 26.2.7, native VKD3D-Proton |
… and narrower hosts
|
Focused Linux/NVIDIA verification of production head Environment: Linux6.17, Wine11.0, RTX4060 Laptop8GiB / NVIDIA590.48.1, DXVK3.1.1, Rust1.98.1 MSVC target. Diagnostic-relaxed vkd3d-proton3.2.0 Only local source change: replace the Shared-target worktree switch was forced fresh by touching The named NVIDIA adapter reports Evidence: Integrated title follow-throughPorted the exact owner change onto the existing local Before launch: combined Wave64 module34/34 (4.96s), shader-cache tests5/5 (0.03s), in-place selection8/8 (0.75s, including the three prior fail-closed pin/heap/selected-host alias gates), GPU-write alias notification1/1 (0.00s). WARP labels remain non-certifying here. Fresh diagnostics release build41.80s. Actual100s guarded run with All three previously refused compute IDs now translate and successfully create host pipelines:
No Evidence prefix AI use: omp, harness model Visual follow-throughReused that same verified binary/source, unchanged settings and100s guard, with screenshot timers anchored inside the launcher. Run The existing descriptor-cap issue remains:310720 |
|
Data point from an RTX 5060 Ti 16 GB (Blackwell, 32-lane waves), Windows 11, driver 621.24, title 1.0.2.1, Series X profile, diag builds. Offline, the whole cache (
The log selects In a 900 s scripted run (same walk, both builds): programs requested and refused by the host 159 on No device removal in any run. Not tested: gameplay with the world drawn (a fork that reaches it would be needed), which of the ~260 newly untranslatable programs matter on screen. AI use: runs, counts and this text were done with Claude Code. |
|
Correction/retraction: the recovery-window comparison in this comment was posted in error and is withdrawn. The local stack referenced ( |
…e halves What was wrong: in halves, three reads into the other half were still refused wherever they were made: `v_readfirstlane_b32` of a value that may differ between the halves, lane masks read as data (`s_bcnt1`, `v_mbcnt`, `vcc_hi` moved to a VGPR, scalar compares of masks), and the whole-wave reductions and prefix sums the console compiler expands (sections the wave simulation follows). The census on b15a57b counted 188, 164 and 96 refused programs needing them. What changed (emit/lower/halves.rs): - `Lower::trade`: the lane-read trade, generalized. Each half's words (each the same in every lane of its host wave) are stored by every lane, then a group barrier, then both halves' words are loaded, then a second barrier. A console wave whose high half has no threads (a group ending inside its low half) gives the word's identity there. The slots grow to two dwords per half. `v_readlane_b32` uses it too. - `v_readfirstlane_b32`: each half reads its first lane in EXEC (the instruction's guard) and its ballot of EXEC. The console's first lane is the low half's where that has one, else the high half's, else lane 0 (EXEC empty). Scalars, values the same in every lane of the console wave and groups of 32 threads or fewer keep the host wave's own read. `main` drops the guard of an instruction with a scalar result (Marvisak#2830 fixes that there), so the trade reads the guard itself. - Lane masks read as data: each half's ballot is one dword of the console's mask, traded at the end of the block writing the mask. - Whole-wave reductions combine the two halves' parts, low half first. A prefix sum in the high half adds the low half's total. - Each stays refused, with its reason, where not every thread of the group meets: inside a branch only some lanes take, and, in a group of several console waves, inside any branch. Relation to other PRs: Marvisak#1890 (beamdotdev's) and Marvisak#189 (alfycs's) trade these reads through group-shared memory too. This builds on Marvisak#2633's trade and refuses where the halves cannot meet; Marvisak#1890 lets each half work over its own 32 lanes there. Evidence, translate --list --wave32 --validate over shaders.rpf, the executable, XboxBvhBuilder.dll and the FidelityFX DLL: compute programs emitted 2,443 -> 2,463, every new one validated and none lost: - first lanes: CS_Slod_BatchCull and five of its variants, CS_HighDetailDeltas_ComputeDeltas; - masks read as data: XboxBvhBuilder.dll (2), CS_DepthProcessing, CS_DepthProcessingHBO, CS_UpdateParticles, CS_UpdateSkinnedAttachMeshParticles, CS_CollisionWithWaterSim, CS_DownsampleAlphaShadowMap, CS_GenerateMaterialMasks; - reductions: CS_RegenerateMinMaxDepth, CS_SortRayTiles, CS_GenerateNormalConesFirstPass, CS_FeedbackToParent4x4x4. Still refused where not every thread of the group meets: 87 masks read as data, 20 first-lane reads and 16 reductions. Those need the two halves to follow the console's flow through the branch, the next step. Tests (emit::halves_tests): - collectives_are_traded_where_every_thread_meets (offline): masks, first lanes, a wave sum and small_group translate in groups of 48, 64, 96 and 128; a first-lane read and a mask inside a lane branch are refused; a sum under a uniform branch translates in a group of 64 and is refused in one of 128. - collectives_cross_the_halves_on_every_gpu: in groups of 48 (an upper half of 16 threads), 64, 96 (a second console wave with no upper half) and 128, the count and both dwords of a mask of lanes below 40, the first lane, a first lane in the upper half under a narrowed EXEC, the exclusive prefix sum and the total of the thread ids, and small_group's results. 0 lanes differ from the console on an RTX 3070 Ti (halves) and the Radeon iGPU of a Ryzen 9 7900X (halves and wave64). The first lane under a narrowed EXEC runs in halves only: the wave64 form gives lane 0's thread id on `main` (Marvisak#2830). - reads_across_32_lane_halves_are_refused_with_their_reason and a_group_one_host_wave_holds_reads_nothing_across_halves: updated, the buffer-load first lane rule now checked inside a branch. Checks: cargo clippy --workspace --all-targets --locked -- -D warnings, and with --all-features: clean. cargo xtask policy: ok. cargo test -p victory-shader --lib -- --test-threads=1: 313 passed, 3 failed, the same 3 as on main on this NVIDIA machine; heap_direct_texture_reads_mark_their_heap_index skipped as before. lower.rs shrinks by 259 bytes (523,196). Co-Authored-By: Claude Opus 5.5
…ed Wave64 requirement
…or and Marvisak#189 integration caution
…assing; integration pending
…ext merge-conflict inspection
…nd bounded integration plan
…nd safe integration checkpoint
Problem
Wave64 compute shaders that rely on lane layout (
console_lanesor single-wave LDS) currently emitWaveSize(64)(PSV0min/max = 64). On 32-lane GPUs (NVIDIA/Intel) and narrower hosts such as WARP (WaveLaneCountMin = 4), D3D12 rejects these PSOs inCreateComputePipelineStatewithE_INVALIDARG(0x80070057).Related to #71, #85, #97, #3.
Summary of Changes
victory-shader::emit):Wave64Mode(Native,Wave32,Emulate),TranslateOptions,translate_with, andemit_with. Defaulttranslate/emitkeepWave64Mode::Native.Host::supports_wave32andHost::recommended_wave64_modeinemit::host, and checkedDXGI_ADAPTER_FLAG_SOFTWAREinHost::new(true)for WARP environments.victory-shader::resource):index_valuesand addedspilled_sgprsso constant-lanev_readlane_b32reads fromv_writelane_b32(including spills to lanes>= 32in<= 32-thread groups) resolve directly to their scalar values or constants.victory-shader::emit::lower):Wave64Mode::Wave32:<= 32threads: runs inside one native 32-lane wave with zero scratch LDS or cross-half barriers, resolving SGPR spills, zeroing the high ballot dword, and supporting<= 32-thread LDS accesses directly.> 32threads: emitsWaveSize(32)when wave emulation is needed and maps each virtual 64-lane wave onto two aligned 32-lane host waves ((waveReadLaneFirst(flattenedThreadIdInGroup) & !31) + waveGetLaneIndex()).ds_swizzle_b32,DPP(with out-of-range lane indices clamped viainsideandrow_maskindexed by 64-laneconsole_lane),v_mbcnt_*,v_writelane_b32, andlane_bitexecute without cross-half barriers; 64-lane ballots,Shape::Active/Shape::Prefix, uniform-block non-uniformv_readfirstlane_b32(with empty-EXECfallback to lane0), and unresolvedv_readlane_b32exchange through disjoint scratch LDS slots (handling partial virtual waves and enforcing the 32 KiB / 8192-dword TGSM limit).Wave64Mode::Emulate:wave_size = Nonewithout settingflags::WAVE_OPS, usingflattenedThreadIdInGroup+ TGSM +barrier(1 | 8)for ballots (atomicOr), tree reductions (Shape::Active), Hillis-Steele scans (Shape::Prefix),v_readlane_b32,v_readfirstlane_b32(atomicMin, with lane0fallback when empty),ds_swizzle_b32, andDPP.compute_postdoms) + group-uniformity analysis (compute_uniformity, preservingval_uniformacross unguardedv_mov_b32) ensures barriers are never emitted inside divergent control flow or insidebegin_guardedblocks; unsafe divergent cross-half operations fail cleanly withShaderError::Unsupported.preemit_masks), and per-instruction ballots/guards are materialized before operand evaluation (materialize_masks).32 < threads <= 64(Wave32) or1 < threads <= 64(Emulate) accessing LDS (has_lds_mem),plan_lds_fencesinserts group-uniformbarrier(1 | 8)checkpoints at uniform joins/exits (lds_fences.enter/lds_fences.leave), permits multiple divergent pure LDS reads, and refuses unfenceable divergent LDS write/read or write/write conflicts cleanly (LDS accesses without a uniform LDS fence in split wave64).victory-gpu,apps/victory):victory-gpu::Hostqueries D3D12 wave capabilities on open (recommended_wave64_mode) and updatesshader_cache: native 64-lane hosts useWave64Mode::Native, while< 64-lane hosts (including 32-lane NVIDIA/Intel GPUs and WARP) default toWave64Mode::Emulate(which still leaves non-lane-dependent shaders native without scratch LDS, while avoidingWave32divergent/cross-half miscompilations).VICTORY_WAVE64_EMULATE=auto|wave32|1|0remains available as an override (with the mode byte included in cache keys).victory translate --pipelinespasses the host's recommendedWave64Modeviaemit_with.crates/victory-shader/src/emit/wave64_tests.rs):Wave32andEmulate, plus host capability andNativePSO rejection checks).Trade-offs & Known Limitations
Wave64Mode::Native: BecauseNativeemitsWaveSize(64)DXIL that passes translation even when a Wave32 host rejects it inCreateComputePipelineState(E_INVALIDARG), enablingWave32/Emulatereplaces unsafe split-wave barriers/hazards with explicitShaderError::Unsupportedrefusals. On the 26,084-program corpus tested by@bittertea0323, hostCreateComputePipelineStatecompute rejections dropped from97to0, while offline translation reported+26refusals (14×"LDS accesses without a uniform LDS fence in split wave64"and12×"a cross-lane wave operation in divergent control flow"). Translator refusal totals before and after this PR are therefore not directly comparable without accounting for PSO rejections.v_readfirstlane_b32in divergent control flow (Wave32): Because separate 32-lane hardware warps cannot enter a group barrier inside divergent control flow without risking a GPU deadlock,emulated_readfirstlaneinWave32returns each half's own first active lane whendivergent(Emulaterefuses). This is exact when the value is uniform across active lanes or in half-local waterfall iteration, but if both halves are active in divergent control flow with differing first active lane values, the upper half (32..63) observes its own first active lane rather than the lower half's (0..31) as on Wave64.Verification
On Windows (
feat/wave64-compute-emulation@54b333f):cargo xtask policy:155 files okcargo clippy --workspace --all-targets --locked -- -D warnings -A deprecated: 0 errors, 0 warningscargo test -p victory-shader --locked -- wave64 --test-threads=1: 26 passed, 0 failed (including live GPU execution tests)cargo test -p victory-gpu --locked -- --test-threads=1: 50 passed, 0 failed, 1 ignoredVICTORY_WARP=1 cargo test -p victory-shader --locked -- wave64 --test-threads=1: 26 passed, 0 failed