Repository navigation
Conversation
When HostHeap::dynamic ran out, State::tables skipped the fresh table and the stage's user data fell back to the title's table offset. Constant buffer tables are always made fresh and never mirrored, so the shader read whatever host descriptor sat at those slots as a constant buffer; on AMD a texture or null descriptor read as a buffer gives a wild base address and the device is removed (Marvisak#59: faults at 0x7000037xxxxx, 0x8000037xxxxx, 0x33c4000, a different pipeline every run, about 60 s in). bind now reports that a table could not be made, and the draw, mesh dispatch, dispatch or indirect execution is dropped. The dynamic range grows from 2^16 to 2^18 slots, which the world did not exhaust on an RX 9070 XT. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
A host that refuses the title's slots plus 2^18 dynamic ones (NVIDIA's 1,000,000-view cap) now gets 2^16 dynamic slots, as before, instead of losing mirrored title slots to the larger range: at the cap, 2^18 left 737,856 title slots against 934,464, and titles were seen to index slots up to 917,140. The cap itself is unchanged. Hosts that take the larger heap (RX 9070 XT) keep 2^18.
A root SRV is a bare GPU address: nothing bounds what a shader reads through it. Vertex fetch reads its stream through a root SRV with no record limit, and a mesh shader read past the end of the buffer's host copy into memory the host had already freed (the "inside freed texture" device removal after the fix for Marvisak#59: the fault lay just past the copy's end, in the gap where released textures had been). Each root SRV is now a one-descriptor table holding a raw view of the host copy from the root address to the copy's end, made once per address per list in the heap's dynamic slots; reads past the end return zero, as for any bounded view. A root SRV the title did not set, or one with no host copy, gets a null raw view (an unset table is undefined). Addresses not on 16 bytes, which a raw view cannot start at, read zeros and are logged once. VICTORY_ROOT_SRV_DIRECT=1 restores root descriptors.
|
NVIDIA / Linux data point, since NVIDIA was untested here. Setup: RTX 5080, driver 615.71.09, CachyOS, proton-cachyos (vkd3d-proton 3.2.0), Series X 1.0.2.1, diagnostics build of Before (same stack without #336 / #493): 4 of 5 runs ended in a GPU hang, With #336 + #493: 4 of 4 runs without a hang: 8, 10 and 9 min after start, through to the timer, and 7.5 min (stopped by hand), about 6–8.5 min in the world. The last one also had #431. No Four runs, so not conclusive, but it fits @matheushagedorn's finding on #71 (an AI-assisted (Claude Code); the numbers come from the logs of these runs. |
… and descriptor safety (Marvisak#493, Marvisak#336)
|
Heads-up: this PR and #458 both add Whichever lands second will need to drop or rename its copy. |
|
NVIDIA data point: RTX 4070 (driver 32.0.16.2101, Windows 11), diag builds, entering the world (first mission intro), 300 s runs.
Still seen on NVIDIA with both applied: the 65,536 dynamic descriptor slots run out (
|
|
RTX 5070, native Windows D3D12: this plus #483 keeps the world alive, where main loses the device within 1-2.5 min. Setup: Windows 11 Pro 26200.9974, NVIDIA RTX 5070, driver 617.14, in-box D3D12 10.0.26100.9818, Rust 1.98.1, release build.
With this PR + #483 the slow-submission lines settle at 265-284 ms for the same 11-list submissions that took 11 s before (10-40x), and the frame log goes 2 fps / 455-570 ms per frame, 500-1113 draws per frame. Stopped by the run, not by a fault. One integration note for landing both: #493 and #483 conflict in
That build runs No game files; only timings, frame counts and the two error names. AI-assisted (DeepSeek V4.1 Flash coding agent). |
hophaver's Marvisak#493: each root SRV becomes a one-descriptor table holding a raw view of the buffer's host copy from the root address to the copy's end, in a dynamic slot, so reads past the copy return zeros. VICTORY_ROOT_SRV_DIRECT=1 restores root descriptors. The branch carries Marvisak#336, which this tree had at 3c81420, and with it Marvisak#336's second commit e8d3b64. Conflict resolution, crates/victory-gpu/src/descriptor/host.rs: this tree's side is kept whole (the `spare` field, the capped sampler heap with its dynamic slots, `with`, `free_table`), and only c48b240's own additions are taken (raw_at, null_raw_at, is_sampler, gpu_handle). e8d3b64's sizing is not taken: it gives a heap the host caps 2^16 dynamic slots in place of 2^18 (MIN_DYNAMIC), so that more of the title's slots are mirrored. A tester measured that tradeoff in the title on an RTX 5080 (Zignixx, upstream issue Marvisak#71, comment 7123097017, one run per row): with 65,536 dynamic slots 22-30% of the requests for slots were refused and about 1,680 mesh dispatches per frame were dropped; with 262,144 none were, the peak in use was 132,014, and "title slot past the host heap" never fired in a 7-minute run. A capped view heap therefore keeps 2^18 dynamic slots, as this tree had. New test a_capped_view_heap_keeps_its_dynamic_slots (on the integration machine's RTX 5070 the heap of 1,310,720 title slots is capped: 737,856 title slots and 262,144 dynamic ones). Change beyond the PR, crates/victory-gpu/src/draw.rs, root_srv_table: the host copy is moved to its read state (list.buffer_state with BUFFER_READ), as root_view does since Marvisak#334. Marvisak#493 was written without Marvisak#334's buffer-state tracker; without this a copy a shader wrote earlier would be read through the table in its unordered-access state. Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
Seven more upstream PRs are in (Marvisak#493, Marvisak#483, Marvisak#206, Marvisak#469, Marvisak#459, Marvisak#454, Marvisak#579) and the wave64 stack is at Marvisak#439's head 965ce30. Records how each was combined with what the tree had, that a capped view heap keeps 2^18 dynamic slots and why, Marvisak#189 and Marvisak#578 as left out, and a new section with testers' reports from the title: the set without the world-entry hang on three NVIDIA cards and how this tree differs from it, VICTORY_SKIP_WAVE64 as the switch to try, and Marvisak#136 bisected as making every frame black. Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
…+ Marvisak#1418) + shader stack No textual conflict; checked with cargo check --workspace --all-targets and the full test suite (RTX, WARP, all features) when first merged on the previous Marvisak#1511 head (289f241); this replay with cargo check --workspace --all-targets --all-features, and the full suite at the end of the line.
…shader writes and reads) onto integ/next Conflicts: 1. crates/victory-gpu/src/draw.rs, `State::bind`: the stack (Marvisak#1439's depth sampling) resets `self.depth_sampled`, Marvisak#334 starts a buffer-state command (`list.begin_command()`). Independent; both kept, reset first. 2. crates/victory-gpu/src/host.rs tests: the stack adds `warp_device_creation_and_caps_probe`, Marvisak#334 adds `buffer_states_transition_between_writes_and_reads`, `buffer_states_keep_a_command_writing` and `debug_layer_accepts_buffers_written_then_read_as_vertices` (with its helpers) at the same place. The shared text holds the `#[test]` before and the closing brace after, so neither side's body closes inside the hunk: the stack's test is closed and Marvisak#334's follow as separate items (not nested). Non-textual fixes: - draw.rs `root_srv_table` (Marvisak#493, bounded root SRVs as one-view tables) reads a host copy without going through `root_view`, so it never asked Marvisak#334's tracker for the read state. It now calls `list.buffer_state(&s.buffer, BUFFER_READ)` after its refresh, on cache hits too, as Marvisak#334's author and Hiiva noted on Marvisak#334 (Marvisak#334 (comment), Marvisak#334 (comment)). - indirect.rs test `clamp_preserves_record_offsets_and_shared_budget` (Marvisak#1279, via Marvisak#1439) called `indirect::done`, which Marvisak#334 removes (the clamp now asks the tracker for the write state and `close` returns the copy to COMMON). The call is dropped; the next `bound` asks for the write state again, so no transition is missing.
…removal on RX 9070 XT
Builds on #336 (it uses that PR's
bindreturningfalse); the diff againstmainshows #336's two commits until that one is merged. The change here isc48b240.Problem
With #336, the world on an RX 9070 XT runs past the 60 s descriptor exhaustion, then is removed at about 134–145 s with a different signature, seen on three machines (#336 comments):
As @GamingRipperDoc worked out there: the mesh shader reads its vertex stream through root SRV
root3, whose host copy ends exactly at the end of that 4 MB title memory copy, and the fault lies just past it. A root SRV is a bare address, and vertex fetch reads it with no record limit, so a read past the copied range lands in whatever the host placed there, here memory that had held since-freed textures.Change
raw_at). Reads past the end return zero, as for any bounded view, instead of reaching other host memory.VICTORY_ROOT_SRV_DIRECT=1goes back to root descriptors.Root CBVs are unchanged.
Tested
Windows 11, RX 9070 XT, v1.0.2.1, diag build,
VICTORY_D3D12_DRED=1, this branch alone onmaind2a4bae(+ #336):inside freed texture 1024x1024 f99), matching the two reports on GPU: drop draws whose fresh tables cannot be made; 2^18 dynamic slots #336 (~136 s, ~145 s).root SRV not on 16 bytesline.cargo test -p victory-gpupasses (43, 1 ignored).cargo xtask policypasses.One run with the change; more runs, and NVIDIA / Intel, are untested.