Skip to content

XGameRuntime: XAsyncGetResultSize writes 0 while the operation is pending - #1201

Draft
Longno242 wants to merge 1 commit into
xcl-dev:mainfrom
Longno242:xasync-get-result-size-pending
Draft

Longno242 wants to merge 1 commit into
xcl-dev:mainfrom
Longno242:xasync-get-result-size-pending

Conversation

@Longno242

Copy link
Copy Markdown

XAsyncGetResultSize returned E_PENDING without writing *size. libHttpClient always writes *bufferSize first (0 while pending), so a caller's leftover sentinel could be mistaken for a real size.

No open issue tracked this; checked that open XAsync PRs (#1188, #1176, #670, …) do not cover GetResultSize's pending path.

What is in it

  • crates/xcl/src/hle/xgameruntime/xasync.rs: write *size = 0 on pending (and on finished blocks); unit test with a 0xDEAD sentinel

Tested

  • Hardware/OS: NVIDIA GeForce RTX 5080, Windows 11 Home, rustc 1.97.1 MSVC debug
  • Commit tested: 8b57a0d (clean tree)
  • cargo test -p xcl --lib xasync::tests -- --test-threads=4: 15 passed, 0 failed, 0 ignored

Regression run

  • Not run: no Xbox Series X|S package available. Needed before merge because crates/xcl/src outside tests changed.

Not tested

  • Full cargo test --workspace
  • scripts/smoke.ps1 on a retail Series title
  • libHttpClient live path against system XGameRuntime

AI use

  • Cursor Auto (Composer): found the gap vs libHttpClient's always-write *bufferSize contract, implemented the fix and test, opened this draft PR. Exact underlying model name not disclosed to the agent.

…ding

libHttpClient always stores into *bufferSize before returning, including
E_PENDING (typically 0). Leaving the caller's out-parameter untouched let
a stale sentinel survive until GetResult.

Assisted-by: Cursor Auto (Composer)
Co-authored-by: Cursor <cursoragent@cursor.com>
@DavidM1911

Copy link
Copy Markdown
Contributor

Independent verification on current main 384f7f7 (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 — XAsyncGetResultSize pending-write change keeps the suite green.

AI use: test runs by Devin (Cognition, SWE-2); no code changes.

CalvyPZ pushed a commit to CalvyPZ/xcl that referenced this pull request Nov 24, 2026
libHttpClient stores *bufferUsed before returning E_PENDING (and on
failure HRESULTs). Leaving the out-parameter untouched kept a caller's
sentinel. Same class as GetResultSize (xcl-dev#1201).

Assisted-by: Cursor Auto (Composer)
Co-authored-by: Cursor <cursoragent@cursor.com>
@Toons29

Toons29 commented Nov 25, 2026

Copy link
Copy Markdown

Regression run of 8b57a0da on the retail title, for this PR's Regression run section. Both blocks are from scripts/smoke.ps1 as printed, not edited: main on 4178e888, this PR on its head commit with no uncommitted changes, same title and time.

xcl-smoke v1
commit: 4178e888c0b5be50a2887eda45cdb832763b68a4
gpu: AMD Radeon RX 9070
title: game.exe
seconds: 60
exit: 0x0
frames shown: 1618 (PresentX 1618)
presents per 2 s (last 3): 61 60 60
device removals: 0
crashes: 0
peak commit: 14831 MB
xcl-smoke v1
commit: 8b57a0daf1f78cd20c7478db53c65336191de540
gpu: AMD Radeon RX 9070
title: game.exe
seconds: 60
exit: 0x0
frames shown: 1631 (PresentX 1631)
presents per 2 s (last 3): 60 60 60
device removals: 0
crashes: 0
peak commit: 14684 MB

Against the limits in CONTRIBUTING.md: 101 % of main's frames, 99 % 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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants