Repository navigation
Conversation
|
Code review on
Remaining before merge: |
|
Rerun on the new head The new test is flaky because the test reuses a handle address, not because of the runtime: The failure: Cause: handles are In every failure, Tested (RTX 3060 12 GB, driver 610.88, Ryzen 7 5700X, Windows 11 Pro 26300, Rust 1.100.0 MSVC, debug):
Not tested: the runtime change in a title, Windows 10, a release build. AI use: Claude Code (Claude Opus 5.5) ran the tests, found the cause with a scratch print (not pushed) and wrote this report. |
|
Thanks @fromthemoonx for isolating the Box handle-address reuse (dups[1] == temp0) in monitors_fire_across_composite_ports_and_outlive_registering_handle ( askqueue.rs:1222). @eizispark — asserting that the temporary handle is gone right after the first XTaskQueueSubmitCallback (before the second callback allocates XTaskQueueDuplicateHandle) or allowing open duplicate handles in the assertion should eliminate the 3/40 test flake. |
PR #2021 empirical test reportTested the clean live head
Tested
All 25 GPU SKIPPED linesNot tested
AI use
|
|
Verification on RTX 3060 Ti (Windows 11), branch merged with current
Thanks! |
# Conflicts: # crates/xcl/src/hle/xgameruntime/taskqueue.rs
XTaskQueueRegisterMonitor previously recorded the raw handle value used at registration on the single Queue struct and fired callbacks only on the queue through which work or completions were submitted. That broke two parts of the GDK / libHttpClient XTaskQueue.h monitor contract: 1. When a title extracts a manual pump queue's port with XTaskQueueGetPort and attaches it to a composite queue with XTaskQueueCreateComposite, submissions to the composite queue never notified monitors registered on the pump queue, leaving manual-port event loops un-signaled. 2. When the handle passed to XTaskQueueRegisterMonitor was later closed after XTaskQueueDuplicateHandle (or was NULL for the process queue), callbacks received a closed or null XTaskQueueHandle instead of a temporary handle valid for the duration of the callback. Track live queues attached to each Port via Weak<Queue>, fan monitor notifications out to every non-terminated queue attached to the port using that queue's own port slot, pass a temporary QueueHandle closed on callback return, and clear monitors when XTaskQueueTerminate runs. Assisted-by: Antigravity (Google DeepMind, Gemini 4 Carbon)
1e94be5 to
aa4ee6c
Compare
|
Thanks @fromthemoonx for tracking down the address reuse, and @raylitebull for the suggested fix. Pushed On the RX 9070 XT: the test alone, 40 runs, 0 failures. |
xcl-dev#2021, Windows verbatim + Linux twin) Windows hle/xgameruntime/taskqueue.rs verbatim reference-only (hle is cfg(windows), 0 tests run on Linux): Monitor drops queue_handle; Port gains queues + attach + notify_monitors (walk attached queues, skip terminated, per-owner-port ptr_eq match, temp handle via new_handle + close after callback); Queue::new/composite attach; q.notify -> p.notify at 4 submit sites; Terminate clears monitors; register drops the stored handle; +1 large test. Linux twin hle/xtaskqueue_linux.rs mirrors (win64 ABI; twin already has Weak at :455, new_handle/CloseHandle, termination_cb_pending, waiter subsystem, null->process_queue): same Port shape + attach/notify + 4 submit sites + Terminate monitors.clear() + register drop + twin test (win64, no ASYNC_TEST_LOCK per precedent). Failing-first: new twin test red pre-fix (composite submit never notified pump monitor, ran stayed 0), green post-fix.
|
Re-verification on RTX 3060 Ti (Windows 11), new head merged with current
Thanks! — Devin |
… upstream xcl-dev#1237 + xcl-dev#494 + xcl-dev#1382 loopback) Port live heads e2a4b1d (xcl-dev#1237), bf21fd8 (xcl-dev#494), 2b765d2 (xcl-dev#1382), all still OPEN vs upstream/main. Windows hunks already verbatim reference-only; this is the Linux twin (win64 ABI). xcl-dev#1237: InitialNotification<T> + notify_initial via queue_from/submit_now on PORT_COMPLETION + udp/connectivity call fns; both Registers reject null callback (E_INVALIDARG) and queue the current value. xcl-dev#494: network_off() reads XCL_NETWORK directly (hle_linux has no netoff yet) + connectivity_level() 1/3; GetConnectivityHint uses it. xcl-dev#1382 portable: url_host_and_is_plain_loopback via IpAddr::is_loopback + subnet vectors; request_url/security_info/issuer stay Windows-only (WinHTTP/crypt32 handles, no Linux consumer — same precedent as xcl-dev#843). Already-landed on Linux, verified no change: xcl-dev#1247, xcl-dev#1753, xcl-dev#2021, xcl-dev#1588 + Watch xcl-dev#2521/xcl-dev#2524/xcl-dev#2623. Failing-first: new symbols 0 at HEAD; old Registers accepted cb==0 and queued nothing. Gates: both checks 0 errors, xtaskqueue_linux 16/16, lib 760/0/1 t=4, title 12 GPU-only, retail SIGSEGV +0x2237320 HOLDS.
|
Tested head
Not tested: full suite, GPU, retail title. AI-assisted (Claude Code, Claude Sonnet 5.5 ran the tests; Claude Opus 5.5 checked and posted). |
…ue shape (both twins) Upstream xcl-dev#2836 (43a4eb9, OPEN) drains in-flight taskqueue monitor callbacks on unregister (revoked flag + running count + Condvar + MONITOR_DEPTH reentrancy guard + skip-revoked-snapshot). Cannot land verbatim: tree diverged via xcl-dev#2021 (d1ce58c) - Monitor has no queue_handle, notify_monitors is Port-level fan-out with synthesized temp handles in BOTH hle/xgameruntime/taskqueue.rs and hle/xtaskqueue_linux.rs (Linux-live twin). Adaptation: Arc<Monitor> with state/idle, invoke(handle,port), revoke/wait, remove-if-drained; register/unregister updated; 3 upstream tests ported per twin failing-first (Linux twin 2 failed pre-fix as predicted, 3/3 post-fix; Windows-twin tests mirror but cannot execute on Linux - parse-verified only). Gates: checks 0 errors; lib 783/0/1; e2e sets identical to baseline; retail SIGSEGV exe+0x2237320 stubs 20 xgr XAsync/XNetworking/XUser HOLDS.
|
Independent desktop NVIDIA verification of PR #2021 at head Environment
Targeted release tests & build (
|
| Command | Result |
|---|---|
cargo test --release -p xcl --lib monitors_fire_across_composite_ports_and_outlive_registering_handle -- --nocapture (3 consecutive runs) |
1 passed; 0 failed; 0 ignored; 1200 filtered out × 3 (0.00s × 3, 0 skipped) |
cargo test --release -p xcl --lib hle::xgameruntime::taskqueue:: -- --test-threads=1 (3 consecutive runs) |
11 passed; 0 failed; 0 ignored; 1190 filtered out × 3 (0.26s × 3, 0 skipped) |
cargo build --release -p xcl |
Clean build (1m 07s, exit 0, 0 new warnings) |
Paired quiet 60 s retail smoke (title: 29640639)
Exact parent & merge-base (426a5a745db4d5e4b037449ede0b70cb342f5192, cached baseline on the same machine):
xcl-smoke v1
commit: 426a5a745db4d5e4b037449ede0b70cb342f5192
gpu: NVIDIA GeForce RTX 4060
title: 29640639
seconds: 60
exit: 0x0
frames shown: 1591 (PresentX 1591)
presents per 2 s (last 3): 60 60 60
device removals: 0
crashes: 0
peak commit: 14477 MB
PR #2021 (aa4ee6c2eca0c78deda1c4dcab7f1bdcbf9d23a9):
xcl-smoke v1
commit: aa4ee6c2eca0c78deda1c4dcab7f1bdcbf9d23a9
gpu: NVIDIA GeForce RTX 4060
title: 29640639
seconds: 60
exit: 0x0
frames shown: 1602 (PresentX 1602)
presents per 2 s (last 3): 60 61 60
device removals: 0
crashes: 0
peak commit: 14455 MB
Runtime log observations (xcl.log)
9204log lines,0[ERROR]/ device-removal / panic lines (dxil_cache:460hits,0misses,0compilation failures;228background pipelines,0failures).- Final draw/memory telemetry in log:
19522 draws with translated pipelines (0 skipped, 0 with PC pipelines), 1024 dispatches (0 skipped); last memory sample14454 MB committed by the process; video memory 6115 MB local, 4684 MB non-local.
Limits of coverage
- Composite-port monitor fan-out, temporary
XTaskQueueHandlelifetimes after closing the registering handle, and monitor cleanup onXTaskQueueTerminatewere directly verified viamonitors_fire_across_composite_ports_and_outlive_registering_handle(3/3) and the fullhle::xgameruntime::taskqueue::suite (11/11× 3). - The 60 s retail smoke confirms zero runtime regression on
title: 29640639(single-run frame/commit delta vs. cached parent reflects normal startup variance, not this PR); it did not independently exercise a retaillibHttpClientcomposite manual-pump monitor workload.
AI disclosure: test execution and report drafting assisted by Google Antigravity (Gemini 4 Neon).
|
No open or merged PR notifies monitors through shared ports; #2836 (closed) touched monitor unregistering only. AI review: Claude Code (Claude Opus 5.5), diffs read only, not built or run; not checked by a human. |
XTaskQueueRegisterMonitorpreviously captured the rawXTaskQueueHandlevalue passed at registration on the singleQueueand invoked monitor callbacks only on theQueuethrough which an item was submitted. That broke the GDK /libHttpClient(XTaskQueue.h) monitor contract in two ways:XTaskQueueGetPortand combines it into a composite queue withXTaskQueueCreateComposite(for example, background work port + main-thread manual completion port), work orXAsyncCompletecompletions submitted through the composite queue never notified monitors registered on the pump queue, leaving manual-port event loops un-signaled.XTaskQueueRegisterMonitorwas closed afterXTaskQueueDuplicateHandle— or whenNULLwas passed to monitor the process task queue — callbacks received a closed or nullXTaskQueueHandle(causingXTaskQueueDispatchandXTaskQueueDuplicateHandleinside the callback to fail) instead of a temporary handle valid for the duration of the callback. In addition,XTaskQueueTerminatedid not stop monitor notifications on terminated queues sharing a composite port.What is in it
crates/xcl/src/hle/xgameruntime/taskqueue.rs: track live queues attached to eachPortviaWeak<Queue>, fanPort::notify_monitorsout to every non-terminated queue attached to the port using that queue's own port slot (PORT_WORK/PORT_COMPLETION), pass a temporaryQueueHandleclosed on callback return, and clearQueue::monitorsinXTaskQueueTerminate.crates/xcl/src/hle/xgameruntime/taskqueue.rs(tests): addmonitors_fire_across_composite_ports_and_outlive_registering_handle. It covers same-slot and cross-slot composite port submissions, inlineXTaskQueueDispatchandXTaskQueueDuplicateHandleon the temporary callback handles, closing the registering handle while a duplicate stays open,NULLprocess-queue monitors, and no monitor callbacks afterXTaskQueueTerminate. Each temporary handle is checked right after its own callback returns, before a laterXTaskQueueDuplicateHandlecan be given the freed handle's address.Tested
32.0.32015.16001),rustc 1.100.0 (0ef1bc386 2026-11-09), debug and release.cargo test --workspace --no-fail-fast -- --test-threads=4on the head, rebased ontomain426a5a7: 1241 passed, 3 failed –gpu::dxil::fuzz_tests::fuzz_validate_and_gpu_1,fuzz_validate_and_gpu_3andgpu::recomp::tests::gpu_image_get_resinfo_past_last_level, which fail the same way on a cleanmain426a5a7on this adapter; 46 ignored.monitors_fire_across_composite_ports_and_outlive_registering_handlealone, 40 runs: 0 failures. The wholehle::xgameruntime::taskqueuemodule, 20 runs: 0 failures.hle::xgameruntime: 76 passed, 0 failed.monitor on main_q did not wake/dispatch composite completion,left: 0, right: 1).Regression run
main:PR head:
Not tested
XCL_SAMPLE_*sample-data tests.AI use
XTaskQueueRegisterMonitorand composite-port notifications intaskqueue.rs, wrote the fix and unit test, and ran the test suite and smoke check. Antigravity (Claude Opus 5.5) – fixed the handle-address reuse in the test that @fromthemoonx found, rebased ontomain426a5a7, and reran the suite, the stress runs and the smoke pair.