XGameRuntime: XAsyncGetResult writes 0 into *used while pending #1205

Open
github-bot wants to merge 1 commit from github-bot/gh-1205 into main AGit
Owner

@⁠Longno242 on GitHub · 2026-11-24 13:14 UTC · original
Longno242:xasync-get-result-used-pending → main · +29 −0 · 1 files · 1 commits · open

XAsyncGetResult returned E_PENDING (and some failure HRESULTs) without writing *used. libHttpClient always writes *bufferUsed first (0 when there is no result yet), so a caller's leftover sentinel could look like a real length.

Related to #1201 (GetResultSize); this covers GetResult's *used out-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 = 0 on pending and failure paths; unit test with a 0xDEAD sentinel

Tested

  • Hardware/OS (full suite by @⁠jennydeth): 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
  • Commit tested: c3aa9bdf81c584411922271b58a6db7e8786de37 (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)
  • Retail smoke: see Regression run (@⁠Toons29, RX 9070)

Regression run

  • Retail scripts/smoke.ps1 from @⁠Toons29 (RX 9070, 60 s, same title/time; blocks as printed):
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: c3aa9bdf81c584411922271b58a6db7e8786de37
gpu: AMD Radeon RX 9070
title: game.exe
seconds: 60
exit: 0x0
frames shown: 1604 (PresentX 1604)
presents per 2 s (last 3): 60 60 60
device removals: 0
crashes: 0
peak commit: 14814 MB

Not tested

  • Full cargo test --workspace
  • Live libHttpClient against system XGameRuntime
  • live libHttpClient against the system XGameRuntime

AI use

  • @⁠jennydeth: Claude Code (Claude Opus 5.5) ran the full workspace suite and reported results in a PR comment
  • Cursor Auto (Composer): found the gap next to #1201, implemented the fix and test, opened this draft PR. Exact underlying model name not disclosed to the agent.
