Repository navigation
Conversation
|
Reviewed and verified Code review
Verification (Windows 11, RTX 5090 + WARP +
|
|
Verified the wave logic: WaveActiveAllEqual is a wave-uniform reduction so can't diverge inside the guard; when false every lane falls back to its own atomic (identical to today). The stale-load fast path can only produce an extra OR (idempotent), never a lost mark - the comment says exactly this. Nesting the crossing guard (first != last) inside the marks guard is per-lane correct for per-lane spans. One trade worth noting: the same=false case now pays a rawBufferLoad + atomic where it paid only the atomic - wins big on uniform writes, mildly worse on fully divergent ones. DXIL ops 110/115/120 and the WAVE_OPS flag look right. |
Independent WARP verification: PR head
|
26a0550 to
6b9ece1
Compare
6b9ece1 to
347a399
Compare
|
Automated triage for the maintainers. Generated by Claude Code |
|
From a tester working with Claude (AI-assisted, Claude Code): an in-title measurement on AMD/Linux (RX 9070 XT, RADV via vkd3d-proton), this PR with #2484 on |
Dukestar69
left a comment
There was a problem hiding this comment.
Tested merged onto origin/main (63bcca4) on Windows 11 x64 (NVIDIA GeForce RTX 5090 + WARP, dxil.dll validator active):
cargo test -p victory-shader --lib title_page_marks: 2 passed, 0 failed (title_page_marks_use_wave_ops_and_guard_the_atomicandtitle_page_marks_keep_every_lanes_bit).cargo test -p victory-shader --lib emit::memory_tests -- --skip heap_direct_texture_reads_mark_their_heap_index: 4 passed, 0 failed (RTX 5090 hardware + WARP).cargo clippy -p victory-shader --all-targets -- -D warnings: clean.cargo xtask policy: 191 files ok.
Synthetic tests only (no game files used). AI-assisted (Gemini 4 Neon).
A benchmark (ignored by default) and a check, in HLSL that does what translated programs do when they store to title memory: look the address up in the page table (an upload heap), set the bits of the pages written in the list's bitmap with atomics, store into the host copy. Variants: main's two unconditional atomics per store; a load first and an atomic only for a clear bit (Marvisak#2167's approach); one atomic per wave for lanes sharing a bitmap word (Marvisak#2755's); both; none. Each with the bitmap in system memory, as now, and in video memory; four ways of writing. RTX 5070 Ti, driver 621.24, ms per dispatch of 131,072 threads storing 16 dwords each (bitmap clear before the dispatch / already set): one page linear page/lane scattered main, system bitmap 79.8/76.5 75.8/75.0 1595/1583 336/337 test-first, system 1.6/0.33 11.5/0.35 21/20 13.0/6.7 wave, system 1.7/0.33 11.4/0.36 22/22 13.5/6.8 main, video bitmap 0.31/0.31 0.32/0.32 20/20 6.4/6.5 test-first, video 0.30/0.30 0.32/0.32 20/21 6.8/6.7 no marks 0.30/0.29 0.32/0.32 20/19 6.5/6.5 Atomics on a bitmap in system memory are what cost: up to 250 times the dispatch without marks. Loading first removes them once a page is marked; one atomic per wave adds nothing on this GPU. A bitmap in video memory costs nothing even with main's unconditional atomics, first marks included. What is left in "page per lane" and "scattered" is the stores into the host copy in system memory. `every_variant_marks_the_pages_main_marks` checks every variant, in both places, sets exactly main's bits. `dxc.exe` comes from the Windows SDK; without it or a GPU both tests do nothing. cargo test -p victory-gpu --release --lib marks_bench -- --ignored --nocapture
…s, per way of marking (benchmark for Marvisak#2167, Marvisak#2175, Marvisak#2465, Marvisak#2755)
Adapted from brainbudt, Marvisak#2755 (347a399). Preserve the e815cef end-address lookup. Exercise both uniform and divergent EXEC and compare the bitmap on hardware and WARP.
Lanes writing the same title-memory page repeatedly issue
atomicOragainst the same dirty-bitmap word in system RAM, serializing GPU dispatches (reported in #2695).What changed
WaveActiveAllEqualon the bitmap word index. When active lanes share a word, combine their masks withWaveActiveBitOrand elect one writer withWaveIsFirstLane; when words differ, each lane keeps its own address and mask.atomicBinOpand skip the atomic when all requested bits are already set.WAVE_OPS(SFI0 0x4000); stays on SM 6.6 with no fixed wave size, and excludes pixel helper lanes.Verification
x86_64-pc-windows-msvccargo check --testspassed; macOS ARM64 & Linux x86-64 release test suites (159 passed) and Clippy-D warningspassed (tested with the Build and test on Linux; a CI job keeps it so; VICTORY_LOG_FILE #2670 validator guards).Created with gpt-6.2-astra in Codex (orchestrated with Gemini 4 Neon in T3 Code).