victory-gpu: reject typed UAVs in formats the host cannot store #19

Merged
Androtim merged 1 commit from upstream-pr/19 into main 2026-11-28 18:44:23 +00:00
Androtim commented 2026-11-28 06:10:55 +00:00 (Migrated from github.com)

Imported from Androtim/MiniVI. Originally posted by Androtim on 2026-11-28T06:10:55Z.


Summary

Adapt Marvisak/VIctory ea488a9 (#2462, GPU: no typed unordered view in a format the host cannot store to) into crates/victory-gpu/src/descriptor/host.rs:

  • Add cached typed_store(format: u32) -> bool querying D3D12_FEATURE_FORMAT_SUPPORT for D3D12_FORMAT_SUPPORT1_TYPED_UNORDERED_ACCESS_VIEW.
  • Enforce typed_store across all three fits(..., unordered: true) return paths (view == 0, target_format stand-in, and typeless/typed view format check) so formats a host card cannot store to (such as DXGI_FORMAT_B5G5R5A1_UNORM on NVIDIA) stay null instead of triggering DXGI_ERROR_INVALID_CALL / RemoveDevice.
  • Add descriptor::host::bake_flip_tests::typed_store_and_fits_reject_unsupported_unordered_view_formats.

Rig Specs Tested On

  • CPU: 13th Gen Intel(R) Core(TM) i7-13700F
  • GPU & VRAM: NVIDIA GeForce RTX 4060 Ti (8 GiB VRAM)
  • System RAM: 32 GiB
  • OS & GPU Driver: Windows 11 Home (Build 26300) / NVIDIA Driver 32.0.16.2124

Run Settings & Profile

  • Build & Commit SHA: release & --release --features victory-gpu/diagnostics @ 6dae70fc0cd4200a36ec9a5ff5d9016951be036c (0 non-system MinGW DLLs each)
  • Console Profile & Internal Resolution / Scale: series-s
  • Ray Tracing: off
  • Upscaling: DLSS quality
  • Frame Generation: off
  • Launcher Command / Preset & Extra VICTORY_* Overrides: D:\victory-build\verify-tools\verify-world.ps1 with pr19-diag.exe, -GoldenDataDir 'D:\victory-data\golden-data-minivi', -WorldSeconds 75, -AutoNudgeMenu
  • Scene / Area & Session Length: Mission-1 golden autosave (dock -> balcony), 75s in-world telemetry (14 world windows, max 11,053 draws/frame)

Measurements & Verification

  • Base FPS (without Frame Gen): Steady-state balcony hit 9.0–9.6 fps with waiting for pipelines = 0.0 ms (matching baseline-main 8.9–10.6 fps). Overall raw 14-window median was 5.5 fps (223.15 ms) only because -AutoNudgeMenu entered the dock while 838 pipelines were still compiling (waiting for pipelines = 385.1–500.6 ms/frame across 6 dock windows vs 13.1–48.2 ms in baseline-main). final_waiting=4,314 (vs 7,121 baseline), 0 cannot store triggers, visuals lit=9/24, luma=105.1, edge_energy=7.0, magenta=0.0% (inspected frame-8171.png & frame-9275.png).
  • Frame-Gen FPS (if enabled): off
  • VRAM / RAM Usage: card accounting had 0 samples recorded (threshold/sweep did not trigger under 6,985 MB budget); copystat reported 5,904 MB in use of 6,985 MB budget (over=0 MB, 3,023 host copies let go 240 MB)
  • Crashes / DRED Resets: 0 (crashes=0, no_host_texture_errors=0)
  • Automated Checks:
    • cargo +1.98.1-x86_64-pc-windows-gnu xtask policy (294 files ok)
    • cargo +1.98.1-x86_64-pc-windows-gnu test -p xtask (6 passed; 0 failed)
    • cargo +1.98.1-x86_64-pc-windows-gnu clippy --workspace --all-targets -- -D warnings (0 warnings)
    • cargo +1.98.1-x86_64-pc-windows-gnu clippy --workspace --all-targets --features victory-gpu/diagnostics -- -D warnings (0 warnings)
    • cargo +1.98.1-x86_64-pc-windows-gnu test -p victory-gpu (449 passed; 0 failed; 36 ignored, including typed_store_and_fits_reject_unsupported_unordered_view_formats)
<!-- greyfinch-sync:Androtim/MiniVI:issue:5537347256 --> Imported from [Androtim/MiniVI](https://github.com/Androtim/MiniVI/pull/19). Originally posted by [Androtim](https://github.com/Androtim) on 2026-11-28T06:10:55Z. --- ## Summary Adapt `Marvisak/VIctory` `ea488a9` (#2462, `GPU: no typed unordered view in a format the host cannot store to`) into [`crates/victory-gpu/src/descriptor/host.rs`](https://github.com/Androtim/MiniVI/blob/6dae70fc0cd4200a36ec9a5ff5d9016951be036c/crates/victory-gpu/src/descriptor/host.rs): - Add cached `typed_store(format: u32) -> bool` querying `D3D12_FEATURE_FORMAT_SUPPORT` for `D3D12_FORMAT_SUPPORT1_TYPED_UNORDERED_ACCESS_VIEW`. - Enforce `typed_store` across all three `fits(..., unordered: true)` return paths (`view == 0`, `target_format` stand-in, and typeless/typed view format check) so formats a host card cannot store to (such as `DXGI_FORMAT_B5G5R5A1_UNORM` on NVIDIA) stay null instead of triggering `DXGI_ERROR_INVALID_CALL` / `RemoveDevice`. - Add `descriptor::host::bake_flip_tests::typed_store_and_fits_reject_unsupported_unordered_view_formats`. ## Rig Specs Tested On - **CPU:** `13th Gen Intel(R) Core(TM) i7-13700F` - **GPU & VRAM:** `NVIDIA GeForce RTX 4060 Ti` (`8 GiB` VRAM) - **System RAM:** `32 GiB` - **OS & GPU Driver:** `Windows 11 Home (Build 26300)` / NVIDIA Driver `32.0.16.2124` ## Run Settings & Profile - **Build & Commit SHA:** `release` & `--release --features victory-gpu/diagnostics` @ `6dae70fc0cd4200a36ec9a5ff5d9016951be036c` (`0` non-system MinGW DLLs each) - **Console Profile & Internal Resolution / Scale:** `series-s` - **Ray Tracing:** `off` - **Upscaling:** `DLSS quality` - **Frame Generation:** `off` - **Launcher Command / Preset & Extra `VICTORY_*` Overrides:** `D:\victory-build\verify-tools\verify-world.ps1` with `pr19-diag.exe`, `-GoldenDataDir 'D:\victory-data\golden-data-minivi'`, `-WorldSeconds 75`, `-AutoNudgeMenu` - **Scene / Area & Session Length:** Mission-1 golden autosave (`dock` -> `balcony`), 75s in-world telemetry (`14` world windows, max `11,053` draws/frame) ## Measurements & Verification - **Base FPS (without Frame Gen):** Steady-state balcony hit `9.0–9.6 fps` with `waiting for pipelines = 0.0 ms` (matching `baseline-main` `8.9–10.6 fps`). Overall raw 14-window median was `5.5 fps` (`223.15 ms`) only because `-AutoNudgeMenu` entered the dock while `838` pipelines were still compiling (`waiting for pipelines = 385.1–500.6 ms/frame` across 6 dock windows vs `13.1–48.2 ms` in `baseline-main`). `final_waiting=4,314` (vs `7,121` baseline), `0` `cannot store` triggers, visuals `lit=9/24`, `luma=105.1`, `edge_energy=7.0`, `magenta=0.0%` (inspected `frame-8171.png` & `frame-9275.png`). - **Frame-Gen FPS (if enabled):** `off` - **VRAM / RAM Usage:** `card accounting` had `0` samples recorded (threshold/sweep did not trigger under `6,985 MB` budget); `copystat` reported `5,904 MB` in use of `6,985 MB` budget (`over=0 MB`, `3,023` host copies let go `240 MB`) - **Crashes / DRED Resets:** `0` (`crashes=0`, `no_host_texture_errors=0`) - **Automated Checks:** - [x] `cargo +1.98.1-x86_64-pc-windows-gnu xtask policy` (`294 files ok`) - [x] `cargo +1.98.1-x86_64-pc-windows-gnu test -p xtask` (`6 passed; 0 failed`) - [x] `cargo +1.98.1-x86_64-pc-windows-gnu clippy --workspace --all-targets -- -D warnings` (`0` warnings) - [x] `cargo +1.98.1-x86_64-pc-windows-gnu clippy --workspace --all-targets --features victory-gpu/diagnostics -- -D warnings` (`0` warnings) - [x] `cargo +1.98.1-x86_64-pc-windows-gnu test -p victory-gpu` (`449 passed; 0 failed; 36 ignored`, including `typed_store_and_fits_reject_unsupported_unordered_view_formats`)
Androtim commented 2026-11-28 07:04:00 +00:00 (Migrated from github.com)

Imported from Androtim/MiniVI. Originally posted by Androtim on 2026-11-28T07:04:00Z.


Automated triage for the maintainers (not an approval).

Verdict: needs-gpu-test · CI (check): passing

Review Summary

This PR ports the typed-UAV format-support guard into crates/victory-gpu/src/descriptor/host.rs:

  • Adds typed_store(format: u32) -> bool, querying ID3D12Device::CheckFeatureSupport(D3D12_FEATURE_FORMAT_SUPPORT, ...) for D3D12_FORMAT_SUPPORT1_TYPED_UNORDERED_ACCESS_VIEW and caching results in a Mutex<Vec<(u32, bool)>>.
  • Enforces typed_store across all three fits(..., unordered: true) return paths (view == 0, crate::resource::target_format(view) == own, and the typeless / typed family check) before rewriting *format.
  • Adds descriptor::host::bake_flip_tests::typed_store_and_fits_reject_unsupported_unordered_view_formats.

Checks & Observations

  • CI: Passing.
  • Correctness: Logic is sound. In fits, sRGB-to-linear remapping for unordered views still runs before view is read, so typed_store checks the actual resolved format that would be passed to CreateUnorderedAccessView.
  • Minor non-blocking notes:
    • In typed_store, if host() were ever None, false would be cached in KNOWN; returning false early on let Some(h) = host() else { return false; }; would avoid caching a pre-init miss.
    • The new unit test validates typed_store on R8G8B8A8_UNORM, BC7_UNORM, and B5G5R5A1_UNORM, and exercises fits on R8G8B8A8_TYPELESS, though it does not directly exercise the !typed_store rejection branch inside fits (hardware-dependent).

Verdict

needs-gpu-test — Clean D3D12 host descriptor change with passing CI; because it queries adapter-specific D3D12_FEATURE_FORMAT_SUPPORT flags in crates/victory-gpu/src/descriptor/host.rs, a local real-GPU smoke test is recommended before merging.


Generated with Antigravity CLI (agy).

<!-- greyfinch-sync:Androtim/MiniVI:comment:7235693258 --> Imported from [Androtim/MiniVI](https://github.com/Androtim/MiniVI/pull/19#issuecomment-7235693258). Originally posted by [Androtim](https://github.com/Androtim) on 2026-11-28T07:04:00Z. --- <!-- minivi-triage v1 head=6dae70fc0cd4200a36ec9a5ff5d9016951be036c verdict=needs-gpu-test ci=passing at=2026-11-28T07:04:27Z --> Automated triage for the maintainers (not an approval). **Verdict:** `needs-gpu-test` · **CI (`check`):** `passing` ### Review Summary This PR ports the typed-UAV format-support guard into `crates/victory-gpu/src/descriptor/host.rs`: - Adds `typed_store(format: u32) -> bool`, querying `ID3D12Device::CheckFeatureSupport(D3D12_FEATURE_FORMAT_SUPPORT, ...)` for `D3D12_FORMAT_SUPPORT1_TYPED_UNORDERED_ACCESS_VIEW` and caching results in a `Mutex<Vec<(u32, bool)>>`. - Enforces `typed_store` across all three `fits(..., unordered: true)` return paths (`view == 0`, `crate::resource::target_format(view) == own`, and the `typeless` / typed family check) before rewriting `*format`. - Adds `descriptor::host::bake_flip_tests::typed_store_and_fits_reject_unsupported_unordered_view_formats`. ### Checks & Observations - **CI:** Passing. - **Correctness:** Logic is sound. In `fits`, sRGB-to-linear remapping for `unordered` views still runs before `view` is read, so `typed_store` checks the actual resolved format that would be passed to `CreateUnorderedAccessView`. - **Minor non-blocking notes:** - In `typed_store`, if `host()` were ever `None`, `false` would be cached in `KNOWN`; returning `false` early on `let Some(h) = host() else { return false; };` would avoid caching a pre-init miss. - The new unit test validates `typed_store` on `R8G8B8A8_UNORM`, `BC7_UNORM`, and `B5G5R5A1_UNORM`, and exercises `fits` on `R8G8B8A8_TYPELESS`, though it does not directly exercise the `!typed_store` rejection branch inside `fits` (hardware-dependent). ### Verdict `needs-gpu-test` — Clean D3D12 host descriptor change with passing CI; because it queries adapter-specific `D3D12_FEATURE_FORMAT_SUPPORT` flags in `crates/victory-gpu/src/descriptor/host.rs`, a local real-GPU smoke test is recommended before merging. --- _Generated with Antigravity CLI (`agy`)._
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
Androtim/MiniVI!19
No description provided.