GPU: match failed feature-level query results #2931

Open
github-bot wants to merge 1 commit from github-bot/gh-2931 into main AGit
Owner

@⁠andrewpozdnakov7-jpg on GitHub · 2026-11-26 00:26 UTC · original
andrewpozdnakov7-jpg:codex2/feature-level-failure → main · +24 −11 · 1 files · 1 commits · open

Summary

Match the D3D12_FEATURE_FEATURE_LEVELS failure results. An empty list returns E_INVALIDARG and leaves MaxSupportedFeatureLevel untouched. A nonempty list with no supported level returns DXGI_ERROR_UNSUPPORTED and writes zero. A successful query still reports the highest requested level within the console's 12_2 ceiling.

Verification

  • On native Windows D3D12 WARP at feature level 11_0, an empty request leaves the sentinel 0x1234. Requests [0] and [0xd000] return DXGI_ERROR_UNSUPPORTED and write zero. A valid mixed request succeeds; [0xb000, 0xb123] returns 0xb123.
  • The same synthetic device-vtable fixture on 63bcca4 observes the wrong empty-list status, a stale output above the ceiling, and success for [0]. It passes all three cases with this change and preserves the success and wrong-size controls. The query structure is documented in Microsoft's feature-level API reference.
  • Eight default device tests and the full app-local WARP GPU suite (246 passed, 1 ignored) pass. Strict GPU Clippy passes in default and all-features configurations.
  • Staged asset policy passed (191 files).
