Repository navigation
Conversation
In raw_views_a_submission_in_flight_may_read_stay_until_it_has_run, gpu_caught_up checks only the D3D12 GPU fence value and returns without draining when the fence has already advanced, racing against xtp-gpu-finisher copying dst back to title memory. Settle reader explicitly before asserting on dst.words(). Also serialize the Gate::close tests in descriptor/host.rs and resource/pool.rs with host::submissions::serial(), matching host::submissions and draw.rs.
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.
What and why
descriptor::host::tests::raw_views_a_submission_in_flight_may_read_stay_until_it_has_runcalledgpu_caught_up(host)aftergate.open()and then asserted ondst.words()[..64].gpu_caught_uploops onwhile host.completed() < ticket, which checks the D3D12 GPU fence value (ID3D12Fence::GetCompletedValue). When the GPU finishesreaderand advances the fence beforegpu_caught_upenters its loop, the loop runs zero times and returns beforextp-gpu-finisherfinishesHost::completewrite-back intodst, leaving the0xdead_beefsentinel in title memory (crates/xtp-gpu/src/descriptor/host.rs:6603).Settling
reader(reader.settle()) waits for both the GPU fence andtimeline.finishwrite-back before readingdst.words(), without touching the heap, whilecompleted_untilstill verifies that host completion returns both retired raw views to the pool.In addition, the four
Gate::closetests incrates/xtp-gpu/src/descriptor/host.rsandreserved_textures_map_and_give_back_their_tilesincrates/xtp-gpu/src/resource/pool.rsheld the shared host queue withouthost::submissions::serial(), unlikehost::submissionsanddraw.rs. Serializing them prevents holding the queue concurrently with tests waiting under the host submission lock.Fixes part of #54 (
raw_views_a_submission_in_flight_may_read_stay_until_it_has_run; other tests tracked in #54 are unchanged).Depends on: none
Area
xtp-gpuunit tests (descriptor::host,resource::pool,host::submissionsdoc comment).Tests
cargo xtask pr-checkpasses on my machine (ranfmt,clippyplain +--all-features,xtask policy,xtask conventions, and repeatedxtp-gpuWARP + hardware runs; the 17 inline-ray tests requiring Windows SDKdxcwere skipped locally becausedxcis not installed on this machine)Measured on Windows 11 Pro build 26300.10075, NVIDIA GeForce RTX 3050 Ti Laptop GPU (driver
32.0.16.2140),rustc 1.100.0(stable-x86_64-pc-windows-gnu; MSVClink.exenot installed locally):main9b822f5): 30 parallel WARP runs (XTP_TEST_ADAPTER=warp,--test-threads=8, skipping the 17 DXC-only RT tests): 29 passed, 1 failed (run 29) indescriptor::host::tests::raw_views_a_submission_in_flight_may_read_stay_until_it_has_runatcrates/xtp-gpu/src/descriptor/host.rs:6603(assertion left == right failed: the old window, untouched,left: [3735928559, ...]=0xdead_beef).XTP_TEST_ADAPTER=warp,XTP_REQUIRE_GPU=1,--test-threads=8, skipping DXC-only RT tests): 40/40 passed (604 passed, 0 failed per run).XTP_TEST_ADAPTER=hardware,XTP_REQUIRE_GPU=1,--test-threads=8) of all 5 modified tests together withhost::submissions::: 10/10 passed (25 passed, 0 failed per run).cargo fmt --all --check,cargo clippy -p xtp-gpu --no-deps --all-targets --locked(both plain and--all-features, zero warnings in touched files; Rust 1.100 flags pre-existing untouchedfetch_update/texture.rs:937),cargo xtask policy, andcargo xtask conventions(commits, title, and PR body) all passed.dxcunavailable) andXTP_D3D12_DEBUG=1(Graphics Tools /d3d12SDKLayers.dllnot installed on this machine).Provenance
AI assistance: Antigravity assisted with investigating the failure, implementing the fix, and running the verification checks; I reviewed and verified every changed line and measurement.
Checklist
<area>: <summary>; one topic; under 400 changed lines, or the reason is above