**@⁠Longno242** on GitHub · 2026-11-24 13:14 UTC · [original](https://github.com/xcl-dev/xcl/pull/1205) `Longno242:xasync-get-result-used-pending` → `main` · +29 −0 · 1 files · 1 commits · open `XAsyncGetResult` returned `E_PENDING` (and some failure HRESULTs) without writing `*used`. libHttpClient always writes `*bufferUsed` first (0 when there is no result yet), so a caller's leftover sentinel could look like a real length. Related to #1201 (`GetResultSize`); this covers `GetResult`'s `*used` out-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 = 0` on pending and failure paths; unit test with a `0xDEAD` sentinel **Tested** - Hardware/OS (full suite by @⁠jennydeth): 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 - Commit tested: `c3aa9bdf81c584411922271b58a6db7e8786de37` (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) - Retail smoke: see **Regression run** (@⁠Toons29, RX 9070) **Regression run** - Retail `scripts/smoke.ps1` from @⁠Toons29 (RX 9070, 60 s, same title/time; blocks as printed): ``` 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: c3aa9bdf81c584411922271b58a6db7e8786de37 gpu: AMD Radeon RX 9070 title: game.exe seconds: 60 exit: 0x0 frames shown: 1604 (PresentX 1604) presents per 2 s (last 3): 60 60 60 device removals: 0 crashes: 0 peak commit: 14814 MB ``` **Not tested** - Full `cargo test --workspace` - Live libHttpClient against system XGameRuntime - live libHttpClient against the system XGameRuntime **AI use** - @⁠jennydeth: Claude Code (Claude Opus 5.5) ran the full workspace suite and reported results in a PR comment - Cursor Auto (Composer): found the gap next to #1201, implemented the fix and test, opened this draft PR. Exact underlying model name not disclosed to the agent.
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 (#1201).

Assisted-by: Cursor Auto (Composer)
Co-authored-by: Cursor <[email protected]>
github-bot locked as GitHub sync and limited conversation to collaborators 2026-11-26 04:46:58 +00:00
Author
Owner

@⁠DavidM1911 on GitHub · 2026-11-24 13:28 UTC · original

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 — includes the new get_result_writes_zero_used_while_pending.

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

**@⁠DavidM1911** on GitHub · 2026-11-24 13:28 UTC · [original](https://github.com/xcl-dev/xcl/pull/1205#issuecomment-7132888103) 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** — includes the new `get_result_writes_zero_used_while_pending`. AI use: test runs by Devin (Cognition, SWE-2); no code changes.
Author
Owner

@⁠Toons29 on GitHub · 2026-11-25 03:15 UTC · original

Regression run of c3aa9bdf 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: c3aa9bdf81c584411922271b58a6db7e8786de37
gpu: AMD Radeon RX 9070
title: game.exe
seconds: 60
exit: 0x0
frames shown: 1604 (PresentX 1604)
presents per 2 s (last 3): 60 60 60
device removals: 0
crashes: 0
peak commit: 14814 MB

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.

**@⁠Toons29** on GitHub · 2026-11-25 03:15 UTC · [original](https://github.com/xcl-dev/xcl/pull/1205#issuecomment-7151747272) Regression run of `c3aa9bdf` 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: c3aa9bdf81c584411922271b58a6db7e8786de37 gpu: AMD Radeon RX 9070 title: game.exe seconds: 60 exit: 0x0 frames shown: 1604 (PresentX 1604) presents per 2 s (last 3): 60 60 60 device removals: 0 crashes: 0 peak commit: 14814 MB ``` 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.
Author
Owner

@⁠Longno242 on GitHub · 2026-11-25 12:36 UTC · original

Thanks @⁠Toons29 — pasted both of your xcl-smoke v1 blocks under Regression run so the description check can see them.

**@⁠Longno242** on GitHub · 2026-11-25 12:36 UTC · [original](https://github.com/xcl-dev/xcl/pull/1205#issuecomment-7162609023) Thanks @⁠Toons29 — pasted both of your `xcl-smoke v1` blocks under **Regression run** so the description check can see them.
Author
Owner

@⁠Longno242 on GitHub · 2026-11-25 12:43 UTC · original

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.

**@⁠Longno242** on GitHub · 2026-11-25 12:43 UTC · [original](https://github.com/xcl-dev/xcl/pull/1205#issuecomment-7162776243) 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.
Author
Owner

@⁠jennydeth on GitHub · 2026-11-25 13:00 UTC · original

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.

**@⁠jennydeth** on GitHub · 2026-11-25 13:00 UTC · [original](https://github.com/xcl-dev/xcl/pull/1205#issuecomment-7163171648) 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.
Author
Owner

@⁠Longno242 on GitHub · 2026-11-25 13:21 UTC · original

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)).

**@⁠Longno242** on GitHub · 2026-11-25 13:21 UTC · [original](https://github.com/xcl-dev/xcl/pull/1205#issuecomment-7163652503) 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)).
This pull request can be merged automatically.
This branch is out-of-date with the base branch
You are not authorized to merge this pull request.
View command line instructions

Checkout

From your project repository, check out a new branch and test the changes.
git fetch -u origin '+refs/pull/1205/head:github-bot/gh-1205'
git switch 'github-bot/gh-1205'

Merge

Merge the changes and update on Forgejo.
git switch 'main'
git merge --no-ff 'github-bot/gh-1205'
git switch 'github-bot/gh-1205'
git rebase 'main'
git switch 'main'
git merge --ff-only 'github-bot/gh-1205'
git switch 'github-bot/gh-1205'
git rebase 'main'
git switch 'main'
git merge --no-ff 'github-bot/gh-1205'
git switch 'main'
git merge --squash 'github-bot/gh-1205'
git switch 'main'
git merge --ff-only 'github-bot/gh-1205'
git switch 'main'
git merge 'github-bot/gh-1205'
git push origin 'main'
This discussion has been locked. Commenting is limited to contributors.
No description provided.