GPU: leave shader writes to large write-combined buffers on the card (VICTORY_WC_NO_BACK, port of NVIDIA), fixes the #90 spikes #462

Closed
github-bot wants to merge 661 commits from github-bot/gh-462 into main AGit
Owner

@⁠cafeoh on GitHub · 2026-11-29 23:32 UTC · original
cafeoh:pr/wc-no-back → main · +60214 −5433 · 206 files · 661 commits · closed without merging

Fixes the "spikes" of #90 (one-frame stretched triangles on characters) and makes frames faster.

What

XMemVirtualAlloc now records memory the title reserves write-combined (0x400), and forgets it when freed or decommitted. With VICTORY_WC_NO_BACK=1, what shaders write into a card copy that lies wholly in such memory and is at least VICTORY_WC_NO_BACK_MIN_KB large is not declared, compared, fetched or copied back into title memory: the title's CPU does not read write-combined memory, so the card's copy is the truth.

  • Code default: off. scripts/play.ps1 turns it on with VICTORY_WC_NO_BACK_MIN_KB=1024.
  • The frame-rate line reports the writes / MB left on the card per frame and the write-combined regions known.
  • Port of trustno1-coder/VIctory-NVIDIA 50c15a145 + 2f81d0c85 (GPL-3.0); their launcher has it on. VICTORY_WC_BAR is not ported.

Why it fixes #90

With submissions sent ahead, a flight's copy-back of the skinning output (~25 MB, write-combined) can land after the title has already written the next frame's data into the same memory. That one frame of mixed old and new data is the spikes. With no copy-back for these buffers there is nothing late to land.

Evidence (RTX 2080 Ti, Ryzen 7 7800X3D, Windows 10, Series S, RT on)

  • NVIDIA's build is spike-free only because of this switch: with VICTORY_WC_NO_BACK=0 alone, the spikes come back.
  • On our tree, a live key flipping the switch in game removes and brings back the spikes, also with every landing delayed by 30 ms. Video, off -> on (0:07) -> off (0:12) -> on (0:17):

https://github.com/user-attachments/assets/990936ca-9a5d-445c-981d-30467e6d855c

Speed (scripted runs, warm caches, one change only)

Tree WC off WC on
This branch (Vice-Tay main fe7c6e5 + this PR), last 60 s 11.86 fps, p95 145 ms, 31 frames > 2x median 12.63 fps, p95 124 ms, 20 frames > 2x median +6.5%
Our working tree (more copy-back machinery), last 40 s, 2 runs a side 14.11 / 14.50 fps 17.97 / 17.94 fps +24-27%, median frame -12 ms

Known limits

  • Not the default: VICTORY_WC_NO_BACK_MIN_KB=0 (every size left on the card) breaks things: small write-combined buffers the CPU does read, or that share 4 KiB parts with CPU writes, stay wrong (broken meshes that persist; NVIDIA saw dark cutscenes). The launcher uses 1024.
  • A second host copy over the same memory, or a whole-4 KiB refresh after a CPU write, can still put old bytes over the card's results. Not seen with 1024.

Checks

cargo build --release (0 warnings), both CI clippy variants with -D warnings, cargo test -p victory-gpu -p victory-hle (incl. the new registry test).

