Repository navigation
Shaders: preserve scalar mask words across Wave32 compute branches - #2091
rezioliver-collab wants to merge 5 commits into
Conversation
DenRakEiw
left a comment
There was a problem hiding this comment.
Verified locally merged onto origin/main (940d32f, Windows 11 x64, NVIDIA GeForce RTX 5090 + WARP, Rust 1.98.1 MSVC, with dxil.dll validator):
cargo test -p victory-shader --lib wave32— passed on RTX 5090 hardware + WARPcargo test -p victory-shader --lib emit::memory_tests::— 3 passed, 0 failedcargo test -p victory-gpu --lib descriptor_base_word_tracks_the_guest_view_address— passedcargo clippy -p victory-shader -p victory-gpu --all-targets— 0 warningscargo xtask policy— ok (184 files ok)
Clean Wave32 compute branch scalar mask preservation and guest view base word tracking across victory-shader and victory-gpu. Looks great.
AI-assisted (Gemini 4 Neon).
|
Triage verdict — Review the Wave32 work independently of #1065 ( Evidence
Checks and limits
Next step
This verification was AI-assisted. |
catminou4
left a comment
There was a problem hiding this comment.
Tested locally: macOS arm64, rustc 1.98.1, PR head merged into main 940d32f, cargo test -p victory-shader --locked.
144 passed / 0 failed / 2 ignored. Scalar mask words preserved across Wave32 compute branches — mask-word liveness fix; mixed gpu+shader, gpu half Windows-only.
|
AMD/Linux validation run of this stack, on the full retail dump. It is not a small win: +777 programs validate, and almost all of it comes from the last commit, not the scalar-mask ones. Method:
So of the +777, +759 is the "validator 1.8 for compute derivatives" commit alone, and the four scalar-mask/Wave32 commits give +18. Nothing is lost in either step (validated sets grow, no program disappears from the list). What the 777 are: the whole which is the gradient-in-compute rejection the last commit describes; the validator gives no further detail in this path. Two process notes, since the title only mentions scalar masks:
I did not check whether these 777 also compile in DXC or run; this is the DXIL validator count only. |
…nt 2D mip loads, Win11 timer opt-out Translator (tools/rdna2spirv.py) - ubiquitarianism/leonida#1585 (whoalin1, GPL-3.0): the low-16 mask of every int-derived value merged into a preserved 16-bit half is OpBitFieldUExtract (base 0, count 16), not OpBitwiseAnd & 0xFFFF, which NVIDIA's compiler miscompiles (the kept high half corrupted). Six sites: VOP3 16-bit integer results, mad_i16/u16, min/max/med3, signed cvt_i16_f16 / cvt_norm_i16_f16, signed saturate_int16. Two tests that pinned the old shape updated; new tests/semantic/test_nv_and16_extract.py (shape census + interpreter values, negative control; fails on the previous translator). - ubiquitarianism/leonida#1572 (tedin7, GPL-3.0), refined: 2D image_load_mip with glc reads the coherent storage view for mip 0; any other mip takes the sampled fetch at that level instead of upstream's zero-fill, which is only right for a single-level T#. Other dims and tfe/lwe stay Unsupported. CoherentMipLoad tests + spirv-val on four forms; design.md row updated. Decoder (tools/rdna2_decode.py + native port) - ubiquitarianism/leonida#1525 / #1524 (GPL-3.0): inline constants 240..248 on 16-bit integer operands decode to their binary16 patterns (LLVM printImmediateInt16), so the translator no longer reads f32 bits there; ds_condxchg32 keeps one offset; ds_swizzle omits offset 0 and prints ROTATE/FFT as LLVM does. Ported to tools/rdna2_decode_native (tables passed through the blob, _src_is_int16 added to the fingerprint). Runtime (runtime/src/main.cpp) - FVF-07, after ThatRecompDev/five-star-recomp@344f05b (GPL-3.0): ScopedTimerResolution also opts out of Windows 11 timer-resolution throttling (PROCESS_POWER_THROTTLING_IGNORE_TIMER_RESOLUTION) and hands it back to the system with timeEndPeriod. Guard only: Marvisak/VIctory#2091's Wave32 scalar-mask fix is already how this translator works (EXEC is a per-lane flag, scalar ops unmasked, wave-uniform branches); tests/semantic/test_wave32_scalar_mask_branches.py pins it. Skipped: ubiquitarianism/leonida#742 (XMem view coalescing). Natively it saves about 230 ms once at startup (99,776 per-page views 233 ms vs 4 MiB views 4 ms), but every partial unmap would then tear down up to 63 neighbouring pages, including GPU host-pointer imports and pages under in-flight I/O. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
|
Automated triage for the maintainers. The last commit ( On the Wave32 part ( Generated by Claude Code |
Shaders: preserve scalar mask words across Wave32 compute branches
Change
A native Wave32 has one scalar register value for all 32 lanes. When two branches run with different EXEC masks, the last scalar write reached by the wave determines what all lanes read at reconvergence. An active-lane ballot inside one branch can lose bits that belong to lanes outside that branch.
This change retains scalar dwords at supported mask/data joins. For remaining eligible cases in full Wave32 compute groups, it lowers the native scalar control flow with a shared 32-bit EXEC. Scalar writes follow native execution order, including writes reached with empty EXEC. Vector writes use their lane's EXEC bit. The host descriptor table also supplies the native base word when a scalar instruction reads it numerically. The existing GPU page-write tracking uses its own table.
The final commit is Halfect’s compute-derivative metadata change from #1065, ported with the original author attribution. Review the Wave32 compiler and runtime changes through
93685fe74. Related mask work is tracked in #1407 and #1420.Archive validation
Tested against
Marvisak/VIctory:mainat940d32f69b22265690a0b5a15d6ded572ba33baf. The same fixed cohort of 40 compute programs was measured in all four configurations with the Windows x64 SDK DXIL validator.Full, unfiltered scans matched all 25,889 archive entries by position and stage.
With #1065 held constant, the Wave32 commits gained 42 SDK passes and lost 0. The full PR gained 777 and lost 0 against unmodified main.
Regression tests
The seven hand-written Wave32 fixtures all failed to lower on unmodified main when the same fixture source was backported. On the PR head all seven passed SDK validation. On an RTX 5080, all 704 thread outputs matched their CPU expectations across empty, full and sparse EXEC, ordered scalar writes, inactive-lane reads, descriptor base words and loop joins. The host descriptor-address regression and the upstream page-write-mark regression also passed.
Both workspace Clippy variants passed with warnings denied. The asset-policy check passed. The complete workspace suite on Windows recorded 696 passed, 5 failed and 10 ignored on main, and 707 passed, 5 failed and 10 ignored on the PR head.
The same 5 tests failed on both revisions.
descriptor::host::tests::dynamic_slots_are_held_until_releasedemit::stride_tests::a_heap_buffer_read_by_element_takes_the_views_strideemit::stride_tests::a_heap_buffer_read_where_no_buffer_view_is_reads_zerosemit::synthetic_tests::gathers_at_a_level_match_the_hardwarememory::tests::lists_share_a_table_and_copies_keep_their_viewsThe hardware results cover synthetic dispatches. The archive exercise measured offline translation and SDK acceptance. Game rendering and performance were outside this measurement.
AI assistance was provided by OpenAI Codex (GPT-6) for the Wave32 follow-up, integration and validation.