GPU tests: verify a synthetic frame through PresentX #1143

Open
Doffi4 wants to merge 3 commits from upstream-pr/1143 into main
Doffi4 commented 2026-11-24 16:11:13 +00:00 (Migrated from github.com)

Imported from Marvisak/VIctory. Originally posted by Doffi4 on 2026-11-24T16:11:13Z.


Adds a self-contained opt-in Windows D3D12.X smoke test based on the findings in #1131.

The fixture generates asset-free synthetic Xbox-style vertex and pixel shader containers in memory. It uses the normal pipeline stream and worker, clears and submits one target, then resets the list and draws a full-screen triangle. The first two frames are 384×216. It then presents a 320×180 draw and returns to the original 384×216 target with a distinct blue clear, verifying fresh content after both resizes. All four frames go through PresentX. The test checks all RGBA pixels in the actual DXGI back buffers after the copy, checks the buffer rotation, and requires S_OK from DXGI Present.

The test needs an interactive Windows desktop and is ignored by default. Adapter selection and back-buffer instrumentation are compiled only into diagnostics test builds. No external compiler or game files are needed.

cargo test --locked -p victory-gpu --features diagnostics synthetic_presentx -- --ignored --nocapture

AI-assisted testing

  • Windows 11 25H2 x64, Rust 1.98.1 MSVC, debug + diagnostics.
  • Radeon 780M (32.0.32029.2010), RTX 5060 Laptop (32.0.16.2101), WARP: 3 passes, zero skips or failures across the explicit runs. Four frames on each adapter. Every pixel matched at 384×216 (82,944 pixels) and 320×180 (57,600 pixels).
  • Regular diagnostics library suite: 53 passed, 2 ignored, 0 failed. Package Clippy with all features and targets and staged asset policy passed.
  • The test checks swap-chain content and DXGI return status. Desktop scanout, menus and world entry are outside its scope.
