GPU diagnostics: stop inferring descriptor slots from fault addresses #1236

Closed
github-bot wants to merge 1 commit from gh-pr/1236/head into gh-pr/1236/base
Owner

@⁠EatCodeSleep2 on GitHub · 2026-11-24 16:42 UTC · original
EatCodeSleep2:fix/dred-descriptor-heap-diagnostic-772 → main · +6 −32 · 2 files · 1 commits · closed without merging

Summary

  • Remove the descriptor slot estimates that subtract an opaque GPU descriptor handle from the DRED page-fault virtual address.
  • Name the shader-visible view and sampler heaps when DRED is enabled so the allocation report can identify a heap if DRED associates it with a fault.

The old arithmetic reproduces both large numbers in #772 (566,987,264 and 1,139,159,808) from the reported fault address and the handle increments. Those numbers do not identify descriptors accessed by the GPU. Descriptor handle documentation · DRED allocation output

Refs #772. This change covers the page-fault diagnostics. The reported device removal was not reproduced. #1233 addresses descriptor tables in the command breadcrumb report separately.

Verification

  • With VICTORY_D3D12_DRED=1, cargo test --locked -p victory-gpu --lib --features diagnostics -- --quiet (53 passed, 1 ignored).
  • cargo clippy --locked -p victory-gpu --all-targets --features diagnostics -- -D warnings passed.

AI-assisted. No game files were used.

