Repository navigation
Conversation
`coherent_buffer_sanitizes_console_flags_and_state` failed now and then in the whole suite (`VirtualFree` returned 0 at its end) and passed alone. The device it makes is the one other tests adopted: D3D12 has one device per adapter. On that device its placed resource is XCL's, and since e7da8a1 (xcl-dev#866) a last `Release` is held until the queues XCL knows of are past their work; `Release` waits 300 us for that. With other tests' work in flight the resource goes a few ms later, and until then the imported heap pins the pages: `VirtualFree` fails with ERROR_INVALID_PARAMETER. The test now frees the memory with `free_imported`, which retries `VirtualFree` until the held release has gone (10 s at most). `imported_heap_memory_frees_after_a_held_release` makes the case on purpose: an adopted device, a known queue that waits on a fence, so the release is held and `VirtualFree` fails; then the queue goes on and the memory is freed. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Owner
Author
|
Upstream PR xcl-dev#910 was closed or merged. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
hle::d3d12x::real::readback_routing_tests::coherent_buffer_sanitizes_console_flags_and_statefails now and then in the whole suite at its last line (VirtualFreeof the 64 KiB under its imported heap returns 0) and passes alone. It shows up in the test reports of xcl-dev#682, xcl-dev#607 and xcl-dev#708, in a comment on xcl-dev#718, and in xcl-dev#866's own description, whose heldReleasewas meant to fix it. It still happened onmaina1672ef, which has xcl-dev#866.Cause: D3D12 has one device per adapter, and other tests in the lib adopt it (
bind.rs,title_textures.rs,vram.rs). The test's placed resource is then XCL's, and its lastReleasegoes throughlate_release(xcl-dev#866): it is held until every queue XCL knows of is past its work.Releaseitself waits 300 µs for that. With other tests' work in flight the resource goes a few ms later, fromlate_release's thread, and until then the imported heap pins the pages:VirtualFreefails withERROR_INVALID_PARAMETER(87). Measured with a probe: on the adopted device, with a known queue waiting on an unsignalled fence,VirtualFreeright after the drops returned 0 (error 87). Once the fence was signalled it succeeded 5.3 ms later. Without the blocked queue it succeeded at once.Test-only: the diff is inside
real.rs's#[cfg(test)] mod readback_routing_tests, so I'd ask for thetest-onlylabel. The runtime is unchanged, includinglate_release's 300 µs wait.What is in it
crates/xcl/src/hle/d3d12x/real.rs(tests only):free_importedretriesVirtualFreeuntil the held release has gone (at most 10 s), and the coherent test frees its memory with it.imported_heap_memory_frees_after_a_held_release. It sets up the case on purpose: the device adopted, a queue registered as known (present::note_execute) and waiting on a fence. It then asserts that the release is held (VirtualFreefails), lets the queue go, and asserts thatfree_importedfrees the memory. Withfree_importedcut to a single attempt (the old cleanup), it failed 5 runs out of 5; as written, it passed 5 out of 5. The blocked queue is let go as soon as the hold is seen (and on unwind), so other tests' held releases wait less than a millisecond for it.Tested
XCL_ADAPTER=nvidiacargo build --workspace && cargo test --workspace --no-fail-fast -- --test-threads=4:maina1672ef: 711 passed, 4 failed, 41 ignored. The 4: this test, plus the Tests: placed_title_textures_share_vram_and_preserve_pixels fails now and then at its cubemap reuse check (main 9ce2070) xcl-dev/xcl#718 trio (placed_title_textures_share_vram_and_preserve_pixelsand the twoPoisonErrorfollow-ups).145b449): 713 passed, 3 failed, 41 ignored. The 3: the Tests: placed_title_textures_share_vram_and_preserve_pixels fails now and then at its cubemap reuse check (main 9ce2070) xcl-dev/xcl#718 trio, as onmain; the coherent test and the new one pass.gpu_geometry_wave32_prefix_count_over_a_mask,gpu_wave32_program_in_wave64_hardwaremain, the coherent test failed in 1 of 7 runs here (1 full workspace run, 6 lib-only runs). The new test reproduces the case every time instead.Not tested
smoke.ps1run: test-only change (hence the label request).AI use
🤖 Generated with Claude Code
Mirror of xcl-dev#910 (auto-synced, do not edit).