GPU: unit tests for the OPTIONS, ARCHITECTURE and MULTISAMPLE feature queries #958

Closed
LouisRiverstone wants to merge 1 commit from upstream-pr/958 into main
LouisRiverstone commented 2026-11-24 14:27:27 +00:00 (Migrated from github.com)

Imported from Marvisak/VIctory. Originally posted by LouisRiverstone on 2026-11-24T14:27:27Z.


Fixes #869.

check_feature_support implements five feature ids, but only FEATURE_LEVELS had a test. Titles read the other answers to decide which GPU features to use, so a silent edit would go unnoticed.

Three tests, none touching production code:

  • OPTIONS (0): the 16 words equal OPTIONS, the key tiers are 3/3/3, 40 address bits and heap tier 2, and a wrong size or null pointer gives E_INVALIDARG.
  • ARCHITECTURE (1): node 0 gives not tile-based, unified, cache-coherent; a non-zero node gives E_INVALIDARG.
  • MULTISAMPLE (4): sample counts 1/2/4/8 report one quality level, and 0/3/16 report none.

Verify: cargo test -p victory-gpu feature_

🤖 Generated with Claude Code

<!-- greyfinch-sync:Marvisak/VIctory:issue:6584038846 --> Imported from [Marvisak/VIctory](https://github.com/Marvisak/VIctory/pull/958). Originally posted by [LouisRiverstone](https://github.com/LouisRiverstone) on 2026-11-24T14:27:27Z. --- Fixes #869. `check_feature_support` implements five feature ids, but only `FEATURE_LEVELS` had a test. Titles read the other answers to decide which GPU features to use, so a silent edit would go unnoticed. Three tests, none touching production code: - **OPTIONS (0):** the 16 words equal `OPTIONS`, the key tiers are 3/3/3, 40 address bits and heap tier 2, and a wrong size or null pointer gives `E_INVALIDARG`. - **ARCHITECTURE (1):** node 0 gives not tile-based, unified, cache-coherent; a non-zero node gives `E_INVALIDARG`. - **MULTISAMPLE (4):** sample counts 1/2/4/8 report one quality level, and 0/3/16 report none. **Verify:** `cargo test -p victory-gpu feature_` 🤖 Generated with [Claude Code](https://claude.com/claude-code)
DenRakEiw commented 2026-11-24 15:03:31 +00:00 (Migrated from github.com)

Imported from Marvisak/VIctory. Originally posted by DenRakEiw on 2026-11-24T14:32:54Z.

Review: APPROVED


Tested head 7d0302b (fast-forward on main ffe310e) on Windows 11 x64 (Rust 1.98.1 MSVC) with NVIDIA GeForce RTX 5090 (Blackwell) and WARP (VICTORY_D3D12_WARP=1):

  • cargo test -p victory-gpu (RTX 5090): 53 passed, 0 failed, 1 ignored (including feature_options_report_the_rdna2_tiers, feature_architecture_is_unified_and_coherent, and feature_multisample_has_one_level_for_the_hardware_counts)
  • VICTORY_D3D12_WARP=1 cargo test -p victory-gpu (WARP): 53 passed, 0 failed, 1 ignored
  • cargo clippy -p victory-gpu --all-targets: 0 warnings
  • cargo xtask policy: ok

Clean unit test coverage for check_feature_support features 0, 1, and 4. Approving.

AI-assisted (Gemini 4 Neon).

<!-- greyfinch-sync:Marvisak/VIctory:review:6041141237 --> Imported from [Marvisak/VIctory](https://github.com/Marvisak/VIctory/pull/958#pullrequestreview-6041141237). Originally posted by [DenRakEiw](https://github.com/DenRakEiw) on 2026-11-24T14:32:54Z. **Review:** APPROVED --- Tested head `7d0302b` (fast-forward on `main` `ffe310e`) on Windows 11 x64 (Rust 1.98.1 MSVC) with **NVIDIA GeForce RTX 5090** (Blackwell) and **WARP** (`VICTORY_D3D12_WARP=1`): - `cargo test -p victory-gpu` (RTX 5090): **53 passed, 0 failed, 1 ignored** (including `feature_options_report_the_rdna2_tiers`, `feature_architecture_is_unified_and_coherent`, and `feature_multisample_has_one_level_for_the_hardware_counts`) - `VICTORY_D3D12_WARP=1 cargo test -p victory-gpu` (WARP): **53 passed, 0 failed, 1 ignored** - `cargo clippy -p victory-gpu --all-targets`: **0 warnings** - `cargo xtask policy`: ok Clean unit test coverage for `check_feature_support` features 0, 1, and 4. Approving. AI-assisted (Gemini 4 Neon).
MichaelSmithAI commented 2026-11-24 15:04:09 +00:00 (Migrated from github.com)

Imported from Marvisak/VIctory. Originally posted by MichaelSmithAI on 2026-11-24T14:41:10Z.


On RTX 4090 under Wine/vkd3d-proton 3.2, five focused tests passed with a test-only comparison of the guest device vtable and the live D3D12 device. For RGBA8_UNORM at 8× MSAA, both queries returned one quality level. For BC7_UNORM at 8×, the guest returned one and the host returned zero. The guest FORMAT_SUPPORT query also returned the same flags for both formats, while the host returned different flags.

This confirms the tests capture VIctory’s current guest-visible answers. A positive guest multisample answer alone does not establish host support for that format. The comparison used feature queries only. Texture creation and title use were outside the test.

<!-- greyfinch-sync:Marvisak/VIctory:comment:7134780936 --> Imported from [Marvisak/VIctory](https://github.com/Marvisak/VIctory/pull/958#issuecomment-7134780936). Originally posted by [MichaelSmithAI](https://github.com/MichaelSmithAI) on 2026-11-24T14:41:10Z. --- On RTX 4090 under Wine/vkd3d-proton 3.2, five focused tests passed with a test-only comparison of the guest device vtable and the live D3D12 device. For RGBA8_UNORM at 8× MSAA, both queries returned one quality level. For BC7_UNORM at 8×, the guest returned one and the host returned zero. The guest FORMAT_SUPPORT query also returned the same flags for both formats, while the host returned different flags. This confirms the tests capture VIctory’s current guest-visible answers. A positive guest multisample answer alone does not establish host support for that format. The comparison used feature queries only. Texture creation and title use were outside the test.
Zipettte commented 2026-11-24 16:05:19 +00:00 (Migrated from github.com)

Imported from Marvisak/VIctory. Originally posted by Zipettte on 2026-11-24T15:41:06Z.


Tested on AMD Radeon RX 7700 XT (RDNA3, gfx1101), driver 32.0.32029.2010, Windows 11, Rust 1.98.1 MSVC at 7d0302b: cargo test -p victory-gpu 52 passed. In the full run frame::tests::waits_end_on_ticks_and_count_frames failed once ([4, 5, 6, 8], a skipped frame), but it passed 5/5 on rerun, and also 5/5 on main. So it looks like the timing flake that #985 targets, not something this PR causes.

Tested with AI assistance (Claude).

<!-- greyfinch-sync:Marvisak/VIctory:comment:7136439119 --> Imported from [Marvisak/VIctory](https://github.com/Marvisak/VIctory/pull/958#issuecomment-7136439119). Originally posted by [Zipettte](https://github.com/Zipettte) on 2026-11-24T15:41:06Z. --- Tested on AMD Radeon RX 7700 XT (RDNA3, gfx1101), driver 32.0.32029.2010, Windows 11, Rust 1.98.1 MSVC at 7d0302b: `cargo test -p victory-gpu` 52 passed. In the full run `frame::tests::waits_end_on_ticks_and_count_frames` failed once (`[4, 5, 6, 8]`, a skipped frame), but it passed 5/5 on rerun, and also 5/5 on main. So it looks like the timing flake that #985 targets, not something this PR causes. _Tested with AI assistance (Claude)._
Marvisak commented 2026-11-25 01:07:55 +00:00 (Migrated from github.com)

Imported from Marvisak/VIctory. Originally posted by Marvisak on 2026-11-25T00:29:37Z.


Automated triage for the maintainers.

The three new tests in crates/victory-gpu/src/device.rs repeat what check_feature_support already does and do not check those answers against a reference. feature_options_report_the_rdna2_tiers compares the output with the same OPTIONS constant the function writes. The architecture test copies the [0, 1, 1] literal. The multisample test copies the matches!(q[1], 1 | 2 | 4 | 8) rule. That rule is a known shortcut: it ignores the format, and the RTX 4090 comparison in this thread shows the host disagreeing for BC7. Fixing it would then require editing this test, so the test does not catch regressions. It only makes intended changes harder.

A test that checks these values against public documentation or the console's real answers would be welcome. As it stands this adds no value, so it is a proposed close. This PR will be closed in 48 hours unless the author pushes a change or a maintainer removes the triage: proposed close label.


Generated by Claude Code

<!-- greyfinch-sync:Marvisak/VIctory:comment:7148565995 --> Imported from [Marvisak/VIctory](https://github.com/Marvisak/VIctory/pull/958#issuecomment-7148565995). Originally posted by [Marvisak](https://github.com/Marvisak) on 2026-11-25T00:29:37Z. --- <!-- victory-triage v1 head=56a78f41eaacf33b5565466d284511247b8c1da1 verdict=proposed-close at=2026-11-25T02:20:29Z --> Automated triage for the maintainers. The three new tests in `crates/victory-gpu/src/device.rs` repeat what `check_feature_support` already does and do not check those answers against a reference. `feature_options_report_the_rdna2_tiers` compares the output with the same `OPTIONS` constant the function writes. The architecture test copies the `[0, 1, 1]` literal. The multisample test copies the `matches!(q[1], 1 | 2 | 4 | 8)` rule. That rule is a known shortcut: it ignores the format, and the RTX 4090 comparison in this thread shows the host disagreeing for BC7. Fixing it would then require editing this test, so the test does not catch regressions. It only makes intended changes harder. A test that checks these values against public documentation or the console's real answers would be welcome. As it stands this adds no value, so it is a proposed close. This PR will be closed in 48 hours unless the author pushes a change or a maintainer removes the `triage: proposed close` label. --- _Generated by [Claude Code](https://claude.ai/code)_
upstream-sync closed this pull request 2026-11-25 16:05:52 +00:00

Pull request closed

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!958
No description provided.