**@⁠cafeoh** on GitHub · 2026-11-29 23:32 UTC · [original](https://github.com/TaynanGT/Vice-Tay/pull/462) `cafeoh:pr/wc-no-back` → `main` · +60214 −5433 · 206 files · 661 commits · closed without merging Fixes the "spikes" of #90 (one-frame stretched triangles on characters) and makes frames faster. ## What `XMemVirtualAlloc` now records memory the title reserves write-combined (`0x400`), and forgets it when freed or decommitted. With `VICTORY_WC_NO_BACK=1`, what shaders write into a card copy that lies wholly in such memory and is at least `VICTORY_WC_NO_BACK_MIN_KB` large is **not** declared, compared, fetched or copied back into title memory: the title's CPU does not read write-combined memory, so the card's copy is the truth. - Code default: off. `scripts/play.ps1` turns it on with `VICTORY_WC_NO_BACK_MIN_KB=1024`. - The frame-rate line reports the writes / MB left on the card per frame and the write-combined regions known. - Port of trustno1-coder/VIctory-NVIDIA 50c15a145 + 2f81d0c85 (GPL-3.0); their launcher has it on. `VICTORY_WC_BAR` is not ported. ## Why it fixes #90 With submissions sent ahead, a flight's copy-back of the skinning output (~25 MB, write-combined) can land after the title has already written the next frame's data into the same memory. That one frame of mixed old and new data is the spikes. With no copy-back for these buffers there is nothing late to land. ## Evidence (RTX 2080 Ti, Ryzen 7 7800X3D, Windows 10, Series S, RT on) - NVIDIA's build is spike-free only because of this switch: with `VICTORY_WC_NO_BACK=0` alone, the spikes come back. - On our tree, a live key flipping the switch in game removes and brings back the spikes, also with every landing delayed by 30 ms. Video, off -> on (0:07) -> off (0:12) -> on (0:17): https://github.com/user-attachments/assets/990936ca-9a5d-445c-981d-30467e6d855c ## Speed (scripted runs, warm caches, one change only) | Tree | WC off | WC on | | |---|---|---|---| | This branch (Vice-Tay main `fe7c6e5` + this PR), last 60 s | 11.86 fps, p95 145 ms, 31 frames > 2x median | **12.63 fps**, p95 124 ms, 20 frames > 2x median | +6.5% | | Our working tree (more copy-back machinery), last 40 s, 2 runs a side | 14.11 / 14.50 fps | **17.97 / 17.94 fps** | +24-27%, median frame -12 ms | ## Known limits - Not the default: `VICTORY_WC_NO_BACK_MIN_KB=0` (every size left on the card) breaks things: small write-combined buffers the CPU does read, or that share 4 KiB parts with CPU writes, stay wrong (broken meshes that persist; NVIDIA saw dark cutscenes). The launcher uses 1024. - A second host copy over the same memory, or a whole-4 KiB refresh after a CPU write, can still put old bytes over the card's results. Not seen with 1024. ## Checks `cargo build --release` (0 warnings), both CI clippy variants with `-D warnings`, `cargo test -p victory-gpu -p victory-hle` (incl. the new registry test).
Record memory that XMemVirtualAlloc reserves with the write-combined bit (0x400) and forget it when the title frees or decommits it. With VICTORY_WC_NO_BACK=1, shader writes to a card-memory copy that lies wholly in write-combined memory and is at least VICTORY_WC_NO_BACK_MIN_KB in size queue no copy-back: no declare, compare, fetch or landing into title memory. Placed constants over the range are still forgotten. Off by default; VICTORY_WC_NO_BACK_MIN_KB=1024 is the recommended cutoff, because leaving every copy on the card makes small CPU-read results such as exposure stale and darkens cutscenes.

scripts/play.ps1 turns it on with the 1024 KiB cutoff: it removes the #90 spikes and is faster.

The frame-rate line reports the writes and MB left on the card per frame and the write-combined regions known. Includes a unit test for the region registry.

Port of trustno1-coder/VIctory-NVIDIA 50c15a145 and 2f81d0c85 (GPL-3.0); VICTORY_WC_BAR is not ported.
github-bot locked as GitHub sync and limited conversation to collaborators 2026-11-29 23:35:09 +00:00
Author
Owner

@⁠Kal0s-design on GitHub · 2026-11-30 00:00 UTC · original · reviewed

Read the diff against main and ran it here (Windows, victory-gpu lib tests, clippy with --all-features): clean, 529 passing. One correctness gap in the registry, with a test and a small fix.

A write-combined commit inside a plain reservation outlives the reservation. title_memory_write_combined records what XMemVirtualAlloc returns, so a MEM_COMMIT with 0x400 inside a reservation made without it is recorded as its own region, starting inside the reservation. On release, title_memory_freed(at, 0) calls write_combined_freed(at, 0), which drops only regions with from == at. The inner region stays. If another allocation later takes those addresses without 0x400, its copies count as write-combined and their shader writes are left on the card. That's the failure this switch must never cause: the title's CPU reading stale bytes in memory that isn't write-combined.

Repro (fails on this branch with "stale after the reservation's release"):

#[cfg(windows)]
#[test]
fn a_write_combined_commit_goes_with_its_reservation() {
    use windows_sys::Win32::System::Memory::{MEM_COMMIT, MEM_RELEASE, MEM_RESERVE, PAGE_NOACCESS, PAGE_READWRITE, VirtualAlloc, VirtualFree};
    // SAFETY: a reservation of our own, then a commit inside it.
    let base = unsafe { VirtualAlloc(std::ptr::null(), 0x40_0000, MEM_RESERVE, PAGE_NOACCESS) } as usize;
    assert_ne!(base, 0);
    let part = base + 0x10_0000;
    // SAFETY: inside the reservation above.
    assert_eq!(unsafe { VirtualAlloc(part as *const _, 0x10_0000, MEM_COMMIT, PAGE_READWRITE) } as usize, part);
    title_memory_write_combined(part, 0x10_0000);
    assert!(is_write_combined(part as u64, 0x1000));
    crate::watch::title_memory_freed(base, 0);
    assert!(!is_write_combined(part as u64, 0x1000), "stale after the reservation's release");
    // SAFETY: our reservation.
    unsafe { VirtualFree(base as *mut _, 0, MEM_RELEASE) };
}

Fix: title_memory_freed already finds the allocation's extent for a release (allocation_end, before VirtualFree). Forget write-combined regions over that extent instead of passing the 0:

 pub fn title_memory_freed(at: usize, len: usize) {
-    crate::shadow::write_combined_freed(at, len);
     let first = at / BLOCK;
     let freed_end = if len != 0 {
         at.saturating_add(len).div_ceil(BLOCK)
     } else {
         allocation_end(at, at).div_ceil(BLOCK).max(first + 1)
     };
+    // The whole allocation on a release: also write-combined commits that
+    // start inside it (a reservation the title did not ask write-combined).
+    crate::shadow::write_combined_freed(at, freed_end * BLOCK - at);

With that change, the test above and NVIDIA's write_combined_regions both pass, the 529 lib tests pass, and clippy is clean. Rounding a decommit up to a whole 64 KiB block can only forget more, which falls back to the copy-back.

Whether GTA VI actually commits write-combined inside a plain reservation, I haven't checked. With VICTORY_WC_NO_BACK on by default in play.ps1, I'd still close the hole before it lands. Smaller notes, not blocking:

  • Shadow::wc is found once per copy and kept. That's fine as long as a copy never outlives the memory it was made for, which I believe holds here, since copies go with their buffers.
  • A view or section the title maps (not XMemVirtualAlloc) is never recorded, so it keeps the copy-back. That's the safe side.

AI-assisted: yes

**@⁠Kal0s-design** on GitHub · 2026-11-30 00:00 UTC · [original](https://github.com/TaynanGT/Vice-Tay/pull/462#pullrequestreview-6105514395) · **reviewed** Read the diff against main and ran it here (Windows, `victory-gpu` lib tests, clippy with `--all-features`): clean, 529 passing. One correctness gap in the registry, with a test and a small fix. **A write-combined commit inside a plain reservation outlives the reservation.** `title_memory_write_combined` records what `XMemVirtualAlloc` returns, so a `MEM_COMMIT` with `0x400` inside a reservation made without it is recorded as its own region, starting inside the reservation. On release, `title_memory_freed(at, 0)` calls `write_combined_freed(at, 0)`, which drops only regions with `from == at`. The inner region stays. If another allocation later takes those addresses without `0x400`, its copies count as write-combined and their shader writes are left on the card. That's the failure this switch must never cause: the title's CPU reading stale bytes in memory that isn't write-combined. Repro (fails on this branch with "stale after the reservation's release"): ```rust #[cfg(windows)] #[test] fn a_write_combined_commit_goes_with_its_reservation() { use windows_sys::Win32::System::Memory::{MEM_COMMIT, MEM_RELEASE, MEM_RESERVE, PAGE_NOACCESS, PAGE_READWRITE, VirtualAlloc, VirtualFree}; // SAFETY: a reservation of our own, then a commit inside it. let base = unsafe { VirtualAlloc(std::ptr::null(), 0x40_0000, MEM_RESERVE, PAGE_NOACCESS) } as usize; assert_ne!(base, 0); let part = base + 0x10_0000; // SAFETY: inside the reservation above. assert_eq!(unsafe { VirtualAlloc(part as *const _, 0x10_0000, MEM_COMMIT, PAGE_READWRITE) } as usize, part); title_memory_write_combined(part, 0x10_0000); assert!(is_write_combined(part as u64, 0x1000)); crate::watch::title_memory_freed(base, 0); assert!(!is_write_combined(part as u64, 0x1000), "stale after the reservation's release"); // SAFETY: our reservation. unsafe { VirtualFree(base as *mut _, 0, MEM_RELEASE) }; } ``` Fix: `title_memory_freed` already finds the allocation's extent for a release (`allocation_end`, before `VirtualFree`). Forget write-combined regions over that extent instead of passing the 0: ```diff pub fn title_memory_freed(at: usize, len: usize) { - crate::shadow::write_combined_freed(at, len); let first = at / BLOCK; let freed_end = if len != 0 { at.saturating_add(len).div_ceil(BLOCK) } else { allocation_end(at, at).div_ceil(BLOCK).max(first + 1) }; + // The whole allocation on a release: also write-combined commits that + // start inside it (a reservation the title did not ask write-combined). + crate::shadow::write_combined_freed(at, freed_end * BLOCK - at); ``` With that change, the test above and NVIDIA's `write_combined_regions` both pass, the 529 lib tests pass, and clippy is clean. Rounding a decommit up to a whole 64 KiB block can only forget more, which falls back to the copy-back. Whether GTA VI actually commits write-combined inside a plain reservation, I haven't checked. With `VICTORY_WC_NO_BACK` on by default in `play.ps1`, I'd still close the hole before it lands. Smaller notes, not blocking: - `Shadow::wc` is found once per copy and kept. That's fine as long as a copy never outlives the memory it was made for, which I believe holds here, since copies go with their buffers. - A view or section the title maps (not `XMemVirtualAlloc`) is never recorded, so it keeps the copy-back. That's the safe side. AI-assisted: yes
title_memory_freed passed the release's length 0 on, so write_combined_freed
dropped only regions starting at the allocation base. Forget the regions over
the allocation's whole extent instead (found by Kal0s-design, VT#462; test from
the review).
Author
Owner

@⁠cafeoh on GitHub · 2026-11-30 00:25 UTC · original

@⁠Kal0s-design Thanks, confirmed and fixed in 320d657be: title_memory_freed now finds the freed extent first and forgets write-combined regions over all of it. Your test is in and passes, with NVIDIA's write_combined_regions. I haven't checked either whether GTA VI commits write-combined inside a plain reservation. Agreed on both notes: copies go with their buffers, and views the title maps keep the copy-back.

**@⁠cafeoh** on GitHub · 2026-11-30 00:25 UTC · [original](https://github.com/TaynanGT/Vice-Tay/pull/462#issuecomment-7265252509) @⁠Kal0s-design Thanks, confirmed and fixed in 320d657be: `title_memory_freed` now finds the freed extent first and forgets write-combined regions over all of it. Your test is in and passes, with NVIDIA's `write_combined_regions`. I haven't checked either whether GTA VI commits write-combined inside a plain reservation. Agreed on both notes: copies go with their buffers, and views the title maps keep the copy-back.
Author
Owner

@⁠Kal0s-design on GitHub · 2026-11-30 01:00 UTC · original

Checked 320d657b: the title_memory_freed change and the test are what I ran here, and CI is green on it. Nothing further from me on this PR.

AI-assisted: yes

**@⁠Kal0s-design** on GitHub · 2026-11-30 01:00 UTC · [original](https://github.com/TaynanGT/Vice-Tay/pull/462#issuecomment-7265764491) Checked 320d657b: the `title_memory_freed` change and the test are what I ran here, and CI is green on it. Nothing further from me on this PR. AI-assisted: yes
Author
Owner

@⁠Garu667 on GitHub · 2026-11-30 02:06 UTC · original

Tested on an RTX 3080 10 GB (Windows 11, Series S profile, DLSS quality, 1080p output), on our local tree with both commits cherry-picked cleanly. Scripted prologue runs, warm caches, alternating off/on, only this switch changed (VICTORY_WC_NO_BACK_MIN_KB=1024 when on):

Pair WC off: fps avg / p10 / prep median WC on avg
1 14.4 / 8.9 / 47.0 ms 15.7 / 10.8 / 41.2 ms +9%
2 13.7 / 7.9 / 49.8 ms 16.8 / 12.6 / 40.0 ms +23%
3 14.5 / 9.7 / 47.3 ms 16.8 / 10.9 / 38.3 ms +16%

Better in all three pairs, prep time down 6-10 ms per frame. No new image defects seen in the captures we checked. Thanks for porting this!

**@⁠Garu667** on GitHub · 2026-11-30 02:06 UTC · [original](https://github.com/TaynanGT/Vice-Tay/pull/462#issuecomment-7266711080) Tested on an RTX 3080 10 GB (Windows 11, Series S profile, DLSS quality, 1080p output), on our local tree with both commits cherry-picked cleanly. Scripted prologue runs, warm caches, alternating off/on, only this switch changed (`VICTORY_WC_NO_BACK_MIN_KB=1024` when on): | Pair | WC off: fps avg / p10 / prep median | WC on | avg | |---|---|---|---| | 1 | 14.4 / 8.9 / 47.0 ms | **15.7 / 10.8 / 41.2 ms** | +9% | | 2 | 13.7 / 7.9 / 49.8 ms | **16.8 / 12.6 / 40.0 ms** | +23% | | 3 | 14.5 / 9.7 / 47.3 ms | **16.8 / 10.9 / 38.3 ms** | +16% | Better in all three pairs, prep time down 6-10 ms per frame. No new image defects seen in the captures we checked. Thanks for porting this!
Author
Owner

@⁠Indy2l on GitHub · 2026-11-30 04:05 UTC · original

Tested on RTX 3060 12 GB, i5-12400F, 16 GB, Windows 11, driver 621.40, Series S, -Machine 3060, ray tracing off, prologue (prison) route. Build: fe7c6e5 + #395 (static samplers in one order, so the pipeline cache stays warm between launches) + this PR's two commits, with play.ps1's VICTORY_WC_NO_BACK=1 and VICTORY_WC_NO_BACK_MIN_KB=1024. Seven runs on the one executable: four with the switch on, three with -More @{VICTORY_WC_NO_BACK='0'}. All recorded; recordings stay local.

Speed, as you found: standing still at the cell window, 14.25 fps against 12.5 without the PR (same base, an earlier run). Walking to the crowded room, 12.2 against about 10.3-11. The copy-back fell from 37-38 ms to 17-19 ms a frame. Memory unchanged.

Spikes: with the switch on, the stretched triangles that are all over the inmates in the crowded room without it were mostly gone. In one run a single large stretched spike showed for a fraction of a second; I can't tell whether it was the same kind. With the switch off on the same executable they were back as before.

Probably caused by the switch, intermittently: the inmates' clothes. In 2 of the 4 switch-on runs, every orange prison jumpsuit, the player's and all the inmates', looked dark red-brown, glossy and blotchy, as if wet, with the "INMATE" print on the back hard to read. When it happened it was there from the cell onwards and stayed, at least to the crowded room about 4.5 minutes later; in the other two runs the clothes were normal throughout. In the 3 switch-off runs on the same executable, and in every run we've made without the PR, the jumpsuits were normal, matte orange. Seven runs aren't proof, and this PC also has textures that arrive late and wrong for a while, but the split points at the switch. It would fit your third listed risk, with timing deciding it: another host copy of the same bytes (a texture placed in that memory, say) made from the bytes before the shader writes that stay on the card. If that's it, a larger VICTORY_WC_NO_BACK_MIN_KB wouldn't help, since copies are 4 MiB windows or larger. I can run a build that logs overlaps between ranges left on the card and other host copies on this route, if that helps.

AI-assisted: yes

**@⁠Indy2l** on GitHub · 2026-11-30 04:05 UTC · [original](https://github.com/TaynanGT/Vice-Tay/pull/462#issuecomment-7268466127) Tested on RTX 3060 12 GB, i5-12400F, 16 GB, Windows 11, driver 621.40, Series S, `-Machine 3060`, ray tracing off, prologue (prison) route. Build: `fe7c6e5` + #395 (static samplers in one order, so the pipeline cache stays warm between launches) + this PR's two commits, with `play.ps1`'s `VICTORY_WC_NO_BACK=1` and `VICTORY_WC_NO_BACK_MIN_KB=1024`. Seven runs on the one executable: four with the switch on, three with `-More @{VICTORY_WC_NO_BACK='0'}`. All recorded; recordings stay local. **Speed, as you found:** standing still at the cell window, 14.25 fps against 12.5 without the PR (same base, an earlier run). Walking to the crowded room, 12.2 against about 10.3-11. The copy-back fell from 37-38 ms to 17-19 ms a frame. Memory unchanged. **Spikes:** with the switch on, the stretched triangles that are all over the inmates in the crowded room without it were mostly gone. In one run a single large stretched spike showed for a fraction of a second; I can't tell whether it was the same kind. With the switch off on the same executable they were back as before. **Probably caused by the switch, intermittently: the inmates' clothes.** In 2 of the 4 switch-on runs, every orange prison jumpsuit, the player's and all the inmates', looked dark red-brown, glossy and blotchy, as if wet, with the "INMATE" print on the back hard to read. When it happened it was there from the cell onwards and stayed, at least to the crowded room about 4.5 minutes later; in the other two runs the clothes were normal throughout. In the 3 switch-off runs on the same executable, and in every run we've made without the PR, the jumpsuits were normal, matte orange. Seven runs aren't proof, and this PC also has textures that arrive late and wrong for a while, but the split points at the switch. It would fit your third listed risk, with timing deciding it: another host copy of the same bytes (a texture placed in that memory, say) made from the bytes before the shader writes that stay on the card. If that's it, a larger `VICTORY_WC_NO_BACK_MIN_KB` wouldn't help, since copies are 4 MiB windows or larger. I can run a build that logs overlaps between ranges left on the card and other host copies on this route, if that helps. AI-assisted: yes
Author
Owner

@⁠Indy2l on GitHub · 2026-11-30 04:45 UTC · original

A correction to the clothing part of my report above: the link to this PR is weaker than I said.

I ran three more switch-on runs on the same base, with local logging added on top of this PR. The logging recorded:

  • every resource the title places in write-combined memory;
  • every time shader writes left on the card overlap such a resource;
  • any other card copy of the same memory, whether it already existed when writes were first left on the card or was made afterwards.

All three runs had normal clothes, so the tally is now 2 of 7 switch-on runs with the wet-looking jumpsuits, against 0 of 3 with the switch off. In all three logged runs, the only overlaps were the written buffers themselves: no texture and no second card copy over memory whose writes stayed on the card. So your third listed risk doesn't show up on this route, and the clothes may well be an unrelated texture problem that happened to land on two switch-on runs. Speed and the spikes stand as reported.

AI-assisted: yes

**@⁠Indy2l** on GitHub · 2026-11-30 04:45 UTC · [original](https://github.com/TaynanGT/Vice-Tay/pull/462#issuecomment-7269058978) A correction to the clothing part of my report above: the link to this PR is weaker than I said. I ran three more switch-on runs on the same base, with local logging added on top of this PR. The logging recorded: - every resource the title places in write-combined memory; - every time shader writes left on the card overlap such a resource; - any other card copy of the same memory, whether it already existed when writes were first left on the card or was made afterwards. All three runs had normal clothes, so the tally is now 2 of 7 switch-on runs with the wet-looking jumpsuits, against 0 of 3 with the switch off. In all three logged runs, the only overlaps were the written buffers themselves: no texture and no second card copy over memory whose writes stayed on the card. So your third listed risk doesn't show up on this route, and the clothes may well be an unrelated texture problem that happened to land on two switch-on runs. Speed and the spikes stand as reported. AI-assisted: yes
Author
Owner

@⁠cafeoh on GitHub · 2026-11-30 07:12 UTC · original

Thanks both, and thanks @⁠Garu667 for the three pairs.

@⁠Indy2l: we see glossy, blotchy materials too (faces mostly), and we had them long before we tried this switch, so I'd also call the jumpsuits a separate texture problem. Two things that caused it here:

  • A race where a texture upload from title memory lands over a write the host made after recording. trustno1-coder/VIctory-NVIDIA#33 detects it (VICTORY_PRELUDE_RECHECK=1: a "texture upload over a host write" warning), and their commit e530c00 fixes it (VICTORY_UPLOAD_GUARD=1 + VICTORY_PLACED_COPIED=1). With both off we got clear garbage on a face in the café; with them on, none in our runs since. Neither is in Vice-Tay main yet.
  • Missing BCPack tables give shiny skin as well (#385); worth checking that the log has no warning about them.

If the recheck warning fires in a run where the jumpsuits turn, that would point at the first one.

AI-assisted: yes

**@⁠cafeoh** on GitHub · 2026-11-30 07:12 UTC · [original](https://github.com/TaynanGT/Vice-Tay/pull/462#issuecomment-7271483008) Thanks both, and thanks @⁠Garu667 for the three pairs. @⁠Indy2l: we see glossy, blotchy materials too (faces mostly), and we had them long before we tried this switch, so I'd also call the jumpsuits a separate texture problem. Two things that caused it here: - A race where a texture upload from title memory lands over a write the host made after recording. trustno1-coder/VIctory-NVIDIA#33 detects it (`VICTORY_PRELUDE_RECHECK=1`: a "texture upload over a host write" warning), and their commit e530c00 fixes it (`VICTORY_UPLOAD_GUARD=1` + `VICTORY_PLACED_COPIED=1`). With both off we got clear garbage on a face in the café; with them on, none in our runs since. Neither is in Vice-Tay main yet. - Missing BCPack tables give shiny skin as well (#385); worth checking that the log has no warning about them. If the recheck warning fires in a run where the jumpsuits turn, that would point at the first one. AI-assisted: yes
github-bot closed this pull request 2026-11-30 17:08:23 +00:00
Author
Owner

@⁠TaynanGT on GitHub · 2026-11-30 17:05 UTC · original

main has moved to a new line of the code and everything is now named Vice-Tay, so this PR no longer applies as it is (details in #468). If you'd like this change in, please rebuild it on the current main and open a new PR; I'll review it there.

**@⁠TaynanGT** on GitHub · 2026-11-30 17:05 UTC · [original](https://github.com/TaynanGT/Vice-Tay/pull/462#issuecomment-7285694408) `main` has moved to a new line of the code and everything is now named Vice-Tay, so this PR no longer applies as it is (details in #468). If you'd like this change in, please rebuild it on the current `main` and open a new PR; I'll review it there.
Author
Owner

@⁠Indy2l on GitHub · 2026-11-30 17:45 UTC · original

Thanks, that matches what we see: the three switches you named are on by default on the new main, and none of our earlier runs had them, so we'll watch whether the jumpsuits ever turn again.

One thing from this PR didn't make it into the new main: your follow-up commit 8f4e0a95 (a write-combined commit inside a plain reservation is forgotten with the reservation, found by Kal0s-design, with their test). watch::title_memory_freed still passes the release's length 0 on to shadow::write_combined_freed, which then only drops regions starting at the allocation base. With VICE_TAY_WC_NO_BACK=1 now on by default, a stale region left there would keep shader writes on the card for whatever memory comes next at that address.

The commit replays onto current main almost unchanged (only the test's calls needed crate::shadow:: paths); the test fails without the fix and passes with it. Would you like to open it as a new PR yourself? If you'd rather not, I can open it with you as the commit's author and Kal0s-design credited.

AI-assisted: yes

**@⁠Indy2l** on GitHub · 2026-11-30 17:45 UTC · [original](https://github.com/TaynanGT/Vice-Tay/pull/462#issuecomment-7286787668) Thanks, that matches what we see: the three switches you named are on by default on the new `main`, and none of our earlier runs had them, so we'll watch whether the jumpsuits ever turn again. One thing from this PR didn't make it into the new `main`: your follow-up commit 8f4e0a95 (a write-combined commit inside a plain reservation is forgotten with the reservation, found by Kal0s-design, with their test). `watch::title_memory_freed` still passes the release's length 0 on to `shadow::write_combined_freed`, which then only drops regions starting at the allocation base. With `VICE_TAY_WC_NO_BACK=1` now on by default, a stale region left there would keep shader writes on the card for whatever memory comes next at that address. The commit replays onto current `main` almost unchanged (only the test's calls needed `crate::shadow::` paths); the test fails without the fix and passes with it. Would you like to open it as a new PR yourself? If you'd rather not, I can open it with you as the commit's author and Kal0s-design credited. AI-assisted: yes
Author
Owner

@⁠cafeoh on GitHub · 2026-11-30 17:53 UTC · original

Thanks for checking and replaying it. Yes, please open it, with the commit under my name and Kal0s-design credited for finding the bug and for the test. I looked at the current main too: write_combined_freed with length 0 still only drops a region that starts at the allocation base, so a write-combined commit inside a plain reservation stays registered after the release, as you say.

#357 can stay closed: we no longer use that merge.

**@⁠cafeoh** on GitHub · 2026-11-30 17:53 UTC · [original](https://github.com/TaynanGT/Vice-Tay/pull/462#issuecomment-7286995585) Thanks for checking and replaying it. Yes, please open it, with the commit under my name and Kal0s-design credited for finding the bug and for the test. I looked at the current `main` too: `write_combined_freed` with length 0 still only drops a region that starts at the allocation base, so a write-combined commit inside a plain reservation stays registered after the release, as you say. #357 can stay closed: we no longer use that merge.

Pull request closed

This discussion has been locked. Commenting is limited to contributors.
No description provided.