XGameRuntime: XAsyncGetResult writes 0 into *used while pending #1196
Loading…
Reference in a new issue
No description provided.
Delete branch "upstream-pr/1205"
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?
Imported from ivall/xcl. Originally posted by Longno242 on 2026-11-24T13:14:03Z.

XAsyncGetResultreturnedE_PENDING(and some failure HRESULTs) without writing*used. libHttpClient always writes*bufferUsedfirst (0 when there is no result yet), so a caller's leftover sentinel could look like a real length.Related to #1201 (
GetResultSize); this coversGetResult's*usedout-parameter. Open #1188 is about preserving non-zero success HRESULTs, not this.What is in it
crates/xcl/src/hle/xgameruntime/xasync.rs: write*used = 0on pending and failure paths; unit test with a0xDEADsentinelTested
c3aa9bdc3aa9bdf81c584411922271b58a6db7e8786de37(clean tree)cargo test --workspace -- --test-threads=4: 742 passed, 0 failed, 41 ignored. SKIPPED: 2 GPU tests for no wave64 (expected on this card)SKIPPED: 2 GPU tests for no wave64 (expected on this card)Regression run
scripts/smoke.ps1from @Toons29 (RX 9070, 60 s, same title/time; blocks as printed):Not tested
cargo test --workspaceAI use
Imported from ivall/xcl. Originally posted by DavidM1911 on 2026-11-24T13:28:46Z.
Independent verification on current
main384f7f7(branch already contains it — clean).Machine: Windows 11, Ryzen 9 7900X; Rust stable MSVC, debug.
cargo test -p xcl --lib xasync: 16 passed, 0 failed — includes the newget_result_writes_zero_used_while_pending.AI use: test runs by Devin (Cognition, SWE-2); no code changes.
Imported from ivall/xcl. Originally posted by Toons29 on 2026-11-25T03:15:47Z.
Regression run of
c3aa9bdfon the retail title, for this PR's Regression run section. Both blocks are fromscripts/smoke.ps1as printed, not edited:mainon4178e888, this PR on its head commit with no uncommitted changes, same title and time.Against the limits in CONTRIBUTING.md: 99 % of
main's frames, 100 % of its peak commit, no crash, no device removal.AMD Radeon RX 9070 (RDNA4, driver 32.0.32029.2010), Ryzen 7 7800X3D, 32 GB, Windows 11 build 26300, Rust 1.100.0,
cargo build --release -p xcl, 60 s,XCL_NETWORK=0. This is a regression check only: it does not show whether the run reaches the code this PR changes.AI use: Claude Code (Claude Opus 5.5) built both trees and ran
scripts/smoke.ps1; I checked the blocks before posting.Imported from ivall/xcl. Originally posted by Longno242 on 2026-11-25T12:36:33Z.
Thanks @Toons29 — pasted both of your
xcl-smoke v1blocks under Regression run so the description check can see them.Imported from ivall/xcl. Originally posted by Longno242 on 2026-11-25T12:43:52Z.
CI is stuck on
action_required(first-time contributor workflow approval). Smoke + PR description are green; please approve the pending CI workflow when you get a chance.Imported from ivall/xcl. Originally posted by jennydeth on 2026-11-25T13:00:59Z.
Full workspace run (listed under Not tested).
Setup: RTX 3060 12 GB (32-lane waves, driver 32.0.16.2101), Ryzen 5 5600X, 32 GB RAM, Windows 11 build 26300, Rust 1.100.0, DXC 1.9.2609.5, debug build. Head
c3aa9bd.Result: cargo test --workspace -- --test-threads=4: 742 passed, 0 failed, 41 ignored. SKIPPED: 2 GPU tests for no wave64 (expected on this card).
Not tested: live libHttpClient against the system XGameRuntime.
AI use: Claude Code (Claude Opus 5.5) ran the tests and wrote this report.
Imported from ivall/xcl. Originally posted by Longno242 on 2026-11-25T13:21:11Z.
Thanks @jennydeth — copied your workspace counts into Tested (742 passed, 0 failed, 41 ignored. SKIPPED: 2 GPU tests for no wave64 (expected on this card)).
Imported from ivall/xcl. Originally posted by github-actions[bot] on 2026-11-29T07:43:26Z.
Nothing has happened on this PR for 3 days, so it is marked
staleand will be closed in 4 days. A push or a comment takes the mark off: rebase it ontomainif it conflicts, and say in one line what it still fixes. If it only waits for a maintainer, a comment saying so is enough.Imported from ivall/xcl. Originally posted by Longno242 on 2026-11-29T20:44:05Z.
Still waiting on a maintainer: description/smoke are in place; CI needs first-time-contributor workflow approval. Not abandoned.
Imported from ivall/xcl. Originally posted by Foniass on 2026-12-01T05:07:06Z.
Triage (#1607) – head
c3aa9bdRelated but not overlapping: #1201 (same author) makes the same fix for
XAsyncGetResultSize; this one changesXAsyncGetResult(xasync.rs), which main still leaves*useduntouched on E_PENDING and failure. The new test covers the pending case only; the failed-status paths are not tested. The identity-mismatch E_INVALIDARG and E_NOT_SUFFICIENT_BUFFER returns still leave*usedunchanged.Recommendation: keep open.
AI review: Claude Code (Claude Opus 5.5), diffs read only, not built or run; not checked by a human.
Imported from ivall/xcl. Originally posted by BBareth on 2026-12-01T09:38:45Z.
merge-check claim
head:
c3aa9bdf81Imported from ivall/xcl. Originally posted by BBareth on 2026-12-01T09:59:51Z.
merge-check
base:
493dbd3dd0head:
c3aa9bdf81merge: clean
build: cargo build --workspace -> ok
tests: cargo test --workspace --no-fail-fast -- --test-threads=4 -> 2901 passed, 0 failed, 51 ignored; 28 SKIPPED lines, as on the base; failing: none. The base alone, same machine, same commit: 2900 passed, 0 failed, 51 ignored, 28 SKIPPED lines (22 no wave64, 2 no heap windows, 2 no d3d12SDKLayers.dll, 1 no D3D12 debug layer, 1 cannot disable the driver cache). The new test
get_result_writes_zero_used_while_pendingran and passed.review: no blocking finding; one file (+29/-0), every line read.
XAsyncGetResultwrites 0 into*used(when it is not null) before it returnsE_PENDINGor a failed status, in the finished and in the active branch; successful paths are unchanged. TheE_INVALIDARGreturns (unknown block, wrong identity) still leave*usedalone. Note for the maintainer: #1201 adds its test at the same place in the same file, so the second of the two to merge will need a small conflict resolved. Not tested here: a retail title that reads*usedafter a pending call.performance: none: one store on the pending and failure paths.
verdict: safe to merge
hardware / tool and model: RTX 5070 Ti 16 GB, driver 621.24 (32.0.16.2124); i7-12700K; Windows 11 26200. Claude Code, Claude Fable 5.2 read the diff, ran the build and the suite and wrote this check.
Imported from ivall/xcl. Originally posted by brainhay5 on 2026-12-01T10:06:21Z.
merge-check claim
head:
c3aa9bdf81Imported from ivall/xcl. Originally posted by brainhay5 on 2026-12-01T11:48:24Z.
merge-check claim withdrawn
Our automated merge-check loop claimed this PR and then stopped before posting a check — two loops were running at once and both are now shut down. No check from us is coming, so this claim is void and the head is free for someone else to take.
AI use: an agent posted this withdrawal.
Imported from ivall/xcl. Originally posted by cj-tomlin on 2026-12-01T19:08:33Z.
merge-check claim
head:
c3aa9bdf81Imported from ivall/xcl. Originally posted by cj-tomlin on 2026-12-01T19:15:49Z.
merge-check
base:
6bfb5c5153head:
c3aa9bdf81merge: clean
build: cargo build --workspace -> ok
tests: cargo test --workspace --no-fail-fast -- --test-threads=4 -> 2904 passed, 1 failed, 51 ignored; SKIPPED: 27 (22 no wave64, 2 no heap windows, 3 no D3D12 debug layer / d3d12SDKLayers.dll); failing:
gpu_two_pass_cache_e2e::two_pass_driver_cache_reuses_both_passes_and_recovers_corrupt_blobs(itsdisabledchild run fails), which fails on the base too: run alone 6 times each, 5 of 6 failed on the merge and 6 of 6 onmain6bfb5c51, same machine. It passed in my full-suite runs of two other PRs on the same base earlier today, so it is intermittent here; this PR does not touch that path. The newxasync::tests::get_result_writes_zero_used_while_pendingpasses, and fails when I take the fix's pending write back out of the merged tree.review: none blocking, after reading the whole diff (+29/-0,
xasync.rs).XAsyncGetResultwrites 0 into a non-null*usedbefore returningE_PENDINGor a failed status, in the finished and in the active branch; successful paths are unchanged. CPU-side only, so this NVIDIA-only run covers it. Not blocking: (1) the test covers the pending case only, not the two failed-status writes; (2) theE_INVALIDARGandE_NOT_SUFFICIENT_BUFFERreturns still leave*usedalone; (3) #1201 adds its test at the same place inxasync.rs: merging #1201 on top of this merge gives a content conflict, so whichever of the two lands second needs a rebase.performance: none: one store on the pending and failure paths.
verdict: safe to merge
hardware / tool and model: NVIDIA GeForce RTX 3080 10 GB, driver 621.40, AMD Ryzen 7 7800X3D, Windows 11 build 26300, debug build / Claude Code (Claude Opus 5.5) merged, built, ran the suite, read the diff and drafted this; I checked it.
Imported from ivall/xcl. Originally posted by Longno242 on 2026-12-02T20:47:17Z.
Rebased onto current
main(resolved conflict with #1201'sget_result_size_writes_zero_while_pending— kept both tests).cargo test -p xcl --lib xasync::: 16 passed, 0 failed. Not abandoned — clearing stale / needs-rebase.Pre-rebase retail smoke in the description is stale after the rebase; needs a fresh title-run pair on the new tip before merge.
Imported from ivall/xcl. Originally posted by Foniass on 2026-12-02T21:07:10Z.
Follow-up review of
a2d968f4, sincec3aa9bd(code reading only, not a merge-check;PR descriptionred) · 1 mediumIn short: The PR makes
XAsyncGetResultwrite 0 into*usedwhile the operation is pending. Since the triage note onc3aa9bdit was only rebased ontomain:git range-diffshows the commit's change is the same. The earlier point about untested paths still stands, and nothing blocks it.Medium
E_PENDING. Neither the failed-status paths that now also write 0, nor theE_INVALIDARG(identity mismatch) andE_NOT_SUFFICIENT_BUFFERreturns that still leave*usedunchanged, are tested. Add a case for a failed operation, so the difference between the two kinds of return is pinned down.Checked and fine
maindropped nothing.XAsyncGetResultSize) is now onmain, so the two calls agree on*usedwhile pending.Written by Claude Code (Claude Opus 5.5) and posted by Foniass without a human check of each point.
View command line instructions
Checkout
From your project repository, check out a new branch and test the changes.Merge
Merge the changes and update on Forgejo.Warning: The "Autodetect manual merge" setting is not enabled for this repository, you will have to mark this pull request as manually merged afterwards.