GPU: marked UAV refreshes cover whole 64 KiB pages #2172
No reviewers
Labels
No labels
accessibility
area: build
area: formats
area: gpu
area: loader
area: runtime
area: shader
bug
documentation
duplicate
enhancement
good first issue
gpu: amd
gpu: intel
gpu: nvidia
help wanted
host: wine
invalid
out of scope
question
request
run report
triage: confirmed
triage: has patch
triage: merge candidate
triage: needs info
triage: needs rebase
triage: needs work
triage: proposed close
wontfix
No milestone
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set
Reference
github/Marvisak--VIctory!2172
Loading…
Reference in a new issue
No description provided.
Delete branch "gh-pr/2172/head"
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?
@fuzeofficlal on GitHub · 2026-11-25 06:59 UTC · original
fuzeofficlal:fix/gpu-marked-uav-subpage-copyback→main· +473 −66 · 3 files · 1 commits · merged 2026-11-25 21:55 UTCProblem
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.@MamaLeVrai on GitHub · 2026-11-25 08:52 UTC · original
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.
@Marvisak on GitHub · 2026-11-25 13:28 UTC · original · edited 2026-11-25 16:19 UTC
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