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

Open
b3IKK wants to merge 1 commit from upstream-pr/1188 into main
b3IKK commented 2026-11-24 13:00:53 +00:00 (Migrated from github.com)

Imported from ivall/xcl. Originally posted by b3IKK on 2026-11-24T13:00:53Z.


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.
<!-- greyfinch-sync:ivall/xcl:issue:5472631640 --> Imported from [ivall/xcl](https://github.com/xcl-dev/xcl/pull/1188). Originally posted by [b3IKK](https://github.com/b3IKK) on 2026-11-24T13:00:53Z. --- `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.
DavidM1911 commented 2026-11-24 14:06:33 +00:00 (Migrated from github.com)

Imported from ivall/xcl. Originally posted by DavidM1911 on 2026-11-24T13:26:57Z.


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.

<!-- greyfinch-sync:ivall/xcl:comment:7132844477 --> Imported from [ivall/xcl](https://github.com/ivall/xcl/pull/1188#issuecomment-7132844477). Originally posted by [DavidM1911](https://github.com/DavidM1911) on 2026-11-24T13:26:57Z. --- 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.
github-actions[bot] commented 2026-11-27 21:26:37 +00:00 (Migrated from github.com)

Imported from ivall/xcl. Originally posted by github-actions[bot] on 2026-11-27T21:26:37Z.


Nothing has happened on this PR for 3 days, so it is marked stale and will be closed in 4 days. A push or a comment takes the mark off: rebase it onto main if it conflicts, and say in one line what it still fixes. If it only waits for a maintainer, a comment saying so is enough.

<!-- greyfinch-sync:ivall/xcl:comment:7228448195 --> Imported from [ivall/xcl](https://github.com/xcl-dev/xcl/pull/1188#issuecomment-7228448195). Originally posted by [github-actions[bot]](https://github.com/apps/github-actions) on 2026-11-27T21:26:37Z. --- Nothing has happened on this PR for 3 days, so it is marked `stale` and will be closed in 4 days. A push or a comment takes the mark off: rebase it onto `main` if it conflicts, and say in one line what it still fixes. If it only waits for a maintainer, a comment saying so is enough.
Foniass commented 2026-12-01 05:02:52 +00:00 (Migrated from github.com)

Imported from ivall/xcl. Originally posted by Foniass on 2026-12-01T05:02:52Z.


Triage (#1607) – head 6c07ef2

Not on main: main's XAsyncGetResult still returns S_OK on both success paths, even though XAsyncGetStatus / XAsyncGetResultSize return the stored status. #1205 changes *used while the call is pending, which is a different fix. The test covers both the Finished and the Active (payload) path with S_FALSE.
No problems found in the diff.
Recommendation: keep open.

AI review: Claude Code (Claude Opus 5.5), diffs read only, not built or run; not checked by a human.

<!-- greyfinch-sync:ivall/xcl:comment:7301367553 --> Imported from [ivall/xcl](https://github.com/xcl-dev/xcl/pull/1188#issuecomment-7301367553). Originally posted by [Foniass](https://github.com/Foniass) on 2026-12-01T05:02:52Z. --- **Triage (#1607)** – head 6c07ef2 Not on main: main's `XAsyncGetResult` still returns S_OK on both success paths, even though `XAsyncGetStatus` / `XAsyncGetResultSize` return the stored status. #1205 changes `*used` while the call is pending, which is a different fix. The test covers both the Finished and the Active (payload) path with S_FALSE. No problems found in the diff. Recommendation: keep open. AI review: Claude Code (Claude Opus 5.5), diffs read only, not built or run; not checked by a human.
This pull request cannot be merged automatically due to conflicts.
Merge manually to resolve the conflicts.
View command line instructions

Checkout

From your project repository, check out a new branch and test the changes.
git fetch -u origin 'upstream-pr/1188:upstream-pr/1188'
git switch 'upstream-pr/1188'

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.

git switch 'main'
git merge --no-ff 'upstream-pr/1188'
git switch 'upstream-pr/1188'
git rebase 'main'
git switch 'main'
git merge --ff-only 'upstream-pr/1188'
git switch 'upstream-pr/1188'
git rebase 'main'
git switch 'main'
git merge --no-ff 'upstream-pr/1188'
git switch 'main'
git merge --squash 'upstream-pr/1188'
git switch 'main'
git merge --ff-only 'upstream-pr/1188'
git switch 'main'
git merge 'upstream-pr/1188'
git push origin 'main'
Sign in to join this conversation.
No reviewers
No labels
No milestone
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Reference
xcl-dev/xcl!1179
No description provided.