gdk rt: XAsync return codes match the reference (6 conformance scenarios) #266
No reviewers
Labels
No labels
accessibility
bug
documentation
duplicate
enhancement
good first issue
help wanted
invalid
library
question
wontfix
No milestone
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set
Reference
github/omonkeyz--xbox-emulator!266
Loading…
Reference in a new issue
No description provided.
Delete branch "gh-pr/266/head"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
@QuentinDanblon on GitHub · 2026-11-23 08:41 UTC · original
QuentinDanblon:pr/xtq-async-hresults→main· +38 −19 · 3 files · 1 commits · closed without mergingLibrary / area:
compat-common, GDK runtime XAsync (src/gdk/rt.rs), conformance table (tests/gdk_xtaskqueue_conformance.rs)Exports changed (exports.txt rows): none
Source of the behaviour: libHttpClient
Source/Task/AsyncLib.cppandTaskQueue.cppatc5007fd9(MIT): the rules were followed and rewritten in Rust, no code copied. The existing libHttpClient line ofTHIRD_PARTY/CREDITSnow namessrc/gdk/rt.rstoo. The same six scenarios pass against thexgameruntime.dllof Gaming Services on my PC (gdk_xtaskqueue_conformance_real).Six rows leave the
DIFFERStable. Each one was a return code that differed from the reference:verify_global_queueXAsyncBeginwith no queue in the block and no process queue returned S_OKE_NO_TASK_QUEUEand leaves that status in the blockverify_begin_after_terminateXAsyncBeginon a queue whose termination has started returned S_OKE_ABORTverify_failed_begin_completesXAsyncBeginreturn that failureXAsyncBeginreturns S_OK and the call completes with the failure, so the completion callback runsverify_cant_schedule_twiceXAsyncSchedulereturned S_OKE_UNEXPECTEDuntil the worker callback has runverify_failure_in_do_workXAsyncCompleteleft the status S_OKE_UNEXPECTEDverify_result_buffer_checksXAsyncGetResultwith a null buffer returned 0x8007007aE_INVALIDARG, checked before the size;XAsyncGetResultSizewrites 0 for a pending or failed callTwo side changes these needed:
XAsyncRun's provider now callsXAsyncCompletewith the result of the work function, as the reference does. Without it, the newE_UNEXPECTEDrule would have turned every successfulXAsyncRuninto a failure.What is still different, and not claimed here
E_ABORTofXAsyncBeginreads the queue's terminated flags. The reference gets it fromXTaskQueueSuspendTermination, which also holds termination back while the call is in flight. That part is theverify_terminate_waits_for_async_in_flightrow, which stays inDIFFERS.XAsyncBeginwith a non-zero queue handle that is not a queue is still accepted, as before.XAsyncScheduleon a call whose state is gone returnsE_INVALIDARG, as before. The reference returns the call's failure code first when it has one.Tests
cargo test -p compat-common --release --test gdk_xtaskqueue_conformance, on this commit rebased on6e81ffc: 3 runs, 60 passed each.902209a, the two differ bydocs/BLOCKERS.mdonly) I ran it 6 times while other builds and GPU tests were running on the machine: 4 runs passed, 2 failed.verify_simple_async_call("XAsyncGetStatus(wait) returned before the completion callback ran"). That scenario also fails now and then onmainwithout this change: 2 failures in 10 runs on902209a, onverify_simple_async_callandverify_async_block_reuse.verify_immediate_dispatch,verify_serialized_queues_do_not_keep_threadsandverify_serialized_port_final_release("a delayed callback on an immediate port never ran"). These three do not use XAsync. I did not see them fail onmain, and I did not reproduce the failure. I think it is a timing limit under load, but I have not proven it.gdk_xtaskqueue_conformance_real(the same scenarios against the realxgameruntime.dll): 60 passed.TOMBOX_XTQ_ALL=1 ... -- --test-threads=1 --skip verify_get_async_status_no_deadlock: 43 passed, 16 failed. The 16 are rows still inDIFFERS.cargo test -p compat-common --release --no-fail-fast: lib 125 passed.gdk_multi_dlldid not build here (thed3d12_xsbuild script did not find DXC in that shell), every other integration test passed.pr_gate.py: 0 problems.verify_register_*,verify_queue_terminationand the twoverify_shared_port_queue_rundown_*rows (XTaskQueueRegisterWaiter) are being worked on in a separate branch. It touches lines next to these inDIFFERS, so I will rebase it on whatever you merge first.cargo test -p compat-commonpasses, with the two exceptions written above (one build failure from my environment, one scenario that is already intermittent onmain)missingwith a note🤖 Generated with Claude Code
@omonkeyz on GitHub · 2026-11-23 09:41 UTC · original
Applied in
883d1c8(merged ine3c62b7) with your authorship kept, thanks. It shipped in r32i (377a22a) after a full-boot Trackmania run: sign-in, the offline menu and the race all matched r32h, with no new gdk errors.Pull request closed