GPU: check_feature_support features 0 (D3D12_OPTIONS), 1 (ARCHITECTURE), 4 (MULTISAMPLE) have no unit tests #869
Loading…
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Imported from Marvisak/VIctory. Originally posted by kss306 on 2026-11-24T13:00:27Z.
check_feature_supportincrates/victory-gpu/src/device.rsimplements five feature IDs but only feature 2 (FEATURE_LEVELS) has a unit test. Features 0 (D3D12_OPTIONS), 1 (ARCHITECTURE), and 4 (MULTISAMPLE) are implemented and return values that titles read to decide which GPU features to enable — but no assertion verifies any of them.Untested features
Feature 0 — D3D12_OPTIONS (
device.rs, ~line 230):This 16-word array advertises RDNA2 capabilities. A silent edit to any tier value could make a title disable a valid feature or crash on a capability mismatch.
Feature 1 — ARCHITECTURE (~line 297):
Returns
[node, tile-based=0, unified=1, cache-coherent=1]. Non-zeronodereturnsE_INVALIDARG.Feature 4 — MULTISAMPLE (~line 316):
Quality level count: 1 for sample counts 1/2/4/8, 0 for others. The title queries this before allocating multisampled render targets.
Missing test
The only test,
feature_levels_pick_the_highest_supportedindevice.rstests, callscheck(device, 2, ...)exclusively. The function slots for features 0, 1, and 4 share the same VTable slot as feature 2, confirming they all go throughcheck_feature_support— but only feature 2 is exercised.Suggested tests
Add three test functions in the
#[cfg(test)]block ofdevice.rs:cargo test -p victory-gpu— all three pass without game data or GPU hardware.AI-assisted: found with Kiro (Claude) and independently confirmed by five separate analysis passes without cross-contamination; no hardware run, no game data.
Imported from Marvisak/VIctory. Originally posted by MichaelSmithAI on 2026-11-24T13:08:10Z.
Melissa added a test through guest device slot 0x68 on
ffe310efor all three requested feature IDs. It checks all 16 options words, rejection of the short options buffer with its sentinel intact, the node-0 architecture record and rejection of node 1, and RGBA8_UNORM multisample queries. The Win64 test passed under Wine. Test-only commitFor a separate host comparison on RTX 4090 with Wine/vkd3d-proton 3.2, the RGBA8 quality-level count matched the guest at every sample count probed on both sides: one level for 1, 2, 4 and 8 samples, zero for 16. The guest test also checks zero levels for 3 samples. For architecture and options, the expected values come from VIctory’s guest profile: it reports unified, cache-coherent memory and tiled-resources tier 3, while the host probe reported discrete memory and tier 4. The patch adds coverage for current guest behavior. No console measurement or title run was involved.
Imported from Marvisak/VIctory. Originally posted by pushkarreddyy on 2026-11-24T13:32:11Z.
Claiming this issue.
Technical Analysis & Implementation Plan
In crates/victory-gpu/src/device.rs:
check_feature_support implements features:
Only feature 2 (FEATURE_LEVELS) was previously unit tested.
I am implementing comprehensive unit tests for features 0, 1, 3, and 4 in device.rs, testing both expected capability values and boundary conditions (wrong size, null pointer -> E_INVALIDARG).
Preparing a clean, verified branch with Rust 2024 compliance on fork.
Imported from Marvisak/VIctory. Originally posted by pushkarreddyy on 2026-11-24T13:33:51Z.
Verified Implementation Ready on Fork
Comprehensive unit tests for check_feature_support (features 0, 1, 3, 4) are implemented and available on my fork:
ffe310e)Compare: https://github.com/Marvisak/VIctory/compare/main...pushkarreddyy:VIctory:test/gpu-check-feature-support
Covered Tests & Capabilities (crates/victory-gpu/src/device.rs):
Imported from Marvisak/VIctory. Originally posted by pushkarreddyy on 2026-11-24T14:37:39Z.
Pull request is now open for review: #976.
Imported from Marvisak/VIctory. Originally posted by Marvisak on 2026-11-25T06:50:07Z.
Automated triage for the maintainers.
Confirmed on current
main: the tests incrates/victory-gpu/src/device.rsexercisecheck_feature_supportfor features 2, 7, 8 and 23 (feature_levels_pick_the_highest_supportedand the shader-model/wave tests), but not 0 (options), 1 (architecture) or 4 (multisample). Open PR #958 adds tests for exactly those three; #976 was closed without merging. Review can go to #958.Generated by Claude Code