D3D12.X: abort failed device batches and restore pending in title_textures::upload_all #2224
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!2224
Loading…
Reference in a new issue
No description provided.
Delete branch "github-bot/gh-2224"
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?
@Decodere on GitHub · 2026-11-25 10:30 UTC · original
Decodere:fix-2109-upload-all-abort-restore→main· +219 −45 · 1 files · 1 commits · openWhat is in it
Part of #2109.
When
upload_queueortexture::upload_batchfails intitle_textures::upload_all()(for example after a 10 s GPU wait timeout on a stalled queue),upload_all()previously kept submitting every remaining batch intodofor the same device, turning one stalled queue into anN × 10 sfreeze while leaving failed and skipped textures stuck withpending = falseand staleLAST_CONTENThashes.This change extracts pure-CPU batch-control (
run_upload_batches) and pending-restoration (restore_pending) helpers incrates/xcl/src/hle/d3d12x/title_textures.rswithout changingtexture.rsor any other file:failed_devices: Vec<usize>across batches (zero allocations on the happy path). Onceupload_queueortexture::upload_batchreturnsErr(e)for a device, log viawarn(&e)and mark that device failed so all remainingtodoitems for that device are drained without runningcontent_hash/same_as_last_upload/subresources_of_all/upload_batch, while unaffected devices continue uploading normally.LAST_CONTENTfor every resource in a failedErrbatch (so retries cannot false-skip as unchanged) and for each failed index in a partialOk(failed)result. OnOk(failed), count only(batch.len() - failed_keys.len())towardUPLOADSand do not restorepending(avoiding infinite retry loops on permanently failing textures).ID3D12Resourcehandles of failed and skipped same-device items until after the loop, lockTEXTURESonce to restorepending = true(and incrementPENDINGby the exact restored count) only on activeby_resentries where!e.pending && !e.gpu_written, and drop the retainedID3D12Resourcehandles after releasingTEXTURESso raw pointers stay pinned during lookup and COMRelease->forget()cannot re-enterTEXTURES.pendingafter batch failures (Part of #2109); does not claim to fix the upstream RTX 3090 GPU queue stall itself.(Rebased onto
origin/main50a9fdefto integrate #2306'svram::level_pages()->map_levels_with_texels(&r, &subs)call cleanly insideupload_all's batch submit closure.)Tested
upload_all_*: 0 passed / 2 failed — device 1 submitted all 4 batches instead of aborting after batch 1 and leftretryempty;restore_pending_*: 0 passed / 1 failed — returned0instead of1).cargo test --release -p xcl --lib hle::d3d12x::title_textures::tests:: -- --test-threads=1 --nocaptureon85d79bf6atop50a9fdef): 22 passed, 0 failed, 0 ignored (0.93 s,0skipped — includes all existing GPU upload tests, #2306'sa_placed_texture_gets_the_pages_of_a_level_with_its_texels, and all 3 new tests:upload_all_aborts_failed_device_batches_while_other_devices_continue,upload_all_clears_last_content_on_batch_err_and_partial_ok_without_poisoning_skipped, andrestore_pending_requeues_only_active_non_pending_non_gpu_written_entries).cargo build --release --workspaceandcargo test --release --workspace --no-fail-fast -- --test-threads=4 --nocaptureon Windows 11, Intel Core i5-11400F, NVIDIA GeForce RTX 4060 driver 621.14, DXC1.9.2609.5): 23 test binaries, 1291 passed, 1 failed, 46 ignored, where the sole failure isorigin/main50a9fdef's pre-existinggpu::recomp::lower_dxil::tests::a_bridged_mask_write_where_one_half_is_elsewhere_meets_no_barrier(left: 3, right: 1, failing onmainCI run45656870453after #2074), plus 28 runtimeSKIPPEDlines (21no wave64on RTX 4060,3wave32 per-lane formrefusedby driver,2missingd3d12SDKLayers.dll/ D3D12 debug layer,1driver shader cache toggle unavailable,1no heap windows).Regression run
Baseline (
origin/main50a9fdef81cb796b8756a31defb0648301d002ce):PR head (
85d79bf639d42a0c7149c3efcadf6bb0cd3abb1a):Not tested
texture::upload_batchtimeout on live D3D12 hardware; failure-path batch abort,LAST_CONTENTinvalidation, andrestore_pendingstate transitions are covered by the new pure-CPU unit tests, while the happy path ran under the RTX 4060 GPU unit tests and 60 s smoke test above.#[ignore]tests did not execute on this machine.ID3D12Devicehardware scenarios live (covered by pure-CPU unit test).AI use
Implemented and verified with Google Antigravity (Gemini 4 Neon). All code changes, failing-first and post-fix unit tests, full workspace release tests, and paired 60 s RTX 4060 smoke runs were reviewed and executed locally.
@raylitebull on GitHub · 2026-11-25 10:48 UTC · original
Code review on
3a60f54:run_upload_batches+restore_pendingincrates/xcl/src/hle/d3d12x/title_textures.rscleanly stops submitting subsequent batches for a failed device, preservesLAST_CONTENTfor unchanged/skipped entries while clearing failed keys, and re-markspendingonly for active!pending && !gpu_writtenentries (dropping COM handles outsideTEXTURESto prevent lock re-entry).Build and testandPR descriptionare both green (CLEAN).Remaining before merge: Dual-vendor (AMD + NVIDIA) verification on
3a60f54.@tiagonleal on GitHub · 2026-11-25 12:31 UTC · original
Verification on NVIDIA RTX 5070 Ti (Windows 11), head
3a60f54e96c01ea9600744ba69ce3d2d39cf91b3Tested
3a60f54e96c01ea9600744ba69ce3d2d39cf91b3(git rev-parse HEADof a clean worktree, no local changes, built as is; merge-base withmain568e7db7729c8fa6c8f0f4b32d798faaf11462bb). The PR was open and the head unchanged when I started and again before writing this.cargo testdefault), DXC from the Windows SDK 10.0.26100.0 (dxcompiler/dxil 1.8.2502.11).cargo test -p xcl --lib title_textures -- --test-threads=4 --nocapture: 17 passed, 0 failed, 0 ignored (9 s). This includes the three new tests (upload_all_aborts_failed_device_batches_while_other_devices_continue,upload_all_clears_last_content_on_batch_err_and_partial_ok_without_poisoning_skipped,restore_pending_requeues_only_active_non_pending_non_gpu_written_entries).cargo test -p xcl --lib hle::d3d12x -- --test-threads=4 --nocapture: 180 passed, 0 failed, 2 ignored (11 s).cargo test -p xcl --lib -- --test-threads=4 --nocapture(whole lib): 1097 passed, 4 failed, 26 ignored. The 4 failures aregpu::dxil::fuzz_tests::fuzz_validate_and_gpu_0to_3, each withCreateComputePipelineState: Not enough memory resources are available to complete this operation. (0x8007000E). They are not from this PR: the same four tests fail with the same message on its merge-base568e7db(same command: 1094 passed, 4 failed, 26 ignored; the 3 extra passes here are this PR's new tests). Runninggpu::dxil::fuzz_testsalone at this head, twice, gave 4 failed both times (andfuzz_validate_and_gpu_0alone with--test-threads=1failed too), andgpu::dxil::fuzz_testson the merge-base gave 4 failed again.SKIPPEDlines in the whole-lib run: 23 GPU tests withno wave64orrefused (unsupported V_MUL_F16 / V_PK_MUL_F16 / V_CVT_F16_F32 ...)on this wave32-only GPU, andshaders::tests::pso_measurement_compiles_an_exact_synthetic_record: cannot disable the driver cache (Windows Developer Mode is required), 0x887A002D.Not tested
xcl-smokerun; this is a unit-test run only.cargo test --workspaceand the other test targets undercrates/xcl/tests; release profile.AI use
Run and written with Claude Code (Claude Fable 5.2 and Claude Sonnet 5.5).
@Decodere on GitHub · 2026-11-25 17:14 UTC · original
Rebased onto
50a9fdef(85d79bf6, preserving#2306'svram::level_pages()/map_levels_with_texelsandvram::before_executeinsideupload_all). Re-verifiedtitle_textures::tests(22/0), paired 60 s RTX 4060 smoke (1544 -> 1565,0device removals/crashes), and workspace (1291 passed, 1 failedsolely on50a9fdef's#2074test).@emirduran707 on GitHub · 2026-11-25 18:13 UTC · original
Independent AMD RDNA4 (native wave64) test report on exact head
85d79bf639d42a0c7149c3efcadf6bb0cd3abb1a(clean detached checkout, no local changes).Tested
stable-x86_64-pc-windows-msvc), DXC 1.9.2602.17; tests debug, smoke release.cargo build --workspace && cargo test --workspace --no-fail-fast -- --test-threads=4: 1289 passed, 3 failed, 46 ignored; 8 SKIPPED (6 inlower_dxil::tests::{f16,f32}_programs_on_the_gpurefused by per-lane form;heap_window_out_of_memory_falls_back_to_the_switch_form;pso_measurement_compiles_an_exact_synthetic_record). All native wave64 GPU tests ran and passed.hle::d3d12x::title_textures::tests::restore_pending_requeues_only_active_non_pending_non_gpu_written_entries,upload_all_aborts_failed_device_batches_while_other_devices_continue, andupload_all_clears_last_content_on_batch_err_and_partial_ok_without_poisoning_skipped.main68a284a:gpu::dxil::fuzz_tests::fuzz_validate_and_gpu_1(seed 722) andfuzz_validate_and_gpu_3(seed 1599) on this GPU, plusgpu::recomp::lower_dxil::tests::a_bridged_mask_write_where_one_half_is_elsewhere_meets_no_barrier(from50a9fde/ #2074).Regression run (60 s retail-title smoke,
XCL_NETWORK=0, release)(Matched
main68a284abaseline on the same machine today: 1573 frames, 14420 MB peak, 0 device removals, 0 crashes.)Not tested
AI use
@DavidM1911 on GitHub · 2026-11-26 08:15 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.