[pr-fix] GPU: a write-combined commit inside a plain reservation is forgotten with the reservation #481
Loading…
Reference in a new issue
No description provided.
Delete branch "upstream-pr/481"
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 TaynanGT/Vice-Tay. Originally posted by Indy2l on 2026-11-30T21:20:03Z.
Related: #462
What it changes
When the title releases an allocation,
title_memory_freedgets length 0, andwrite_combined_freedwith length 0 only drops a write-combined region that starts at the allocation's base. A write-combined commit inside a reservation that was made without write-combining starts further in, so it stays registered after the release. Memory the title later gets at that address is then still treated as write-combined, and shader writes to it stay on the card.The fix works out the released allocation's whole extent and forgets every write-combined region over it, as the code already does for other lengths.
Kal0s-design found this during the review of #462 and wrote the test. cafeoh wrote the fix there (
320d657b, on the linemainused before #468). This is the same change on the currentmain, with cafeoh as the commit's author and Kal0s-design as co-author, at cafeoh's request on #462. cafeoh confirmed there that the currentmainstill has the bug.How it was tested
a_write_combined_commit_goes_with_its_reservation(crates/vice-tay-gpu/src/shadow.rs) fails without thewatch.rschange: the region is still write-combined after the reservation's release ("stale after the reservation's release").cargo testpassed for the crates it touches: yes, apart from one test that fails onmainas well.cargo test --locked -p vice-tay-gpu: 923 passed, 3 failed while a GPU-heavy job ran on the same card (watch::tests::ask_rest_falls_back_per_piece_when_touching_unwatched_neighbourand twotexbackGPU tests); each passes when run on its own.cargo test --locked -p vice-tay-gpu --all-features -- --test-threads=1: 1,010 passed, 1 failed,compose::tests::bgrx_plane_selects_a_typed_view(compose.rs:584), which fails the same way onmainat206e07b4without this change.Also run:
cargo clippy --locked -p vice-tay-gpu --all-targets -- -D warnings, with and without--all-features(no warnings from the code; the only warning is the unknownclippy::chunks_exact_to_as_chunkslint the build's flags allow);cargo run --locked -p xtask -- policy(426 files ok);git diff --check(clean).Nobody has checked whether GTA VI itself commits write-combined memory inside a plain reservation (cafeoh noted the same on #462), so this fixes a defect the test shows, not a visible problem in the game.
Has this been tried here before?
Yes, on the previous line: cafeoh committed it as
320d657bon #462's branch, and that PR was closed with every other PR against the oldmain(#468), so the fix never reached the currentmain. Nothing is different except that it is rebuilt on the currentmain.AI-assisted: yes
🤖 Generated with Claude Code
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.