Repository navigation
Conversation
|
Code review on
Remaining before merge: Dual-vendor (AMD + NVIDIA) verification on |
|
Verification on NVIDIA RTX 5070 Ti (Windows 11), head Tested
Not tested
AI use
Run and written with Claude Code (Claude Fable 5.2 and Claude Sonnet 5.5). |
3a60f54 to
85d79bf
Compare
|
Rebased onto |
|
Independent AMD RDNA4 (native wave64) test report on exact head Tested
Regression run (60 s retail-title smoke, (Matched Not tested
AI use
|
|
Re-verification on RTX 3060 Ti (Windows 11), new head merged with current
Thanks! — Devin |
…tures::upload_all When `upload_queue` or `texture::upload_batch` fails (for example, a 10 s GPU wait timeout), `title_textures::upload_all()` previously kept submitting every remaining batch in `todo` for the same device, turning a single stalled queue into an `N x 10 s` freeze and leaking failed/skipped textures with `pending = false` and stale `LAST_CONTENT` hashes. Track failed devices across batches via `run_upload_batches` and `restore_pending`: - Once a device returns `Err` from `upload_queue` or `texture::upload_batch`, skip remaining `todo` items for that device (avoiding `content_hash`, detiling, and further submits) while still allowing unaffected devices to upload normally. - Clear `LAST_CONTENT` for every resource in a failed `Err` batch and for each failed item in a partial `Ok(failed)` result (counting only succeeded uploads toward `UPLOADS`, without requeuing permanently failing `Ok(failed)` items). - Keep the `ID3D12Resource` handles for failed/skipped batch items alive across a single `TEXTURES` lock after the loop to restore `pending = true` (and increment `PENDING`) only on active `!pending && !gpu_written` entries, dropping the handles after releasing `TEXTURES` so COM release cannot re-enter the lock. Part of xcl-dev#2109 Assisted-by: Google Antigravity (Gemini 4 Neon)
85d79bf to
043a59f
Compare
|
Rebased cleanly onto Re-verified on the rebased head (
|
What 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 x 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 incrementPENDING) 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
main83b00818to preserve #2844'swith_title_bytes(*va, tex.size() as usize, content_hash)safe-copy read and new concurrent-decommit/guard-page tests insidetitle_textures.rs, alongside #2306'svram::level_pages()->map_levels_with_texels(&r, &subs)and #2976'sXCL_PREPARE=0.)Tested
1.9.2609.5,rustc 1.100.0, debug + release.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 clippy --all-targets -- -A clippy::approx_constanton rebased head043a59f0: exit0,0new warnings or errors incrates/xcl/src/hle/d3d12x/title_textures.rs(only pre-existing upstream warnings elsewhere in the file).XCL_ADAPTER=warp,XCL_WARP=1):cargo test -p xcl --lib -- hle::d3d12x::title_textures:: --test-threads=1 --nocapture-> 24 passed, 0 failed, 0 ignored across 3/3 consecutive runs (14.79–15.38 s,0runtime skips — includes all existing GPU upload tests, D3D12.X: XCL_TEXTURE_LEVEL_PAGES=1 gives a sampled texture's levels their pages with their texels #2306'sa_placed_texture_gets_the_pages_of_a_level_with_its_texels, D3D12.X: UMA windows in a driver heap on NVIDIA, 4.9x FPS (0.62 -> 3.03) #2844'stitle_bytes_survive_concurrent_decommit+title_bytes_leave_guard_pages_alone, and all 3 PR 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 test --release -p xcl --lib -- hle::d3d12x::title_textures:: --test-threads=1 --nocapture-> 24 passed, 0 failed, 0 ignored across 3/3 consecutive runs (3.73–3.83 s,0runtime skips).Regression run
Paired quiet 60 s
--releaseruns on desktop NVIDIA GeForce RTX 4060 withXCL_PREPARE=0andXCL_NETWORK=0(viascripts/smoke.ps1 -Seconds 60):Baseline (
main83b008188efbf954b846667f48d75e3fa9310a01,XCL_PREPARE=0 XCL_NETWORK=0):PR head (
043a59f04d3594f4b523cf6f20acc4b0aec54702,XCL_PREPARE=0 XCL_NETWORK=0):Not tested
texture::upload_batchtimeout on live D3D12 hardware; failure-path batch abort,LAST_CONTENTinvalidation, andrestore_pendingstate transitions are covered by the pure-CPU unit tests, while the happy path ran under the WARP and RTX 4060 GPU unit tests and paired 60 s smoke runs above.prepare_for_launch) was skipped in the paired 60 s smoke runs viaXCL_PREPARE=0(introduced by xcl run: XCL_PREPARE=0 starts the title without the shader preparation #2976); shaders compiled on demand during the run.83b00818(onlyclippy --all-targets, targeted 3x Debug WARP + 3x Release RTX 4060title_textures::suites, and paired 60 s smokes ran on043a59f0).ID3D12Devicehardware scenarios live (covered by pure-CPU unit test) or non-Windows / Wine hosts.AI use
Implemented, rebased, and verified with Google Antigravity (Gemini 4 Neon). All code changes, failing-first and post-rebase unit tests, clippy checks, and paired 60 s RTX 4060 smoke runs were reviewed and executed locally.