XGameRuntime: preserve non-zero success HRESULTs in XAsyncGetResult #1188

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

@⁠b3IKK on GitHub · 2026-11-24 13:00 UTC · original
b3IKK:xgameruntime/xasync-preserve-success-hr → main · +39 −3 · 1 files · 1 commits · open

XAsyncGetStatus and XAsyncGetResultSize return the completion status passed to XAsyncComplete, including positive non-zero success HRESULTs such as S_FALSE. XAsyncGetResult hardcoded S_OK on zero-payload completions (both Lookup::Finished and Lookup::Active) and returned OP_GET_RESULT's S_OK instead of the completion status on non-empty payloads.

This preserves the completion status in XAsyncGetResult (returning h.status / status for zero-payload completions, and returning status when OP_GET_RESULT succeeds with S_OK).

What is in it

  • crates/xcl/src/hle/xgameruntime/xasync.rs: preserve non-zero success HRESULTs in XAsyncGetResult; add regression test get_result_preserves_nonzero_success_hresult covering both zero-payload and non-empty payload S_FALSE completions (verified failing before the fix).

Tested

  • hardware (GPU + driver, CPU), Windows build, Rust version, debug / release: NVIDIA GeForce RTX 5080 (driver 32.0.16.1088), AMD Ryzen 9 9950X3D, Windows 11 10.0.26300, Rust 1.100.0 (stable-x86_64-pc-windows-msvc), DXC 1.9.2609.5, debug (scripts/test.ps1) and release (scripts/smoke.ps1)
  • .\scripts\test.ps1 (cargo build --workspace + cargo test --workspace -- --test-threads=4): 742 passed, 0 failed, 41 ignored (SKIPPED GPU tests: 2 no wave64 — gpu::recomp::tests::gpu_geometry_wave32_prefix_count_over_a_mask, gpu::recomp::tests::gpu_wave32_program_in_wave64_hardware)
  • cargo test -p xcl --lib get_result_preserves_nonzero_success_hresult: 1 passed, 0 failed (failed returning 0 instead of 1 before the fix)

Regression run

main:

xcl-smoke v1
commit: 47efa2ecea0a12934719ae69b81930cf02a4b1c3
gpu: NVIDIA GeForce RTX 5080
title: 9cc6a39e
seconds: 60
exit: 0x0
frames shown: 1226 (PresentX 1226)
presents per 2 s (last 3): 60 60 60
device removals: 0
crashes: 0
peak commit: 15341 MB

PR:

xcl-smoke v1
commit: 6c07ef2cc0501ad996c2ae89f8a53c01a02435a2
gpu: NVIDIA GeForce RTX 5080
title: 9cc6a39e
seconds: 60
exit: 0x0
frames shown: 1606 (PresentX 1606)
presents per 2 s (last 3): 60 60 60
device removals: 0
crashes: 0
peak commit: 14982 MB

Not tested

  • AMD GPUs and native wave64 hardware
  • other titles (Minecraft Preview, Unicorn Overlord, Fortnite, XDefiant) and Linux / Wine

AI use

  • OpenCode, Gemini 4 Neon: audited xasync.rs, wrote the fix and regression test, ran the test suite and scripts/smoke.ps1 regression runs, and drafted this PR description.
