GPU: refresh heap textures with untracked pages (FIND-17) #3041
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!3041
Loading…
Reference in a new issue
No description provided.
Delete branch "github-bot/gh-3041"
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?
@leftmove on GitHub · 2026-11-26 04:58 UTC · original
leftmove:fix/find-17-mixed-texture-refresh→main· +72 −15 · 2 files · 1 commits · openFIND-17, coordinated in Marvisak/VIctory#1633.
A texture can span both tracked and untracked memory. The submission-time refresh used only the tracker's dirty ranges, so once those pages were clean, a late write to the untracked portion could leave the heap texture at its initial zeros.
Include untracked ranges when choosing subresources to refresh. A subresource that touches untracked memory keeps a content hash to avoid another GPU copy when its bytes stay the same. The synthetic regression exercises the heap upload path, samples the resulting host texture, and checks the initial zero, the late write, and the absence of duplicate uploads.
Verification
victory-formatsandxtaskpassed (52 passed, 5 ignored). The staged asset-policy check passed.mainand passed with the fix.victory-gputests type-checked forx86_64-pc-windows-gnuin default and diagnostics builds. The native Linuxvictory-gpubuild hits the same Windows-gating errors onmain.AI-assisted with Codex. Original finding
@Marvisak on GitHub · 2026-11-26 06:15 UTC · original
Automated triage for the maintainers.
I confirmed the bug on
main.watch::track_asgives a tracker with untracked parts no dirty bit, so it is neverclean(). However,Staging::refresh_nowincrates/victory-gpu/src/texture.rslooks only atTracked::take. A write to the untracked part of a texture that is partly tracked returns no ranges, so the texture is never refreshed.shadow.rsalready handlesTracked::untracked, buttexture.rsdid not.This PR adds subresources that overlap
t.untracked(..)to the refresh set. For those subresources it always decides by the blake3 hash, skipping the "a whole page changed" shortcut, so unchanged bytes are not uploaded again. This is the content-hash behaviour the module doc already describes for untracked memory. I found no other callers affected.CI:
checkpassing. The new D3D12 testa_heap_texture_refreshes_after_a_write_to_its_untracked_pagereturns early without a host device, and the author did not run it on Windows. Please run it once on a GPU machine before merging. The reported in-game symptom is also unverified, as the description says.Generated by Claude Code
@fuzeofficlal on GitHub · 2026-11-26 05:15 UTC · original · approved these changes
Code review and Windows GPU verification of
ddadc546.Logic looks sound:
watch::trackalready leaves trackers with non-emptyuntrackedruns without a dirty bit (bit = None), sot.clean()andclean_bit(bit)stayfalseandrefresh_all/bindlessalways reachrefresh_now.t.untracked(start, start + size)clamps runs to[start, start + size), sof - start/e - startcannot underflow.!has_untrackedon the whole-page shortcut ensures a subresource touching untracked memory keeps its content hash even after a tracked write, avoiding redundant uploads on subsequent submissions; and ondetilefailure,last.hashes[i]is cleared so the next refresh retries.Tested locally on Windows 11 with both NVIDIA RTX 5090 and D3D12 WARP:
cargo test --locked -p victory-gpu --lib a_heap_texture_refreshes_after_a_write_to_its_untracked_page— passed on RTX 5090 and WARPcargo test --locked -p victory-gpu --lib texture::tests::— 2/2 passed@kotekompotek on GitHub · 2026-11-26 05:26 UTC · original · approved these changes
Verified: trackers with untracked parts never carry a clean bit (watch.rs), so
refresh_nowreaches the new path every submission;has_untrackedsubresources are always hashed rather than taking the owned-dirty-page shortcut — the only detector for writes the tracker cannot see — and the hash is kept across refreshes so unchanged spans still skip. The hardware test's committed-untracked/reserved-tracked split discriminates all four transitions.@leftmove on GitHub · 2026-11-26 08:24 UTC · original
Thanks for confirming the bug on
mainand marking this a merge candidate. Triage reviewThis Linux machine has no GPU, so I couldn’t run
a_heap_texture_refreshes_after_a_write_to_its_untracked_pagehere. The test returns early without a host device, and the in-game symptom remains unverified. A maintainer or verifier with a Windows GPU machine will need to run the test before merging.AI-assisted with Codex.
@Dukestar69 on GitHub · 2026-11-26 08:31 UTC · original · approved these changes
Verified on RTX 5090 & WARP against
origin/main(63bcca4):cargo test -p victory-gpu --lib draw:: -- --test-threads=1: 21/21 passed on RTX 5090 and WARP (includinga_heap_texture_refreshes_after_a_write_to_its_untracked_page).cargo test -p victory-gpu --lib host:: -- --test-threads=1: allhost::tests passed (only pre-existing#1744descriptor::host::tests::dynamic_slots_are_held_until_releasedfailed).cargo clippy -p victory-gpu --all-targets -- -D warnings: clean.cargo xtask policy: 191 files ok.Cleanly ensures heap textures backed by untracked pages are refreshed on CPU writes.
Synthetic tests only (no game files used). AI-assisted (Gemini 4 Neon).
@Jackster on GitHub · 2026-11-26 16:35 UTC · original
Windows 11, Radeon RX 7900 XTX (gfx1100, 32.0.32029.2010),
63bcca4+ this PR. You wrote that Windows, WARP and a compatible GPU were unavailable for the D3D12 regression, so here are all three:draw::tests::a_heap_texture_refreshes_after_a_write_to_its_untracked_pagepasses on the hardware adapter (0.17 s).VICTORY_D3D12_WARP=1, diagnostics build, 0.07 s).texture.rshalf of the patch reverted and the test kept, it fails on the hardware adapter —assertion left == right failed: late write reaches the GPU— so the test does catch the missed refresh, as your Linux harness said it should.cargo test -p victory-gpu --libon the head: 232 passed / 0 failed / 1 ignored.The gameplay symptom (FIND-17) is still unverified, as you said; this covers the D3D12 path only. Synthetic only. AI-assisted.
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.