GPU: a command queue's SuspendX and ResumeX succeed #3225

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

@⁠JurajSimicevic on GitHub · 2026-11-26 13:44 UTC · original
JurajSimicevic:queue/suspend-resume → main · +44 −1 · 1 files · 1 commits · open

Problem

When the title is suspended (window close, or a relaunch through lifecycle::end_title), Grand Theft Auto VI's suspend routine calls the command queue's SuspendX(0) at slot 0xb8. Nothing is written there, so every suspend logs method not implemented object="command queue" slot=0xb8 and the call returns E_NOTIMPL. #1080 noted it and left it as a follow-up. queue.rs already names 0xb8/0xc0 as suspend and resume, from the title's calls.

Change

  • SuspendX(flags) and ResumeX() return S_OK. On the console, a suspend stops the queue's GPU work and ResumeX restarts it (Microsoft's public GDK sample DeviceResourcesGXDK.cpp calls SuspendX(0) on suspend and ResumeX() on resume). Here there is nothing to stop. Our submissions have run when Execute returns, work held for a wait runs as soon as the wait is met, and a suspended title is never resumed, because the process ends.
  • METHODS gets them at 0xa8/0xb0 in the older layout, so newer_slot puts them at 0xb8/0xc0, where Grand Theft Auto VI calls them.
  • New test queue::tests::queues_suspend_and_resume: the slots in both layouts, and both calls through a queue's own table return S_OK.

crates/victory-gpu/src/queue.rs only.

