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>
…PP, host) Incorporate verified follow-up fixes from PR Marvisak#189 reviewers and contributors: - Fence single-console-wave LDS accesses at group-uniform joins/exits and reject unfenceable divergent regions (fixes marquezinii's split-block stale LDS readback; from #1 by @erickbobd). - Allow Wave32 divergent v_readfirstlane per half without LDS barriers (fixes waterfall loops / common divergent refusals reported by @AKA0GHOST and @NuraadGit), preserve ValUniform propagation across unguarded v_mov_b32 copies for uniform v_readfirstlane in divergent branches (@marquezinii), and return lane 0 when EXEC == 0 in emulated_readfirstlane. - Clamp DPP row_shr/row_shl lane indices using inside before read_lane/exchange_64 to avoid out-of-range waveReadLaneAt on WARP 1.0.22 (@ifBars). - Verify DXGI_ADAPTER_FLAG_SOFTWARE in shader::emit::host::Host::new(true) for Wine/DXVK (@dpalacios69, @tanishq-dubey), base recommended_wave64_mode_matches_device_capabilities on queried capabilities (@ifBars), and serialize wave64 GPU tests under valu_tests::ONE_AT_A_TIME (@r4tedx). Co-authored-by: erickbobd <188809599+erickbobd@users.noreply.github.com>
Avoid false positives in plan_lds_fences on Wave32: - Skip need_lds_barriers in Wave32 when total_threads <= 32 (single native host wave). - Track reads vs writes/atomics separately in plan_lds_fences so multiple pure ds_read* instructions inside a divergent region or loop are allowed while RAW/WAW/WAR hazards remain rejected.
… and verify 64-thread float reduction
…c regression tests
Log every rejected adapter and WARP in Host::all_adapters(), and print SKIPPED <test>: no SM 6.6 adapter instead of panicking on an empty host list. This makes Turing/SM 6.5 machines diagnosable instead of producing identical failures.
…on, then native The two 64-lane emulations refuse different programs: Wave32 those with a cross-lane operation in divergent control flow, Emulate those with a non-uniform v_readfirstlane there. A program the asked-for lowering refuses now tries the other one, then the native lowering; the refusal reported is the asked-for one's. On an RTX 4050 Laptop (32 lanes) this takes the shader pack's pipelines the host refuses from 395 (native) to 257, with the same 307 container refusals as native. AI-assisted (Claude Code). Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
… readfirstlane in Emulate
911df5d to
3e39e34
Compare
|
@alfycs @KainanP I tested the new divergent The 128-thread workgroup contains two guest waves. Active lanes should read group-thread ID 0 in the first guest wave and 64 in the second. Inactive lanes should retain 42. These are wrong output dwords out of 128 read back:
RTX lanes 32–39 read 32 instead of 0, and lanes 96–103 read 96 instead of 64. Built-in WARP first diverged at lane 4 and app-local WARP in git fetch https://github.com/steven-seagull27/VIctory.git codex/pr189-divergent-readfirstlane-readback
git cherry-pick fa11afdc74a8ef7f3096a0c9f200dfc8bafb7165
cargo test -p victory-shader --lib gpu_divergent_readfirstlane_spans_host_waves -- --nocaptureThe test deliberately asserts the guest result. The table comes from running each supported adapter/mode independently through the same fixture and oracle so a first failure cannot hide later cases. I'm checking whether we can elect across the guest wave before the divergent branch for this case. |
|
@alfycs I opened the source fix against your current branch. Stacked PR with the readback and implementation. Across six 128-thread dispatches, The fix elects before the branch when the read starts the active edge and the VGPR is already available in its uniform predecessor. The separate Native Wave64 high-half control still varied on portable WARP before and after the patch. @KainanP, your Intel Wave16 result on this branch would check the one hardware width I couldn't run here. To pick up both commits on git fetch https://github.com/steven-seagull27/VIctory.git codex/pr189-firstlane-before-exec-split
git cherry-pick fa11afdc74a8ef7f3096a0c9f200dfc8bafb7165 e3b6fdbbd66e81510c777f52c05fe4a324ee9729 |
|
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 |
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