GPU: device slots 0x1c8 and 0x218 fail on purpose, with no object #3161

Open
arogan178 wants to merge 1 commit from upstream-pr/3163 into main
arogan178 commented 2026-11-26 10:39:39 +00:00 (Migrated from github.com)

Imported from Marvisak/VIctory. Originally posted by arogan178 on 2026-11-26T10:39:39Z.


Device slots 0x1c8 and 0x218 load pipelines from the title's cache of precompiled native code. When they fail, Grand Theft Auto VI makes the same pipeline from its ordinary description, which we already translate. So they should keep failing. This PR names them, sets out to null on failure (asked for in #829), and records why in the code.

Evidence (GTA VI 1.0.2.1)

Both take (desc, IID_ID3D12PipelineState, out). The description is the root signature, then sections like the FSPX ones #2396 reads: a register packet, a second section, then code and metadata per stage.

  • Graphics, 0x1c8: a background job (title+0x24774c0) calls it once per cache entry and keeps the successes in a map keyed by hash. The pipeline builder (title+0x2479760) looks there first (title+0x2479f40). On a miss it builds the stream description and calls 0x2b0 (create_stream).
  • Compute, 0x218: title+0x247fd30 calls it through title+0x2480050. On null it calls 0x1f0 (create_compute_x) with the ordinary description.
  • The title calls 0x1c8 over 16,000 times a run and 0x218 over 2,000 times. Every failure is covered by the fallback.

This is why #2396 regresses rendering. Answering 0x218 swaps pipelines we translate for native-only ones that do not translate (an in-game run with it: dropped draws per frame went from 82 to 1,440, and 328 compute shaders failed). Answering S_OK without an object crashed the title (#518).

Tests

  • device::tests::precompiled_pipelines_fail_with_no_object, plus the rest of device::: 9 passed. victory-gpu tests cross-built for x86_64-pc-windows-msvc, run under Proton on an RX 9070 XT.
  • victory diag build, one run into the world: the method not implemented warnings for these slots are gone. The title sees the same E_NOTIMPL as before, so nothing else changes.
  • cargo xtask policy: ok.

No game data used.

