Tests: wait for the late release before freeing the coherent buffer test's heap (#1487) #1590
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!1590
Loading…
Reference in a new issue
No description provided.
Delete branch "gh-pr/1590/head"
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?
@Bullet18x on GitHub · 2026-11-24 18:01 UTC · original
Bullet18x:tests/coherent-buffer-late-release→main· +10 −1 · 1 files · 1 commits · merged 2026-11-25 19:22 UTCreadback_routing_tests::coherent_buffer_sanitizes_console_flags_and_statefails intermittently in parallel runs onassert_ne!(VirtualFree(mem, 0, MEM_RELEASE), 0)(real.rs:5825). This is the failure #1523 lists as still open. Part of #1487; independent of #1520 and #1523.Cause:
D3D12CreateDevice(None, …)returns the process's one device. When another test has adopted it, the placed buffer this test makes on its imported heap is adopted too, so its lastReleasegoes tolate_release::hold. If a queue that another test created still has work, the buffer is held. The heap then pinsmem, andVirtualFreefails with 87. This is the documentedlate_releasebehaviour (a title waits for its memory), so the test now waits too: it retriesVirtualFreefor up to 10 s and still asserts that it succeeds.What is in it
crates/xcl/src/hle/d3d12x/real.rs: inreadback_routing_tests::coherent_buffer_sanitizes_console_flags_and_state, retryVirtualFreeuntil the held release lets the pages go (10 s limit). Test-only, inside#[cfg(test)].Tested
5a7307eon main9e3831e(the runs below used this exact diff, uncommitted), allXCL_SAMPLE_*unset.present::note_execute, signal after 200 ms from another thread, and call this test. On main it fails at real.rs:5825:17 (left: 0, right: 0). With this change: 1 passed. The resource was adopted,VirtualFreereturned 0 with GetLastError 87 while the queue was stalled, and returned 1 about 10 ms after the signal.cargo test -p xcl --lib -- --test-threads=16×5 and=32×5: one run failed this test, and one run ended with 0xc0000005 (the #1523 cause)..\scripts\test.ps1: 776 passed, 0 failed, 41 ignored.gpu_geometry_wave32_prefix_count_over_a_mask(no wave64),gpu_wave32_program_in_wave64_hardware(no wave64),heap_window_out_of_memory_falls_back_to_the_switch_form(no heap windows).Regression run
real.rs's#[cfg(test)]module, with no retail smoke run. Please apply thetest-onlylabel after reviewing the diff.Not tested
list_x'swrite_buffer_immediate_on_open_existing_heap_visible_to_cpu(as changed in #1520) also frees an imported heap's memory right after release, and may hit the same hold. It is not changed here.AI use
@fladit123 on GitHub · 2026-11-24 18:52 UTC · original
Independent validation of exact HEAD
5a7307ed7f4aa8a262bbe7c5eecae8effb855c13on NVIDIA Ada Lovelace.Environment
XCL_ADAPTER=4060, sample variables unset.Tested
coherent_buffer_sanitizes_console_flags_and_statetest: 1 passed, 0 failed.cargo test --locked -p xcl --lib -- --test-threads=4 --show-output: five consecutive runs.9e3831e5a7307eAll five PR runs reported 727 passed, 0 failed and 21 ignored. Two explicit hardware skips were included in the passed count in each run:
gpu_geometry_wave32_prefix_count_over_a_mask: no wave64gpu_wave32_program_in_wave64_hardware: no wave64The real RTX 4060 backend was confirmed in the first run. The worktree remains clean.
Review: The change is narrowly scoped to test code. The bounded retry preserves the assertion rather than silently accepting a failed VirtualFree.
Limitations: No regressions observed, but the original failure did not reproduce in my baseline runs. I did not independently demonstrate that the retry path was exercised. No retail title tested.
AI use: ChatGPT (GPT-6.2) assisted with code review, test commands and reporting. All tests were executed locally on my hardware.
@DavidM1911 on GitHub · 2026-11-24 20:12 UTC · original
Verification on RTX 3060 Ti (Windows 11), branch merged with current
main:cargo test -p xcl --lib: all passed, 0 failed, ~22 ignored. (Intermittent single-test flake under parallel scheduling; clean on single-threaded rerun — same flake seen on unmodifiedmain.)Thanks!
@Toons29 on GitHub · 2026-11-24 21:43 UTC · original
Regression run of
5a7307edon the retail title, for this PR's Regression run section. Both blocks are fromscripts/smoke.ps1as printed, not edited:mainon4178e888, this PR on its head commit with no uncommitted changes, same title and time.Against the limits in CONTRIBUTING.md: 101 % of
main's frames, 100 % of its peak commit, no crash, no device removal.AMD Radeon RX 9070 (RDNA4, driver 32.0.32029.2010), Ryzen 7 7800X3D, 32 GB, Windows 11 build 26300, Rust 1.100.0,
cargo build --release -p xcl, 60 s,XCL_NETWORK=0. This is a regression check only: it does not show whether the run reaches the code this PR changes.AI use: Claude Code (Claude Opus 5.5) built both trees and ran
scripts/smoke.ps1; I checked the blocks before posting.@JJAutoCompare on GitHub · 2026-11-25 05:14 UTC · original
Empirical test report (
5a7307ed)Hardware / environment
rustc 1.100.0 (0ef1bc386 2026-11-09)dxcompiler.dll: 1.9(5512-01b62ad4)(1.9.2609.5) - 1.9.2609.5 (01b62ad47)5a7307ed7f4aa8a262bbe7c5eecae8effb855c13.Commands and results
cargo test --workspace --no-runexited 0 outside the Arc lock and built the workspace test executables.cargo test -p xcl --lib hle::d3d12x::real::readback_routing_tests::coherent_buffer_sanitizes_console_flags_and_state --no-runexited 0 outside the lock and confirmed that the focused artifact was ready.Invoke-ArcTest.ps1 -Test), withXCL_ADAPTER=A770andRUST_TEST_NOCAPTURE=1, the following command exited 0.SKIPPED.Observed behavior
The coherent-buffer fixture passed. DXGI enumeration identified the Intel Arc A770 as adapter 0, which is the default adapter requested by the fixture's direct D3D12 device creation. The fixture emits no retry count, so this run cannot establish whether the first heap release succeeded or a retry was needed.
Not tested
Coverage was limited to workspace test compilation and the single fixture. The full GPU workspace suite, the parallel-test interaction described in #1487, 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
pr1590-focused.logand published.@ivall on GitHub · 2026-11-25 19:22 UTC · original
Merging:
VirtualFreeis retried while the held release still pins the pages.mainfailed here in this test once in 5 runs ofhle::d3d12xon 16 threads, with this PR not in 5 (too few to prove it, but it is the failure described).Tested on AMD RDNA4 (native wave64), Windows, DXC 1.8.2502.11, debug,
main2898511with 27 test PRs merged locally, this one included: the whole suite 3 times, 1419 passed, 2 failed, 46 ignored each time (fuzz_validate_and_gpu_1and_3, which fail the same way onmain);hle::d3d12xon 16 threads 5 times, no failure.AI use: Claude Code (Claude Opus 5.5) reviewed and tested this and wrote the comment on the maintainer's behalf.