GPU: marked UAV refreshes cover whole 64 KiB pages #2170
Loading…
Reference in a new issue
No description provided.
Delete branch "upstream-pr/2172"
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 fuzeofficlal on 2026-11-25T06:59:24Z.
Problem
A marked UAV view that is shorter than 64 KiB, or not page-aligned, inside a tracked buffer copy refreshed only its own byte range, and
Shadow::updatesplit tracked refreshes at the ranges earlier lists' shaders write. Either wayTracked::takesaw only part of the enclosing 64 KiB page, so the page was neither guarded nor taken. It stayed changed, and after the submissionShadow::copy_back_markedhitsaved.is_none() && t.changed(page)and kept the title's bytes, dropping every GPU write to that page.Changes
Shadow::page_rangewidens a range to the 64 KiB pages it touches, cut to the copy.readable), root UAVs (State::root_view) and heap hulls (bindless::refresh). The range declared as written (gpu_writes) stays exact.Tracked::take, still updating the snapshots under ranges shaders write. Only pages the title changed are copied, and no shader of the submission has run yet at that point, so the wider refresh overwrites no GPU writes. Untracked copies are unchanged.Verification
cargo test -p victory-gpu --lockedon hardware and withVICTORY_D3D12_WARP=1: all pass exceptdynamic_slots_are_held_until_releasedandlists_share_a_table_and_copies_keep_their_views, which fail the same way on main (HEAP_VIEWS limit).VICTORY_D3D12_DEBUG=1and no debug-layer messages. All 5 new tests fail without the page widening.cargo clippy --workspace --all-targets [--all-features] --locked -- -D warningsandcargo xtask policypass.Imported from Marvisak/VIctory. Originally posted by DenRakEiw on 2026-11-25T07:03:13Z.
Review: APPROVED
Verified locally merged onto
origin/main(940d32f, Windows 11 x64, NVIDIA GeForce RTX 5090, Rust 1.98.1 MSVC):cargo test -p victory-gpu --lib marked_subpage_uav_writes_copy_back_and_keep_neighbor_bytes— passed on RTX 5090cargo clippy -p victory-gpu --all-targets— 0 warningscargo xtask policy— ok (183 files ok)Clean whole-64 KiB-page coverage for marked UAV refreshes preserving neighbor bytes on subpage writes. Looks good.
AI-assisted (Gemini 4 Neon).
Imported from Marvisak/VIctory. Originally posted by catminou4 on 2026-11-25T07:17:34Z.
Review: COMMENTED
Static review only: victory-gpu is Windows-only (D3D12/windows_sys) — nothing compiles or runs on macOS; source review of the diff.
Marked UAV refreshes cover whole 64 KiB pages — refresh-granularity coarsening; relates to #1986/#1998/#2004's withheld-range cluster (#1976).
Imported from Marvisak/VIctory. Originally posted by MamaLeVrai on 2026-11-25T08:52:14Z.
Test report on real hardware: AMD RX 6950 XT (RDNA2), Windows 11, Rust 1.98.1, with a GPU present, so the hardware-only shader checks run. I merged this PR's head
a78c1e93intomain940d32fin a throwaway tree (no conflict).cargo clippy --workspace --all-targets --locked -- -D warnings: clean; the same with--all-features: clean.cargo test --workspace --locked: 706 passed, 0 failed, 10 ignored, two runs (mainalone on the same machine: 701 passed, 0 failed, 10 ignored). The title was not run, so this says nothing about in-game effect. No game data.AI-assisted (Claude Code); no game data.
Imported from Marvisak/VIctory. Originally posted by Xvania7 on 2026-11-25T12:59:32Z.
Review: APPROVED
Hardware verification on real hardware: NVIDIA GeForce RTX 5060, Windows 10 x64, Rust 1.98.1.
Tested
a78c1e9checked out into an isolated tree:cargo clippy -p victory-gpu --target-dir ... -- -D warnings: 0 warnings, clean.cargo run -p xtask -- policy: clean (asset policy: 182 files ok).shadow::tests: 4/4 passed:mark_runs_are_reused_and_joined: oktitle_writes_under_a_busy_range_are_copied: oksnapshots_cover_the_declared_ranges_and_writes_go_back_once: okmarked_pages_go_back_by_the_bytes_the_gpu_changed: okdraw::testsmarked subpage UAV test suite: 5/5 passed:marked_subpage_uav_and_cpu_disjoint_write_three_way_merge: okmarked_subpage_uavs_after_copy_in_same_list: okmarked_subpage_uav_writes_copy_back_and_keep_neighbor_bytes: okmarked_subpage_uav_unaligned_and_cross_page_shadow_bounds: okmarked_unaligned_root_uav_and_bindless_subpage_refresh: okEnsuring marked UAV refreshes align to full 64 KiB page boundaries cleanly prevents partial unaligned copy-backs across subpage chunks while preserving adjacent bytes. LGTM.
Imported from Marvisak/VIctory. Originally posted by Marvisak on 2026-11-25T13:28:38Z.
Automated triage for the maintainers.
Recommended for a maintainer's look (re-reviewed after the rebase). Marked UAV refreshes (
readableandState::root_viewindraw.rs,bindless::refresh) now widen to whole 64 KiB pages viaShadow::page_range, andShadow::updatetakes a tracked range in oneTracked::take(update_tracked) instead of splitting it at busy ranges, socopy_back_markedno longer finds a partly taken page still changed and keeps the title's bytes over the shader's. I checkedpage_rangeagainst the copy's bounds, that the declared written range (gpu_writes) stays exact, and that thebeforesnapshot is still synced for bytes copied under ranges earlier lists write. One behaviour change to be aware of: under such busy ranges the untracked and unmapped parts of a tracked copy are now refreshed as well (before, only taken runs were), with the snapshot synced; by my reading that is consistent with the existing reasoning that no shader of the submission has run yet.CI:
checkpassing on this head.Generated by Claude Code