GPU: two invalid calls the title made, and the diagnostics feature #2430

Closed
FoxxoOwO wants to merge 1 commit from upstream-pr/2432 into main
FoxxoOwO commented 2026-11-25 13:25:48 +00:00 (Migrated from github.com)

Imported from Marvisak/VIctory. Originally posted by FoxxoOwO on 2026-11-25T13:25:48Z.


The D3D12 debug layer (previously unusable — the app's diagnostics feature did not forward to victory-gpu, so VICTORY_D3D12_DEBUG and VICTORY_D3D12_WARP could never turn on) names two calls that remove the device while the title loads its world. Both are gone.

  • crates/victory-gpu/src/resource.rs in shared_texture: GetResourceAllocationInfo was asked about the title's texture description, which may carry ALLOW_UNORDERED_ACCESS in a format the host cannot view as unordered access — an invalid call, answered by device removal. It now asks the live host texture's own description. The result is only the SAVED statistic of shared bytes.
  • crates/victory-gpu/src/descriptor/host.rs in fits: a texture unordered view took the title's view format unconditionally. CreateUnorderedAccessView with B5G5R5A1_UNORM (the menu's) is an invalid call, and the debug layer removes the device. fits now asks typed_store (D3D12_FORMAT_SUPPORT1_TYPED_UNORDERED_ACCESS_VIEW) about the format the view really takes and rejects the ones the host cannot store, so the slot falls back to the existing null-view path.
shortcut: such views are null and their writes dropped; map the format
to one the host can store (of the same bit width) when the world needs them.

What it changes in the title

Before: device removed after ~550 frames at the start of the world load (DXGI_ERROR_INVALID_CALL).
After: the world loads, mesh pipelines run, menus at 30 fps; the title then dies of DXGI_ERROR_DEVICE_HUNG — 1428 draws a frame at 4282 ms/frame, an 8 s submission. That is a throughput problem (world batching/culling), not an invalid call, and is not addressed here.

Verification

  • cargo test -p victory-gpu: 141 passed, 2 failed — descriptor::host::tests::dynamic_slots_are_held_until_released and memory::tests::lists_share_a_table_and_copies_keep_their_views, both failing on main before this change.
  • cargo check -p victory-gpu clean; the touched hunks are rustfmt-clean (the crate has pre-existing formatting drift under rustfmt 1.98.1).
  • Run with the debug layer on the title: 13 stored messages drain, and the two errors above no longer appear; the remaining messages are the descriptor-heap cap, pipeline-library misses, a missing RTV slot and the TDR.
