GPU: backport placed-page write-watch stamps from Vice-Tay #1496
Loading…
Reference in a new issue
No description provided.
Delete branch "upstream-pr/1496"
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 fxceless/victory-fork. Originally posted by t90 on 2026-11-27T19:50:54Z.
Pages first placed at submission are copied from title memory but keep
Held::taken = 0. The next refresh treats them as never uploaded and can send unchanged CPU bytes over data the structure builder has already changed on the GPU. Remember the write-watch asking from before the initial copy, so later refreshes still notice newer title writes without repeating that first whole-page upload.VICTORY_PLACE_TAKEN=0retains the old behaviour for comparison.Backport of Vice-Tay a33271f / #342, credited to urielbeaupre and TaynanGT. This is independent of the scalar-code PR and changes only
memory.rs.Validation on current
cd93552, with the uploaded file verified identical to the tested local source:VICTORY_D3D12_WARP=1and--features diagnostics. The regression actually executes: no unchanged bytes are retaken, and a later four-byte CPU write reaches the mapped copy.cargo check --locked -p victory-gpu --all-featurespasses with existing warnings; asset policy passes (280 files).victory-formats/src/texture.rs:1346. The unrelated formatting/lint PRs are kept separate.Draft pending full integration and in-game RT verification. The regression checks upload/stamp behaviour using synthetic allocations, not actual GPU-written structure readback. No measured FPS gain or complete ray-tracing correction is claimed. No game files, dumps or extracted data are included. Prepared with AI assistance.
Imported from fxceless/victory-fork. Originally posted by Kal0s-design on 2026-11-28T11:21:42Z.
Verified on NVIDIA (real D3D12 device, pinned 1.98.1 toolchain, build pulled nothing from the network).
The PR touches one file, so I applied its
crates/victory-gpu/src/memory.rschange onto currentmain(6b3ce6c); it applies clean.Tests (
cargo test -p victory-gpu --lib memory::tests::): 6/6 pass, including the newa_placed_page_is_not_taken_again_until_the_title_writes. Itseprintlnfires ("no unchanged bytes retaken; the later title dword reached the copy"), soMemory::new()succeeded here (it builds a real D3D12 host device) and the test ran the write-watch path instead of taking its skip branch.Sensitivity: running that test with
VICTORY_PLACE_TAKEN=0(the flag the PR adds to keep the old refresh) fails it here —With the flag on,
stats.changedon that first refresh is 0; with it off, it is 65536 (a whole page,PAGE == 1 << 16). After the title then writes one dword,changedis 4 and the staging copy reads back the new value. So the stamp is what stops the first refresh re-taking the placed page.Not covered: the real in-game upload path and a live title's rendering (the test drives the write-watch memory path directly), the wider D3D12 submission around it, and concurrent first-touch of the
place_taken()OnceLock.AI-assisted: yes.
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.