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

Open
JurajSimicevic wants to merge 1 commit from upstream-pr/3225 into main
JurajSimicevic commented 2026-11-26 13:44:25 +00:00 (Migrated from github.com)

Imported from Marvisak/VIctory. Originally posted by JurajSimicevic on 2026-11-26T13:44:25Z.


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://github.com/Marvisak/VIctory/issues/1633#issuecomment-7193577024).

No game data: log lines and counts only.

AI-assisted.

🤖 Generated with Claude Code

<!-- greyfinch-sync:Marvisak/VIctory:issue:6627974579 --> Imported from [Marvisak/VIctory](https://github.com/Marvisak/VIctory/pull/3225). Originally posted by [JurajSimicevic](https://github.com/JurajSimicevic) on 2026-11-26T13:44:25Z. --- ## 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://github.com/Marvisak/VIctory/issues/1633#issuecomment-7193577024). No game data: log lines and counts only. AI-assisted. 🤖 Generated with [Claude Code](https://claude.com/claude-code)
Dukestar69 commented 2026-11-26 14:01:43 +00:00 (Migrated from github.com)

Imported from Marvisak/VIctory. Originally posted by Dukestar69 on 2026-11-26T13:49:23Z.

Review: APPROVED


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

<!-- greyfinch-sync:Marvisak/VIctory:review:6075247320 --> Imported from [Marvisak/VIctory](https://github.com/Marvisak/VIctory/pull/3225#pullrequestreview-6075247320). Originally posted by [Dukestar69](https://github.com/Dukestar69) on 2026-11-26T13:49:23Z. **Review:** APPROVED --- 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).
oni-swr commented 2026-11-26 16:05:00 +00:00 (Migrated from github.com)

Imported from Marvisak/VIctory. Originally posted by oni-swr on 2026-11-26T15:03:49Z.


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

<!-- greyfinch-sync:Marvisak/VIctory:comment:7195727229 --> Imported from [Marvisak/VIctory](https://github.com/Marvisak/VIctory/pull/3225#issuecomment-7195727229). Originally posted by [oni-swr](https://github.com/oni-swr) on 2026-11-26T15:03:49Z. --- 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).
cloph-dsp commented 2026-11-27 06:17:08 +00:00 (Migrated from github.com)

Imported from Marvisak/VIctory. Originally posted by cloph-dsp on 2026-11-27T06:17:08Z.


Independent CPU-only verification of PR #3225 (GPU: queue Suspend/Resume keeps per-queue state).

  • Windows, rustc/cargo 1.100.0/MSVC, worktree-local CARGO_TARGET_DIR (D:\Victory-Contrib\target-3225-watch), CARGO_BUILD_JOBS=2.
  • Head db63d1f29e0a3d260bb8355cff03a738ba11c59d, merge base 63bcca43c6a00a758510398fa43096ce7e4f7df0.
  • Command: cargo test --locked -p victory-gpu --lib -- queue::tests::queues_suspend_and_resume --exact --test-threads=1 --quiet -> 1 passed; 0 failed; 232 filtered.
  • Negative control: git grep -F for the new test name on 63bcca4 returned no hits (test absent on base).
  • git diff --check 63bcca4 HEAD exit 0 (clean).
  • Only the named synthetic test was replayed; the full crate suite and real D3D12 queue scheduling were not exercised.
  • AI-assisted (Hy4 flash). GPU/driver: N/A (CPU-only synthetic queue state). No game data, assets, shaders, DRM or decrypt used.
<!-- greyfinch-sync:Marvisak/VIctory:comment:7211387952 --> Imported from [Marvisak/VIctory](https://github.com/Marvisak/VIctory/pull/3225#issuecomment-7211387952). Originally posted by [cloph-dsp](https://github.com/cloph-dsp) on 2026-11-27T06:17:08Z. --- Independent CPU-only verification of PR #3225 (`GPU: queue Suspend/Resume keeps per-queue state`). - Windows, rustc/cargo 1.100.0/MSVC, worktree-local `CARGO_TARGET_DIR` (`D:\Victory-Contrib\target-3225-watch`), `CARGO_BUILD_JOBS=2`. - Head `db63d1f29e0a3d260bb8355cff03a738ba11c59d`, merge base `63bcca43c6a00a758510398fa43096ce7e4f7df0`. - Command: `cargo test --locked -p victory-gpu --lib -- queue::tests::queues_suspend_and_resume --exact --test-threads=1 --quiet` -> `1 passed; 0 failed; 232 filtered`. - Negative control: `git grep -F` for the new test name on `63bcca4` returned no hits (test absent on base). - `git diff --check 63bcca4 HEAD` exit 0 (clean). - Only the named synthetic test was replayed; the full crate suite and real D3D12 queue scheduling were not exercised. - AI-assisted (Hy4 flash). GPU/driver: N/A (CPU-only synthetic queue state). No game data, assets, shaders, DRM or decrypt used.
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/3225:upstream-pr/3225'
git switch 'upstream-pr/3225'

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/3225'
git switch 'upstream-pr/3225'
git rebase 'main'
git switch 'main'
git merge --ff-only 'upstream-pr/3225'
git switch 'upstream-pr/3225'
git rebase 'main'
git switch 'main'
git merge --no-ff 'upstream-pr/3225'
git switch 'main'
git merge --squash 'upstream-pr/3225'
git switch 'main'
git merge --ff-only 'upstream-pr/3225'
git switch 'main'
git merge 'upstream-pr/3225'
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
Marvisak/VIctory!3223
No description provided.