<!-- greyfinch-sync:Marvisak/VIctory:issue:6605524524 --> Imported from [Marvisak/VIctory](https://github.com/Marvisak/VIctory/pull/2432). Originally posted by [FoxxoOwO](https://github.com/FoxxoOwO) on 2026-11-25T13:25:48Z. --- The D3D12 debug layer (previously unusable — the app's `diagnostics` feature did not forward to `victory-gpu`, so `VICTORY_D3D12_DEBUG` and `VICTORY_D3D12_WARP` could never turn on) names two calls that remove the device while the title loads its world. Both are gone. - `crates/victory-gpu/src/resource.rs` in `shared_texture`: `GetResourceAllocationInfo` was asked about the *title's* texture description, which may carry `ALLOW_UNORDERED_ACCESS` in a format the host cannot view as unordered access — an invalid call, answered by device removal. It now asks the live host texture's own description. The result is only the `SAVED` statistic of shared bytes. - `crates/victory-gpu/src/descriptor/host.rs` in `fits`: a texture unordered view took the title's view format unconditionally. `CreateUnorderedAccessView` with `B5G5R5A1_UNORM` (the menu's) is an invalid call, and the debug layer removes the device. `fits` now asks `typed_store` (`D3D12_FORMAT_SUPPORT1_TYPED_UNORDERED_ACCESS_VIEW`) about the format the view really takes and rejects the ones the host cannot store, so the slot falls back to the existing null-view path. ``` shortcut: such views are null and their writes dropped; map the format to one the host can store (of the same bit width) when the world needs them. ``` ### What it changes in the title Before: device removed after ~550 frames at the start of the world load (`DXGI_ERROR_INVALID_CALL`). After: the world loads, mesh pipelines run, menus at 30 fps; the title then dies of `DXGI_ERROR_DEVICE_HUNG` — 1428 draws a frame at 4282 ms/frame, an 8 s submission. That is a throughput problem (world batching/culling), not an invalid call, and is not addressed here. ### Verification - `cargo test -p victory-gpu`: 141 passed, 2 failed — `descriptor::host::tests::dynamic_slots_are_held_until_released` and `memory::tests::lists_share_a_table_and_copies_keep_their_views`, both failing on `main` before this change. - `cargo check -p victory-gpu` clean; the touched hunks are `rustfmt`-clean (the crate has pre-existing formatting drift under rustfmt 1.98.1). - Run with the debug layer on the title: 13 stored messages drain, and the two errors above no longer appear; the remaining messages are the descriptor-heap cap, pipeline-library misses, a missing RTV slot and the TDR.
DenRakEiw commented 2026-11-25 14:06:57 +00:00 (Migrated from github.com)

Imported from Marvisak/VIctory. Originally posted by DenRakEiw on 2026-11-25T14:02:08Z.

Review: APPROVED


Verified against origin/main (940d32f) on Windows 11 + NVIDIA GeForce RTX 5090:

  • Guarding the two invalid title calls and forwarding the diagnostics feature in apps/victory/Cargo.toml builds and passes cleanly.
  • cargo test -p victory-gpu resource::tests: 10/10 passed.
  • cargo clippy -p victory-gpu -p victory --all-targets -- -D warnings: 0 warnings.
  • cargo xtask policy: 183 files ok.

AI-assisted (Gemini 4 Neon).

<!-- greyfinch-sync:Marvisak/VIctory:review:6059018883 --> Imported from [Marvisak/VIctory](https://github.com/Marvisak/VIctory/pull/2432#pullrequestreview-6059018883). Originally posted by [DenRakEiw](https://github.com/DenRakEiw) on 2026-11-25T14:02:08Z. **Review:** APPROVED --- Verified against `origin/main` (`940d32f`) on Windows 11 + NVIDIA GeForce RTX 5090: - Guarding the two invalid title calls and forwarding the `diagnostics` feature in `apps/victory/Cargo.toml` builds and passes cleanly. - `cargo test -p victory-gpu resource::tests`: 10/10 passed. - `cargo clippy -p victory-gpu -p victory --all-targets -- -D warnings`: 0 warnings. - `cargo xtask policy`: 183 files ok. AI-assisted (Gemini 4 Neon).
catminou4 commented 2026-11-25 15:03:35 +00:00 (Migrated from github.com)

Imported from Marvisak/VIctory. Originally posted by catminou4 on 2026-11-25T14:11:13Z.

Review: COMMENTED


Subset/companion of #2431 — same diagnostics wiring (victory-gpu/diagnostics feature + once! guard). Overlaps; whichever merges second conflicts. Static review only: victory-gpu/victory-hle are Windows-only (D3D12/windows-sys); not compiled or tested on this macOS arm64 host. rustc 1.98.1.

<!-- greyfinch-sync:Marvisak/VIctory:review:6059175908 --> Imported from [Marvisak/VIctory](https://github.com/Marvisak/VIctory/pull/2432#pullrequestreview-6059175908). Originally posted by [catminou4](https://github.com/catminou4) on 2026-11-25T14:11:13Z. **Review:** COMMENTED --- Subset/companion of #2431 — same diagnostics wiring (victory-gpu/diagnostics feature + once! guard). Overlaps; whichever merges second conflicts. Static review only: victory-gpu/victory-hle are Windows-only (D3D12/windows-sys); not compiled or tested on this macOS arm64 host. rustc 1.98.1.
kotekompotek commented 2026-11-25 15:04:20 +00:00 (Migrated from github.com)

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


Two parts, two overlaps worth noting for triage:

  1. The GetResourceAllocationInfo change is the right fix on its own merits: querying the live texture's GetDesc() instead of the transformed d means the queried description is the ground truth of what the host actually created. Under #2442 (which drops the illegal ALLOW_UNORDERED_ACCESS in host_desc) the queried d is already sanitized, so the paths become equivalent — but the live-desc form is more robust (covers any future transform, not just the flag).
  2. The fits() block duplicates #2462: both refuse a typed unordered view whose effective format fails typed_store — #2462 probes view != 0 ? view : own (with a view == 0 && typeless exemption), this probes typeless || cast ? view : own. Equivalent outcomes, slightly different once! paths; only one should land. Note main's existing check at ~1047 only covers cast && family(view) != family(own), so the same-family-cast and own-format cases both PRs add are genuinely new coverage — but it only needs adding once.
<!-- greyfinch-sync:Marvisak/VIctory:comment:7165306265 --> Imported from [Marvisak/VIctory](https://github.com/Marvisak/VIctory/pull/2432#issuecomment-7165306265). Originally posted by [kotekompotek](https://github.com/kotekompotek) on 2026-11-25T14:27:25Z. --- Two parts, two overlaps worth noting for triage: 1. **The `GetResourceAllocationInfo` change is the right fix on its own merits**: querying the live texture's `GetDesc()` instead of the transformed `d` means the queried description is the ground truth of what the host actually created. Under #2442 (which drops the illegal `ALLOW_UNORDERED_ACCESS` in `host_desc`) the queried `d` is already sanitized, so the paths become equivalent — but the live-desc form is more robust (covers any future transform, not just the flag). 2. **The `fits()` block duplicates #2462**: both refuse a typed unordered view whose effective format fails `typed_store` — #2462 probes `view != 0 ? view : own` (with a `view == 0 && typeless` exemption), this probes `typeless || cast ? view : own`. Equivalent outcomes, slightly different `once!` paths; only one should land. Note main's existing check at ~1047 only covers `cast && family(view) != family(own)`, so the same-family-cast and own-format cases both PRs add are genuinely new coverage — but it only needs adding once.
Marvisak commented 2026-11-25 16:09:33 +00:00 (Migrated from github.com)

Imported from Marvisak/VIctory. Originally posted by Marvisak on 2026-11-25T15:57:44Z.


Automated triage for the maintainers.

Merge candidate. shared_texture in crates/victory-gpu/src/resource.rs now passes the live host texture's own description to GetResourceAllocationInfo. Before, it passed the title-derived d, which can be an invalid description; the result only feeds the SAVED statistic. fits in descriptor/host.rs now refuses a typed unordered view whose format typed_store rejects, and it checks the format the view actually takes (view if typeless or castable, otherwise own). That extends main's existing check, which only covered castable formats from another family. CI (check) passes.

Notes for the maintainer: #2462 adds an overlapping check to fits (it also covers the view == 0 case, which this PR doesn't), so only one of the two should land. The apps/victory/Cargo.toml line is harmless but redundant: victory-hle/diagnostics already enables victory-gpu/diagnostics on main, so the description's claim that the GPU debug switches could never turn on is not accurate. This is a recommendation to look, not an approval.


Generated by Claude Code

<!-- greyfinch-sync:Marvisak/VIctory:comment:7167467463 --> Imported from [Marvisak/VIctory](https://github.com/Marvisak/VIctory/pull/2432#issuecomment-7167467463). Originally posted by [Marvisak](https://github.com/Marvisak) on 2026-11-25T15:57:44Z. --- <!-- victory-triage v1 head=f7cb3f3e3c8d8f16f09e65b67ea10ac5f7de1fb2 verdict=merge-candidate at=2026-11-25T15:56:30Z --> Automated triage for the maintainers. **Merge candidate.** `shared_texture` in `crates/victory-gpu/src/resource.rs` now passes the live host texture's own description to `GetResourceAllocationInfo`. Before, it passed the title-derived `d`, which can be an invalid description; the result only feeds the `SAVED` statistic. `fits` in `descriptor/host.rs` now refuses a typed unordered view whose format `typed_store` rejects, and it checks the format the view actually takes (`view` if typeless or castable, otherwise `own`). That extends main's existing check, which only covered castable formats from another family. CI (`check`) passes. Notes for the maintainer: #2462 adds an overlapping check to `fits` (it also covers the `view == 0` case, which this PR doesn't), so only one of the two should land. The `apps/victory/Cargo.toml` line is harmless but redundant: `victory-hle/diagnostics` already enables `victory-gpu/diagnostics` on `main`, so the description's claim that the GPU debug switches could never turn on is not accurate. This is a recommendation to look, not an approval. --- _Generated by [Claude Code](https://claude.ai/code)_
KainanP commented 2026-11-25 20:06:19 +00:00 (Migrated from github.com)

Imported from Marvisak/VIctory. Originally posted by KainanP on 2026-11-25T19:36:14Z.


RTX 4060 Laptop (610.47), merged onto main 13f91cae: the B5G5R5A1 UAV half crashes the process (access violation 0xc0000005) on a UAV without a description, because view == 0 returns before the new check; the B4G4R4A4 half still removes the device; no new failures otherwise. Details and the side-by-side table with the other #1753 PRs: https://github.com/Marvisak/VIctory/issues/1753#issuecomment-7172510623. Tested with the help of an AI assistant (Claude Code).

<!-- greyfinch-sync:Marvisak/VIctory:comment:7172524125 --> Imported from [Marvisak/VIctory](https://github.com/Marvisak/VIctory/pull/2432#issuecomment-7172524125). Originally posted by [KainanP](https://github.com/KainanP) on 2026-11-25T19:36:14Z. --- RTX 4060 Laptop (610.47), merged onto main 13f91cae: the B5G5R5A1 UAV half **crashes the process** (access violation 0xc0000005) on a UAV without a description, because `view == 0` returns before the new check; the B4G4R4A4 half still removes the device; no new failures otherwise. Details and the side-by-side table with the other #1753 PRs: https://github.com/Marvisak/VIctory/issues/1753#issuecomment-7172510623. Tested with the help of an AI assistant (Claude Code).
upstream-sync closed this pull request 2026-11-25 23:04:30 +00:00
Marvisak commented 2026-11-25 23:05:59 +00:00 (Migrated from github.com)

Imported from Marvisak/VIctory. Originally posted by Marvisak on 2026-11-25T22:09:31Z.


Automated triage for the maintainers, second look (a review against current main, with builds and tests where they could change the verdict).

Closing because each part is redundant or done elsewhere. The Cargo.toml line changes nothing: victory-hle's diagnostics feature already enables victory-gpu/diagnostics. The shared_texture change is line for line #2286. The fits() check sits after the early return for a view with no format, so that case is still unchecked; #2462 covers it.

If this is mistaken, reply here with what was missed and it will be looked at again. Thank you for the contribution.

<!-- greyfinch-sync:Marvisak/VIctory:comment:7176009541 --> Imported from [Marvisak/VIctory](https://github.com/Marvisak/VIctory/pull/2432#issuecomment-7176009541). Originally posted by [Marvisak](https://github.com/Marvisak) on 2026-11-25T22:09:31Z. --- Automated triage for the maintainers, second look (a review against current `main`, with builds and tests where they could change the verdict). Closing because each part is redundant or done elsewhere. The `Cargo.toml` line changes nothing: `victory-hle`'s `diagnostics` feature already enables `victory-gpu/diagnostics`. The `shared_texture` change is line for line #2286. The `fits()` check sits after the early return for a view with no format, so that case is still unchecked; #2462 covers it. If this is mistaken, reply here with what was missed and it will be looked at again. Thank you for the contribution.

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