<!-- greyfinch-sync:Marvisak/VIctory:issue:6586181926 --> Imported from [Marvisak/VIctory](https://github.com/Marvisak/VIctory/pull/1143). Originally posted by [Doffi4](https://github.com/Doffi4) on 2026-11-24T16:11:13Z. --- Adds a self-contained opt-in Windows D3D12.X smoke test based on the findings in #1131. The fixture generates asset-free synthetic Xbox-style vertex and pixel shader containers in memory. It uses the normal pipeline stream and worker, clears and submits one target, then resets the list and draws a full-screen triangle. The first two frames are 384×216. It then presents a 320×180 draw and returns to the original 384×216 target with a distinct blue clear, verifying fresh content after both resizes. All four frames go through PresentX. The test checks all RGBA pixels in the actual DXGI back buffers after the copy, checks the buffer rotation, and requires S_OK from DXGI Present. The test needs an interactive Windows desktop and is ignored by default. Adapter selection and back-buffer instrumentation are compiled only into diagnostics test builds. No external compiler or game files are needed. ```powershell cargo test --locked -p victory-gpu --features diagnostics synthetic_presentx -- --ignored --nocapture ``` ### AI-assisted testing - Windows 11 25H2 x64, Rust 1.98.1 MSVC, debug + diagnostics. - Radeon 780M (32.0.32029.2010), RTX 5060 Laptop (32.0.16.2101), WARP: 3 passes, zero skips or failures across the explicit runs. Four frames on each adapter. Every pixel matched at 384×216 (82,944 pixels) and 320×180 (57,600 pixels). - Regular diagnostics library suite: 53 passed, 2 ignored, 0 failed. Package Clippy with all features and targets and staged asset policy passed. - The test checks swap-chain content and DXGI return status. Desktop scanout, menus and world entry are outside its scope.
Doffi4 commented 2026-11-24 17:04:21 +00:00 (Migrated from github.com)

Imported from Marvisak/VIctory. Originally posted by Doffi4 on 2026-11-24T16:18:02Z.


AI-assisted testing follow-up: the smoke test now presents two frames at 384×216, then presents a 320×180 target through the same queue and swap chain. The third present requires DXGI S_OK, the new back-buffer dimensions, all 57,600 RGBA pixels matching the expected triangle color, and buffer rotation restarting after ResizeBuffers.

Passed on Radeon 780M (32.0.32029.2010), RTX 5060 Laptop (32.0.16.2101), and WARP on Windows 11 25H2 x64, debug + diagnostics: 3 pass, 0 skip, 0 fail. Clippy and the staged asset policy passed.

<!-- greyfinch-sync:Marvisak/VIctory:comment:7137437971 --> Imported from [Marvisak/VIctory](https://github.com/Marvisak/VIctory/pull/1143#issuecomment-7137437971). Originally posted by [Doffi4](https://github.com/Doffi4) on 2026-11-24T16:18:02Z. --- AI-assisted testing follow-up: the smoke test now presents two frames at 384×216, then presents a 320×180 target through the same queue and swap chain. The third present requires DXGI S_OK, the new back-buffer dimensions, all 57,600 RGBA pixels matching the expected triangle color, and buffer rotation restarting after ResizeBuffers. Passed on Radeon 780M (32.0.32029.2010), RTX 5060 Laptop (32.0.16.2101), and WARP on Windows 11 25H2 x64, debug + diagnostics: 3 pass, 0 skip, 0 fail. Clippy and the staged asset policy passed.
MichaelSmithAI commented 2026-11-24 17:04:36 +00:00 (Migrated from github.com)

Imported from Marvisak/VIctory. Originally posted by MichaelSmithAI on 2026-11-24T16:37:01Z.


We used the back-buffer readback approach from this PR to check the single-plane fallback from #841 on an RTX 4090 under Wine/GE 3.2. The test used synthetic targets on the fallback branch (d723113) with test-only instrumentation. Its usual single-plane capture samples the source texture, so we added a read of the current DXGI back buffer immediately after the copy.

With a black 3840×2160 primary and a completed red 2560×1440 fallback available, frame 4 put [255, 0, 0, 255] in every pixel of back buffer 1 at 2560×1440. Presenting the same primary again, after the fallback had been consumed, put [0, 0, 0, 255] in every pixel of back buffer 0 at 3840×2160. Both DXGI Present calls returned S_OK.

That confirms the fallback selection reached the swap chain across both resizes. Identifying the pass that should produce the title’s 4K image still needs a title capture. The fixture ends at the swap chain and does not measure desktop scanout.

<!-- greyfinch-sync:Marvisak/VIctory:comment:7137944285 --> Imported from [Marvisak/VIctory](https://github.com/Marvisak/VIctory/pull/1143#issuecomment-7137944285). Originally posted by [MichaelSmithAI](https://github.com/MichaelSmithAI) on 2026-11-24T16:37:01Z. --- We used the back-buffer readback approach from this PR to check the single-plane fallback from #841 on an RTX 4090 under Wine/GE 3.2. The test used synthetic targets on the fallback branch (`d723113`) with test-only instrumentation. Its usual single-plane capture samples the source texture, so we added a read of the current DXGI back buffer immediately after the copy. With a black 3840×2160 primary and a completed red 2560×1440 fallback available, frame 4 put [255, 0, 0, 255] in every pixel of back buffer 1 at 2560×1440. Presenting the same primary again, after the fallback had been consumed, put [0, 0, 0, 255] in every pixel of back buffer 0 at 3840×2160. Both DXGI Present calls returned S_OK. That confirms the fallback selection reached the swap chain across both resizes. Identifying the pass that should produce the title’s 4K image still needs a title capture. The fixture ends at the swap chain and does not measure desktop scanout.
DoubleD17 commented 2026-11-24 18:03:58 +00:00 (Migrated from github.com)

Imported from Marvisak/VIctory. Originally posted by DoubleD17 on 2026-11-24T17:39:42Z.

Review: COMMENTED


On 69a49fa, frames 2 and 3 draw with the same pipeline and expect the same uniform green. Frame 3 checks the new 320x180 dimensions and distinguishes the draw from the magenta clear. In a CPU check of the size and RGBA assertions, uniform green at 320x180 satisfied the frame 3 checks regardless of which draw produced it. The controls rejected the old 384x216 size and the magenta clear, and frame 4 rejected green because it expects blue. Could the frame 3 draw use its own color so the readback distinguishes it from frame 2? This checks the assertions. I did not run D3D12 or observe stale content in PresentX.

AI-assisted.

<!-- greyfinch-sync:Marvisak/VIctory:review:6044347127 --> Imported from [Marvisak/VIctory](https://github.com/Marvisak/VIctory/pull/1143#pullrequestreview-6044347127). Originally posted by [DoubleD17](https://github.com/DoubleD17) on 2026-11-24T17:39:42Z. **Review:** COMMENTED --- On `69a49fa`, frames 2 and 3 draw with the same pipeline and expect the same uniform green. Frame 3 checks the new 320x180 dimensions and distinguishes the draw from the magenta clear. In a CPU check of the size and RGBA assertions, uniform green at 320x180 satisfied the frame 3 checks regardless of which draw produced it. The controls rejected the old 384x216 size and the magenta clear, and frame 4 rejected green because it expects blue. Could the frame 3 draw use its own color so the readback distinguishes it from frame 2? This checks the assertions. I did not run D3D12 or observe stale content in PresentX. AI-assisted.
Zipettte commented 2026-11-24 18:06:14 +00:00 (Migrated from github.com)

Imported from Marvisak/VIctory. Originally posted by Zipettte on 2026-11-24T18:01:21Z.


Tested on AMD Radeon RX 7700 XT (RDNA3, gfx1101), driver 32.0.32029.2010, Windows 11, Rust 1.98.1 MSVC at 69a49fa: cargo test -p victory-gpu passes, 50 passed / 0 failed. Workspace baseline on main (ffe310e) is green on the same machine (342 passed).

Tested with AI assistance (Claude).

<!-- greyfinch-sync:Marvisak/VIctory:comment:7140043094 --> Imported from [Marvisak/VIctory](https://github.com/Marvisak/VIctory/pull/1143#issuecomment-7140043094). Originally posted by [Zipettte](https://github.com/Zipettte) on 2026-11-24T18:01:21Z. --- Tested on AMD Radeon RX 7700 XT (RDNA3, gfx1101), driver 32.0.32029.2010, Windows 11, Rust 1.98.1 MSVC at 69a49fa: `cargo test -p victory-gpu` passes, 50 passed / 0 failed. Workspace baseline on main (ffe310e) is green on the same machine (342 passed). _Tested with AI assistance (Claude)._
Marvisak commented 2026-11-25 02:05:50 +00:00 (Migrated from github.com)

Imported from Marvisak/VIctory. Originally posted by Marvisak on 2026-11-25T01:17:31Z.


Automated triage for the maintainers.

Needs rebase. This pull request conflicts with main (conflicting: crates/victory-gpu/src/host.rs). It will be reviewed once it is rebased onto the current main.


Generated by Claude Code

<!-- greyfinch-sync:Marvisak/VIctory:comment:7149397949 --> Imported from [Marvisak/VIctory](https://github.com/Marvisak/VIctory/pull/1143#issuecomment-7149397949). Originally posted by [Marvisak](https://github.com/Marvisak) on 2026-11-25T01:17:31Z. --- <!-- victory-triage v1 head=69a49fa212056be7d6fb2d965cfbc42e5b34e052 verdict=needs-rebase at=2026-11-25T01:17:30Z --> Automated triage for the maintainers. **Needs rebase.** This pull request conflicts with `main` (conflicting: `crates/victory-gpu/src/host.rs`). It will be reviewed once it is rebased onto the current `main`. --- _Generated by [Claude Code](https://claude.ai/code)_
passerbyyhx commented 2026-11-25 21:03:03 +00:00 (Migrated from github.com)

Imported from Marvisak/VIctory. Originally posted by passerbyyhx on 2026-11-25T20:11:44Z.


I strengthened the resize check and ran it on a GeForce RTX 4090 Laptop GPU (621.14). Frame 3 now has a 16×8 red corner on the 320×180 green back buffer. All four frames passed on two runs. When I disabled just the corner, the size still matched and the test failed at (0,0) with green instead of red. The test-only change is in Doffi4/VIctory#1, based on 69a49fa.

Code and hardware testing assisted by Codex.

<!-- greyfinch-sync:Marvisak/VIctory:comment:7173318716 --> Imported from [Marvisak/VIctory](https://github.com/Marvisak/VIctory/pull/1143#issuecomment-7173318716). Originally posted by [passerbyyhx](https://github.com/passerbyyhx) on 2026-11-25T20:11:44Z. --- I strengthened the resize check and ran it on a GeForce RTX 4090 Laptop GPU (621.14). Frame 3 now has a 16×8 red corner on the 320×180 green back buffer. All four frames passed on two runs. When I disabled just the corner, the size still matched and the test failed at (0,0) with green instead of red. The test-only change is in [Doffi4/VIctory#1](https://github.com/Doffi4/VIctory/pull/1), based on `69a49fa`. Code and hardware testing assisted by Codex.
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/1143:upstream-pr/1143'
git switch 'upstream-pr/1143'

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