Repository navigation
Conversation
|
Ran the two new tests at Environment unchanged: Windows 11 Pro build 26200 x64, NVIDIA GeForce RTX 5070 Ti (Blackwell, wave32 only, 16 GB) driver 32.0.16.2124, Intel Core i5-12400F, 64 GB RAM, rustc 1.100.0 MSVC 14.44.35207, DXC 1.9.2609.5, debug build. Both still pass on Not tested (same gaps as above): a title that actually issues more than 65 535 groups in X, RDNA2/RDNA4 and Intel GPUs, Wine, release profile, native wave64. AI-assisted (OpenCode), model: DeepSeek V4.1 Flash Free - checked out the new head in a detached worktree, rebuilt, ran the tests, and updated this report; the worktree was not modified; no game data was used. |
|
Update for head AMD run, which this PR lists as not tested. Updated for head Tested: pass, head
On Not tested: RDNA2; the upper-boundary case from the review above beyond the PR's own tests; the whole workspace suite; a title. AI use: Claude Code (Claude Opus 5.5) ran the tests on this machine and wrote this report. |
Indirect dispatch fold disagrees with the CPU at the upper boundaryOn
The shader in Tested
Not tested
AI use
|
|
Test report from the retail game, GTA VI 1.0.2.1. With this PR applied, the world-loading GPU hang did not show up in one run; before it, the hang happened in both runs I had on the same machine. Correction (edited): the PR's per-dispatch report lines never appeared in that run, so I can't attribute the missing hang to it. See below. Tested at Hardware: NVIDIA GeForce RTX 5060 Ti 16 GB, driver 621.24, Agility SDK 1.620.2. CPU i7-14700KF, 64 GB RAM, Windows 10 22H2 (19045). Rust 1.88.0, release build with line tables. Game runs used Before (
With this PR (one run):
Update, a second run with this PR (same build, no DRED;
Unit tests: Not tested:
AI use: run, log analysis and this report by Claude Code (Claude Opus 5.5); posted at the request of the person running the tests. |
…in-place vtables Integrates 16 upstream PRs (ivall#1380, ivall#1383, ivall#1384, ivall#1395, ivall#1398, ivall#1400, ivall#1404, ivall#1405, ivall#1419, ivall#1420, ivall#1421, ivall#1423, ivall#1424, ivall#1427, ivall#1428, ivall#1429) on top of the Linux/Proton fork, plus three Proton/vkd3d-proton fixes caught during verification: - Recompiler (ivall#1428): flatten IO_GROUP_LIMIT early-return in compute shaders so vkd3d-proton v3.1 dxil-spirv accepts the emitted CFG. - D3D12.X (ivall#1395 + ivall#867): skip UnadoptGuard on in-place-patched vtables and restore native vtables in runner::submit_list when a prior test adopted the singleton ID3D12Device. - Tests: match Wine centered default in window_position_modes. Verified under GE-Proton11-14 (RX 9060 XT / RADV): - gpu_sparse_vram_descriptors_buffers_and_xmem + gpu_valu_float_and_int + window_position_modes: 3 passed, 0 failed - Broad sweep (present, real, sparse, clamp, dstorage, gpu_valu, gpu_typed_buffer): 82 passed, 0 failed, 1 ignored, 0 skipped - 2.5 min retail title run (XCL_MEM_LIMIT=12G): 3,000+ frames at 30.0 fps, 6.0-6.1 GB flat committed RAM, 6.4 GB local VRAM, 0 DS failures.
a902d3e to
cf6cc59
Compare
|
Thanks @nnonno91 and @gut0to, fixed in Thanks also @Aniseto and @DarkPanda69 for the NVIDIA / AMD test runs, and @oz-stanislav-zhukov for the run on the title. Smoke run and the whole suite are redone on the new head (numbers in the description). AI use: Claude Code (Claude Opus 5.5) wrote this. |
|
Verification on RTX 3060 Ti (Windows 11), branch merged with current
Thanks! |
cf6cc59 to
e29892e
Compare
…direct DXIL) Brings in upstream xcl-dev#680 (descriptor-heap memory windows without per-access switches, with switch fallback) and xcl-dev#1426 (direct RDNA2 -> DXIL backend behind XCL_DIRECT_DXIL=1 / XCL_DIRECT_DXIL=all, bypassing HLSL and DXC). Retains xcl-dev#1398 no-GVN retry, xcl-dev#1410 wave64 logging, and xcl-dev#1428 folded X dispatch group limit alongside xcl-dev#680 and xcl-dev#1426.
|
Added "Part of #505" to the description, since this PR is about a stop at the world load (#1833) and has no AI use: Claude Code (Claude Opus 5.5) wrote this. |
The console runs up to 2^32 - 1 thread groups a dimension; D3D12 takes 65 535, and past that a dispatch is undefined. On an NVIDIA RTX 5060 Ti a retail game's world loading hung the GPU (DXGI_ERROR_DEVICE_HUNG, 0x887A0006) about 100 s in, every run: the only unfinished work was an ExecuteIndirect of one loop-free compute program (found with the dispatch markers of xcl-dev#1323), and its arguments, written by an earlier dispatch, were 72 512 x 1 x 1 and 75 072 x 1 x 1 groups. A dispatch of more than 65 535 groups in X with 1 in Y now runs as 65 535 x ceil(n / 65 535) groups. The console's count goes into a new io word (IO_GROUP_LIMIT, in the trap-temp range like IO_UMA_BASE_HI; 0 when not folded), and every translated compute program takes gid.x + gid.y * 65 535 as its group in X when the word is set, its Y as 0, and returns at once in the groups at or past the count. A dispatch that cannot be folded (two dimensions past the limit) is clamped and logged. - Dispatch and console-recorded dispatches: the counts are known on the CPU (bind::fold, also in console_list). - ExecuteIndirect of one dispatch: the counts are only on the GPU. A one-thread pass (clamp.rs) reads them, writes the counts to dispatch into a slot of XCL's buffer and the console's count into the dispatch's io (folding only when the rows stay within 65 535, as bind::fold does), then the dispatch reads its arguments from the slot. bind_abi now returns what it bound so the binding can be set again after the pass. The translated compute HLSL changes (a few lines in the prelude), so cached translations and DXIL of compute programs are made again once. New tests: a folded dispatch runs each console group once and none past its count (GPU; fails without the change from group 65 535 on), the indirect pass folds / clamps / leaves counts as they are (GPU), and the folding rule (unit). runner::device() gives tests the runner's device: a test making its own device first left the Agility SDK unappliable and the GPU tests after it skipped. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
e29892e to
280164a
Compare
# Conflicts: # crates/xcl/src/hle/d3d12x/bind.rs
|
A gap I found while merging this for a test on AMD RDNA4: the fold is only undone on the HLSL path. What is needed: the same unfolding in the direct translator's group and thread ids, with a GPU test like It also conflicts in Tested: AI use: Claude Code (Claude Opus 5.5) read the code, ran the tests and wrote this on the maintainer's behalf. |
`bind` and `clamp` fold a dispatch of more than 65 535 groups in X into Y for every translated compute pipeline, but only the HLSL path took its group in X back from both ids (`IO_GROUP_LIMIT`). The direct translator (`gpu::dxil`, `compute_init`) and its per-lane form (`recomp::lower`) now do the same: the group in X from both ids, Y 0, and the groups past the console's count leave at once (a gate before the program; the per-lane form's skip block). The folded-dispatch GPU test runs all three: HLSL, direct (wave32, wave64, split wave64) and per-lane; the native wave64 forms only on a GPU that runs wave64. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
|
@ivall Thanks, you were right: the fold was only undone on the HLSL path. AI use: Claude Code (Claude Opus 5.5) wrote the change and this comment. |
|
The direct path's unfold is written and tested; it goes in with this PR. On
Not merged yet: it changes the DXIL of every compute program, and I want a title run of the tree first. AI use: Claude Code (Claude Opus 5.5) wrote the commit, ran the tests and wrote this on the maintainer's behalf. |
|
For comparison, two other designs of this fix, in case cases are worth borrowing:
Cases that might be worth a test here: x > 65,535 with y > 1 (clamped now), the same pipeline used by a direct and then an indirect dispatch, and a side-effect-only program whose padding groups must not write. Read from the PR texts and this diff only. AI-assisted (Claude Code). |
…lamp indirect dispatches)
Part of #505 (the world load): the GPU hang (
0x887a0006) about 100 s into the world load on an RTX 5060 Ti.The console runs up to 2^32 − 1 thread groups a dimension; D3D12 takes 65 535, and past that a dispatch is undefined. On an NVIDIA RTX 5060 Ti a retail game's world loading hung the GPU (
DXGI_ERROR_DEVICE_HUNG, 0x887A0006) about 100 s in, every run. The dispatch markers of #1323 showed one unfinished dispatch each time: anExecuteIndirectof one loop-free compute program, whose arguments (written by an earlier dispatch) were 72 512 × 1 × 1 and 75 072 × 1 × 1 groups. Clamping them to 65 535 removed the hang but left the last groups' work undone (the game crashed later, reading what they should have written); folding runs all of them.A dispatch of more than 65 535 groups in X with 1 in Y now runs as 65 535 × ⌈n / 65 535⌉ groups. The console's count goes into a new io word,
IO_GROUP_LIMIT(in the trap-temp range likeIO_UMA_BASE_HI; 0 when not folded), and every translated compute program – the HLSL path and both direct translators (gpu::dxiland its per-lane form inrecomp::lower) – takesgid.x + gid.y · 65 535as its group in X when the word is set, 0 as its Y, and returns at once in the groups at or past the count. A dispatch that cannot be folded (two dimensions past the limit) is clamped and logged.What is in it
Dispatchand console-recorded dispatches, whose counts the CPU knows:bind::fold(bind.rs, also used inconsole_list.rs).ExecuteIndirectof one dispatch, whose counts only the GPU knows: a one-thread pass (clamp.rs) reads them, writes the counts to dispatch into a slot of XCL's buffer and the console's count into the dispatch's io; the dispatch then reads its arguments from the slot.bind_abinow returns what it bound (Bound), sorebindsets it again after the pass.recomp/emit.rs; the direct translator's compute entry (gpu/dxil/kernel.rs,compute_init, with a gate before the program for the groups past the count) and its per-lane form's (recomp/lower.rs, the groups past the count take its skip block);IO_GROUP_LIMIT/FOLD_Xinrecomp/mod.rs.recomp/tests.rs: the HLSL path, the direct translator in wave32, wave64 and split wave64, and the per-lane form; fails without the change from group 65 535 on), the indirect pass folds / clamps / leaves counts as they are (GPU,clamp.rs), the folding rule (unit,bind.rs).runner::device()gives tests the runner's device: a test that made its own device first left the Agility SDK unappliable for the process (0x887E0003), and the GPU tests after it skipped.The translated compute HLSL and the direct translators' compute DXIL change (a few lines in the prelude / entry), so cached translations and DXIL of compute programs are made again once.
Tested
cargo build --workspace, thencargo test --workspace -- --test-threads=4oncf6cc59: 754 passed, 0 failed, 41 ignored (SKIPPED GPU tests:gpu_geometry_wave32_prefix_count_over_a_mask,gpu_wave32_program_in_wave64_hardware– no wave64 on this GPU). One run before that hadvram::tests::d32s8_targets_take_their_own_size_of_video_memoryfail withE_FAILcreating a resource; it passed 3 of 3 times alone, on this head and onmain.72512 groups folded into 65535 x 2, group 65535).cf6cc59(after @nnonno91's and @gut0to's reports): the indirect pass computes the row count without the addition that wrapped near 2^32 and folds only when it stays within 65 535, asbind::folddoes. Its test covers 65 535², 65 535² + 1 andu32::MAXagainstbind::foldand fails on the previous shader.main9e3831e(conflict inbind_abiwith the descriptor-heap binding of fe7d70b; both kept), heade29892e:cargo test --workspace -- --test-threads=4779 passed, 0 failed, 41 ignored.main1d027e5(conflict inexecute_indirectwith D3D12.X: an ExecuteIndirect reads the arguments written before it #1791'sfresh_indirect_arguments; both kept: the fold pass first, then the ExecuteIndirect between D3D12.X: an ExecuteIndirect reads the arguments written before it #1791's transitions), head280164a:cargo test --workspace --no-fail-fast -- --test-threads=4962 passed, 0 failed, 43 ignored. In a first runvram::tests::d32s8_targets_take_their_own_size_of_video_memoryfailed once while the precompile held most of the video memory; it passed 3 of 3 times alone.7dbd80c(after @ivall's report that only the HLSL path undid the fold): the direct translators unfold too.main1a0bbe3merged in (no conflicts), head7dbd80c, driver 621.40, DXC 1.9.2609.5:cargo test --workspace --no-fail-fast -- --test-threads=41248 passed, 5 failed, 46 ignored (SKIPPED GPU tests: the wave64 ones – no wave64 on this GPU – and two f16 per-lane cases the per-lane form refuses). The failures arefuzz_validate_and_gpu_0–_3(0x8007000E creating the pipeline, the same seeds without this change) andvram::tests::d32s8_targets_take_their_own_size_of_video_memory(passed 3 of 3 times alone). WithXCL_DIRECT_DXIL=all,cargo test -p xcl --lib gpu::: 628 passed, the same 4 fuzz tests failed, 22 ignored. The extended GPU test fails on the direct path without7dbd80c.Regression run
main:
PR:
The 60 s stay in the game's menus and loading screen, before the folded dispatches. The PR's first run after the build had 1136 frames and a peak commit of 26285 MB (its shader caches were made new for the changed translator sources); the block above is the run right after it, with no change in between.
Not tested
kernel.rsandbind.rs, and itsdispatch_chainwould need to fold too; whichever lands second takes care of it.max > 1): they are left as they were.AI use
🤖 Generated with Claude Code