Repository navigation
Conversation
Four transition barriers retained clones inside ManuallyDrop, so the test freed its backing allocation while resource references remained. Borrow the resource through the existing fence waits and add a CPU-only reference-count regression. Part of xcl-dev#1487; the specific leak was also reported in xcl-dev#175. This does not establish the cause of every parallel access violation. Assisted-by: Codex (GPT-6; exact variant unavailable)
GonZiin
left a comment
There was a problem hiding this comment.
Independent full-suite run on AMD RDNA4. Both the reference-count regression and the imported-heap GPU test passed. I checked the diff and all changed Rust lines are inside the test module.
Tested
- Head
6159773d93e826b4c328ad7174334c7a12c75541, clean checkout. Windows 11 Pro build 26300, Ryzen 7 7800X3D, Radeon RX 9070 XT (driver 32.0.32029.2010), Rust 1.100.0 MSVC, DXC 1.8.2502.11, debug. .\scripts\test.ps1exited 0. Workspace totals were 771 passed, 0 failed, 41 ignored and 0 reported GPU skips. The bundled title end-to-end test passed.- The PR description job is asking for retail smoke blocks because the tests live inside
list_x.rs. A maintainer can apply the documentedtest-onlylabel after checking this revision.
Not tested
Retail smoke and the opt-in sample data tests.
AI use
Codex (gpt-6.2-sol) inspected the diff, ran the Windows tests, and wrote this review.
|
Test report for head Tested
Cause (same as #1590) Check Suggestion let start = std::time::Instant::now();
let mut freed = VirtualFree(mem, 0, MEM_RELEASE);
while freed == 0 && start.elapsed() < std::time::Duration::from_secs(10) {
std::thread::sleep(std::time::Duration::from_millis(5));
freed = VirtualFree(mem, 0, MEM_RELEASE);
}
assert_ne!(freed, 0, "the heap's pages were not let go within 10 s");Not tested
AI use: Claude Code with Claude Opus 5.5 ran the tests, found the cause and wrote this report. I checked each point. |
|
Verification on RTX 3060 Ti (Windows 11), branch merged with current
Thanks! |
crastinator
left a comment
There was a problem hiding this comment.
Tested on RDNA2 under Wine (RADV). This also fixes the parallel device removal I traced in #1246: the VirtualFree of this test's imported memory while another test's GPU work ran on the shared device.
Tested (head 6159773, merged onto main c160d86: no conflicts)
- AMD Radeon RX 6700 XT (RDNA2, gfx1031, RADV NAVI22, Mesa 26.3.1), Ryzen 7 5700X, Linux 7.3.5. Proton Experimental 11.0-20261112's Wine, vkd3d-proton v3.1 + #257's patch (
-Db_ndebug=true, dxil-spirv53aac418), DXVK v3.1.1-209dxgi, DXC 1.9.2609.5. Cross-built forx86_64-pc-windows-msvc, Rust 1.99.1, debug. - The #1246 pair,
--test-threads=2 --exact gpu::recomp::tests::jumps_to_outer_loop_heads_are_structured hle::d3d12x::list_x::tests::write_buffer_immediate_on_open_existing_heap_visible_to_cpu:mainfails 3/3 (kernel dispatch: D3D12 device removedafter ~0.15 s). With this PR it passes 3/3. cargo test -p xcl --lib -- --test-threads=4, 2 runs: 801 / 9 / 22 and 804 / 6 / 22 (passed / failed / ignored), no device removal. The 6 are the Wine-lane set: #530 ×2, #676, #890 ×2,gpu_depth_buffer_created_for_unordered_access_is_placed(#1475). Run 1 also had the #718 trio.mainin the same setup: 795 / 14 / 22, with 5 device-removed lines (the #1246 cascade throughsparse,title_texturesandvram).- This also explains what I couldn't in #1246. Dropping every object the test made before the
VirtualFreedidn't help there, because the fourManuallyDropbarrier clones still held the resource, so the imported heap never went away.
Not tested
- Windows. A retail title (test-only change).
- Anything that needs game files: no
XCL_SAMPLE_*set.
AI use
- Claude Code (Claude Opus 5.5) ran the tests and wrote this report; I checked the results.
|
Regression run of Against the limits in CONTRIBUTING.md: 101 % of AMD Radeon RX 9070 (RDNA4, driver 32.0.32029.2010), Ryzen 7 7800X3D, 32 GB, Windows 11 build 26300, Rust 1.100.0, AI use: Claude Code (Claude Opus 5.5) built both trees and ran |
Empirical test report (6159773)Verified PR #1520 at Hardware / environment
Commands and results
& Invoke-ArcTest.ps1 -Test {
& $xclLibTest --exact `
hle::d3d12x::list_x::tests::imported_heap_test_barriers_do_not_retain_the_resource `
hle::d3d12x::list_x::tests::write_buffer_immediate_on_open_existing_heap_visible_to_cpu
}
Observed behavior
Not tested The full GPU workspace suite and game smoke runs were omitted. AI use Verified with T3 Code / Codex (gpt-6.2-sol, reasoningEffort: high). Coordinator #2 (T3 Code / Antigravity, gemini-4-neon) verified counts against |
|
The leak fix is right and worth having (it also explains the device removal of #1246). What holds it is the new AI use: Claude Code (Claude Opus 5.5) wrote this on the maintainer's behalf. |
|
Test report on Wine + AMD (the "Not tested" of the reports above): this test's leak is what makes RADV reject a command submission in the lib suite (#3067). Tested
Not tested
AI use: Claude Code (Claude Opus 5.5) ran the tests and the bisection on my machine and wrote this; I checked each point. |
|
Second hardware confirmation, on RDNA3 this time. rig1: RX 7900 XT 20 GB (Navi 31), Ryzen 9 9900X, 96 GB, Arch, Mesa 26.2.5 RADV, wine 11.0 (proton build), Without #1520, both current heads crash the suite on rig1:
With #1520 merged locally (
The 6 reds, identical on both heads: So #1520 kills the suite poison on RDNA3 and RDNA4 under Wine, and it is the only thing standing between rig1 lanes and a completed suite count. Please merge it; every AMD/Wine tester is eating a fake crash without it. Tested: both suites above, at the merged shas named, rig1. |
|
Patch suggestion for the Ivall's blocker ("fails at times because another test's work still holds the last {
// Same shape as `free_imported` in the real.rs readback tests (#1590): the last
// `Release` of a placed resource can be held a few ms past this point while other
// tests' queue work is in flight, and until it is gone the imported heap pins the
// pages, so `VirtualFree` fails with ERROR_INVALID_PARAMETER.
let start = std::time::Instant::now();
loop {
if VirtualFree(mem, 0, MEM_RELEASE) != 0 {
break;
}
if start.elapsed() > std::time::Duration::from_secs(10) {
panic!("VirtualFree kept failing 10 s after the held release should be gone");
}
std::thread::sleep(std::time::Duration::from_millis(1));
}
}rig1 (RX 7900 XT, Mesa 26.2.5 RADV, wine 11.0 proton build),
This also matches my flake data on Wine fixed-address (re)allocation over the same heap (#3067): when a release is racing, it is racing for a bounded time or never, and a retry with a timeout is the right shape on both sides. Tested: the patch above on merge |
Test only: four list_x barrier tests stop leaking imported heap resource references. Merged cleanly. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
|
@wileyGray the AI use: Claude Code (Claude Fable 5.2) read the check's log and wrote this. |
|
No open or merged PR makes the same change; main's write_buffer_immediate_on_open_existing_heap_visible_to_cpu still clones buf into ManuallyDrop in its four barriers. #1600, #1628 and #1671 are also part of #1487 but fix other flaky tests. AI review: Claude Code (Claude Opus 5.5), diffs read only, not built or run; not checked by a human. |
Part of #1487. Four transition barriers in the imported-heap GPU test cloned a resource into
ManuallyDropand never released it. The test then freed the backing allocation with four resource references outstanding. This fixes that specific lifetime bug, also identified in the #175 investigation; it does not establish the cause of every intermittent access violation in #1487.What is in it
crates/xcl/src/hle/d3d12x/list_x.rs: borrow the resource in the four test barriers while its owner remains alive through the existing fence waits, checkVirtualFree, and add a CPU-only reference-count regression. All 75 changed lines are inside#[cfg(test)] mod tests.Tested
6159773d93e826b4c328ad7174334c7a12c75541, based on mainb7aa9f3; Windows 11 Home build 26300, i9-14900K, RTX 4080 SUPER, driver 32.0.16.2114, Rust 1.93.0, DXC 1.9.2609.5, debug,XCL_ADAPTER=NVIDIA. AllXCL_SAMPLE_*unset.scripts/test.ps1(workspace build and tests with four threads): 771 passed, 0 failed, 41 ignored. Includes four GPU/debug skips (two native-wave64 tests, two missing-debug-layer tests) and 33 sample-gated early returns; these are not executed coverage. Synthetic console-title e2e passed.(5, 4)after four barriers / dropping the owner, versus expected(1, 0). With the fix: 1 passed, 0 failed. Reproduce:cargo test -p xcl --lib imported_heap_test_barriers_do_not_retain_the_resource -- --nocapture.real::readback_routing_tests::coherent_buffer_sanitizes_console_flags_and_statewith two threads: 20 passed, 0 failed, 0 skipped, no access violations or stalls (0.27-0.36 seconds per pair).git diff --checkpassed.Paired-test reproduction and exact GPU/debug skips
Build with
cargo test -p xcl --lib --no-run. Run the emitted library test executable ten times, one process at a time, with these arguments (each run must report exactly two passes and no skips):Full-suite GPU/debug skips:
gpu_geometry_wave32_prefix_count_over_a_maskandgpu_wave32_program_in_wave64_hardware(no native wave64);uploads_start_from_each_subresources_stateandtest_title_draws_with_a_root_signature_under_the_debug_layer(debug layer unavailable).Regression run
test-onlylabel under CONTRIBUTING.md. The path-based description check otherwise requests retail smoke blocks. No runtime behavior changes.Not tested
AI use