**@⁠andrewpozdnakov7-jpg** on GitHub · 2026-11-26 00:26 UTC · [original](https://github.com/Marvisak/VIctory/pull/2931) `andrewpozdnakov7-jpg:codex2/feature-level-failure` → `main` · +24 −11 · 1 files · 1 commits · open ### Summary Match the `D3D12_FEATURE_FEATURE_LEVELS` failure results. An empty list returns `E_INVALIDARG` and leaves `MaxSupportedFeatureLevel` untouched. A nonempty list with no supported level returns `DXGI_ERROR_UNSUPPORTED` and writes zero. A successful query still reports the highest requested level within the console's 12_2 ceiling. ### Verification - On native Windows D3D12 WARP at feature level 11_0, an empty request leaves the sentinel `0x1234`. Requests `[0]` and `[0xd000]` return `DXGI_ERROR_UNSUPPORTED` and write zero. A valid mixed request succeeds; `[0xb000, 0xb123]` returns `0xb123`. - The same synthetic device-vtable fixture on `63bcca4` observes the wrong empty-list status, a stale output above the ceiling, and success for `[0]`. It passes all three cases with this change and preserves the success and wrong-size controls. The query structure is documented in [Microsoft's feature-level API reference](https://learn.microsoft.com/en-us/windows/win32/api/d3d12/ns-d3d12-d3d12_feature_data_feature_levels). - Eight default device tests and the full app-local WARP GPU suite (246 passed, 1 ignored) pass. Strict GPU Clippy passes in default and all-features configurations. - Staged asset policy passed (191 files).
github-bot locked as GitHub sync and limited conversation to collaborators 2026-11-26 05:17:46 +00:00
Author
Owner

@⁠fuzeofficlal on GitHub · 2026-11-26 00:42 UTC · original

Code review and RTX 5090 + WARP verification at head e15a3d35b560 merged cleanly onto main (63bcca43c6a0):

  • Code review (crates/victory-gpu/src/device.rs:354-373): Returns E_INVALIDARG early without mutating query.highest when query.count == 0 || query.requested.is_null(); otherwise writes the highest requested level <= HIGHEST_FEATURE_LEVEL (0xc200, or 0 if none qualify) and returns DXGI_ERROR_UNSUPPORTED (0x887A0004) when query.highest == 0 (covering both all-above-max like [0xd000] and all-zero [0]), matching native D3D12 CheckFeatureSupport(FEATURE_LEVELS).
  • Verified (Windows 11, NVIDIA RTX 5090 + WARP, VICTORY_D3D12_DEBUG=1, Rust 1.98.1):
    • cargo clippy -p victory-gpu --all-targets --locked -- -D warnings (default + --features diagnostics): 0 warnings; cargo test -p xtask --locked: 6/6 passed
    • device::tests: 8/8 passed on both RTX 5090 and WARP
    • descriptor::host::tests + host::tests + pipeline::host::tests: 31/31 passed on WARP; 30/31 on RTX 5090 (only pre-existing NVIDIA 1M heap-cap baseline dynamic_slots_are_held_until_released)
    • Single-threaded WARP victory-gpu --lib --features diagnostics (skipping present_plane_tests): 245/245 passed, 1 ignored.

Clean and accurate; LGTM.

**@⁠fuzeofficlal** on GitHub · 2026-11-26 00:42 UTC · [original](https://github.com/Marvisak/VIctory/pull/2931#issuecomment-7179037676) Code review and RTX 5090 + WARP verification at head `e15a3d35b560` merged cleanly onto `main` (`63bcca43c6a0`): - **Code review (`crates/victory-gpu/src/device.rs:354-373`)**: Returns `E_INVALIDARG` early without mutating `query.highest` when `query.count == 0 || query.requested.is_null()`; otherwise writes the highest requested level `<= HIGHEST_FEATURE_LEVEL` (`0xc200`, or `0` if none qualify) and returns `DXGI_ERROR_UNSUPPORTED` (`0x887A0004`) when `query.highest == 0` (covering both all-above-max like `[0xd000]` and all-zero `[0]`), matching native D3D12 `CheckFeatureSupport(FEATURE_LEVELS)`. - **Verified (Windows 11, NVIDIA RTX 5090 + WARP, `VICTORY_D3D12_DEBUG=1`, Rust 1.98.1)**: - `cargo clippy -p victory-gpu --all-targets --locked -- -D warnings` (default + `--features diagnostics`): 0 warnings; `cargo test -p xtask --locked`: 6/6 passed - `device::tests`: 8/8 passed on both RTX 5090 and WARP - `descriptor::host::tests` + `host::tests` + `pipeline::host::tests`: 31/31 passed on WARP; 30/31 on RTX 5090 (only pre-existing NVIDIA 1M heap-cap baseline `dynamic_slots_are_held_until_released`) - Single-threaded WARP `victory-gpu --lib --features diagnostics` (skipping `present_plane_tests`): 245/245 passed, 1 ignored. Clean and accurate; LGTM.
Author
Owner

@⁠Marvisak on GitHub · 2026-11-26 04:25 UTC · original

Automated triage for the maintainers.

Needs work. feature_levels in victory-gpu/src/device.rs now returns E_INVALIDARG for an empty request and DXGI_ERROR_UNSUPPORTED (writing 0) when no level is supported. That matches the desktop WARP behaviour measured, but these are the console runtime's return values, and nothing shows the title ever sends such a request, so as it stands this guards paths the title may never reach. Please point to a title call that hits one of these paths, or to the console runtime's documented behaviour, and stop asserting acceptance of non-level values such as 0xb123 unless that is shown.

CI: passing.


Generated by Claude Code

**@⁠Marvisak** on GitHub · 2026-11-26 04:25 UTC · [original](https://github.com/Marvisak/VIctory/pull/2931#issuecomment-7182585009) <!-- victory-triage v1 head=e15a3d35b56025c64f061f2c7a66da9065b5784a verdict=needs-work at=2026-11-26T04:25:32Z --> Automated triage for the maintainers. **Needs work.** `feature_levels` in `victory-gpu/src/device.rs` now returns `E_INVALIDARG` for an empty request and `DXGI_ERROR_UNSUPPORTED` (writing 0) when no level is supported. That matches the desktop WARP behaviour measured, but these are the console runtime's return values, and nothing shows the title ever sends such a request, so as it stands this guards paths the title may never reach. Please point to a title call that hits one of these paths, or to the console runtime's documented behaviour, and stop asserting acceptance of non-level values such as `0xb123` unless that is shown. CI: passing. --- _Generated by [Claude Code](https://claude.ai/code)_
This pull request can be merged automatically.
You are not authorized to merge this pull request.
View command line instructions

Checkout

From your project repository, check out a new branch and test the changes.
git fetch -u origin '+refs/pull/2931/head:github-bot/gh-2931'
git switch 'github-bot/gh-2931'

Merge

Merge the changes and update on Forgejo.
git switch 'main'
git merge --no-ff 'github-bot/gh-2931'
git switch 'github-bot/gh-2931'
git rebase 'main'
git switch 'main'
git merge --ff-only 'github-bot/gh-2931'
git switch 'github-bot/gh-2931'
git rebase 'main'
git switch 'main'
git merge --no-ff 'github-bot/gh-2931'
git switch 'main'
git merge --squash 'github-bot/gh-2931'
git switch 'main'
git merge --ff-only 'github-bot/gh-2931'
git switch 'main'
git merge 'github-bot/gh-2931'
git push origin 'main'
This discussion has been locked. Commenting is limited to contributors.
No reviewers
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.

Dependencies

No dependencies set

Reference
github/Marvisak--VIctory!2931
No description provided.