Descriptor heap: a view a shader picks past the title's host slots reads the null slot, not another draw's table (DEVICE_HUNG in an indirect dispatch of 4fb416369fc50b6e) #3686

Open
github-bot wants to merge 2 commits from github-bot/gh-3686 into main AGit
Owner

@⁠Lyrnc on GitHub · 2026-11-30 03:50 UTC · original
Lyrnc:fix/indirect-null-slot → main · +402 −37 · 10 files · 2 commits · open

Branch: Lyrnc/VIctory-NVIDIA fix/indirect-null-slot (one commit on trustno1-coder/VIctory-NVIDIA main 41adb551, v2026.11.29.05)
Labels: pr-fix, area: descriptors, area: shaders

Part of #3222, #3050, #3016, #2912, #3111, #3195, #3079 (sailcat's comment), #2786, #3230 (not verified in game, see below).

Problem

From v2026.11.29.02 on, RTX 40/50 cards stop with DXGI_ERROR_DEVICE_HUNG (0x887A0006) 40-190 s into the world: #3050 (RTX 5080, 6 of 6 runs, even at 1080p with everything off), #3222 (5070 + 9800X3D), DudeZeroOne in #3050 (5070 Ti + 9800X3D, 3 of 3), #3016 (5070, 4 of 4), meloiss and Bj0rnis in #2912 (5080 Laptop, 5070 Ti), #3111 and #3195 (5080), sailcat in #3079 (5090). Before each one the submitting thread is idle for 2-10 s: the card is running something that does not finish.

#3222's device-removed data (VICTORY_D3D12_DRED=light) names the command: an indirect compute dispatch of 4fb416369fc50b6e, with "user data [0, 0, 0, 0, 12ba3e0, 0, 10, 0], word 6 slot 16: null", and no page fault. Leaving that program out (VICTORY_LEAVE_OUT) stops the hangs.

Root cause

"word 6 slot 16: null" is not what the dispatch read. host::indirects::slots guesses which user-data words are heap slots: any small word that is not a multiple of 32 is taken for a slot as it is. The program's root layout has a 7-view descriptor table at user-data word 4, three root constants at words 5-7 and the resource heap at word 8. So word 6 is the root constant 16, and slot 16 of the title's heap (null) has nothing to do with it. The table at word 4 is a byte offset of 0x12ba3e0, slots 613,663 to 613,669. That is past the heap's 606,783 title slots, among the dynamic slots, where the host makes tables afresh. describe_slots only looked below the title's count, so the report never showed what the table held.

What the program does read, and where that goes wrong on a capped heap. Besides its table, the program picks two buffer views from the resource heap by indices it reads from memory, and it does not loop (both seen offline in a local copy; nothing of it is in this PR). A hang with no page fault in such a program is what an NVIDIA card does when it reads a descriptor it cannot use. heap_handle's own comment says the same about a view index past the heap ("hung its GPU (GPU-based validation: 'descriptor heap index out of bounds')"). Here the index stays inside the heap but lands on the wrong slot:

  • NVIDIA caps a shader-visible view heap at 1,000,000 views (PORTABLE_VIEWS), and the title's heap has 1,245,184 (#2625). HostHeap::new_with keeps the title's first null - dynamic slots, then the dynamic slots, then the null slot at 999,999. Its warning says "views past {fitted} read a null slot".
  • That is true only for indices at or past 999,999. Shaders clamp a picked index to the null slot only there (heap_handle_at, VIEW_LIMIT). A title index between fitted and 999,999 reads a dynamic slot: whatever table another draw had made there. That can be a constant buffer's raw view, a UAV, or a texture's view where the program expects a buffer. NVIDIA has no raw twins (they need 2^22 views), so nothing makes such a read type-safe.
  • d7c2d8a7 (in v2026.11.29.02) moved real title slots into that window. It raised the capped heap's dynamic slots from 262,144 to 393,216, so fitted fell from 737,855 to 606,783. The code's own note says the title's highest slot seen is about 720,000 (DYNAMIC's doc comment). On v2026.11.28.03 and v2026.11.29.01, every title slot the title uses had a host slot of its own. From .02 on, title slots 606,783 to about 720,000 alias dynamic slots. Which of them a frame picks depends on what has streamed in, which fits the hang coming 40-190 s into the world. It also fits the "wrong texture for a moment" reports on .02: a ceiling with an unrelated poster in #3222, a guard's face showing signage in sailcat's comment.

So the dispatch hangs because an index the title gave it, which the host cannot hold on a capped heap, reads another draw's table slot. It is not reading an unfilled table, a slot freed early, the indirect-gather path or late mirroring. The table itself (made afresh, in dynamic slots) is not the problem.