**@⁠EatCodeSleep2** on GitHub · 2026-11-24 16:42 UTC · [original](https://github.com/Marvisak/VIctory/pull/1236) `EatCodeSleep2:fix/dred-descriptor-heap-diagnostic-772` → `main` · +6 −32 · 2 files · 1 commits · closed without merging ## Summary - Remove the descriptor slot estimates that subtract an opaque GPU descriptor handle from the DRED page-fault virtual address. - Name the shader-visible view and sampler heaps when DRED is enabled so the allocation report can identify a heap if DRED associates it with a fault. The old arithmetic reproduces both large numbers in #772 (566,987,264 and 1,139,159,808) from the reported fault address and the handle increments. Those numbers do not identify descriptors accessed by the GPU. [Descriptor handle documentation](https://learn.microsoft.com/en-us/windows/win32/direct3d12/creating-descriptor-heaps) · [DRED allocation output](https://learn.microsoft.com/en-us/windows/win32/api/d3d12/ns-d3d12-d3d12_dred_page_fault_output) Refs #772. This change covers the page-fault diagnostics. The reported device removal was not reproduced. #1233 addresses descriptor tables in the command breadcrumb report separately. ## Verification - With `VICTORY_D3D12_DRED=1`, `cargo test --locked -p victory-gpu --lib --features diagnostics -- --quiet` (53 passed, 1 ignored). - `cargo clippy --locked -p victory-gpu --all-targets --features diagnostics -- -D warnings` passed. AI-assisted. No game files were used.
github-bot locked as GitHub sync and limited conversation to collaborators 2026-11-26 04:24:33 +00:00
github-bot closed this pull request 2026-11-26 04:24:33 +00:00
Author
Owner

@⁠Zipettte on GitHub · 2026-11-24 17:59 UTC · original

Tested on AMD Radeon RX 7700 XT (RDNA3, gfx1101), driver 32.0.32029.2010, Windows 11, Rust 1.98.1 MSVC at ec83690: cargo test -p victory-gpu passes, 50 passed / 0 failed. Workspace baseline on main (ffe310e) is green on the same machine (342 passed).

Tested with AI assistance (Claude).

**@⁠Zipettte** on GitHub · 2026-11-24 17:59 UTC · [original](https://github.com/Marvisak/VIctory/pull/1236#issuecomment-7140001258) Tested on AMD Radeon RX 7700 XT (RDNA3, gfx1101), driver 32.0.32029.2010, Windows 11, Rust 1.98.1 MSVC at ec83690: `cargo test -p victory-gpu` passes, 50 passed / 0 failed. Workspace baseline on main (ffe310e) is green on the same machine (342 passed). _Tested with AI assistance (Claude)._
Author
Owner

@⁠Headache3318 on GitHub · 2026-11-24 18:44 UTC · original

Second read against ffe310e and the four overlapping descriptor PRs (AI-assisted, Arch Linux kernel 7.3.5, zero-CPU: git merge-tree --write-tree + file reads, nothing built — complements Zipettte's 7700 XT test run):

  • Conflict map: #1236 @ ec83690 (base = tip exactly) 3-way conflicts only with #483 — descriptor/host.rs regions of merged blob 045d54ed: lines 20-25 (count-field doc) and 78-98 (HostHeap::new make/extra fallback); merges clean with #493/#568/#588. Root: #483 forked at d2a4bae before #336's sizing commit e8d3b64 (ancestor of every other head) — and #483's tester merges (h0useadv 11:01, DuarttBR 15:30) deliberately extended GPU_RANGES to count+extra+1 to keep the 'past heap end' reporting that this PR deletes → those merges need a joint redo, not four independent rebases.
  • Gap: DRED allocation hits report only allocations containing the VA (D3D12_DRED_ALLOCATION_TYPE_DESCRIPTOR_HEAP; windows-0.62.2 mod.rs:1648/1684; main host.rs:629-631 walks), while main's near_heaps printed past its end (slot N) for every heap regardless of containment (descriptor/host.rs:47-56) — the class the removal's own comment cites as its reason (:38-39); after this lands, a fault just past a heap's end can never name the heap.
  • The replacement names heaps by count + extra — the host total including 262,144/65,536 dynamic headroom (MIN_DYNAMIC fallback, main descriptor/host.rs:70-74,96-121), never the title's count (:26) — so 'title indexed past its own slots inside headroom' becomes indistinguishable from dynamic-pool slots; and #568 @ 22e6676 keeps GPU_RANGES/near_heaps verbatim (:70/:74/:163, shifted +30 by its imports hunk), so #568 alone never stops the misleading numbers — the merged 1236×568 tree has zero GPU_RANGES/near_heaps/handle-start references left in the file.
  • Forward-refuted inside #493's clean merge (tree 5a3f51a47): the new comment 'cannot locate a faulting GPU VA' sits 231 lines above #493's gpu_handle start + index*self.step (CPU-side GetDescriptorHandleIncrementSize, main :124-128) — the merged file's last GetGPUDescriptorHandleForHeapStart().ptr consumer, feeding SetCompute/GraphicsRootDescriptorTable at #493 draw.rs:584-591; the comment should claim only the VA→slot direction, or #493's bounded table starts inherit the same doubt.
  • Soundness vs README: the documented DRED surface survives — allocation hits via host::name + ObjectNameW/AllocationType walk (:638-643), commands-in-flight via breadcrumbs/stopped-list/marker notes with fault_in (:655-699); shadow::near and GBV untouched — only Victory's added slot guesswork dies, plus a robustness bonus: one global-mutex lock leaves the crash-report path (:45 → host.rs:651 → removal_data :614). #588 shares no file with #1236 (draw.rs +25/−4, shadow.rs +54/−2 only), so 'descriptor/host.rs shared by all five' holds only for #1236/#493/#483/#568.
**@⁠Headache3318** on GitHub · 2026-11-24 18:44 UTC · [original](https://github.com/Marvisak/VIctory/pull/1236#issuecomment-7141087040) Second read against `ffe310e` and the four overlapping descriptor PRs (AI-assisted, Arch Linux kernel 7.3.5, **zero-CPU**: `git merge-tree --write-tree` + file reads, nothing built — complements Zipettte's 7700 XT test run): - Conflict map: #1236 @ `ec83690` (base = tip exactly) 3-way conflicts **only with #483** — `descriptor/host.rs` regions of merged blob `045d54ed`: lines 20-25 (`count`-field doc) and 78-98 (`HostHeap::new` make/extra fallback); merges clean with #493/#568/#588. Root: #483 forked at `d2a4bae` **before** #336's sizing commit `e8d3b64` (ancestor of every other head) — and #483's tester merges (h0useadv 11:01, DuarttBR 15:30) deliberately extended `GPU_RANGES` to `count+extra+1` to keep the 'past heap end' reporting that **this PR deletes** → those merges need a joint redo, not four independent rebases. - Gap: DRED allocation hits report only allocations **containing** the VA (`D3D12_DRED_ALLOCATION_TYPE_DESCRIPTOR_HEAP`; windows-0.62.2 `mod.rs:1648/1684`; main `host.rs:629-631` walks), while main's `near_heaps` printed `past its end (slot N)` for every heap regardless of containment (`descriptor/host.rs:47-56`) — the class the removal's own comment cites as its reason (:38-39); after this lands, a fault just past a heap's end can never name the heap. - The replacement names heaps by `count + extra` — the host total including 262,144/65,536 dynamic headroom (`MIN_DYNAMIC` fallback, main `descriptor/host.rs:70-74,96-121`), never the title's `count` (:26) — so 'title indexed past its own slots inside headroom' becomes indistinguishable from dynamic-pool slots; and #568 @ `22e6676` keeps `GPU_RANGES`/`near_heaps` **verbatim** (:70/:74/:163, shifted +30 by its imports hunk), so #568 alone never stops the misleading numbers — the merged 1236×568 tree has zero `GPU_RANGES`/`near_heaps`/handle-start references left in the file. - Forward-refuted inside #493's clean merge (tree `5a3f51a47`): the new comment 'cannot locate a faulting GPU VA' sits **231 lines above** #493's `gpu_handle` `start + index*self.step` (CPU-side `GetDescriptorHandleIncrementSize`, main :124-128) — the merged file's last `GetGPUDescriptorHandleForHeapStart().ptr` consumer, feeding `SetCompute/GraphicsRootDescriptorTable` at #493 `draw.rs:584-591`; the comment should claim only the VA→slot direction, or #493's bounded table starts inherit the same doubt. - Soundness vs README: the documented DRED surface survives — allocation hits via `host::name` + `ObjectNameW`/`AllocationType` walk (:638-643), commands-in-flight via breadcrumbs/stopped-list/marker notes with `fault_in` (:655-699); `shadow::near` and GBV untouched — only Victory's added slot guesswork dies, plus a robustness bonus: one global-mutex lock leaves the crash-report path (:45 → `host.rs:651` → `removal_data` :614). #588 shares **no file** with #1236 (`draw.rs` +25/−4, `shadow.rs` +54/−2 only), so 'descriptor/host.rs shared by all five' holds only for #1236/#493/#483/#568.

Pull request closed

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