GPU: refresh heap textures with untracked pages (FIND-17) #3039
Loading…
Reference in a new issue
No description provided.
Delete branch "upstream-pr/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?
Imported from Marvisak/VIctory. Originally posted by leftmove on 2026-11-26T04:58:33Z.
FIND-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
Imported from Marvisak/VIctory. Originally posted by fuzeofficlal on 2026-11-26T05:15:12Z.
Review: APPROVED
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 passedImported from Marvisak/VIctory. Originally posted by kotekompotek on 2026-11-26T05:26:21Z.
Review: APPROVED
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.Imported from Marvisak/VIctory. Originally posted by Marvisak on 2026-11-26T06:15:49Z.
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
Imported from Marvisak/VIctory. Originally posted by Dukestar69 on 2026-11-26T08:31:15Z.
Review: APPROVED
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).
Imported from Marvisak/VIctory. Originally posted by leftmove on 2026-11-26T08:24:14Z.
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.
Imported from Marvisak/VIctory. Originally posted by Jackster on 2026-11-26T16:35:53Z.
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.Warning: The "Autodetect manual merge" setting is not enabled for this repository, you will have to mark this pull request as manually merged afterwards.