Repository navigation
Conversation
XApuEnqueueCommand previously wrote the current pending queue length into its optional count out-parameter, and XApuGetResultCount wrote the pending queue length into its optional total out-parameter instead of the cumulative dequeued count (XCL-BT-043). Wrap the result queue with wrapping u32 enqueued and dequeued totals under XApu.results so XApuEnqueueCommand reports cumulative enqueued commands, XApuDequeueResult increments dequeued on S_OK (not XAPU_NO_RESULTS), and XApuGetResultCount returns pending results while writing cumulative dequeued results to *total. Part of xcl-dev#1489 Assisted-by: Google Antigravity (Gemini 4 Neon)
|
Code review on
Remaining before merge: |
PR #2041 verificationTested live PR head What is in it
Tested
Skip notices from the full workspace log Full log Not tested
AI use Coordinator #2 (T3 Code / Antigravity, gemini-4-neon) verified the counts against |
|
Verification on RTX 3060 Ti (Windows 11), branch merged with current
Thanks! |
|
Tested head
Not tested: the full suite, GPU, retail title. AI-assisted (Claude Code, Claude Sonnet 5.5 ran the tests; Claude Opus 5.5 checked and posted). |
|
merge-check claim |
|
merge-check |
|
merge-check claim |
|
merge-check claim |
1 similar comment
|
merge-check claim |
|
merge-check |
|
merge-check |
|
No open or merged PR makes the same change: the other #1489 PRs touch unrelated code, and the other open XApu PRs (#1715, #1283, #2700) do not change the enqueue/result counters. AI review: Claude Code (Claude Opus 5.5), diffs read only, not built or run; not checked by a human. |
What is in it
Track cumulative XApu enqueued and dequeued totals separately from the pending result queue length (
XCL-BT-043, part of #1489).Part of #1489
crates/xcl/src/hle/acphal.rs,XApuEnqueueCommandwroteq.len() as u32(current pending queue length) into its optionalcountout-parameter instead of the cumulative total of commands enqueued on the connection, andXApuGetResultCountwroteq.len() as u32(the same pending queue length it returns) into its optionaltotalout-parameter instead of the cumulative total of results dequeued viaXApuDequeueResult. After enqueueing 2 commands and dequeuing 2 results,XApuGetResultCount(h, &mut total)returned0with*total = 0instead of2, and enqueueing a 3rd command wrote*count = 1instead of3.queue: VecDeque<XApuResult>,enqueued: u32,dequeued: u32) inXApuResultsunderXApu.results: Mutex<XApuResults>so queue mutations and totals update atomically under one lock:XApuEnqueueCommandpushes the result, incrementsst.enqueuedviawrapping_add(1), and writesst.enqueuedto*countwhen non-null.XApuDequeueResultincrementsst.dequeuedviawrapping_add(1)only whenpop_front()returnsSome(r)(leavingdequeuedunchanged onXAPU_NO_RESULTS), releasing the lock beforewrite_unaligned.XApuGetResultCountreads(st.queue.len() as u32, st.dequeued)under the lock, writesdequeuedto*totalwhen non-null, and returnspending.xapu_enqueue_and_result_count_report_cumulative_totalsandxapu_cumulative_counters_wrap_at_u32_maxincrates/xcl/src/hle/acphal.rscovering cumulative counts across enqueue/dequeue cycles, empty dequeues (XAPU_NO_RESULTS), null optional out-parameters / null handle safety, andu32::MAXwraparound.Tested
621.14, wave32), Intel Core i5-11400F, 32 GB RAM, Windows 11 Home build 26200, Rust1.100.0(stable-x86_64-pc-windows-msvc), DXC1.9.2609.5(01b62ad4).origin/main656c0e8with new test added, debug):cargo test -p xcl --lib hle::acphal::tests -- --nocapture->7 passed; 1 failed(xapu_enqueue_and_result_count_report_cumulative_totalspanicked withleft: 2, right: 0when checking*totalafter 2 enqueues and 0 dequeues).b591ccc7):cargo test --release -p xcl --lib hle::acphal::tests -- --nocapture->10 passed; 0 failed; 0 ignored.b591ccc7):cargo build --release --workspace+cargo test --release --workspace -- --test-threads=4 --nocapture->1104 passed, 0 failed, 46 ignoredacross 20 test binaries.SKIPPEDlines (26 total, all pre-existing on this wave32 Windows host without Graphics Tools / Developer Mode / heap windows):no wave64skips (4ingpu::recomp::lower::tests,13ingpu::recomp::lower_dxil::tests,2ingpu::recomp::tests).per-lane form: refusedskips ingpu::recomp::lower_dxil::tests(f16 arithmetic,f16 packed,f32 conversions).test_title_draws_with_a_root_signature_under_the_debug_layer: nod3d12SDKLayers.dll;uploads_start_from_each_subresources_state:0x887A002D).shaders::tests::pso_measurement_compiles_an_exact_synthetic_record: cannot disable driver cache without Windows Developer Mode.heap_window_out_of_memory_falls_back_to_the_switch_form: no heap windows.Regression run
Paired 60 s retail title runs with
scripts/smoke.ps1(release build, same title, clean working tree) onorigin/main(8f5fca5b) and this PR (b591ccc7):main:this PR:
Not tested
*countor*totalout-parameters ofXApuEnqueueCommand/XApuGetResultCount; the paired smoke run is a regression check only.AI use
Google Antigravity (Gemini 4 Neon) wrote the fix, unit tests, and this PR description; all builds, tests, and paired retail smoke runs were executed locally on the hardware listed above.