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
No reviewers
Labels
No labels
AMD
audio
bug
confirmed
crash
cutscene
dlss
documentation
duplicate
enhancement
fixed-on-main
frame-generation
good first issue
help wanted
input
INTEL
invalid
lighting
linux-proton
memory
needs-info
needs-logs
needs-rebase
NVIDIA
performance
pr-diagnostics
pr-docs
pr-feature
pr-fix
pr-performance
pr-refactor
pr-tests
question
RAYTRACING
rendering
report
series-s
shaders
spam
startup
upstream
wontfix
No milestone
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set
Reference
github/trustno1-coder--VIctory-NVIDIA!3686
Loading…
Reference in a new issue
No description provided.
Delete branch "github-bot/gh-3686"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
@Lyrnc on GitHub · 2026-11-30 03:50 UTC · original
Lyrnc:fix/indirect-null-slot→main· +402 −37 · 10 files · 2 commits · openBranch: Lyrnc/VIctory-NVIDIA
fix/indirect-null-slot(one commit on trustno1-coder/VIctory-NVIDIA main41adb551, 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 of4fb416369fc50b6e, 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::slotsguesses 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_slotsonly 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:PORTABLE_VIEWS), and the title's heap has 1,245,184 (#2625).HostHeap::new_withkeeps the title's firstnull - dynamicslots, then the dynamic slots, then the null slot at 999,999. Its warning says "views past {fitted} read a null slot".heap_handle_at,VIEW_LIMIT). A title index betweenfittedand 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, sofittedfell 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 withVICTORY_WAVE_FOLDEDunset,=1and=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 withVICTORY_DYNAMIC_SLOTS=262144(the .01 layout). That run also hadVICTORY_SLOTS_BITMAP=1, whichdescriptor/slots.rsdocuments as letting draws "pick up another draw's descriptors". sailcat's run B in #3079 (VICTORY_DYNAMIC_SLOTS=262144alone) did not hang. Whether one of those forms is wrong is for the wave64 work to answer. Main's05d1c564already folds the two55679a…/89d08e…programs again before the wave-wide form; the other three keep .02's forms.Fix
victory-shader): a view index a program picks from the resource heap (a scalar or per-lane descriptor load whose root isResourceHeap, 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.victory-gpu):State::host_wordsetsUSER_TITLE_VIEWSat every bind to the bound view heap's host title slots (HostHeap::count). Without a title heap of ours bound, or withVICTORY_TITLE_VIEWS=0, it setsu32::MAX, which keeps every index as before. The word is read once per bind, soVICTORY_AB=VICTORY_TITLE_VIEWScan 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.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
fittedand 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
victory-shaderemit::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 on41adb551+ this commit; the DXIL validated withdxil.dll, and it ran on both the hardware adapter and WARP (neither skipped). Withemit::size_testsandemit::bitcode: 45 passed, 0 failed, 2 ignored (benchmarks).victory-gpudraw::tests::picked_views_are_kept_to_the_bound_heaps_title_slots: the host word (title slots,u32::MAXwith the switch off or without a heap of ours).victory-gpuhost::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 on716a0c99+ 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 (on716a0c99), which main has since landed as41adb551.cargo test -p victory-gpu --lib --locked -- --test-threads=4on41adb551+ 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_keyfails on main too (a staleVICTORY_SCALAR_SPLITSkey; #3210/#3061 fix it).host::card_steps::tests::places_written_after_sending_are_learnedpassed 3 of 3 times when run alone; it only fails when run in parallel with other tests, and this change doesn't touchcard_steps.rs.draw::tests::picked_views_are_kept_to_the_bound_heaps_title_slotspasses. With--features diagnostics,host::indirects::testspasses 3 of 3, including the newthe_tables_words_name_their_slots_and_constants_none.host::upcheck::tests::writes_through_picked_views_come_back(run withVICTORY_PICKED_WRITES=1 VICTORY_RELAY=2 VICTORY_RELAY_COPY=1) fails atupcheck.rs:930the same way on main41adb551without this change.-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.victory translate --listof the list's 16 compute programs with the v2026.11.29.01 build,VICTORY_HOST_WAVE=32 VICTORY_WAVE_WHY=1, andVICTORY_WAVE_FOLDEDunset,=1and=0, gives the DXIL hashes and forms quoted above.NOT tested
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.0x887A0006and the 5-second lines for dropped draws.VICTORY_AB=VICTORY_TITLE_VIEWSand the F1 A/B toggle, withVICTORY_D3D12_DRED=light. If it still hangs, the report now names the table's slots.VICTORY_DYNAMIC_SLOTS=262144, which putsfittedback at 737,855 (sailcat's run B in #3079 did not hang, but ended indid not close).VICTORY_WAVE_FOLDEDobservation is not explained by this change (see Root cause).Checked for overlap
4fb416369fc50b6e. Related:PAST CAPon 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_innervsdynamic_slots/host_word).COPY_DESTroot SRV barrier the debug layer counts in #3222. A different hazard, and it does not touch these files.timingshadowing andmb, which #3222 also hit. Main fixed it in41adb551, which this branch is on.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
@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's344012d5)The added real GFX10 ISA lowering regressions cover mixed
ResourceHeapand dynamicTabledescriptor sources through:USER_TITLE_VIEWS = 606783, a guest index of 800000 selects null slot 999999, while the table snapshot at 800000 remains accessible.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来源经过:USER_TITLE_VIEWS = 606783时,guest 索引 800000 会选到 null 槽 999999,而 table 快照索引 800000 仍可访问。不包含生产代码,也不包含另一种边界实现。
在本 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:通过。344012d589to80f0293380@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 ofbitcode.rs. The three lowering cases cover the mixedResourceHeapandTablesources 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 oflower/tests.rs, and both sets are kept. Two commits, now ending at80f02933: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-shaderpasses, and so doescargo 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.
80f0293380to91e9404ad3@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 (c22a0160and80f02933) ontomainat5fabb46e. Both applied cleanly and the build succeeded.main43a32461, yesterday0452fc2d2e2fc4c3)main5fabb46e+ this PRNo
device removedor 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.@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.
View command line instructions
Checkout
From your project repository, check out a new branch and test the changes.Merge
Merge the changes and update on Forgejo.