What this does not explain. Bj0rnis (#2912: 4 of 4 hangs with the default, none in a 27-minute soak with VICTORY_WAVE_FOLDED=1) and meloiss (33 minutes on .03 with =1) found folding stops it. I translated the program offline with the v2026.11.29.01 translator: its DXIL is the same with VICTORY_WAVE_FOLDED unset, =1 and =0 (577dec630dcf3721, no wave64 retries). Folding changes five other programs bound in the same list (17af15c4015cb4b6, fdd56d97a806bcca → local waves; 55679a0547649d0b, 89d08e561897d4e5 → wave-wide branches; 1c4b3c0547e3e6fa → without skips). They are the instance-culling passes that run before it in the same list, and probably write the records it reads its indices from (not checked). If one of them writes a wrong record, the program gets an index that can land anywhere, the aliased window included. This change makes every index past the title's slots read null, whichever program wrote it. There is also one run against the slot story: Bj0rnis's run 4 in #2912 hung at 1.0 min with VICTORY_DYNAMIC_SLOTS=262144 (the .01 layout). That run also had VICTORY_SLOTS_BITMAP=1, which descriptor/slots.rs documents as letting draws "pick up another draw's descriptors". sailcat's run B in #3079 (VICTORY_DYNAMIC_SLOTS=262144 alone) did not hang. Whether one of those forms is wrong is for the wave64 work to answer. Main's 05d1c564 already folds the two 55679a…/89d08e… programs again before the wave-wide form; the other three keep .02's forms.

Fix

  1. Translator (victory-shader): a view index a program picks from the resource heap (a scalar or per-lane descriptor load whose root is ResourceHeap, not the sampler heap) is compared with a new host word, USER_TITLE_VIEWS, and one at or past it reads the null slot (index < title ? index : null). This happens only when the host has a null slot (view_heap_limit() != 0). Tables are not held to it: the host makes tables afresh past the title's slots on purpose. The translator fingerprint changes (it hashes the shader crate's source), so caches are rebuilt once.
  2. Host (victory-gpu): State::host_word sets USER_TITLE_VIEWS at every bind to the bound view heap's host title slots (HostHeap::count). Without a title heap of ours bound, or with VICTORY_TITLE_VIEWS=0, it sets u32::MAX, which keeps every index as before. The word is read once per bind, so VICTORY_AB=VICTORY_TITLE_VIEWS can switch it live in a diagnostics build for an A/B in one run. The heap's "views past {fitted} read a null slot" warning is now true.
  3. Device-removed report (diagnostics only): each bind records which user-data words are tables (indirects::table_words). The report names those tables' slots, including dynamic ones ("dynamic slot N (taken .., shows a buffer of .. bytes / a texture of WxH)"), and no longer reads a root constant as a slot. The old guess is kept only for executions noted without that mask.

Not added: a guard that refuses a dispatch whose bound slots are null. Null slots are legal and common (every host heap starts null, and the title leaves slots null), so such a guard would drop the title's own work. The clamp in (1) is the guard against the real hazard, a foreign descriptor, and costs one compare and select per picked view.