**@⁠b3IKK** on GitHub · 2026-11-24 13:00 UTC · [original](https://github.com/xcl-dev/xcl/pull/1188) `b3IKK:xgameruntime/xasync-preserve-success-hr` → `main` · +39 −3 · 1 files · 1 commits · open `XAsyncGetStatus` and `XAsyncGetResultSize` return the completion status passed to `XAsyncComplete`, including positive non-zero success `HRESULT`s such as `S_FALSE`. `XAsyncGetResult` hardcoded `S_OK` on zero-payload completions (both `Lookup::Finished` and `Lookup::Active`) and returned `OP_GET_RESULT`'s `S_OK` instead of the completion status on non-empty payloads. This preserves the completion status in `XAsyncGetResult` (returning `h.status` / `status` for zero-payload completions, and returning `status` when `OP_GET_RESULT` succeeds with `S_OK`). **What is in it** - `crates/xcl/src/hle/xgameruntime/xasync.rs`: preserve non-zero success `HRESULT`s in `XAsyncGetResult`; add regression test `get_result_preserves_nonzero_success_hresult` covering both zero-payload and non-empty payload `S_FALSE` completions (verified failing before the fix). **Tested** - hardware (GPU + driver, CPU), Windows build, Rust version, debug / release: NVIDIA GeForce RTX 5080 (driver 32.0.16.1088), AMD Ryzen 9 9950X3D, Windows 11 10.0.26300, Rust 1.100.0 (`stable-x86_64-pc-windows-msvc`), DXC 1.9.2609.5, debug (`scripts/test.ps1`) and release (`scripts/smoke.ps1`) - `.\scripts\test.ps1` (`cargo build --workspace` + `cargo test --workspace -- --test-threads=4`): 742 passed, 0 failed, 41 ignored (SKIPPED GPU tests: 2 `no wave64` — `gpu::recomp::tests::gpu_geometry_wave32_prefix_count_over_a_mask`, `gpu::recomp::tests::gpu_wave32_program_in_wave64_hardware`) - `cargo test -p xcl --lib get_result_preserves_nonzero_success_hresult`: 1 passed, 0 failed (failed returning `0` instead of `1` before the fix) **Regression run** main: ``` xcl-smoke v1 commit: 47efa2ecea0a12934719ae69b81930cf02a4b1c3 gpu: NVIDIA GeForce RTX 5080 title: 9cc6a39e seconds: 60 exit: 0x0 frames shown: 1226 (PresentX 1226) presents per 2 s (last 3): 60 60 60 device removals: 0 crashes: 0 peak commit: 15341 MB ``` PR: ``` xcl-smoke v1 commit: 6c07ef2cc0501ad996c2ae89f8a53c01a02435a2 gpu: NVIDIA GeForce RTX 5080 title: 9cc6a39e seconds: 60 exit: 0x0 frames shown: 1606 (PresentX 1606) presents per 2 s (last 3): 60 60 60 device removals: 0 crashes: 0 peak commit: 14982 MB ``` **Not tested** - AMD GPUs and native wave64 hardware - other titles (Minecraft Preview, Unicorn Overlord, Fortnite, XDefiant) and Linux / Wine **AI use** - OpenCode, Gemini 4 Neon: audited `xasync.rs`, wrote the fix and regression test, ran the test suite and `scripts/smoke.ps1` regression runs, and drafted this PR description.
XAsyncGetStatus and XAsyncGetResultSize return the completion status
passed to XAsyncComplete, including positive non-zero success HRESULTs
such as S_FALSE. XAsyncGetResult hardcoded S_OK on zero-payload
completions (both Lookup::Finished and Lookup::Active) and returned
OP_GET_RESULT's S_OK instead of the completion status on non-empty
payloads.

Return h.status / status for zero-payload completions, and return
`status` when OP_GET_RESULT succeeds with S_OK.

Assisted-by: OpenCode (Gemini 4 Neon)
github-bot locked as GitHub sync and limited conversation to collaborators 2026-11-26 04:46:26 +00:00
Author
Owner

@⁠DavidM1911 on GitHub · 2026-11-24 13:26 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_preserves_nonzero_success_hresult.

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

**@⁠DavidM1911** on GitHub · 2026-11-24 13:26 UTC · [original](https://github.com/xcl-dev/xcl/pull/1188#issuecomment-7132844477) 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_preserves_nonzero_success_hresult`. AI use: test runs by Devin (Cognition, SWE-2); no code changes.
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/1188/head:github-bot/gh-1188'
git switch 'github-bot/gh-1188'

Merge

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