Tested

  • cargo test -p victory-gpu --lib queue::: 6 passed, among them the new test.
  • cargo test --workspace --locked: 569 passed. On this card (RTX 5080) two tests of victory-gpu fail, as they do on main on every NVIDIA host: dynamic_slots_are_held_until_released and lists_share_a_table_and_copies_keep_their_views (the 1,000,000-view cap; #2461 and #1779 address it). The victory-shader test binary exits with STATUS_ACCESS_VIOLATION while its tests run in parallel. That crate doesn't depend on victory-gpu and is the same as on main.
  • cargo clippy --workspace --all-targets --locked -- -D warnings, and the same with --all-features: clean. No new rustfmt hunks.
  • In the title: RTX 5080, diag build of main 63bcca4 with this change, RUST_LOG=info,victory_gpu::queue=debug. The window was closed at the menu:
13:41:22.921  lifecycle: window closed: suspending the title constrained=1 routines=2
13:41:23.022  queue: command queue suspended flags=0
13:41:23.023  lifecycle: title suspended; ending the title

No method not implemented line for the command queue. The title calls SuspendX once, 0.1 s after the close, and finishes suspending right after.

In the world at 0.5 fps it doesn't get that far. In my earlier runs on main, the title reached this call only after the 1 s deadline in lifecycle.rs had passed (title did not finish suspending in time, then the slot=0xb8 line). There, this change makes no difference.

Claim: #1633 (#1633).

No game data: log lines and counts only.

AI-assisted.

🤖 Generated with Claude Code

**@⁠JurajSimicevic** on GitHub · 2026-11-26 13:44 UTC · [original](https://github.com/Marvisak/VIctory/pull/3225) `JurajSimicevic:queue/suspend-resume` → `main` · +44 −1 · 1 files · 1 commits · open ## Problem When the title is suspended (window close, or a relaunch through `lifecycle::end_title`), Grand Theft Auto VI's suspend routine calls the command queue's `SuspendX(0)` at slot 0xb8. Nothing is written there, so every suspend logs `method not implemented object="command queue" slot=0xb8` and the call returns `E_NOTIMPL`. #1080 noted it and left it as a follow-up. `queue.rs` already names 0xb8/0xc0 as suspend and resume, from the title's calls. ## Change - `SuspendX(flags)` and `ResumeX()` return `S_OK`. On the console, a suspend stops the queue's GPU work and `ResumeX` restarts it (Microsoft's public GDK sample `DeviceResourcesGXDK.cpp` calls `SuspendX(0)` on suspend and `ResumeX()` on resume). Here there is nothing to stop. Our submissions have run when Execute returns, work held for a wait runs as soon as the wait is met, and a suspended title is never resumed, because the process ends. - `METHODS` gets them at 0xa8/0xb0 in the older layout, so `newer_slot` puts them at 0xb8/0xc0, where Grand Theft Auto VI calls them. - New test `queue::tests::queues_suspend_and_resume`: the slots in both layouts, and both calls through a queue's own table return `S_OK`. `crates/victory-gpu/src/queue.rs` only. ## Tested - `cargo test -p victory-gpu --lib queue::`: 6 passed, among them the new test. - `cargo test --workspace --locked`: 569 passed. On this card (RTX 5080) two tests of `victory-gpu` fail, as they do on `main` on every NVIDIA host: `dynamic_slots_are_held_until_released` and `lists_share_a_table_and_copies_keep_their_views` (the 1,000,000-view cap; #2461 and #1779 address it). The `victory-shader` test binary exits with `STATUS_ACCESS_VIOLATION` while its tests run in parallel. That crate doesn't depend on `victory-gpu` and is the same as on `main`. - `cargo clippy --workspace --all-targets --locked -- -D warnings`, and the same with `--all-features`: clean. No new rustfmt hunks. - In the title: RTX 5080, diag build of `main` `63bcca4` with this change, `RUST_LOG=info,victory_gpu::queue=debug`. The window was closed at the menu: ``` 13:41:22.921 lifecycle: window closed: suspending the title constrained=1 routines=2 13:41:23.022 queue: command queue suspended flags=0 13:41:23.023 lifecycle: title suspended; ending the title ``` No `method not implemented` line for the command queue. The title calls `SuspendX` once, 0.1 s after the close, and finishes suspending right after. In the world at 0.5 fps it doesn't get that far. In my earlier runs on `main`, the title reached this call only after the 1 s deadline in `lifecycle.rs` had passed (`title did not finish suspending in time`, then the `slot=0xb8` line). There, this change makes no difference. Claim: #1633 (https://git.gtahub.st/github/Marvisak--VIctory/issues/1633). No game data: log lines and counts only. AI-assisted. 🤖 Generated with [Claude Code](https://claude.com/claude-code)
Grand Theft Auto VI's suspend routine calls the command queue's
SuspendX(0) at 0xb8, which had no method: every window close or
relaunch logged "method not implemented" for the command queue and the
call answered E_NOTIMPL (noted in #1080). SuspendX and ResumeX now
succeed. On the console they stop and restart the queue's GPU work; here
submissions have run when Execute returns, work held for a wait runs
once the wait is met, and a suspended title is never resumed, so there
is nothing to stop.

They sit at 0xa8/0xb0 in the older queue layout, so newer queues have
them at 0xb8/0xc0, where the title calls them.

New test: queue::tests::queues_suspend_and_resume.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
github-bot locked as GitHub sync and limited conversation to collaborators 2026-11-26 13:47:21 +00:00
Author
Owner

@⁠Dukestar69 on GitHub · 2026-11-26 13:49 UTC · original · approved these changes

Verified on RTX 5090 against origin/main (63bcca4):

  • cargo test -p victory-gpu --lib queue:: -- --test-threads=1: 6/6 passed (including queues_suspend_and_resume).
  • cargo clippy -p victory-gpu --all-targets -- -D warnings: clean.
  • cargo xtask policy: 191 files ok.

Cleanly implements SuspendX and ResumeX on command queues.

Synthetic tests only (no game files used). AI-assisted (Gemini 4 Neon).

**@⁠Dukestar69** on GitHub · 2026-11-26 13:49 UTC · [original](https://github.com/Marvisak/VIctory/pull/3225#pullrequestreview-6075247320) · **approved these changes** Verified on RTX 5090 against `origin/main` (`63bcca4`): - `cargo test -p victory-gpu --lib queue:: -- --test-threads=1`: 6/6 passed (including `queues_suspend_and_resume`). - `cargo clippy -p victory-gpu --all-targets -- -D warnings`: clean. - `cargo xtask policy`: 191 files ok. Cleanly implements `SuspendX` and `ResumeX` on command queues. Synthetic tests only (no game files used). AI-assisted (Gemini 4 Neon).
Author
Owner

@⁠oni-swr on GitHub · 2026-11-26 15:03 UTC · original

WARP verification at head db63d1f2 (main 63bcca43 as control).

  • New test queue::tests::queues_suspend_and_resume: passes on the head.
  • Full victory-gpu lib suite on the head: 247 passed, 1 ignored in 4 of 5 runs. In the other run, descriptor::host::tests::a_slot_rewritten_while_its_view_is_prepared_views_the_new_record failed once (it passed in the next 3 runs). This PR only touches queue.rs, so I read it as a flake in an unrelated test, not something this PR causes. I did not chase it. Main passed 246 of 246 in 3 of 3 runs.
  • Control: main's code with the test's behaviour part only (slot calls at 0xa8/0xb0 and 0xb8/0xc0; the symbol-identity asserts can't build on main) fails: SuspendX returns E_NOTIMPL (-2147467263) instead of S_OK.

Software adapter (WARP, Microsoft Basic Render Driver), not a physical GPU. Synthetic tests only, no game files. Run with VICTORY_WARP=1 VICTORY_D3D12_WARP=1 cargo test -p victory-gpu --lib --features diagnostics -j 4 and dxil.dll available. Test report only, no code changes.

AI-assisted: verification by Claude Code (Claude Sonnet 5.5).

**@⁠oni-swr** on GitHub · 2026-11-26 15:03 UTC · [original](https://github.com/Marvisak/VIctory/pull/3225#issuecomment-7195727229) WARP verification at head `db63d1f2` (main `63bcca43` as control). - New test `queue::tests::queues_suspend_and_resume`: passes on the head. - Full victory-gpu lib suite on the head: 247 passed, 1 ignored in 4 of 5 runs. In the other run, `descriptor::host::tests::a_slot_rewritten_while_its_view_is_prepared_views_the_new_record` failed once (it passed in the next 3 runs). This PR only touches `queue.rs`, so I read it as a flake in an unrelated test, not something this PR causes. I did not chase it. Main passed 246 of 246 in 3 of 3 runs. - Control: main's code with the test's behaviour part only (slot calls at 0xa8/0xb0 and 0xb8/0xc0; the symbol-identity asserts can't build on main) fails: `SuspendX` returns `E_NOTIMPL` (-2147467263) instead of `S_OK`. Software adapter (WARP, Microsoft Basic Render Driver), not a physical GPU. Synthetic tests only, no game files. Run with `VICTORY_WARP=1 VICTORY_D3D12_WARP=1 cargo test -p victory-gpu --lib --features diagnostics -j 4` and dxil.dll available. Test report only, no code changes. AI-assisted: verification by Claude Code (Claude Sonnet 5.5).
This pull request can be merged automatically.
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/3225/head:github-bot/gh-3225'
git switch 'github-bot/gh-3225'

Merge

Merge the changes and update on Forgejo.
git switch 'main'
git merge --no-ff 'github-bot/gh-3225'
git switch 'github-bot/gh-3225'
git rebase 'main'
git switch 'main'
git merge --ff-only 'github-bot/gh-3225'
git switch 'github-bot/gh-3225'
git rebase 'main'
git switch 'main'
git merge --no-ff 'github-bot/gh-3225'
git switch 'main'
git merge --squash 'github-bot/gh-3225'
git switch 'main'
git merge --ff-only 'github-bot/gh-3225'
git switch 'main'
git merge 'github-bot/gh-3225'
git push origin 'main'
This discussion has been locked. Commenting is limited to contributors.
No reviewers
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.

Dependencies

No dependencies set

Reference
github/Marvisak--VIctory!3225
No description provided.