What changes for the title: views it picks between fitted and the null slot now read as null (zeros) instead of another draw's table. They were never the title's views on this host. Getting them right needs title slots past the cap remapped. Raising the dynamic slots (PR #1007: 458,752) would make that window bigger. With this change that window reads null rather than aliasing.

How it was tested

  • GPU: RTX 5080 16 GB (wave32), driver as installed, Windows 11 26200. Not run in game (see NOT tested).
  • Unit tests:
    • victory-shader emit::size_tests::a_picked_view_past_the_titles_slots_reads_the_null_slot: a program picks a raw buffer from the resource heap at slots 1, 3 and 1000. It is translated with a null slot at 5 and dispatched on the hardware adapter and WARP. With 3 title slots it reads slot 1 itself, and slot 3 and slot 1000 read the null slot. With 4 title slots, or with no bound (u32::MAX), slot 3 is read as before. Without a host limit the program has no such word. Passes on 41adb551 + this commit; the DXIL validated with dxil.dll, and it ran on both the hardware adapter and WARP (neither skipped). With emit::size_tests and emit::bitcode: 45 passed, 0 failed, 2 ignored (benchmarks).
    • victory-gpu draw::tests::picked_views_are_kept_to_the_bound_heaps_title_slots: the host word (title slots, u32::MAX with the switch off or without a heap of ours).
    • victory-gpu host::indirects::tests::the_tables_words_name_their_slots_and_constants_none: #3222's user data. The table at word 4 names slots 613,663..613,669, in the dynamic range, and the constant 16 at word 6 is no slot. Without the mask the old guess still takes it for one. The two existing tests of the module are updated for the mask.
  • cargo check -p victory-gpu --locked: clean on 716a0c99 + this change. The only warnings are main's own; none are on touched lines.
  • cargo check -p victory-gpu --features diagnostics --locked: clean with #3222's two-line fix for main's diagnostics build (on 716a0c99), which main has since landed as 41adb551.
  • cargo test -p victory-gpu --lib --locked -- --test-threads=4 on 41adb551 + this change (344012d5): 921 passed, 2 failed, 60 ignored. The two failures aren't from this change. shader_cache::tests::every_switch_of_the_translator_is_in_the_key fails on main too (a stale VICTORY_SCALAR_SPLITS key; #3210/#3061 fix it). host::card_steps::tests::places_written_after_sending_are_learned passed 3 of 3 times when run alone; it only fails when run in parallel with other tests, and this change doesn't touch card_steps.rs.
  • The new victory-gpu tests: draw::tests::picked_views_are_kept_to_the_bound_heaps_title_slots passes. With --features diagnostics, host::indirects::tests passes 3 of 3, including the new the_tables_words_name_their_slots_and_constants_none.
  • The ignored host::upcheck::tests::writes_through_picked_views_come_back (run with VICTORY_PICKED_WRITES=1 VICTORY_RELAY=2 VICTORY_RELAY_COPY=1) fails at upcheck.rs:930 the same way on main 41adb551 without this change.
  • clippy (-p victory-shader -p victory-gpu --all-targets): 35 warnings, none on a line this change touches; all of them are main's.
  • cargo xtask policy: one violation, crates/victory-loader/src/heap_sites/frame_users.rs (a run of hex literals). That file is main's and this change doesn't touch it.
  • Offline (local, nothing of it in the tree): victory translate --list of the list's 16 compute programs with the v2026.11.29.01 build, VICTORY_HOST_WAVE=32 VICTORY_WAVE_WHY=1, and VICTORY_WAVE_FOLDED unset, =1 and =0, gives the DXIL hashes and forms quoted above.
  • For shader changes, the wave sizes tested: 32-lane host (RTX 5080). The change does not depend on the wave size.

NOT tested

  • In game. Nobody was at the PC, and a hang here can need a hard power-off. Steps for later, on the 5080, v2026.11.29.05 defaults plus this branch, Series X 1440p, DLSS Quality, frame generation off, a save in the open world:
    1. Release build of main 41adb551, 5 minutes in the world, driving through the city, 2 runs. Expect the hang within 40-190 s (#3050). If main no longer hangs here, the test cannot tell, so stop and report that.
    2. The same with this branch, 2 runs of 5 minutes, plus one of 20 minutes. Watch the log for 0x887A0006 and the 5-second lines for dropped draws.
    3. A/B in one run (diagnostics build): VICTORY_AB=VICTORY_TITLE_VIEWS and the F1 A/B toggle, with VICTORY_D3D12_DRED=light. If it still hangs, the report now names the table's slots.
    4. Look for missing geometry or culling holes where title views past 606,783 now read null. That is what the trade-off would look like.
    5. Workaround to test on unpatched builds: VICTORY_DYNAMIC_SLOTS=262144, which puts fitted back at 737,855 (sailcat's run B in #3079 did not hang, but ended in did not close).
  • AMD (raw twins): there the picked index goes through the same compare before the twin's own clamp. The twin of the null slot is a null raw view. Not run on the iGPU.
  • Root-signature room: the word adds one root constant to each stage that picks views from the heap. A pipeline whose root signature is already at 64 dwords would fail to make it. Not measured over the title's pipelines.
  • The VICTORY_WAVE_FOLDED observation is not explained by this change (see Root cause).

Checked for overlap

  • Searched open PRs for "null descriptor", "indirect", "hang", "TDR", "device removed", "DEVICE_HUNG", "dynamic slots", "title slot past", "heap index", "fitted" and 4fb416369fc50b6e. Related:
    • #2666 (open, diagnostics): counts views past the capped heap and shows PAST CAP on F3, and says such views "read the null slot". Counting refusals at mirror time is complementary. Its premise holds only for tables and indices past 999,999 until this lands. No textual conflict expected (mirror_inner vs dynamic_slots/host_word).
    • #1007 (open): raises the default dynamic slots to 458,752 on 1M-capped heaps. Without this change it would put title slots 541,247-720,000 in the aliased window.
    • #194 (open, 11-27 base): the COPY_DEST root SRV barrier the debug layer counts in #3222. A different hazard, and it does not touch these files.
    • #2048 (open): the diagnostics build's timing shadowing and mb, which #3222 also hit. Main fixed it in 41adb551, which this branch is on.
    • #2570, #1719, #2881 (dynamic slot telemetry and allocator): no overlap in behaviour.
    • No open PR clamps picked views to the title's slots.

AI use

Claude Code (Claude Opus 5.5) read the issues and the code, translated the list's programs offline from a local copy to compare their forms (nothing of the title is in this PR), wrote the change and the tests, ran the checks, and wrote this description.

🤖 Generated with Claude Code

**@⁠Lyrnc** on GitHub · 2026-11-30 03:50 UTC · [original](https://github.com/trustno1-coder/VIctory-NVIDIA/pull/3686) `Lyrnc:fix/indirect-null-slot` → `main` · +402 −37 · 10 files · 2 commits · open Branch: Lyrnc/VIctory-NVIDIA `fix/indirect-null-slot` (one commit on trustno1-coder/VIctory-NVIDIA main 41adb551, v2026.11.29.05) Labels: pr-fix, area: descriptors, area: shaders Part of #3222, #3050, #3016, #2912, #3111, #3195, #3079 (sailcat's comment), #2786, #3230 (not verified in game, see below). ## Problem From v2026.11.29.02 on, RTX 40/50 cards stop with `DXGI_ERROR_DEVICE_HUNG` (0x887A0006) 40-190 s into the world: #3050 (RTX 5080, 6 of 6 runs, even at 1080p with everything off), #3222 (5070 + 9800X3D), DudeZeroOne in #3050 (5070 Ti + 9800X3D, 3 of 3), #3016 (5070, 4 of 4), meloiss and Bj0rnis in #2912 (5080 Laptop, 5070 Ti), #3111 and #3195 (5080), sailcat in #3079 (5090). Before each one the submitting thread is idle for 2-10 s: the card is running something that does not finish. #3222's device-removed data (`VICTORY_D3D12_DRED=light`) names the command: an indirect compute dispatch of `4fb416369fc50b6e`, with "user data [0, 0, 0, 0, 12ba3e0, 0, 10, 0], word 6 slot 16: null", and no page fault. Leaving that program out (`VICTORY_LEAVE_OUT`) stops the hangs. ## Root cause **"word 6 slot 16: null" is not what the dispatch read.** `host::indirects::slots` guesses which user-data words are heap slots: any small word that is not a multiple of 32 is taken for a slot as it is. The program's root layout has a 7-view descriptor table at user-data word 4, three root constants at words 5-7 and the resource heap at word 8. So word 6 is the root constant 16, and slot 16 of the title's heap (null) has nothing to do with it. The table at word 4 is a byte offset of 0x12ba3e0, slots 613,663 to 613,669. That is past the heap's 606,783 title slots, among the dynamic slots, where the host makes tables afresh. `describe_slots` only looked below the title's count, so the report never showed what the table held. **What the program does read, and where that goes wrong on a capped heap.** Besides its table, the program picks two buffer views from the resource heap by indices it reads from memory, and it does not loop (both seen offline in a local copy; nothing of it is in this PR). A hang with no page fault in such a program is what an NVIDIA card does when it reads a descriptor it cannot use. `heap_handle`'s own comment says the same about a view index past the heap ("hung its GPU (GPU-based validation: 'descriptor heap index out of bounds')"). Here the index stays inside the heap but lands on the wrong slot: - NVIDIA caps a shader-visible view heap at 1,000,000 views (`PORTABLE_VIEWS`), and the title's heap has 1,245,184 (#2625). `HostHeap::new_with` keeps the title's first `null - dynamic` slots, then the dynamic slots, then the null slot at 999,999. Its warning says "views past {fitted} read a null slot". - That is true only for indices at or past 999,999. Shaders clamp a picked index to the null slot only there (`heap_handle_at`, `VIEW_LIMIT`). A title index between `fitted` and 999,999 reads a **dynamic slot**: whatever table another draw had made there. That can be a constant buffer's raw view, a UAV, or a texture's view where the program expects a buffer. NVIDIA has no raw twins (they need 2^22 views), so nothing makes such a read type-safe. - **d7c2d8a7 (in v2026.11.29.02) moved real title slots into that window.** It raised the capped heap's dynamic slots from 262,144 to 393,216, so `fitted` fell from 737,855 to 606,783. The code's own note says the title's highest slot seen is about 720,000 (`DYNAMIC`'s doc comment). On v2026.11.28.03 and v2026.11.29.01, every title slot the title uses had a host slot of its own. From .02 on, title slots 606,783 to about 720,000 alias dynamic slots. Which of them a frame picks depends on what has streamed in, which fits the hang coming 40-190 s into the world. It also fits the "wrong texture for a moment" reports on .02: a ceiling with an unrelated poster in #3222, a guard's face showing signage in sailcat's comment. So the dispatch hangs because an index the title gave it, which the host cannot hold on a capped heap, reads another draw's table slot. It is not reading an unfilled table, a slot freed early, the indirect-gather path or late mirroring. The table itself (made afresh, in dynamic slots) is not the problem. **What this does not explain.** Bj0rnis (#2912: 4 of 4 hangs with the default, none in a 27-minute soak with `VICTORY_WAVE_FOLDED=1`) and meloiss (33 minutes on .03 with `=1`) found folding stops it. I translated the program offline with the v2026.11.29.01 translator: its DXIL is the same with `VICTORY_WAVE_FOLDED` unset, `=1` and `=0` (`577dec630dcf3721`, no wave64 retries). Folding changes five other programs bound in the same list (`17af15c4015cb4b6`, `fdd56d97a806bcca` → local waves; `55679a0547649d0b`, `89d08e561897d4e5` → wave-wide branches; `1c4b3c0547e3e6fa` → without skips). They are the instance-culling passes that run before it in the same list, and probably write the records it reads its indices from (not checked). If one of them writes a wrong record, the program gets an index that can land anywhere, the aliased window included. This change makes every index past the title's slots read null, whichever program wrote it. There is also one run against the slot story: Bj0rnis's run 4 in #2912 hung at 1.0 min with `VICTORY_DYNAMIC_SLOTS=262144` (the .01 layout). That run also had `VICTORY_SLOTS_BITMAP=1`, which `descriptor/slots.rs` documents as letting draws "pick up another draw's descriptors". sailcat's run B in #3079 (`VICTORY_DYNAMIC_SLOTS=262144` alone) did not hang. Whether one of those forms is wrong is for the wave64 work to answer. Main's 05d1c564 already folds the two `55679a…`/`89d08e…` programs again before the wave-wide form; the other three keep .02's forms. ## Fix 1. **Translator** (`victory-shader`): a view index a program picks from the resource heap (a scalar or per-lane descriptor load whose root is `ResourceHeap`, not the sampler heap) is compared with a new host word, `USER_TITLE_VIEWS`, and one at or past it reads the null slot (`index < title ? index : null`). This happens only when the host has a null slot (`view_heap_limit() != 0`). Tables are not held to it: the host makes tables afresh past the title's slots on purpose. The translator fingerprint changes (it hashes the shader crate's source), so caches are rebuilt once. 2. **Host** (`victory-gpu`): `State::host_word` sets `USER_TITLE_VIEWS` at every bind to the bound view heap's host title slots (`HostHeap::count`). Without a title heap of ours bound, or with `VICTORY_TITLE_VIEWS=0`, it sets `u32::MAX`, which keeps every index as before. The word is read once per bind, so `VICTORY_AB=VICTORY_TITLE_VIEWS` can switch it live in a diagnostics build for an A/B in one run. The heap's "views past {fitted} read a null slot" warning is now true. 3. **Device-removed report** (diagnostics only): each bind records which user-data words are tables (`indirects::table_words`). The report names those tables' slots, including dynamic ones ("dynamic slot N (taken .., shows a buffer of .. bytes / a texture of WxH)"), and no longer reads a root constant as a slot. The old guess is kept only for executions noted without that mask. Not added: a guard that refuses a dispatch whose bound slots are null. Null slots are legal and common (every host heap starts null, and the title leaves slots null), so such a guard would drop the title's own work. The clamp in (1) is the guard against the real hazard, a foreign descriptor, and costs one compare and select per picked view. What changes for the title: views it picks between `fitted` and the null slot now read as null (zeros) instead of another draw's table. They were never the title's views on this host. Getting them right needs title slots past the cap remapped. Raising the dynamic slots (PR #1007: 458,752) would make that window bigger. With this change that window reads null rather than aliasing. ## How it was tested - GPU: RTX 5080 16 GB (wave32), driver as installed, Windows 11 26200. **Not run in game** (see NOT tested). - Unit tests: - `victory-shader` `emit::size_tests::a_picked_view_past_the_titles_slots_reads_the_null_slot`: a program picks a raw buffer from the resource heap at slots 1, 3 and 1000. It is translated with a null slot at 5 and dispatched on the hardware adapter and WARP. With 3 title slots it reads slot 1 itself, and slot 3 and slot 1000 read the null slot. With 4 title slots, or with no bound (`u32::MAX`), slot 3 is read as before. Without a host limit the program has no such word. Passes on 41adb551 + this commit; the DXIL validated with `dxil.dll`, and it ran on both the hardware adapter and WARP (neither skipped). With `emit::size_tests` and `emit::bitcode`: 45 passed, 0 failed, 2 ignored (benchmarks). - `victory-gpu` `draw::tests::picked_views_are_kept_to_the_bound_heaps_title_slots`: the host word (title slots, `u32::MAX` with the switch off or without a heap of ours). - `victory-gpu` `host::indirects::tests::the_tables_words_name_their_slots_and_constants_none`: #3222's user data. The table at word 4 names slots 613,663..613,669, in the dynamic range, and the constant 16 at word 6 is no slot. Without the mask the old guess still takes it for one. The two existing tests of the module are updated for the mask. - `cargo check -p victory-gpu --locked`: clean on 716a0c99 + this change. The only warnings are main's own; none are on touched lines. - `cargo check -p victory-gpu --features diagnostics --locked`: clean with #3222's two-line fix for main's diagnostics build (on 716a0c99), which main has since landed as 41adb551. - `cargo test -p victory-gpu --lib --locked -- --test-threads=4` on 41adb551 + this change (344012d5): 921 passed, 2 failed, 60 ignored. The two failures aren't from this change. `shader_cache::tests::every_switch_of_the_translator_is_in_the_key` fails on main too (a stale `VICTORY_SCALAR_SPLITS` key; #3210/#3061 fix it). `host::card_steps::tests::places_written_after_sending_are_learned` passed 3 of 3 times when run alone; it only fails when run in parallel with other tests, and this change doesn't touch `card_steps.rs`. - The new victory-gpu tests: `draw::tests::picked_views_are_kept_to_the_bound_heaps_title_slots` passes. With `--features diagnostics`, `host::indirects::tests` passes 3 of 3, including the new `the_tables_words_name_their_slots_and_constants_none`. - The ignored `host::upcheck::tests::writes_through_picked_views_come_back` (run with `VICTORY_PICKED_WRITES=1 VICTORY_RELAY=2 VICTORY_RELAY_COPY=1`) fails at `upcheck.rs:930` the same way on main 41adb551 without this change. - clippy (`-p victory-shader -p victory-gpu --all-targets`): 35 warnings, none on a line this change touches; all of them are main's. - `cargo xtask policy`: one violation, `crates/victory-loader/src/heap_sites/frame_users.rs` (a run of hex literals). That file is main's and this change doesn't touch it. - Offline (local, nothing of it in the tree): `victory translate --list` of the list's 16 compute programs with the v2026.11.29.01 build, `VICTORY_HOST_WAVE=32 VICTORY_WAVE_WHY=1`, and `VICTORY_WAVE_FOLDED` unset, `=1` and `=0`, gives the DXIL hashes and forms quoted above. - For shader changes, the wave sizes tested: 32-lane host (RTX 5080). The change does not depend on the wave size. ## NOT tested - **In game.** Nobody was at the PC, and a hang here can need a hard power-off. Steps for later, on the 5080, v2026.11.29.05 defaults plus this branch, Series X 1440p, DLSS Quality, frame generation off, a save in the open world: 1. Release build of main 41adb551, 5 minutes in the world, driving through the city, 2 runs. Expect the hang within 40-190 s (#3050). If main no longer hangs here, the test cannot tell, so stop and report that. 2. The same with this branch, 2 runs of 5 minutes, plus one of 20 minutes. Watch the log for `0x887A0006` and the 5-second lines for dropped draws. 3. A/B in one run (diagnostics build): `VICTORY_AB=VICTORY_TITLE_VIEWS` and the F1 A/B toggle, with `VICTORY_D3D12_DRED=light`. If it still hangs, the report now names the table's slots. 4. Look for missing geometry or culling holes where title views past 606,783 now read null. That is what the trade-off would look like. 5. Workaround to test on unpatched builds: `VICTORY_DYNAMIC_SLOTS=262144`, which puts `fitted` back at 737,855 (sailcat's run B in #3079 did not hang, but ended in `did not close`). - AMD (raw twins): there the picked index goes through the same compare before the twin's own clamp. The twin of the null slot is a null raw view. Not run on the iGPU. - Root-signature room: the word adds one root constant to each stage that picks views from the heap. A pipeline whose root signature is already at 64 dwords would fail to make it. Not measured over the title's pipelines. - The `VICTORY_WAVE_FOLDED` observation is not explained by this change (see Root cause). ## Checked for overlap - [x] Searched open PRs for "null descriptor", "indirect", "hang", "TDR", "device removed", "DEVICE_HUNG", "dynamic slots", "title slot past", "heap index", "fitted" and `4fb416369fc50b6e`. Related: - #2666 (open, diagnostics): counts views past the capped heap and shows `PAST CAP` on F3, and says such views "read the null slot". Counting refusals at mirror time is complementary. Its premise holds only for tables and indices past 999,999 until this lands. No textual conflict expected (`mirror_inner` vs `dynamic_slots`/`host_word`). - #1007 (open): raises the default dynamic slots to 458,752 on 1M-capped heaps. Without this change it would put title slots 541,247-720,000 in the aliased window. - #194 (open, 11-27 base): the `COPY_DEST` root SRV barrier the debug layer counts in #3222. A different hazard, and it does not touch these files. - #2048 (open): the diagnostics build's `timing` shadowing and `mb`, which #3222 also hit. Main fixed it in 41adb551, which this branch is on. - #2570, #1719, #2881 (dynamic slot telemetry and allocator): no overlap in behaviour. - No open PR clamps picked views to the title's slots. ## AI use Claude Code (Claude Opus 5.5) read the issues and the code, translated the list's programs offline from a local copy to compare their forms (nothing of the title is in this PR), wrote the change and the tests, ran the checks, and wrote this description. 🤖 Generated with [Claude Code](https://claude.com/claude-code)
On a view heap capped at 1,000,000 views (NVIDIA) the title's 1,245,184
do not fit: the host keeps its first null - dynamic slots, then the
dynamic slots it makes tables in afresh, then the null slot. Shaders
clamped a view index they pick from the resource heap only at the null
slot, so a title index between the two read whatever table another draw
had made there, a texture's view as a buffer's among them. d7c2d8a7
(v2026.11.29.02) raised the dynamic slots to 393,216 and moved title slots
606,783 to about 720,000, which the title uses, into that window.

#3222's device-removed data names the command the card hung in since .02:
an indirect dispatch of 4fb416369fc50b6e, which picks buffers from the
heap by indices it reads from memory; no page fault. Its "word 6 slot 16:
null" was the report's guess: word 6 is a root constant (16), and the
dispatch's table at word 4 (slots 613,663 on) lay in the dynamic slots,
which the report did not look at.

- victory-shader: a view index picked from the resource heap is compared
  with a new host word, USER_TITLE_VIEWS; one at or past it reads the null
  slot. Only with a host limit; tables are not held to it.
- victory-gpu: the host word is the bound view heap's title slots on the
  host (u32::MAX without a heap of ours, or with VICTORY_TITLE_VIEWS=0).
- Diagnostics: each bind records which user-data words are tables, and the
  device-removed report names their slots, dynamic ones included, instead
  of taking small words for slots.

Tests: a picked raw buffer at slots 1, 3 and 1000 on the hardware adapter
and WARP (null slot past the title's, as before with no bound), the host
word, and #3222's user data in the report. Not run in game.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
github-bot locked as GitHub sync and limited conversation to collaborators 2026-11-30 03:54:27 +00:00
Author
Owner

@⁠tahffo68hk-hash on GitHub · 2026-11-30 08:33 UTC · original

Additional mixed-control-flow tests

I prepared a test-only branch against this PR's head, so it can be cherry-picked or absorbed here without mixing in a second production implementation:

contrib/3686-mixed-control-flow-tests
Commit: 42c1491df4615df1c0dc6a022208a329e849ac03 (parent: this PR's 344012d5)

The added real GFX10 ISA lowering regressions cover mixed ResourceHeap and dynamic Table descriptor sources through:

  • Select and scalar Phi: with USER_TITLE_VIEWS = 606783, a guest index of 800000 selects null slot 999999, while the table snapshot at 800000 remains accessible.
  • LanePhi: verifies the same per-source behavior before lane merging and preserves the inactive-lane zero sentinel.
  • The test-only bitcode evaluator now follows unsigned-less-than guards and selects to assert the emitted descriptor indices. Each case runs DXIL validation.

No production code or alternate boundary mechanism is included.

Validation on the PR head plus this test commit:

  • cargo test --locked -p victory-shader real_isa_mixed_descriptor -- --test-threads=1: 3 passed; DXIL validation passed in all three.
  • cargo test --locked -p victory-shader a_picked_view_past_the_titles_slots_reads_the_null_slot -- --test-threads=1: 1 passed (the PR's existing hardware/WARP regression).
  • cargo build --release --locked -p victory-shader: passed.

混合控制流测试补充

我准备了一个以本 PR head 为父提交的纯测试分支,可直接 cherry-pick 或吸收到本 PR 中,不会混入第二套生产修复:

contrib/3686-mixed-control-flow-tests
提交:42c1491df4615df1c0dc6a022208a329e849ac03(父提交:本 PR 的 344012d5)

新增的真实 GFX10 ISA lowering 回归覆盖混合 ResourceHeap 与动态 Table 来源经过:

  • Select 和标量 Phi:当 USER_TITLE_VIEWS = 606783 时,guest 索引 800000 会选到 null 槽 999999,而 table 快照索引 800000 仍可访问。
  • LanePhi:验证每个来源在 lane 合并前分别处理,并保留 inactive lane 的零哨兵。
  • 仅测试用 bitcode evaluator 新增了对无符号小于比较和 select 的求值,以断言生成的 descriptor 索引。每个案例都会执行 DXIL 校验。

不包含生产代码,也不包含另一种边界实现。

在本 PR head 加该测试提交后的验证结果:

  • cargo test --locked -p victory-shader real_isa_mixed_descriptor -- --test-threads=1:3 项通过,三项 DXIL 校验均通过。
  • cargo test --locked -p victory-shader a_picked_view_past_the_titles_slots_reads_the_null_slot -- --test-threads=1:1 项通过(本 PR 现有的硬件/WARP 回归)。
  • cargo build --release --locked -p victory-shader:通过。
**@⁠tahffo68hk-hash** on GitHub · 2026-11-30 08:33 UTC · [original](https://github.com/trustno1-coder/VIctory-NVIDIA/pull/3686#issuecomment-7273047487) ## Additional mixed-control-flow tests I prepared a test-only branch against this PR's head, so it can be cherry-picked or absorbed here without mixing in a second production implementation: [contrib/3686-mixed-control-flow-tests](https://github.com/tahffo68hk-hash/VIctory-NVIDIA/tree/contrib/3686-mixed-control-flow-tests) Commit: `42c1491df4615df1c0dc6a022208a329e849ac03` (parent: this PR's `344012d5`) The added real GFX10 ISA lowering regressions cover mixed `ResourceHeap` and dynamic `Table` descriptor sources through: - **Select** and scalar **Phi**: with `USER_TITLE_VIEWS = 606783`, a guest index of 800000 selects null slot 999999, while the table snapshot at 800000 remains accessible. - **LanePhi**: verifies the same per-source behavior before lane merging and preserves the inactive-lane zero sentinel. - The test-only bitcode evaluator now follows unsigned-less-than guards and selects to assert the emitted descriptor indices. Each case runs DXIL validation. No production code or alternate boundary mechanism is included. Validation on the PR head plus this test commit: - `cargo test --locked -p victory-shader real_isa_mixed_descriptor -- --test-threads=1`: 3 passed; DXIL validation passed in all three. - `cargo test --locked -p victory-shader a_picked_view_past_the_titles_slots_reads_the_null_slot -- --test-threads=1`: 1 passed (the PR's existing hardware/WARP regression). - `cargo build --release --locked -p victory-shader`: passed. --- ## 混合控制流测试补充 我准备了一个以本 PR head 为父提交的纯测试分支,可直接 cherry-pick 或吸收到本 PR 中,不会混入第二套生产修复: [contrib/3686-mixed-control-flow-tests](https://github.com/tahffo68hk-hash/VIctory-NVIDIA/tree/contrib/3686-mixed-control-flow-tests) 提交:`42c1491df4615df1c0dc6a022208a329e849ac03`(父提交:本 PR 的 `344012d5`) 新增的真实 GFX10 ISA lowering 回归覆盖混合 `ResourceHeap` 与动态 `Table` 来源经过: - **Select** 和标量 **Phi**:当 `USER_TITLE_VIEWS = 606783` 时,guest 索引 800000 会选到 null 槽 999999,而 table 快照索引 800000 仍可访问。 - **LanePhi**:验证每个来源在 lane 合并前分别处理,并保留 inactive lane 的零哨兵。 - 仅测试用 bitcode evaluator 新增了对无符号小于比较和 select 的求值,以断言生成的 descriptor 索引。每个案例都会执行 DXIL 校验。 不包含生产代码,也不包含另一种边界实现。 在本 PR head 加该测试提交后的验证结果: - `cargo test --locked -p victory-shader real_isa_mixed_descriptor -- --test-threads=1`:3 项通过,三项 DXIL 校验均通过。 - `cargo test --locked -p victory-shader a_picked_view_past_the_titles_slots_reads_the_null_slot -- --test-threads=1`:1 项通过(本 PR 现有的硬件/WARP 回归)。 - `cargo build --release --locked -p victory-shader`:通过。
github-bot force-pushed github-bot/gh-3686 from 344012d589 to 80f0293380 2026-11-30 18:58:18 +00:00 Compare
Author
Owner

@⁠Lyrnc on GitHub · 2026-11-30 18:59 UTC · original

@⁠tahffo68hk-hash, thank you. I read the commit and it is test-only. The evaluator additions (IULT, Select, descriptor_index_choices) sit in the #[cfg(test)] part of bitcode.rs. The three lowering cases cover the mixed ResourceHeap and Table sources through Select, Phi and LanePhi, which the PR's own tests did not. It is in the branch now with you as its author.

To take it, I rebased the branch onto main 84bd61e2 (v2026.11.30.02) and force-pushed. The test commit conflicted with main's newer tests at the end of lower/tests.rs, and both sets are kept. Two commits, now ending at 80f02933:

Checks on 80f02933 (Windows 11, rustc 1.98.1, its own target dir):

  • cargo check -p victory-gpu -p victory-shader passes, and so does cargo check -p victory-gpu --features diagnostics.
  • cargo test -p victory-shader --lib -- a_picked_view_past_the_titles_slots_reads_the_null_slot size_tests real_isa_mixed_descriptor: 14 passed. Your three cases are among them, with DXIL validation in each, as is the PR's hardware/WARP null-slot test.
  • cargo test -p victory-gpu --features diagnostics --lib -- the_tables_words_name_their_slots picked_views_are_kept: 2 passed.

AI use: Claude Code (Claude Opus 5.5) reviewed and applied the commit, did the rebase, ran the tests and wrote this reply.

**@⁠Lyrnc** on GitHub · 2026-11-30 18:59 UTC · [original](https://github.com/trustno1-coder/VIctory-NVIDIA/pull/3686#issuecomment-7288667036) @⁠tahffo68hk-hash, thank you. I read the commit and it is test-only. The evaluator additions (`IULT`, `Select`, `descriptor_index_choices`) sit in the `#[cfg(test)]` part of `bitcode.rs`. The three lowering cases cover the mixed `ResourceHeap` and `Table` sources through Select, Phi and LanePhi, which the PR's own tests did not. It is in the branch now with you as its author. To take it, I rebased the branch onto main 84bd61e2 (v2026.11.30.02) and force-pushed. The test commit conflicted with main's newer tests at the end of `lower/tests.rs`, and both sets are kept. Two commits, now ending at 80f02933: - c22a0160: the fix, unchanged; - 80f02933: your tests. Checks on 80f02933 (Windows 11, rustc 1.98.1, its own target dir): - `cargo check -p victory-gpu -p victory-shader` passes, and so does `cargo check -p victory-gpu --features diagnostics`. - `cargo test -p victory-shader --lib -- a_picked_view_past_the_titles_slots_reads_the_null_slot size_tests real_isa_mixed_descriptor`: 14 passed. Your three cases are among them, with DXIL validation in each, as is the PR's hardware/WARP null-slot test. - `cargo test -p victory-gpu --features diagnostics --lib -- the_tables_words_name_their_slots picked_views_are_kept`: 2 passed. AI use: Claude Code (Claude Opus 5.5) reviewed and applied the commit, did the rebase, ran the tests and wrote this reply.
github-bot force-pushed github-bot/gh-3686 from 80f0293380 to 91e9404ad3 2026-12-01 04:54:08 +00:00 Compare
Author
Owner

@⁠eipastel on GitHub · 2026-12-01 05:12 UTC · original

In-game test of this PR on an RTX 5060 8 GB (the #4506 card), Series S, DLSS Performance, prison save, VICTORY_TEXTURE_BUDGET_MB=2000, VICTORY_D3D12_DRED=light, diag build.

The branch conflicts with main, so I cherry-picked its two own commits (c22a0160 and 80f02933) onto main at 5fabb46e. Both applied cleanly and the build succeeded.

runs of 300 s in the world DEVICE_HUNG average fps
main 43a32461, yesterday 6 1 (the #4506 DRED report, 0452fc2d2e2fc4c3) 20.4–22.4
main 5fabb46e + this PR 6 0 22.6–23.1 (runs 2–6; run 1 was rebuilding the shader cache)

No device removed or 0x887A0006 in any of the six logs. One hang in six runs before against none in six now is too few to call it fixed, but nothing got worse, and fps is the same or a little better. I can do more runs if that would help.

**@⁠eipastel** on GitHub · 2026-12-01 05:12 UTC · [original](https://github.com/trustno1-coder/VIctory-NVIDIA/pull/3686#issuecomment-7301528369) In-game test of this PR on an RTX 5060 8 GB (the #4506 card), Series S, DLSS Performance, prison save, `VICTORY_TEXTURE_BUDGET_MB=2000`, `VICTORY_D3D12_DRED=light`, diag build. The branch conflicts with `main`, so I cherry-picked its two own commits (c22a0160 and 80f02933) onto `main` at 5fabb46e. Both applied cleanly and the build succeeded. | | runs of 300 s in the world | DEVICE_HUNG | average fps | |---|---|---|---| | `main` 43a32461, yesterday | 6 | 1 (the #4506 DRED report, `0452fc2d2e2fc4c3`) | 20.4–22.4 | | `main` 5fabb46e + this PR | 6 | 0 | 22.6–23.1 (runs 2–6; run 1 was rebuilding the shader cache) | No `device removed` or 0x887A0006 in any of the six logs. One hang in six runs before against none in six now is too few to call it fixed, but nothing got worse, and fps is the same or a little better. I can do more runs if that would help.
Author
Owner

@⁠Lyrnc on GitHub · 2026-12-01 05:20 UTC · original

@⁠eipastel thank you, that's the most useful kind of test for this one: the card that produced #4506's DRED report, the same save, and DRED on. 0 hangs in 6 against 1 in 6 is suggestive rather than conclusive, as you say. If you have the time, another 6-10 runs of each would make it count, since the hangs were 40-190 s into the world on the affected cards. The branch is being rebased onto current main now (upstream's history rewrite left it conflicting), so the next head will apply without cherry-picking.

AI use: Claude Code (Claude Opus 5.5) wrote this reply.

**@⁠Lyrnc** on GitHub · 2026-12-01 05:20 UTC · [original](https://github.com/trustno1-coder/VIctory-NVIDIA/pull/3686#issuecomment-7301667459) @⁠eipastel thank you, that's the most useful kind of test for this one: the card that produced #4506's DRED report, the same save, and DRED on. 0 hangs in 6 against 1 in 6 is suggestive rather than conclusive, as you say. If you have the time, another 6-10 runs of each would make it count, since the hangs were 40-190 s into the world on the affected cards. The branch is being rebased onto current main now (upstream's history rewrite left it conflicting), so the next head will apply without cherry-picking. AI use: Claude Code (Claude Opus 5.5) wrote this reply.
This pull request can be merged automatically.
This branch is out-of-date with the base branch
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/3686/head:github-bot/gh-3686'
git switch 'github-bot/gh-3686'

Merge

Merge the changes and update on Forgejo.
git switch 'main'
git merge --no-ff 'github-bot/gh-3686'
git switch 'github-bot/gh-3686'
git rebase 'main'
git switch 'main'
git merge --ff-only 'github-bot/gh-3686'
git switch 'github-bot/gh-3686'
git rebase 'main'
git switch 'main'
git merge --no-ff 'github-bot/gh-3686'
git switch 'main'
git merge --squash 'github-bot/gh-3686'
git switch 'main'
git merge --ff-only 'github-bot/gh-3686'
git switch 'main'
git merge 'github-bot/gh-3686'
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/trustno1-coder--VIctory-NVIDIA!3686
No description provided.