D3D12.X: replace busy copy scratch within budget #1421
No reviewers
Labels
No labels
accessibility
bug
documentation
duplicate
enhancement
goal:world-load
good first issue
help wanted
invalid
keep-open
off-goal
question
stale
test-only
wontfix
No milestone
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set
Reference
github/xcl-dev--xcl!1421
Loading…
Reference in a new issue
No description provided.
Delete branch "github-bot/gh-1421"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
@hajduzsolt on GitHub · 2026-11-24 15:47 UTC · original
hajduzsolt:fix/copy-scratch-busy-buffer→main· +61 −8 · 1 files · 2 commits · openRuntime fix verified with unit tests and RX 9070 XT smoke run.
What is in it
crates/xcl/src/hle/d3d12x/list_x.rs: retain busy scratch until GPU completion and test replacement and accounting with synthetic D3D12 resources.Tested
cargo test -p xcl --lib copy_scratch -- --test-threads=4: 3 passed, 0 failed.cargo test --workspace -- --test-threads=4 --nocapture: 752 passed, 0 failed, 41 ignored. The reported passes include tests that return early.test_title_draws_with_a_root_signature_under_the_debug_layeranduploads_start_from_each_subresources_state(D3D12 debug layer unavailable).Regression run
main:
PR:
Not tested
AI use
@srcamarda on GitHub · 2026-11-24 16:54 UTC · original
Test report for
4c65020merged ontomain2008399: AMD RDNA3, with the debug layer installed; the retail title does not reach the #1408 path in its first 150 sTested
main2008399locally (clean merge, not pushed).cargo test --workspace --no-fail-fast -- --test-threads=4: 752 passed, 0 failed, 41 ignored. NoSKIPPEDlines. The two debug-layer tests your description lists as skipped ran and passed here:test_title_draws_with_a_root_signature_under_the_debug_layer(which asserts no "invalid for use as a source buffer" since #993) anduploads_start_from_each_subresources_state. The three copy-scratch tests pass, includingbusy_copy_scratch_is_retired_when_budget_allows_a_replacement.Retail title under the debug layer
XCL_D3D12_DEBUG=1 XCL_NETWORK=0 XCL_ACTIVITY=1 XCL_RUN_SECONDS=150, Enter (= A) at 30 / 40 / 50 s (title screens into the start of loading). Interleavedmain, this PR,main, this PR.CopyBufferRegionare logged with no cap.CopyBufferRegionstate errors: 0 in all four runs,mainand this PR alike. No device removal or crash; frames shown:main2157 / 2008, this PR 1698 / 2009.The id 538 errors the title does hit (same in both builds, and on
main47efa2ebefore #993; for whoever looks at them, not this PR's):ClearRenderTargetViewon a resource inUNORDERED_ACCESS(also once inCOPY_SOURCE);CopyResourcewith its source inRENDER_TARGET;Drawwith a render target inNON_PIXEL_SHADER_RESOURCE | PIXEL_SHADER_RESOURCE.Not tested
+0x23cf683, #534, comes after these 150 s on this machine).Claude Code (Claude Opus 5.5), from runs on the hardware above.
@DavidM1911 on GitHub · 2026-11-24 17:21 UTC · original
Verification on RTX 3060 Ti (Windows 11), branch merged with current
main:cargo test -p xcl --lib: all passed, 0 failed, ~21 ignored.Thanks!
@enderrr9 on GitHub · 2026-11-24 18:00 UTC · original
Test report: NVIDIA, 32-lane waves, head
4c65020Tested
cargo test -p xcl --lib copy_scratch -- --test-threads=4 --nocapture: 3 passed, 0 failed (a_new_list_takes_no_copy_scratch_of_an_earlier_one,busy_copy_scratch_is_retired_when_budget_allows_a_replacement,copy_scratch_budget_counts_resources_until_gpu_completion), none SKIPPEDcargo test --workspace -- --test-threads=4: 752 passed, 0 failed, 41 ignored. SKIPPED:gpu_geometry_wave32_prefix_count_over_a_mask(no wave64),gpu_wave32_program_in_wave64_hardware(no wave64)Not tested
Report written and the tests run with Claude Code (Claude Opus 5.5).
@hajduzsolt on GitHub · 2026-11-24 19:23 UTC · original
Thanks for noting the missing diagnostic. Budget-driven scratch refusals now emit a one-time warning before using the in-place fallback, including requests larger than the budget. The existing budget-exhaustion test and
cargo test --workspace -- --test-threads=2passed (708 library tests passed, 21 ignored).@pvfreis on GitHub · 2026-11-24 16:34 UTC · original · edited 2026-11-24 22:33 UTC
Test report for
7124a95392(this PR's head) merged onto main1d027e5c76(git auto-mergedlist_x.rs, no conflict). (Edited after a rerun. The first version covered4c65020ontob7aa9f3: 770 passed, 1 failed, 41 ignored; main 769/1/41, and noted the log line was missing;7124a95added it.) The new test passes on NVIDIA; no other test result changed. I opened #1408. Of its "Expected": a busy scratch moves toreleased, still charged to the budget, and a new one is made within it; the log line when the budget forces the fallback is now there.Tested
cargo build --workspace --locked --offline, thencargo test --workspace --locked --offline --no-fail-fast -- --test-threads=4:1d027e5: 958 passed, 1 failed, 43 ignored1d027e5: 959 passed, 1 failed, 43 ignored. The difference isbusy_copy_scratch_is_retired_when_budget_allows_a_replacement, which passes; the other two copy-scratch tests pass too, and the log has the new warning (emitted once per process) for a request of 67108864 bytesno wave64(16 ingpu::recomp::lower/lower_dxil,gpu_geometry_wave32_prefix_count_over_a_mask,gpu_wave32_program_in_wave64_hardware), 3 refused wave32 per-lane cases inf16_programs_on_the_gpu/f32_programs_on_the_gpu, andheap_window_out_of_memory_falls_back_to_the_switch_form(no heap windows)test_title_runs_and_game_folder_is_untouched(e2e,presents0), because these runs are in an isolated non-interactive session whereCreateSwapChainForHwndreturns 0x887A0022.Not tested
1d027e5(689f2dbnow; the commits since touch onlygpu/dxilandgpu/recomp)kickoff_x/copy_memory_xend to end, the debug layer on this pathRun and written with Claude Code (Claude Opus 5.5); counts recomputed from the logs by a second agent (Claude Opus 5.5); text reviewed with Claude Fable 5.2. The runs are real, on the hardware above.
@DavidM1911 on GitHub · 2026-11-26 05:13 UTC · original
Re-verification on RTX 3060 Ti (Windows 11), new head merged with current
main:cargo test -p xcl --lib: all passed, 0 failed, 27 ignored. The earlier merge conflict is resolved.Thanks!
— Devin
View command line instructions
Checkout
From your project repository, check out a new branch and test the changes.Merge
Merge the changes and update on Forgejo.