Repository navigation
Conversation
|
RTX 5070 (32-lane): in-game check of this PR with #36 and #579 on Runs: diag build, Tests on that tree ( AI-assisted (Claude Code, Claude Sonnet 5.5): the runs are mine, on my own copy of the title. Counts only, no game data. |
… 0x105 Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_016TFkzoCQk3ZUibQWPNRBXE
…her codes 0x104/0x105/0x106 - fxceless#646 (USER_DISPATCH_THREADS), fxceless#834 (USER_GROUP_BASE) and our USER_VIEW_SLOT each took 0x104; here they are 0x104, 0x106, 0x105. - record_clamp_with takes the scratch buffer's state as record_clamp_as does since fxceless#220, and bound_split tracks it like clamp_into. - The split read asked.x, which since fxceless#220 is the mesh records' count (a scalar, 0 for dispatches): every full dispatch got 65,535 more groups and twice the charge. It reads the record's x now, as the second record's store does. warp_split_runs_every_group_of_a_wide_ dispatch_once passes again. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_016TFkzoCQk3ZUibQWPNRBXE
…celess#834, after fxceless#646's 0x104), USER_VIEW_SLOT 0x106 Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_016TFkzoCQk3ZUibQWPNRBXE
|
RTX 4080 (32-lane): held 546 s with the builder on, no exceptions, and the shade is lit Setup: RTX 4080 16 GB (driver 32.0.16.1088), Ryzen 9 7900X, 32 GB, Windows 11 26200, diag build, Series X profile. Tree:
Two card tests beside the PR's own, both on the RTX 4080 and on a Ryzen 7900X iGPU (gfx1036), host waves of 32 (neither device took the 64-lane form of these programs, so that mode did not run here):
Independent of the thread (found before I read its later half), in case it helps a reviewer:
What comes next on this card: One thing for whoever merges: AI-assisted (Claude Code); measured on my machine. No game data. |
…d groups (fxceless#16) Console DispatchX(x, y, z, flags) sets COMPUTE_DISPATCH_INITIATOR bit 5 (0x20, USE_THREAD_DIMENSIONS) when passing raw thread counts instead of thread-group counts, with hardware EXEC masking trailing lanes in partial tail groups. Previously list.rs ignored flags and passed raw thread counts as full groups, causing up to 64x over-dispatch and wrong entry EXEC popcount/reductions in the ray-tracing structure builder. - victory-gpu: forward DispatchX flags, record compute [numthreads] on Translated, convert thread dimensions with div_ceil, and pass partial axis limits via USER_DISPATCH_THREADS (0x104). - victory-shader: add entry partial-thread masking for spilled compute shaders (early-exit before body_entry when barrier- and exchange-free, or predicated active masking for group barriers and wave64-over-wave32 LDS exchange so both 32-lane halves stay alive for group_sync). - Tests: unit test for thread-to-group conversion in draw.rs and hardware GPU test verifying entry s_bcnt1_i32_b64(exec), whole-wave OR, and lane bounds for both host_max_wave=64 and host_max_wave=32.
|
Thanks @Revens2 and @pr0vId3nce for the thorough 32-lane hardware and in-game verifications (RTX 5070 600 s and RTX 4080 546 s with zero exceptions and lit shade)! I've rebased this PR onto latest \main\ (\ca8829f, now commit \36a2257) to resolve the conflict in \crates/victory-gpu/src/draw.rs's unit tests, and moved \effect_guard\ and \dispatch_threads_prologue\ into a small child module \crates/victory-shader/src/emit/dispatch.rs\ (same #[path = ...]\ pattern as \intersect.rs). That brings \lower.rs\ down to 517,044 bytes (+2,204 bytes over \main's 514,840, leaving >7 KiB of headroom under the 512 KiB \xtask policy\ limit) so it combines more easily with #36 / #156. Re-verified on RX 9070:
@pr0vId3nce I'd gladly include your multi-group wave-reduction / prefix-sum test (limits 70, 100, 33, 1, none) if you'd like to share it as a patch or gist. |
170c242 to
36a2257
Compare
…t-and-prefix-validation Shaders: fix whole-wave EXEC inline constant sign-extension and prefix lane validation
|
Two portable RTX 3050 Laptop (wave32) checks for review at 36a2257, using synthetic inputs:
Hardware runs used the PR integrated onto local 504db0e. Both standalone patches apply to the PR head. No game files or scene-quality measurements in these tests. AI-assisted. |
|
An independent confirmation from an RTX 3090 Ti (32-lane), and a note on why this no longer merges. I opened #1292 for the same bug without having seen this PR, and have closed it in favour of this one. I have not run this PR's code; what follows is from my own smaller version of the same fix (x only) on The counts are threads: one more piece of evidence. Tracing every builder dispatch with its root arguments, one structure gets 25 Flags I saw: In the title (Series X, It was not usable: 4 to 7 s a frame, and Why this conflicts with AI-assisted (Claude Code, Claude Fable 5.2). |
…e), 4 KiB dirty tracking, gather segments, the black-face texture fixes, shadow and translator fixes from pull requests Measured in in-run on/off splits on an RTX 4070 (diagnostics builds, the same switches for every run): - VICTORY_CARD_HASH_WIDE=1|alt: the card's hashes of copies' pieces by a group of 64 threads a piece, alternating per submission: card -10 ms a frame (86.5 vs 96.5), world frames -5 ms. - VICTORY_GATHER_SEGMENTS=1|alt (after flipflop877 c69bff1): one clamp pass per segment once a list stops gathering: ~30 records a pass, neutral to slightly faster at equal draws. - VICTORY_DIRTY_4K=1|alt: refreshes copy only the written 4 KiB pages of a stale write-watched page: -45 % of those bytes; faster in loading, no world gain. Fixes: - Textures under a DirectStorage write or a landed plain read are made due again (VICTORY_PAGE_WRITES default 1|2|8): textures uploaded before their data landed kept zeros (black faces); VICTORY_HEAP_RECHECK_EVERY=<frames> keeps looking at uploaded textures after the schedule (after RyanCase94). - Pull requests #646 (builder dispatches count threads), #1002 (alpha-tested geometry casts cascade shadows), #1314, #1324, #589, #702, #1112 (mesh triangle corners masked 9 bits, cube-map levels, two-sampler branches, split 64-lane masks); upstream #3198 (textures without card room retried). - VICTORY_WAVE_WIDE_ONLY=<hashes>: listed refused programs may take the wave-wide form (after #823's a416e39; the water's colour, with dark patches still under investigation). - VICTORY_MERGE_RUNS_ALT, VICTORY_CLAMP_LEAN, VICTORY_CLAMP_WINDOW, VICTORY_OCCLUSION: measured, no gain; off. The shader translator changed: delete both shader caches before the first run.
…ore pipelines, shader and host fixes Copied from the fxceless fork and upstream VIctory (Marvisak), tested here, not merged. Nothing in the dual-bank lowering or the 64-lane forms changed: every compute path count in the pack census is the same, and the builder's two-wave and halves programs emit the same code byte for byte. - Ray-tracing builder: a DispatchX with flags bit 5 counts threads, not groups (fxceless fxceless#646). The host dispatches the groups that hold them and passes the counts (USER_DISPATCH_THREADS); 37 plain Wave32 builder programs leave the threads past the count. Not yet run in the game. - Two immediate samplers chosen by a branch are both bound and the texel of the console's edge kept (fxceless fxceless#1314): 40 programs translate. - Cube-map levels from explicit gradients no longer 1.44 times too coarse; mesh triangle corners are 9-bit indices; a program's constant table starts after its instructions (VIctory #2143). - A released view heap forgets its raw-address view run (fxceless fxceless#589); a constant view of no bytes stays one; a moved view keeps the title's minimum level; BC7 rotation only in modes 4 and 5; the driver watch skips the Auto HDR notice. - About 70 small VIctory fixes that applied as they are (audio, saves, async calls, loader, samplers, formats, tools). Pack census (32-lane host): 25,755 pipelines and 25,539 validated (25,715 and 25,499 before); 230 containers fail (270 before), no new failure. Tests: all pass but the known lower.rs size check. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
… part 2) 9613092 alone does not build (its second deep-skips form call lacks the label 93db653 adds), so the fifth merge goes on to e4245f3, the commit it was meant to bring; nothing after it (fxceless#1320, fxceless#1321, fxceless#1353, fxceless#1336, fxceless#1324 of 13:05 are left for later). - 93db653: build fix for 9613092 (VICTORY_WAVE_WHY form label). - e4245f3: VICTORY_CARD_HASH_WIDE=alt (1 was already there; default still a thread a piece), VICTORY_GATHER_SEGMENTS and VICTORY_GATHER_DISPATCHES (off), VICTORY_DIRTY_4K (off), VICTORY_MERGE_RUNS_ALT (unset), VICTORY_HEAP_RECHECK_EVERY (0), VICTORY_WAVE_WIDE_ONLY (empty); VICTORY_PAGE_WRITES default now guards+slots+plain reads' textures (1|2|8; "guards" is the old one); host callbacks check due textures first; textures without card room asked again (upstream VIctory #3198); a released view heap forgets its title-memory run (fxceless#589); shader fixes: mesh corners masked 9 bits, two immediate samplers behind a uniform branch, sampleLevel log2 and _cl clamp, split wave64 mask moves (fxceless#1112, fxceless#702). Conflicts, our structure kept: HostList hunks moved to host/host_list.rs; image hunks to emit/image_buffer.rs; copy_stale takes both COLD_SKIP marks and DIRTY_4K pieces; Journal keeps cold_skip::Written plus the 4K map; translate_listed wraps translate_counted; MERGE_RUNS_ALT before our card_steps split. Duplicates kept once (ours): fxceless#1324 (HEAP_IDENTITY), fxceless#1002 (SHADER_CASCADE_EXACT), and fxceless#646: upstream's DispatchX thread counts (USER_DISPATCH_THREADS, same code 0x106) dropped for our port of fxceless#1292 (USER_THREAD_LIMIT, which also covers the paired 64-lane form). Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…to exp/rtx3060-m Combines exp/rtx3060-l (L1 wave, fxceless#854 paired form, fxceless#864, fxceless#812, fxceless#768, LEVELS_ON_DEMAND, RAM_SAFE) with fxceless main e4245f3 (fxceless#927, fxceless#646, DIRTY_4K, GATHER_SEGMENTS, PAGE_WRITES, group-budget indirect clamp, WAVE_WIDE_ONLY) and PR fxceless#1352 SPREAD_LEAN (bit 32, LEAN_RECORDS=64, spread budget counters 3-5). Co-Authored-By: Antigravity <noreply@anthropic.com>
Problem
In
crates/victory-gpu/src/list.rs,DispatchX(x, y, z, flags)ignoredflagsand forwarded(x, y, z)directly toID3D12GraphicsCommandList::Dispatch(x, y, z)as thread-group counts.The ray-tracing structure builder calls
DispatchXwith bit 5 (0x20=COMPUTE_DISPATCH_INITIATOR::USE_THREAD_DIMENSIONS, e.g.0x0020/0x8020) set. In that mode:(x, y, z)are raw thread counts, not thread-group counts.DTid >= count) are masked off in initial hardwareEXEC.Treating raw thread counts as full 64-thread groups caused:
EXECpopcounts (s_bcnt1_i32_b64(exec)returning 64 instead of the partial count) and unmasked whole-wave reductions on partial tail waves.Fix
victory-gpucrates/victory-gpu/src/pipeline.rs: store compute[numthreads(x, y, z)]onTranslated.crates/victory-gpu/src/list.rs: forwardflagsfromdispatch_xtostate::dispatch_x.crates/victory-gpu/src/draw.rs: whenflags & 0x20 != 0(USE_THREAD_DIMENSIONS), skip zero-sized dispatches, convert raw thread counts to host group counts viadiv_ceil, and supply any non-multiple axis limits through host user-data dwordUSER_DISPATCH_THREADS(0x104,0= no cap for normalDispatchor exact multiples).victory-shadercrates/victory-shader/src/emit/shader.rs&mod.rs: define and exportUSER_DISPATCH_THREADS = 0x104.crates/victory-shader/src/emit/lower.rs: adddispatch_threads_prologuefor spilled compute programs (all ray-tracing structure builder stages) along any axis with group dimension > 1:exchange.is_none(), entry block has no back-edge — native Wave64 hosts and Wave32 programs): branch inactive lanes out toRetafter entry inputs (groupId, relabelledthread_id), and place entry-EXECballots/SCC tests inbody_entryso hardwareEXEC,s_bcnt1_i32_b64(exec), wave reductions, and stores see the exact active lane set with zero per-instruction guard overhead.exchange.is_some()for wave64-on-wave32 hosts, or programs containings_barrier): keep all threads alive soGroupMemoryBarrierWithGroupSync/exchange_halvesnever deadlock (even whenlimit <= 32leaves the upper 32-lane half with 0 active lanes), while predicating memory/LDS accesses (effect_guard), active ballots (mask_dword),scc_some,wave_wide, and whole-wave reduction masks (section_val).Verification
draw::tests::dispatch_x_thread_dimensions_convert_to_groups_and_partial_limitsincrates/victory-gpu/src/draw.rs.emit::wave64_tests::spilled_compute_masks_partial_dispatch_threads_on_wave64_and_wave32incrates/victory-shader/src/emit/wave64_tests.rstestings_bcnt1_i32_b64(exec), whole-wave OR, and unconditional per-lanebuffer_store_dwordx2atlimit = 45, 1, 0:host_wave=64(early-exit) andhost_wave=32(predicatedexchange_halves, no barrier hang atlimit = 1), both validated bydxil.dll.cargo test -p victory-shader --lib(215 passed, 0 failed),cargo test -p victory-gpu(119 passed, 0 failed),cargo xtask policy(asset policy: 169 files ok).VICTORY_BVH_BUILDER=1on AMD Radeon RX 9070: eliminates the BVH over-dispatch memory corruption crash (previously crashing within ~7–14 s on empty box-node bounds); sustained 2+ minutes / 8,900+ submissions of builder execution with zero CPU memory corruption.Refs #16.
AI-assisted (Antigravity); verified locally on an AMD Radeon RX 9070. No game data.