GPU: the DRED report reads only the breadcrumb history that is there #3266
Loading…
Reference in a new issue
No description provided.
Delete branch "upstream-pr/3268"
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?
Imported from Marvisak/VIctory. Originally posted by davesousa on 2026-11-26T15:10:57Z.
With
VICTORY_D3D12_DRED,Host::removal_datamakes a slice ofBreadcrumbCountops over each unfinished node'spCommandHistoryand walks all of it. On an RTX 3070 Ti (driver 621.40, Windows 11 26200) one removal's report crashed VIctory instead:0xc0000005reading op 15,360 of a node's history, exactly 60 KiB in, where the memory was reserved but not committed. So that removal's report was lost. It was 1 of 3 DRED removals I have, in aVICTORY_GPU_TIMING=1run (#2703 + #2841 on my NVIDIA stack). The other reports on this card read histories of 17,030 to 19,268 ops without trouble, so the history is not capped at 15,360; in that one, the runtime's count ran past the history it had committed.This PR:
read, as the title-memory copies do), page by page, up to the first page that cannot be read;but only its first N commands can be readwhen the history is cut short;Test:
host::breadcrumbs::a_history_shorter_than_its_count_is_read_as_far_as_it_is_theremakes a two-page reservation with only the first page committed, and a count of two pages. With the old read (from_raw_partsover the count) put back, the test process dies with0xc0000005 STATUS_ACCESS_VIOLATION; with this PR it passes.Checks on the RTX 3070 Ti: both clippy commands and
cargo xtask policypass.cargo test --workspace --locked --no-fail-fastgives the same results asmainon this card (twovictory-gpuview-heap-cap failures,dynamic_slots_are_held_until_releasedandlists_share_a_table_and_copies_keep_their_views, and thevictory-shadercrash of #2571), plus the new test passing.Not tested: a real removal with a cut-short history. That needs a GPU fault, and
ID3D12Device5::RemoveDevicewaits until the GPU is idle, so afterwards DRED lists no unfinished nodes (checked on this card). So there is no forced-removal test here.Claimed on #1633. AI-assisted (Claude Code).
🤖 Generated with Claude Code
Imported from Marvisak/VIctory. Originally posted by Dukestar69 on 2026-11-26T15:28:57Z.
Review: APPROVED
Reviewed the diff and verified locally on Windows 11 x64:
ReadProcessMemory(readable_history) and bounds-checkingdone < history.len()instopped_at/in_flightcleanly prevents access violations whenBreadcrumbCountruns past committed pages.cargo test -p victory-gpu --lib host::breadcrumbs:: -- --test-threads=1: 1 passed, 0 failed (a_history_shorter_than_its_count_is_read_as_far_as_it_is_there).cargo clippy -p victory-gpu --all-targets -- -D warnings: clean.cargo clippy -p victory-gpu --features diagnostics --all-targets -- -D warnings: clean.cargo xtask policy: 191 files ok.Synthetic tests only (no game files used). AI-assisted (Gemini 4 Neon).
Imported from Marvisak/VIctory. Originally posted by oni-swr on 2026-11-26T16:10:00Z.
WARP verification report (test report only, no code changes)
7cbb83ec63bcca43(control); WARP software adapter forced withVICTORY_WARP=1 VICTORY_D3D12_WARP=1,--features diagnostics, d3d10warp.dll 10.0.26100.9818; dxil.dll 1.8.2502.11 (Windows Kit 10.0.26100.0, viaVICTORY_DXIL).--exact),-j 4, synthetic tests only, no game data. Command:cargo test -p victory-gpu --lib --features diagnostics -j 4 -- --exact <test>.host::breadcrumbs::a_history_shorter_than_its_count_is_read_as_far_as_it_is_there: passes on the PR (1 passed).readable_historyandstopped_atfrom this PR, so I added the test to main with two shims that keep main's behaviour (read the runtime's whole count unchecked, index the history atdone). The test crashes on main withSTATUS_ACCESS_VIOLATION(0xc0000005) reading the uncommitted page, i.e. the fault the PR describes. That is a main-plus-shim control, not unmodified main.victory-gpulib suite: PR 247 passed, 0 failed, 1 ignored; main 246 passed, 0 failed, 1 ignored. No failures on either.AI-assisted: verification by Claude Code (Claude Sonnet 5.5)
Imported from Marvisak/VIctory. Originally posted by futurepro62 on 2026-11-26T23:25:19Z.
NVIDIA full-suite run, to go with the reports above by Dukestar69, oni-swr, since none of them names a GPU run. Tested exact head
7cbb83e(on its base63bcca4).Tested
dxil.dllfrom Windows SDK 10.0.26100 (the loader's default), debug.cargo build --workspace --locked, thencargo test --workspace --locked --no-fail-fast -- --test-threads=4 --skip emit::memory_tests::heap_direct_texture_reads_mark_their_heap_index --skip descriptor::host::tests::dynamic_slots_are_held_until_released --skip memory::tests::lists_share_a_table_and_copies_keep_their_views --skip emit::stride_tests::a_heap_buffer_read_by_element_takes_the_views_stride --skip emit::stride_tests::a_heap_buffer_read_where_no_buffer_view_is_reads_zeros --skip emit::synthetic_tests::gathers_at_a_level_match_the_hardware: 867 passed, 0 failed, 10 ignored.a_history_shorter_than_its_count_is_read_as_far_as_it_is_there.--skipleaves out tests that fail on main63bcca4on this card too, not because of this PR:heap_direct_texture_reads_mark_their_heap_indexends thevictory-shadertest process with0xc0000005(#2571), so without the skip the rest of that crate never reports;dynamic_slots_are_held_until_released,lists_share_a_table_and_copies_keep_their_viewsand the twostride_testshit the 1,000,000-view heap cap of NVIDIA drivers (#1835, #2317);gathers_at_a_level_match_the_hardwarefails on lane 0 (#1744).Not tested
AI use
Imported from Marvisak/VIctory. Originally posted by fuzeofficlal on 2026-11-26T23:50:27Z.
Review: APPROVED
Looks good — cleanly prevents DRED breadcrumb reporting from faulting when
BreadcrumbCountruns past the committed pages ofpCommandHistory.Checked
crates/victory-gpu/src/host.rs:1548-1580,host.rs:3798-3829, andin_flight(host.rs:3836-3859):readable_historyreadspCommandHistorypage-by-page throughread(ReadProcessMemory) instead of forming a raw slice overBreadcrumbCount, keeping the valid readable prefix without faulting.stopped_atsafely uses.get(done as usize)and notes truncation wheneverhistory.len() < count as usize.in_flightwithdone > 0 && (done as usize) < history.len()keeps all slices insidein_flightin bounds, and the explicitelse if done == 0avoids misreporting pipelines when a list stopped past the readable prefix.if !readable { return; }before allocatingpieceinreadable_history— and optionally checkinghistory.is_aligned()— would avoid wasted per-page allocations if a corrupted node ever reports a very largeBreadcrumbCount.)Verification (
7cbb83ec):cargo xtask policyandcargo clippy -p victory-gpu(default and--features diagnostics,--tests -- -D warnings): passed.host::breadcrumbs::a_history_shorter_than_its_count_is_read_as_far_as_it_is_there: passed on both hardware GPU and WARP.count == 0, a non-page-aligned 4-byte-aligned pointer straddling committed/uncommitted pages (exact 3 trailing ops read), a pointer starting directly onPAGE_NOACCESS(0ops,done == 0handled), boundarydone == history.len()(op unknown,in_flightskipped), and a1,048,576-op count on an unreadable page (2.00 ms, no fault): all passed.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.Warning: The "Autodetect manual merge" setting is not enabled for this repository, you will have to mark this pull request as manually merged afterwards.