<!-- greyfinch-sync:Marvisak/VIctory:issue:5508467049 --> Imported from [Marvisak/VIctory](https://github.com/Marvisak/VIctory/pull/3163). Originally posted by [arogan178](https://github.com/arogan178) on 2026-11-26T10:39:39Z. --- Device slots 0x1c8 and 0x218 load pipelines from the title's cache of precompiled native code. When they fail, Grand Theft Auto VI makes the same pipeline from its ordinary description, which we already translate. So they should keep failing. This PR names them, sets `out` to null on failure (asked for in #829), and records why in the code. ## Evidence (GTA VI 1.0.2.1) Both take `(desc, IID_ID3D12PipelineState, out)`. The description is the root signature, then sections like the FSPX ones #2396 reads: a register packet, a second section, then code and metadata per stage. - **Graphics, 0x1c8:** a background job (title+0x24774c0) calls it once per cache entry and keeps the successes in a map keyed by hash. The pipeline builder (title+0x2479760) looks there first (title+0x2479f40). On a miss it builds the stream description and calls 0x2b0 (`create_stream`). - **Compute, 0x218:** title+0x247fd30 calls it through title+0x2480050. On null it calls 0x1f0 (`create_compute_x`) with the ordinary description. - The title calls 0x1c8 over 16,000 times a run and 0x218 over 2,000 times. Every failure is covered by the fallback. This is why #2396 regresses rendering. Answering 0x218 swaps pipelines we translate for native-only ones that do not translate (an in-game run with it: dropped draws per frame went from 82 to 1,440, and 328 compute shaders failed). Answering `S_OK` without an object crashed the title (#518). ## Tests - `device::tests::precompiled_pipelines_fail_with_no_object`, plus the rest of `device::`: 9 passed. `victory-gpu` tests cross-built for `x86_64-pc-windows-msvc`, run under Proton on an RX 9070 XT. - `victory` diag build, one run into the world: the `method not implemented` warnings for these slots are gone. The title sees the same E_NOTIMPL as before, so nothing else changes. - `cargo xtask policy`: ok. No game data used.
Dukestar69 commented 2026-11-26 10:47:33 +00:00 (Migrated from github.com)

Imported from Marvisak/VIctory. Originally posted by Dukestar69 on 2026-11-26T10:47:33Z.

Review: APPROVED


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

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

Cleanly ensures device slots 0x1c8 and 0x218 fail explicitly and clear the output object pointer.

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

<!-- greyfinch-sync:Marvisak/VIctory:review:6072754874 --> Imported from [Marvisak/VIctory](https://github.com/Marvisak/VIctory/pull/3163#pullrequestreview-6072754874). Originally posted by [Dukestar69](https://github.com/Dukestar69) on 2026-11-26T10:47:33Z. **Review:** APPROVED --- Verified on RTX 5090 against `origin/main` (`63bcca4`): - `cargo test -p victory-gpu --lib device:: -- --test-threads=1`: 9/9 passed (including `precompiled_pipelines_fail_with_no_object`). - `cargo clippy -p victory-gpu --all-targets -- -D warnings`: clean. - `cargo xtask policy`: 191 files ok. Cleanly ensures device slots `0x1c8` and `0x218` fail explicitly and clear the output object pointer. Synthetic tests only (no game files used). AI-assisted (Gemini 4 Neon).
Jackster commented 2026-11-26 23:02:09 +00:00 (Migrated from github.com)

Imported from Marvisak/VIctory. Originally posted by Jackster on 2026-11-26T23:02:09Z.


Windows 11, 63bcca4 + this PR, Radeon RX 7900 XTX:

  • cargo test -p victory-gpu --lib: 232 passed / 0 failed / 1 ignored (unpatched 63bcca4 here: 231).
  • cargo clippy -p victory-gpu --all-targets -- -D warnings: clean.

precompiled_pipelines_fail_with_no_object passes on this device, so the two fail-on-purpose slots really do return no object here. Synthetic only. AI-assisted.

<!-- greyfinch-sync:Marvisak/VIctory:comment:7205197418 --> Imported from [Marvisak/VIctory](https://github.com/Marvisak/VIctory/pull/3163#issuecomment-7205197418). Originally posted by [Jackster](https://github.com/Jackster) on 2026-11-26T23:02:09Z. --- Windows 11, `63bcca4` + this PR, Radeon RX 7900 XTX: - `cargo test -p victory-gpu --lib`: 232 passed / 0 failed / 1 ignored (unpatched `63bcca4` here: 231). - `cargo clippy -p victory-gpu --all-targets -- -D warnings`: clean. `precompiled_pipelines_fail_with_no_object` passes on this device, so the two fail-on-purpose slots really do return no object here. Synthetic only. AI-assisted.
fuzeofficlal commented 2026-11-27 00:35:55 +00:00 (Migrated from github.com)

Imported from Marvisak/VIctory. Originally posted by fuzeofficlal on 2026-11-27T00:35:55Z.

Review: APPROVED


Reviewed and tested ffe09a4e7e55edb805480ea60e3a85994aec7548 on both RTX 5090 and WARP (VICTORY_D3D12_DEBUG=1).

Verified the vtable layout in crates/victory-gpu/src/device.rs:440-449: indices 57 (0x1c8) and 67 (0x218) were previously unassigned slots with no overlap against neighboring entries. precompiled_pipeline (device.rs:384-395) uses the expected 4-argument extern "system" COM ABI, zeroes *out when non-null, and returns E_NOTIMPL.

Checks run:

  • cargo xtask policy — pass
  • cargo clippy --tests -p victory-gpu -- -D warnings (default and --features diagnostics) — clean
  • device::tests — 9/9 pass on RTX 5090 and 9/9 pass on WARP (VICTORY_D3D12_DEBUG=1, 0 Debug Layer errors).

LGTM!

<!-- greyfinch-sync:Marvisak/VIctory:review:6081999019 --> Imported from [Marvisak/VIctory](https://github.com/Marvisak/VIctory/pull/3163#pullrequestreview-6081999019). Originally posted by [fuzeofficlal](https://github.com/fuzeofficlal) on 2026-11-27T00:35:55Z. **Review:** APPROVED --- Reviewed and tested `ffe09a4e7e55edb805480ea60e3a85994aec7548` on both RTX 5090 and WARP (`VICTORY_D3D12_DEBUG=1`). Verified the vtable layout in `crates/victory-gpu/src/device.rs:440-449`: indices 57 (`0x1c8`) and 67 (`0x218`) were previously unassigned slots with no overlap against neighboring entries. `precompiled_pipeline` (`device.rs:384-395`) uses the expected 4-argument `extern "system"` COM ABI, zeroes `*out` when non-null, and returns `E_NOTIMPL`. Checks run: - `cargo xtask policy` — pass - `cargo clippy --tests -p victory-gpu -- -D warnings` (default and `--features diagnostics`) — clean - `device::tests` — 9/9 pass on RTX 5090 and 9/9 pass on WARP (`VICTORY_D3D12_DEBUG=1`, 0 Debug Layer errors). LGTM!
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/3163:upstream-pr/3163'
git switch 'upstream-pr/3163'

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