Repository navigation
XAsync: cancellation is the provider's to do - #53
Merged
Merged
Conversation
XAsyncCancel called the provider's Cancel and then completed the block with E_ABORT itself. libHttpClient's XAsyncCancel only calls the provider: one that supports cancelling completes with E_ABORT, one that does not (XAsyncRun's) runs to its normal end. Completing in XAsyncCancel also ran the provider's cleanup at once (E_ABORT has no payload) while its DoWork could still be running. For XCL's own operations (begin_with) that cleanup frees the Payload the running work writes its result into when it returns.
Collaborator
|
Merged in 848e740 (merge a963568). Matches libHttpClient's Tested on Windows 11 (RX 9070): |
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]>
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.
XAsyncCancel(xasync.rs) calls the provider withXAsyncOp::Canceland then completes the block withE_ABORTitself. libHttpClient'sXAsyncCancel(Source/Task/AsyncLib.cpp) only calls the provider. A provider that supports cancelling completes withE_ABORT, now or later. One that doesn't, like the provider behindXAsyncRun, which ignoresCancel, runs to its normal end.Forcing the completion has two effects in XCL's fallback (no Gaming Services):
XAsyncRunor a provider that ignoresCancelends withE_ABORT, and work that hasn't started yet never runs.E_ABORThas no payload, soXAsyncCompleteruns the provider'sCleanupright away, even if itsDoWorkis still running on the queue. For XCL's own operations (begin_with), thatCleanupfrees thePayload. The running work then writes its result into it when it returns (*p.result.lock() = Some(r)inpayload_provider).XAsyncCancelnow only calls the provider. XCL'spayload_provideralready ignoresCancel, so XCL's own operations finish normally, asXAsyncRundoes in libHttpClient.Validation
cancel_is_the_providers_to_do: a provider that ignoresCancelstays pending and completes normally; one that completes inCancelends withE_ABORT. The first half fails onmain.cancel_lets_running_work_finish: cancels abegin_withoperation while its work is running, then reads the work's result. Onmain, the status isE_ABORTright after the cancel.cargo test -p xcl --lib: 341 passed, 0 failed, on Windows GNU under Wine.