Tests: the conformance title's GPU frame, cargo conformance and cargo demo (with a stress scale), on Windows and macOS #3019

Open
0xkn0wh3r3 wants to merge 11 commits from upstream-pr/3021 into main
0xkn0wh3r3 commented 2026-11-26 03:35:15 +00:00 (Migrated from github.com)

Imported from Marvisak/VIctory. Originally posted by 0xkn0wh3r3 on 2026-11-26T03:35:15Z.


Depends on #2057 (the conformance title). This branch is built on #2057's branch, so its 5 commits show here until it merges; the 6 commits after 1434e72 are this PR's.

This adds the conformance title's GPU frame, plus one command each to run the acceptance suite and to show the frame as a demo, on Windows and on macOS. The demo can also scale up the work it gives VIctory, as a stress test of the translation layer.

What's here

  • The GPU frame (two commits from tests/gpu-frame-workload, which never had a PR of its own). The conformance title draws a scene through VIctory's console D3D12 with hand-assembled GFX10 shaders, and the test compares it with the same scene drawn natively on WARP from HLSL. That's 37 checks, on top of #2057's 152.
  • cargo conformance (cargo xtask conformance): the whole suite. --window <seconds> then shows the GPU frame, animated, for that long.
  • cargo demo (cargo xtask demo): only the GPU frame, in a window until it is closed, with VIctory's overlay (frame rate and frame times) if #2171 is in. Options:
    • --resolution 720p|1080p|1440p|4k|<width>x<height> (default 1440p). The checks still run on the 512x288 frame; the window's frames are drawn at their own size.
    • --scale <n>: each step past 1 adds 64 small objects, each a draw whose constants are written into title memory and whose view is made in the shader-visible heap that frame, plus one more submission that binds the pass again. It stresses VIctory's per-draw, per-descriptor and per-submission work rather than the GPU. The title prints the frame rate and the work per frame every 5 seconds.
    • --seconds <n>, --no-overlay, --debug, and --dump <dir>, which saves the checked frames and the window's last frame as PPM images.
  • Terrain in the window's frames: ridged Perlin noise around the ground, so the demo is worth looking at. It's a mesh of the shared geometry drawn only in the window; the checked frame and the WARP reference are unchanged.
  • macOS: on a Mac, both commands cross-compile the title and the test with cargo-xwin and run them under CrossOver (Wine, Apple's D3DMetal for D3D12, Rosetta 2) in a bottle of their own. On Windows they run cargo test natively. VICTORY_CONFORMANCE_DLL lets the test use a title DLL built beforehand, since Wine can't run the host's cargo.

Testing

Run on an M5 Max under CrossOver, from this branch, which is main plus #2057 only:

  • cargo conformance: passes. All 189 checks run; the 5 divergences #2057's KNOWN lists are reported, and the WARP comparison is skipped because D3DMetal has no WARP adapter.
  • cargo demo: runs until its window is closed, then exits cleanly. At 1440p, scales 1 to 16 hold the display's 60 fps (up to 965 draws and 16 submissions a frame). Scale 64 (4,037 draws, 64 submissions) takes about 42 ms a frame on demo.
  • Under D3DMetal, timestamp queries and OpenExistingHeapFromAddress1 aren't supported, so the overlay's GPU-time readings are empty and title memory is copied rather than used in place.
  • Not run on Windows yet: there the commands just run cargo test -p victory-hle --test conformance with the same variables.
<!-- greyfinch-sync:Marvisak/VIctory:issue:6618932800 --> Imported from [Marvisak/VIctory](https://github.com/Marvisak/VIctory/pull/3021). Originally posted by [0xkn0wh3r3](https://github.com/0xkn0wh3r3) on 2026-11-26T03:35:15Z. --- **Depends on #2057** (the conformance title). This branch is built on #2057's branch, so its 5 commits show here until it merges; the 6 commits after `1434e72` are this PR's. This adds the conformance title's GPU frame, plus one command each to run the acceptance suite and to show the frame as a demo, on Windows and on macOS. The demo can also scale up the work it gives VIctory, as a stress test of the translation layer. ## What's here - **The GPU frame** (two commits from `tests/gpu-frame-workload`, which never had a PR of its own). The conformance title draws a scene through VIctory's console D3D12 with hand-assembled GFX10 shaders, and the test compares it with the same scene drawn natively on WARP from HLSL. That's 37 checks, on top of #2057's 152. - **`cargo conformance`** (`cargo xtask conformance`): the whole suite. `--window <seconds>` then shows the GPU frame, animated, for that long. - **`cargo demo`** (`cargo xtask demo`): only the GPU frame, in a window until it is closed, with VIctory's overlay (frame rate and frame times) if #2171 is in. Options: - `--resolution 720p|1080p|1440p|4k|<width>x<height>` (default 1440p). The checks still run on the 512x288 frame; the window's frames are drawn at their own size. - `--scale <n>`: each step past 1 adds 64 small objects, each a draw whose constants are written into title memory and whose view is made in the shader-visible heap that frame, plus one more submission that binds the pass again. It stresses VIctory's per-draw, per-descriptor and per-submission work rather than the GPU. The title prints the frame rate and the work per frame every 5 seconds. - `--seconds <n>`, `--no-overlay`, `--debug`, and `--dump <dir>`, which saves the checked frames and the window's last frame as PPM images. - **Terrain in the window's frames**: ridged Perlin noise around the ground, so the demo is worth looking at. It's a mesh of the shared geometry drawn only in the window; the checked frame and the WARP reference are unchanged. - **macOS**: on a Mac, both commands cross-compile the title and the test with `cargo-xwin` and run them under CrossOver (Wine, Apple's D3DMetal for D3D12, Rosetta 2) in a bottle of their own. On Windows they run `cargo test` natively. `VICTORY_CONFORMANCE_DLL` lets the test use a title DLL built beforehand, since Wine can't run the host's `cargo`. ## Testing Run on an M5 Max under CrossOver, from this branch, which is `main` plus #2057 only: - `cargo conformance`: passes. All 189 checks run; the 5 divergences #2057's `KNOWN` lists are reported, and the WARP comparison is skipped because D3DMetal has no WARP adapter. - `cargo demo`: runs until its window is closed, then exits cleanly. At 1440p, scales 1 to 16 hold the display's 60 fps (up to 965 draws and 16 submissions a frame). Scale 64 (4,037 draws, 64 submissions) takes about 42 ms a frame on `demo`. - Under D3DMetal, timestamp queries and `OpenExistingHeapFromAddress1` aren't supported, so the overlay's GPU-time readings are empty and title memory is copied rather than used in place. - Not run on Windows yet: there the commands just run `cargo test -p victory-hle --test conformance` with the same variables.
pickles976 commented 2026-11-26 04:06:29 +00:00 (Migrated from github.com)

Imported from Marvisak/VIctory. Originally posted by pickles976 on 2026-11-26T03:58:05Z.


Independent Linux/Wine verification on NVIDIA GeForce RTX 4060 Laptop GPU (8 GiB), 16 GiB RAM, Wine 11.0 + vkd3d-proton 3.2.0 + DXVK 3.1.1, exact clean PR head 453700e9c3fa0eeeff00dad167ad87f4cb55beb7:

  • Cross-built the fixture DLL and victory-hle --test conformance for Windows MSVC, then ran the actual physical NVIDIA adapter under Wine at VICTORY_CONFORMANCE_WINDOW=12, VICTORY_CONFORMANCE_SIZE=1280x720, VICTORY_CONFORMANCE_SCALE=1, dxgi.hideNvidiaGpu = False. Both fixture and harness were optimized/release builds. The run completed 1/1 test, 37/37 TAP checks, with an actual nonblack rendered window: mountains, checkerboard ground, two cubes and pyramid. The 12-second present trial completed 89 frames (reported 6.7 then 7.8 FPS at five draws/one submission per frame; full-window average 138.21 ms). The debug build separately passed 37/37, 41 frames in 8 seconds (~5.2 FPS). Guarded scope MemoryMax=9G, MemorySwapMax=512M, global MemAvailable >=2 GiB, NVIDIA GPU used <=6 GiB, disk >=10 GiB; no safety stop (minimum available 12,359 MiB, max GPU used 219 MiB). Local release log .compat-runtime/logs/verify-pr3021-wine-rtx4060-release-gpu-frame.log, capture .compat-runtime/cap-pr3021-release/window.ppm (synthetic scene, not retail gameplay).
  • Reference identity caveat: DXVK explicitly logs EnumWarpAdapter: WARP not supported, returning first hardware adapter, and then selects this RTX 4060 Laptop. Thus the passing check labeled the frame matches WARP's drawing actually compares VIctory's output with a native D3D12 rendering on the hardware adapter, not with WARP, on this Wine stack. Could the harness inspect the returned adapter's software flag and label/report the reference accurately (or skip only the WARP-specific assertion) rather than silently claim WARP coverage?
  • Performance caveat / suggested next experiment: The present loop in tests/fixtures/conformance/src/gpu.rs calls submit() every frame, and submit() waits synchronously for a fence before the next PresentX (single allocator/constant buffer). The 7.8 FPS is a real measurement of this demo on this stack, not a retail-title FPS estimate or proof the engine cannot reach 30 FPS. A bounded ring of frame resources and in-flight fences, waiting only before reuse, would make cargo demo more representative of title frame pacing; a release 720p run after that change would separate this forced serialization from backend GPU time.

This synthetic test exercises console-facing root signatures and present successfully in VIctory; it does not remove XCL's separate native-vtable assertion or the retail game's 16 GiB loading blocker.

<!-- greyfinch-sync:Marvisak/VIctory:comment:7182178099 --> Imported from [Marvisak/VIctory](https://github.com/Marvisak/VIctory/pull/3021#issuecomment-7182178099). Originally posted by [pickles976](https://github.com/pickles976) on 2026-11-26T03:58:05Z. --- Independent Linux/Wine verification on **NVIDIA GeForce RTX 4060 Laptop GPU (8 GiB), 16 GiB RAM**, Wine 11.0 + vkd3d-proton 3.2.0 + DXVK 3.1.1, exact clean PR head `453700e9c3fa0eeeff00dad167ad87f4cb55beb7`: - Cross-built the fixture DLL and `victory-hle --test conformance` for Windows MSVC, then ran the **actual physical NVIDIA adapter** under Wine at `VICTORY_CONFORMANCE_WINDOW=12`, `VICTORY_CONFORMANCE_SIZE=1280x720`, `VICTORY_CONFORMANCE_SCALE=1`, `dxgi.hideNvidiaGpu = False`. Both fixture and harness were optimized/release builds. The run completed **1/1 test, 37/37 TAP checks**, with an actual nonblack rendered window: mountains, checkerboard ground, two cubes and pyramid. The 12-second present trial completed 89 frames (reported **6.7 then 7.8 FPS** at five draws/one submission per frame; full-window average 138.21 ms). The debug build separately passed 37/37, 41 frames in 8 seconds (~5.2 FPS). Guarded scope `MemoryMax=9G`, `MemorySwapMax=512M`, global MemAvailable >=2 GiB, NVIDIA GPU used <=6 GiB, disk >=10 GiB; no safety stop (minimum available 12,359 MiB, max GPU used 219 MiB). Local release log `.compat-runtime/logs/verify-pr3021-wine-rtx4060-release-gpu-frame.log`, capture `.compat-runtime/cap-pr3021-release/window.ppm` (synthetic scene, **not retail gameplay**). - **Reference identity caveat:** DXVK explicitly logs `EnumWarpAdapter: WARP not supported, returning first hardware adapter`, and then selects this RTX 4060 Laptop. Thus the passing check labeled `the frame matches WARP's drawing` actually compares VIctory's output with a native D3D12 rendering on the **hardware adapter**, not with WARP, on this Wine stack. Could the harness inspect the returned adapter's software flag and label/report the reference accurately (or skip only the WARP-specific assertion) rather than silently claim WARP coverage? - **Performance caveat / suggested next experiment:** The present loop in `tests/fixtures/conformance/src/gpu.rs` calls `submit()` every frame, and `submit()` waits synchronously for a fence before the next `PresentX` (single allocator/constant buffer). The 7.8 FPS is a real measurement of this demo on this stack, **not a retail-title FPS estimate or proof the engine cannot reach 30 FPS**. A bounded ring of frame resources and in-flight fences, waiting only before reuse, would make `cargo demo` more representative of title frame pacing; a release 720p run after that change would separate this forced serialization from backend GPU time. This synthetic test exercises console-facing root signatures and present successfully in VIctory; it does not remove XCL's separate native-vtable assertion or the retail game's 16 GiB loading blocker.
kotekompotek commented 2026-11-26 05:03:53 +00:00 (Migrated from github.com)

Imported from Marvisak/VIctory. Originally posted by kotekompotek on 2026-11-26T04:43:48Z.

Review: APPROVED


LGTM — the first real end-to-end coverage: fixture built to CARGO_TARGET_TMPDIR (repo stays clean), loaded through the genuine prepare→load→bind_imports→attach path with mounted drives, and missing-import assertion means any HLE gap fails loudly. The KNOWN list with doc citations + fail-on-pass is the right way to track divergence. WARP comparison degrades gracefully. Skimmed the fixture modules — synthetic hand-assembled GFX10 programs and doc-derived checks only, no game data.

<!-- greyfinch-sync:Marvisak/VIctory:review:6068657109 --> Imported from [Marvisak/VIctory](https://github.com/Marvisak/VIctory/pull/3021#pullrequestreview-6068657109). Originally posted by [kotekompotek](https://github.com/kotekompotek) on 2026-11-26T04:43:48Z. **Review:** APPROVED --- LGTM — the first real end-to-end coverage: fixture built to CARGO_TARGET_TMPDIR (repo stays clean), loaded through the genuine prepare→load→bind_imports→attach path with mounted drives, and missing-import assertion means any HLE gap fails loudly. The KNOWN list with doc citations + fail-on-pass is the right way to track divergence. WARP comparison degrades gracefully. Skimmed the fixture modules — synthetic hand-assembled GFX10 programs and doc-derived checks only, no game data.
Marvisak commented 2026-11-26 07:01:46 +00:00 (Migrated from github.com)

Imported from Marvisak/VIctory. Originally posted by Marvisak on 2026-11-26T06:17:41Z.


Automated triage for the maintainers.

Thanks for the reply. The head is unchanged, so the verdict stays needs work; needs the maintainer's decision: build aliases, a new fixture crate with its own lockfile, xtask commands that run other programs, and the macOS/CrossOver runner. The three-way split you outline, with short README text in each, would make this reviewable once #2057 lands.


Generated by Claude Code

<!-- greyfinch-sync:Marvisak/VIctory:comment:7184286855 --> Imported from [Marvisak/VIctory](https://github.com/Marvisak/VIctory/pull/3021#issuecomment-7184286855). Originally posted by [Marvisak](https://github.com/Marvisak) on 2026-11-26T06:17:41Z. --- <!-- victory-triage v1 head=453700e9c3fa0eeeff00dad167ad87f4cb55beb7 verdict=needs-work at=2026-11-26T07:20:04Z --> Automated triage for the maintainers. Thanks for the reply. The head is unchanged, so the verdict stays **needs work; needs the maintainer's decision**: build aliases, a new fixture crate with its own lockfile, xtask commands that run other programs, and the macOS/CrossOver runner. The three-way split you outline, with short README text in each, would make this reviewable once #2057 lands. --- _Generated by [Claude Code](https://claude.ai/code)_
0xkn0wh3r3 commented 2026-11-26 07:01:53 +00:00 (Migrated from github.com)

Imported from Marvisak/VIctory. Originally posted by 0xkn0wh3r3 on 2026-11-26T06:43:35Z.


Understood. Most of this is your decision: the build aliases, the fixture crate and its dependencies, the xtask commands that run other programs, the macOS/CrossOver runner and the README text. Splitting it as you suggest makes sense:

  1. The GPU-frame conformance check, once #2057 lands.
  2. The xtask commands.
  3. The macOS runner and the stress/terrain demo, as a separate decision.

The README text would shrink to a few lines in each piece.

<!-- greyfinch-sync:Marvisak/VIctory:comment:7184719685 --> Imported from [Marvisak/VIctory](https://github.com/Marvisak/VIctory/pull/3021#issuecomment-7184719685). Originally posted by [0xkn0wh3r3](https://github.com/0xkn0wh3r3) on 2026-11-26T06:43:35Z. --- Understood. Most of this is your decision: the build aliases, the fixture crate and its dependencies, the xtask commands that run other programs, the macOS/CrossOver runner and the README text. Splitting it as you suggest makes sense: 1. The GPU-frame conformance check, once #2057 lands. 2. The xtask commands. 3. The macOS runner and the stress/terrain demo, as a separate decision. The README text would shrink to a few lines in each piece.
evan-kolberg commented 2026-11-26 14:01:50 +00:00 (Migrated from github.com)

Imported from Marvisak/VIctory. Originally posted by evan-kolberg on 2026-11-26T13:16:27Z.


I ran the generated GPU frame from exact 453700e9c3fa0eeeff00dad167ad87f4cb55beb7 on an M4 Pro with CrossOver 26.3.0.39832 and D3DMetal 4.0 beta 3. A test-only wrapper runs the checked 512 × 288 frame first, then draws and reads back the requested larger size offscreen in the same process. The stock and candidate hosts used the same guest DLL.

Requested size Stock linear compute buffer HASH-only linear compute buffer
1280 × 720 289 of 720 rows 720 of 720 rows
1920 × 1080 289 of 1080 rows 1080 of 1080 rows

On stock, independent texture copies showed full-height coverage in both the scene color target and the compute output texture. Native translation gave the 512-, 1280-, and 1920-wide compute shaders the same 3,768-byte container size. Reusing the first shader's 512-pixel linear store stride predicts exactly 289 populated buffer rows at both larger sizes.

The sole production change was the Mac fork's existing fix to put an MD5 of the DXIL bitcode in the HASH part. It produced distinct hashes for the three shaders. Both larger scenes then passed full-row coverage and three fenced, byte-identical repeat readbacks. The existing 512 × 288 checks passed in both arms. Mac fix · Exact hash implementation

<!-- greyfinch-sync:Marvisak/VIctory:comment:7193112229 --> Imported from [Marvisak/VIctory](https://github.com/Marvisak/VIctory/pull/3021#issuecomment-7193112229). Originally posted by [evan-kolberg](https://github.com/evan-kolberg) on 2026-11-26T13:16:27Z. --- I ran the generated GPU frame from exact `453700e9c3fa0eeeff00dad167ad87f4cb55beb7` on an M4 Pro with CrossOver 26.3.0.39832 and D3DMetal 4.0 beta 3. A test-only wrapper runs the checked 512 × 288 frame first, then draws and reads back the requested larger size offscreen in the same process. The stock and candidate hosts used the same guest DLL. | Requested size | Stock linear compute buffer | HASH-only linear compute buffer | | --- | ---: | ---: | | 1280 × 720 | 289 of 720 rows | 720 of 720 rows | | 1920 × 1080 | 289 of 1080 rows | 1080 of 1080 rows | On stock, independent texture copies showed full-height coverage in both the scene color target and the compute output texture. Native translation gave the 512-, 1280-, and 1920-wide compute shaders the same 3,768-byte container size. Reusing the first shader's 512-pixel linear store stride predicts exactly 289 populated buffer rows at both larger sizes. The sole production change was the Mac fork's existing fix to put an MD5 of the DXIL bitcode in the `HASH` part. It produced distinct hashes for the three shaders. Both larger scenes then passed full-row coverage and three fenced, byte-identical repeat readbacks. The existing 512 × 288 checks passed in both arms. [Mac fix](https://github.com/pragyaangaur/VIctory-macOS/pull/4) · [Exact hash implementation](https://github.com/pragyaangaur/VIctory-macOS/commit/f59a961c1eaa7f187e99e4773c0169c7df3e1769)
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/3021:upstream-pr/3021'
git switch 'upstream-pr/3021'

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