D3D12.X: keep in-flight texture upload objects alive on Signal/wait failure #1486
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!1486
Loading…
Reference in a new issue
No description provided.
Delete branch "github-bot/gh-1486"
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?
@b3IKK on GitHub · 2026-11-24 16:50 UTC · original
b3IKK:gpu/texture-upload-signal-uaf→main· +52 −18 · 1 files · 1 commits · openAfter
ExecuteCommandLists,upload_batchcalledSignalandwaitand then dropped the allocator, command list and staging buffer unconditionally. IfSignalor the wait failed, the CPU freed memory the GPU could still be reading; the same applies to the uploader kept inUPLOADERS, which was keyed only by the queue pointer and could hand a device another device's staging buffer.This keeps the in-flight objects alive when
Signalor the wait fails (finish_gpu_waitforgets them instead of dropping them) and keys the uploader map by(device, queue).What is in it
crates/xcl/src/gpu/texture.rs:finish_gpu_wait;upload_batchkeeps(allocator, command list, staging)alive on error;UPLOADERSis keyed by(device, queue); unit testfinish_gpu_wait_keeps_inflight_alive_on_error_and_returns_on_ok.(device, queue)key when rebasing.Since the last push: rebased onto
main06c9f55. The conflict was in the test module, wheremainhad addedlarge_staging_uses_sixteen_mib_growth_steps/gpu_large_mixed_upload_keeps_tight_staging_and_exact_pixelsat the same place; both sides are kept.mainalso changed the uploader key to(device, queue), so the branch's test now builds that key too.Tested
stable-x86_64-pc-windows-msvc), DXC 1.9.2609.5, debug (scripts/test.ps1) and release (scripts/smoke.ps1).\\scripts\\test.ps1(cargo build --workspace+cargo test --workspace -- --test-threads=4): 1266 passed, 0 failed, 46 ignored (SKIPPED: the wave64 / direct-DXIL per-lane tests that need 64-lane hardware or a semantics mode this adapter refuses,no heap windows, andcannot disable the driver cache (Windows Developer Mode is required))cargo test -p xcl --lib -- gpu::texture: 15 passed, 0 failedstd::mem::forget(in_flight)put back tostd::mem::drop(in_flight): 0 passed, 1 failed —assertion left == right failed: in-flight objects must stay alive on error(left: 1, right: 0)Regression run
main (
426a5a7, clean tree, no local changes):PR (
bd33797, clean tree, no local changes):(The main block is
426a5a7, an ancestor of the currentmain06c9f55, from the same machine and data folder.)Not tested
Signal/waitfailure while the GPU is still reading (the test drivesfinish_gpu_waitdirectly)AI use
06c9f55, kept both tests at the conflict, adapted the test tomain's(device, queue)key, confirmed the new test fails without the fix, ran the suite and thescripts/smoke.ps1pair.github-bot referenced this pull request2026-11-26 04:59:09 +00:00
@dcastell1 on GitHub · 2026-11-24 16:55 UTC · original
Verified on Windows 11 10.0.26300, NVIDIA GeForce RTX 5090 (driver 621.24), Rust 1.100.0 MSVC 14.44.35207, debug build, on
main@b7aa9f3(baseline 770 passed, 0 failed, 41 ignored on this box):One more than the baseline; keeping in-flight texture upload objects alive is covered and green.
Tree restored afterwards (full diff against a clean checkout), hardware adapter, no Wine, no game data. AI-assisted (opencode): applied the patch to a built tree, ran the suite, reverted it.
@DavidM1911 on GitHub · 2026-11-24 18:53 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. (Intermittent single-test flake / 0xc0000005 abort under parallel scheduling; clean on single-threaded rerun — same flake seen on unmodifiedmain.)Thanks!
@JJAutoCompare on GitHub · 2026-11-25 05:26 UTC · original
Empirical test report (8151725a)
PR #1486 at
8151725a18ccc773b0cf23ef1732224c52adc7aa.Hardware / environment
32.0.101.9175. Windows also listed a Microsoft Basic Display Adapter.rustc 1.100.0 (0ef1bc386 2026-11-09)and DXC1.9.2609.5(01b62ad47). The Cargo test profile was unoptimized, with incremental compilation and debug info disabled.XCL_ADAPTER=A770andRUST_TEST_NOCAPTURE=1. The GPU fixture requested the default D3D12 adapter. Its output did not identify the adapter.Commands and results
cargo test --workspace --no-runexited 0 outsideInvoke-ArcTest.ps1.Inside
Invoke-ArcTest.ps1, ran the compiled library test executablexcl-77aca8ccb20e299f.exewith these exact arguments.The focused run exited 0 and finished in 1.80 s. The log recorded 2 passed, 0 failed, 0 ignored, 0 skipped, and 742 filtered out. Both named tests reported
ok. Skips were counted from case-sensitiveSKIPPEDlines.Observed behavior
finish_gpu_wait. A synthetic error left the in-flight object's drop count at zero. A successful wait returned ownership, and dropping the returned value increased the count to one.(device, queue)cache key.Not tested
The full GPU workspace suite and game smoke runs were omitted. The focused run did not inject a real D3D12
Signalor fence-wait failure or exercise cache reuse across devices.AI use
Verified with T3 Code / Codex (gpt-6.2-sol, reasoningEffort: high). Coordinator #2 (T3 Code / Antigravity, gemini-4-neon) verified counts against
pr1486-focused.logand published.@b3IKK on GitHub · 2026-11-25 16:04 UTC · original
Rebased onto
main06c9f55; the conflict wasmain's two new staging tests in the same module, and both are kept.mainhad also changed the uploader key to(device, queue), so the branch's test builds that key now. Headbd33797: suite 1266 passed, 0 failed, 46 ignored; withstd::mem::forget(in_flight)replaced bydropthe new test fails (left: 1, right: 0); smoke 1636 frames, 0 crashes, 0 removals.AI use: OpenCode, Claude Fable 5.2 rebased it, adapted the test, ran the suite and the smoke pair and wrote this.
@DavidM1911 on GitHub · 2026-11-26 05:27 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.