Repository navigation
Task queues: terminating cancels delayed callbacks before the termination callback - #54
Merged
Merged
Conversation
…tion callback XTaskQueueTerminate canceled the callbacks queued on the queue's ports, but not delayed ones still waiting in the timer heap. Those count as in flight only once due, so the termination callback ran first and the delayed callback ran (canceled) up to its delay later – when a title may already have freed what it passes as the callback's context. They are now taken out of the timer heap and invoked canceled before the termination callback, as libHttpClient's CancelPendingEntries does when a port terminates.
ivall
added a commit
that referenced
this pull request
Nov 23, 2026
Like XTaskQueueSubmitDelayedCallback since #57 (libHttpClient schedules through it): E_ABORT, so XAsyncRun / XCL's own operations on a terminated queue fail through the block (#56) and their work never runs. Test async_work_on_a_terminated_queue_is_aborted; the task queue module comment follows #54 / #57.
Collaborator
gustavsi
added a commit
to gustavsi/xcl
that referenced
this pull request
Nov 24, 2026
…cl-dev#1286-xcl-dev#1291, xcl-dev#1294, xcl-dev#1296-xcl-dev#1297, xcl-dev#1300 Prevent background shader preloading and concurrent DXC/RADV compiles from exhausting host RAM under Wine, and integrate 11 open upstream PRs: - dxc.rs & real.rs: check free physical RAM (ullAvailPhys.min(ullAvailPageFile)) under Wine instead of swap-inclusive ullAvailPageFile, avoid bypassing the guard after 60 s under Wine, and serialize giant (>= 4 MiB DXIL) driver compiles with BIG_COMPILES under Wine. - pso_async.rs: cap background preload workers to 1 under Wine. - title_textures.rs: use real::create_raw_fence in submit_on_title_queue and read coherent-window hash bytes safely via with_title_bytes. - Integrate upstream PRs xcl-dev#968 (sparse::queue lock-free for late_release), xcl-dev#1286 (v_dot2_f32_f16 NEG_HI abs), xcl-dev#1287 (XMA >8 channels), xcl-dev#1288 (Sleep pauses during PSO bind waits), xcl-dev#1289 (pipeline stream bounds check), xcl-dev#1290 (root signature MAX_ARGS cap), xcl-dev#1291 (console UAV clears xcl-dev#53/xcl-dev#54), xcl-dev#1294 (shadowed PENDING accuracy), xcl-dev#1296 (16-bit compare low halves), xcl-dev#1297 (fence_x pre-cell signal arming), xcl-dev#1300 (log driver compute PSO refusal). Verified on RX 9060 XT under GE-Proton11-14 (MemoryMax=12G, 80 s): committed RAM stays flat at 4830 MB (down from 27.6 GB OOM), 1493 frames shown, exit 0x0. Assisted-by: Antigravity (Google DeepMind)
CalvyPZ
pushed a commit
to CalvyPZ/xcl
that referenced
this pull request
Nov 24, 2026
…PC descriptors The command list's console xcl-dev#53 / xcl-dev#54 (ClearUnorderedAccessViewUint / Float) were remapped straight to PC xcl-dev#49 / xcl-dev#50 (`console_remap`) with no override, so a title's call reached the PC method with its handles as they were. Console code takes its descriptor handles from heap xcl-dev#9 / xcl-dev#10, which give it the address of its console heap slots in unified memory (`console_heap::start`), not PC descriptor handles: the PC clear got a GPU handle outside the bound shader-visible heap and a CPU handle pointing at T# words. Only the opt-in console-list replay (XCL_CONSOLE_LISTS=1) translated them. xcl-dev#53 / xcl-dev#54 now go to `list_x::clear_uav_uint_x` / `clear_uav_float_x` (same arguments as the PC methods): two console slots become their PC UAVs (GPU: `pc_gpu_uav`, in the heap lists bind; CPU: `pc_uav`, in the title's CPU-only heap), as the replay does; two PC handles go through as they are; a mix, or a slot without a shader-visible UAV, is skipped and logged once. Test on WARP: an R32_UINT buffer UAV in a CPU-only and a shader-visible console heap, xcl-dev#53 with the console handles and 0xDEADBEEF. With the handles passed through (the old path) the test process dies with STATUS_ACCESS_VIOLATION in the PC clear; with the translation the buffer reads back 0xDEADBEEF. Co-Authored-By: Claude Opus 5.5 <[email protected]>
CalvyPZ
pushed a commit
to CalvyPZ/xcl
that referenced
this pull request
Nov 24, 2026
Add standalone integration tests (Part of xcl-dev#480) comparing XCL's CreateHeap (xcl-dev#28), CreateHeap1 (xcl-dev#54), and QueryInterface (#0) hooks against the unhooked host D3D12 driver (real::orig_fn) and verifying XCL's console heap fallbacks and synthetic IDXGIDevice2 adapter surface without console game files. Assisted-by: Antigravity (Gemini 4 Hydrogen)
emirduran707
added a commit
to emirduran707/xcl
that referenced
this pull request
Nov 25, 2026
…PC descriptors The command list's console xcl-dev#53 / xcl-dev#54 (ClearUnorderedAccessViewUint / Float) were remapped straight to PC xcl-dev#49 / xcl-dev#50 (`console_remap`) with no override, so a title's call reached the PC method with its handles as they were. Console code takes its descriptor handles from heap xcl-dev#9 / xcl-dev#10, which give it the address of its console heap slots in unified memory (`console_heap::start`), not PC descriptor handles: the PC clear got a GPU handle outside the bound shader-visible heap and a CPU handle pointing at T# words. Only the opt-in console-list replay (XCL_CONSOLE_LISTS=1) translated them. (same arguments as the PC methods): two console slots become their PC UAVs (GPU: `pc_gpu_uav`, in the heap lists bind; CPU: `pc_uav`, in the title's CPU-only heap), as the replay does; two PC handles go through as they are; a mix, or a slot without a shader-visible UAV, is skipped and logged once. Test on WARP: an R32_UINT buffer UAV in a CPU-only and a shader-visible console heap, xcl-dev#53 with the console handles and 0xDEADBEEF. With the handles passed through (the old path) the test process dies with STATUS_ACCESS_VIOLATION in the PC clear; with the translation the buffer reads back 0xDEADBEEF. Co-Authored-By: Claude Opus 5.5 <[email protected]>
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.
XTaskQueueTerminate(taskqueue.rs) cancels the callbacks queued on the queue's ports, but not delayed callbacks (XTaskQueueSubmitDelayedCallback, also used byXAsyncSchedulewith a delay) that are still waiting in the timer heap. Those only count ininflightonce they are due. So the wait inTerminatedoesn't hold the termination callback for them: it runs first, and the delayed callback runs later, canceled, up to its full delay after the queue was terminated. A title often frees in the termination callback what it passed as those callbacks' context.libHttpClient moves a terminating port's pending delayed entries to its active list (
CancelPendingEntries(cxt, true)inTaskQueuePortImpl::Terminate), so they are invoked canceled before termination completes.Terminatenow takes the queue's entries out of the timer heap and invokes them canceled before the termination callback, the same way it already handles the port items. Delayed callbacks of other queues stay in the heap.Validation
terminate_cancels_delayed_callbacks_before_its_own_callback: a 60 s delayed callback, thenTerminate(wait = true)with a termination callback. Onmainonly["terminated"]is recorded; with the change it is["delayed, canceled", "terminated"].cargo test -p xcl --lib: 340 passed, 0 failed, on Windows GNU under Wine.