VICTORY_WC_NO_BACK=1: shaders' writes into write-combined title memory stay on the card (with a read census) #477

Open
github-bot wants to merge 7 commits from github-bot/gh-477 into a-publier AGit
Owner

@⁠icecreammule277-dot on GitHub · 2026-11-27 05:19 UTC · original
icecreammule277-dot:wc-no-back → a-publier · +939 −2 · 8 files · 7 commits · open

AI-assisted (Claude Code). Numbers and log lines only.

Builds on #476: its first two commits are that PR. Adds VICTORY_WC_NO_BACK=1 (off by default). Shaders' writes into title memory the title asked for as write-combined stay on the card. They aren't declared as written, so there's no snapshot, no compare and no copy-back. A census switch checks that the title doesn't read them.

Why

#476 showed that all of the copy-back in a heavy scene goes into write-combined memory. On the console the CPU writes such memory but doesn't read it back. This follows the console's own model: what the GPU wrote stays where the GPU wrote it. It's the same idea as fxceless/victory-fork issue #1169 and PR #1178 (lazy copy-back), but much narrower: no fault handler, and it's chosen by the protection the title asked for.

What it does

  • Which ranges stay on the card: a declared write (from lists or picked views) of 64 KiB or more (VICTORY_WC_NO_BACK_MIN_KB) that lies wholly in write-combined title memory. Its copy must also be in the card's memory and known to be write-watched.
    • Anything else is copied back as before: unwatched memory (a refresh couldn't tell what the CPU wrote) and copies in host memory (which hold the shaders' bytes themselves).
  • Refreshes:
    • The range is noted as the card's on its copy (Shadow::card_owns).
    • Where the memory is watched, pages the CPU writes still go up.
    • Where a refresh can't tell (memory not watched), the card's ranges are left out and counted. In the A/B below that count was 0.
  • VICTORY_WC_KEEP_STORES=1 (off): copies holding such ranges send up only the dwords the title changed, through the existing keep_stores path. A part the CPU writes only in part otherwise goes up whole, with older title bytes next to the CPU's. The trade-off is that exact sending misses a value written over the same value. It's separate because neither side has evidence yet.
  • VICTORY_WC_CENSUS=1 (diagnostics, needs VICTORY_WC_NO_BACK=1), after #1169's read census:
    • Once a second, every 4 KiB page of those ranges gets PAGE_GUARD. This is done holding the write guards' lock exclusively, and never on a block the guards keep read-only or one the kernel is writing for the title (kernel_writing takes the census's guards off).
    • A first handler counts each guard hit:
      • our own tagged paths (copy and texture refreshes, our copies);
      • the title's reads and writes, by instruction (named by module on the line);
      • touches in a guarded page outside the ranges.
  • All of it is counted on the VICTORY_WC_STATS line.

Results (diagnostics build, 7900 XTX, plus the PORT_* switches and VICTORY_WINDOWS_BAR_MB=1024)

Matched A/B: same save loaded, standing still, a 62-second window each, with the unwatched and host-memory copies copied back as above.

on off
frame (median) 67.7 ms (14.9 fps) 78.6 ms (12.8 fps)
copy-back 17.2 ms, 1.5 MB 34.8 ms, 23.5 MB
copies up 14.7 ms, 45 MB 20.2 ms, 75 MB
draws 8,942 7,211

The remaining copy-back time is mostly copies in host memory, which are still copied back.

Census: about 13 minutes of play with VICTORY_WC_CENSUS=1.

  • About 690 MB of ranges left on the card; about 900 MB of guards set over the run.
  • 0 title page reads.
  • Title writes: about 0.5 MB/s, about 92% from one store-only loop. It builds 64-byte records and writes them with two vmovups; the rest are similar packing loops. None of them load from their destination.
  • No guards came off for kernel file reads.
  • Gaps: about 20% of the ranges couldn't be guarded (read-only guard blocks, memory not committed), and a read after a write to the same page within the same second isn't seen.

Visual check: no difference seen. A foliage flicker that turned up shows with the switch off too, at the same spot.

Tests

cargo test -p victory-gpu --lib -- census:: wc:: shadow::: 40 passed. They cover the range set (join, cut, cover) and a census test on real guarded pages: a read, a write and a tagged touch are each counted once and go on. Built with --profile diag --features diagnostics.

🤖 Generated with Claude Code

**@⁠icecreammule277-dot** on GitHub · 2026-11-27 05:19 UTC · [original](https://github.com/Belobug/VIctory-Belobug-AMD/pull/477) `icecreammule277-dot:wc-no-back` → `a-publier` · +939 −2 · 8 files · 7 commits · open *AI-assisted (Claude Code). Numbers and log lines only.* **Builds on #476:** its first two commits are that PR. Adds `VICTORY_WC_NO_BACK=1` (off by default). Shaders' writes into title memory the title asked for as write-combined stay on the card. They aren't declared as written, so there's no snapshot, no compare and no copy-back. A census switch checks that the title doesn't read them. ## Why #476 showed that all of the copy-back in a heavy scene goes into write-combined memory. On the console the CPU writes such memory but doesn't read it back. This follows the console's own model: what the GPU wrote stays where the GPU wrote it. It's the same idea as fxceless/victory-fork issue #1169 and PR #1178 (lazy copy-back), but much narrower: no fault handler, and it's chosen by the protection the title asked for. ## What it does - **Which ranges stay on the card:** a declared write (from lists or picked views) of 64 KiB or more (`VICTORY_WC_NO_BACK_MIN_KB`) that lies wholly in write-combined title memory. Its copy must also be in the card's memory and known to be write-watched. - Anything else is copied back as before: unwatched memory (a refresh couldn't tell what the CPU wrote) and copies in host memory (which hold the shaders' bytes themselves). - **Refreshes:** - The range is noted as the card's on its copy (`Shadow::card_owns`). - Where the memory is watched, pages the CPU writes still go up. - Where a refresh can't tell (memory not watched), the card's ranges are left out and counted. In the A/B below that count was 0. - **`VICTORY_WC_KEEP_STORES=1`** (off): copies holding such ranges send up only the dwords the title changed, through the existing `keep_stores` path. A part the CPU writes only in part otherwise goes up whole, with older title bytes next to the CPU's. The trade-off is that exact sending misses a value written over the same value. It's separate because neither side has evidence yet. - **`VICTORY_WC_CENSUS=1`** (diagnostics, needs `VICTORY_WC_NO_BACK=1`), after #1169's read census: - Once a second, every 4 KiB page of those ranges gets `PAGE_GUARD`. This is done holding the write guards' lock exclusively, and never on a block the guards keep read-only or one the kernel is writing for the title (`kernel_writing` takes the census's guards off). - A first handler counts each guard hit: - our own tagged paths (copy and texture refreshes, our copies); - the title's reads and writes, by instruction (named by module on the line); - touches in a guarded page outside the ranges. - All of it is counted on the `VICTORY_WC_STATS` line. ## Results (diagnostics build, 7900 XTX, plus the `PORT_*` switches and `VICTORY_WINDOWS_BAR_MB=1024`) **Matched A/B:** same save loaded, standing still, a 62-second window each, with the unwatched and host-memory copies copied back as above. | | on | off | |---|---|---| | frame (median) | **67.7 ms (14.9 fps)** | 78.6 ms (12.8 fps) | | copy-back | **17.2 ms, 1.5 MB** | 34.8 ms, 23.5 MB | | copies up | **14.7 ms, 45 MB** | 20.2 ms, 75 MB | | draws | 8,942 | 7,211 | The remaining copy-back time is mostly copies in host memory, which are still copied back. **Census:** about 13 minutes of play with `VICTORY_WC_CENSUS=1`. - About 690 MB of ranges left on the card; about 900 MB of guards set over the run. - **0 title page reads.** - Title writes: about 0.5 MB/s, about 92% from one store-only loop. It builds 64-byte records and writes them with two `vmovups`; the rest are similar packing loops. None of them load from their destination. - No guards came off for kernel file reads. - Gaps: about 20% of the ranges couldn't be guarded (read-only guard blocks, memory not committed), and a read after a write to the same page within the same second isn't seen. **Visual check:** no difference seen. A foliage flicker that turned up shows with the switch off too, at the same spot. ## Tests `cargo test -p victory-gpu --lib -- census:: wc:: shadow::`: 40 passed. They cover the range set (join, cut, cover) and a census test on real guarded pages: a read, a write and a tagged touch are each counted once and go on. Built with `--profile diag --features diagnostics`. 🤖 Generated with [Claude Code](https://claude.com/claude-code)
XMem reports every protection the title asks for; copies up (refreshes,
copies, fills, placed steps) and copies back are counted by whether their
title memory was asked for as write-combined, uncached or cached, in one
line beside the frame line. Off by default: no cost unless set.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Co-Authored-By: Claude Opus 5.5 <[email protected]>
The console's CPU does not read write-combined memory back, and in a busy
scene (belorx_8) all of the copy-back went there. Such ranges (64 KiB and
up, VICTORY_WC_NO_BACK_MIN_KB) are not declared as written, from lists and
from picked views: no snapshot, compare or copy back. They are noted as the
card's on their copy, and a refresh that cannot tell what the CPU wrote
(memory not watched) leaves them out; where watched, pages the CPU writes
are still sent up. Off by default; counted on the VICTORY_WC_STATS line.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Co-Authored-By: Claude Opus 5.5 <[email protected]>
After fxceless/victory-fork issue #1169's read census. With
VICTORY_WC_NO_BACK=1, the ranges whose shaders' writes stay on the card
are kept in one set; once a second their 4 KiB pages get PAGE_GUARD,
holding the write guards' lock alone and never on a block those guards
keep read-only or the kernel is writing for the title (kernel_writing
takes the census's guards off). A first handler counts each guard hit:
our tagged paths (copy and texture refreshes, our copies), the title's
reads and writes inside the ranges by instruction (named by module on the
line), and touches beside them in a guarded page. Measurement only.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
A refresh of a part the CPU wrote sent it up whole from title memory,
which under VICTORY_WC_NO_BACK holds older bytes than the card beside the
CPU's own: those went over what shaders wrote. card_owns now marks the copy
keep_stores (the dword-exact path of VICTORY_SEND_CHANGED, for that copy):
the CPU's side holds what title memory held, as nothing comes back. A
value written over the same value is not seen. The VICTORY_WC_NO_BACK line
also counts refreshes that left such ranges out because the memory is not
watched (what the CPU wrote there does not go up), and bytes left to copies
not in the card's memory.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Where the memory is not write-watched a refresh cannot tell what the CPU
wrote there, and left the card's ranges out: what the CPU wrote never went
up (295-576 such refreshes a frame in run belorx_11). A copy in host memory
holds what shaders wrote itself, and a refresh of a part the CPU wrote went
over it. Both are copied back as before now, and counted on the line.
The dword-exact sending of dabd381a is its own switch,
VICTORY_WC_KEEP_STORES=1, off: it does not see a value written over the
same value.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
github-bot locked as GitHub sync and limited conversation to collaborators 2026-11-27 05:20:12 +00:00
Author
Owner

@⁠MamaLeVrai on GitHub · 2026-11-27 07:01 UTC · original

Tested on an RX 6950 XT (RDNA 2), driver 32.0.21045.29003, Windows 11 build 26300, Rust 1.98.1, release. At 0834177: victory-gpu 401 passed, 0 failed, 34 ignored; victory-hle 162 passed, 0 failed, 2 ignored.

AI-assisted (Claude Code); no game data.

**@⁠MamaLeVrai** on GitHub · 2026-11-27 07:01 UTC · [original](https://github.com/Belobug/VIctory-Belobug-AMD/pull/477#issuecomment-7212072356) Tested on an RX 6950 XT (RDNA 2), driver 32.0.21045.29003, Windows 11 build 26300, Rust 1.98.1, release. At `0834177`: `victory-gpu` 401 passed, 0 failed, 34 ignored; `victory-hle` 162 passed, 0 failed, 2 ignored. AI-assisted (Claude Code); no game data.
Author
Owner

@⁠gw1337x on GitHub · 2026-11-27 09:39 UTC · original

Tested in the title on RDNA 3: RX 7800 XT 16 GB, driver 32.0.32015.7029, Ryzen 7 9800X3D, 32 GB RAM, Windows 11 26200 (Memory Integrity off). Diagnostics builds (--profile diag --features diagnostics) of 0834177 and its base 4eb6cfd, same boot.

Settings: scripts/play.ps1 settings plus VICTORY_PORT_CONSTANTS/DESCRIPTORS/CBV/GUARD/JOURNAL=1, Series X profile, ray tracing off; the PR's runs add VICTORY_WC_NO_BACK=1. Method: 270 s hands-off from a Chapter I boat save; fps is the layer's 1 s figure from the window title, sampled every second, 45-265 s with 1000+ draws ("steady" from 205 s); per-frame figures from VICTORY_TIMELINE windows of 30 frames at 200 s and 240 s; screenshots every 5 s.

Run (order) Build steady fps (title / layer's log) frame card running / idle per frame
1 0834177 NO_BACK 30.0 / 30.0 32.8 ms 30.6-30.8 / 2.1-2.2 ms
2 4eb6cfd 29.0 / 28.6 34.1-34.2 ms 31.1-31.7 / 2.5-3.1 ms
3 0834177 NO_BACK 30.0 / 30.0 32.7-32.8 ms 31.0-31.1 / 1.5-1.9 ms
4 4eb6cfd 29.0 / 28.6 33.8-34.4 ms 31.8-32.2 / 2.0-2.2 ms
5, 6 0834177 NO_BACK - / 30.0, 30.0 - -
7 0834177 NO_BACK + VICTORY_WC_CENSUS=1 - / 30.0 - -

What showed:

  • With VICTORY_WC_NO_BACK=1 the steady figure is 30.0 in all five runs against 28.6 in the two base runs here; frames are about 1-1.5 ms shorter.
  • Active: the wc line reports 800-1,300 declarations a frame left on the card in the boat scene; 5-12 MB a frame of small ones still copied back.
  • Census (run 7): 545-589 MB of ranges guarded through the boat scene; the title touched 0.000 MB a second of them, read or written, in all 51 lines. Guard pass 0.7 ms. So in this scene the title's processor does not read what is left on the card.
  • Peak commit 33.7-34.4 GB in the five NO_BACK runs against 32.5-33.5 GB for the two base runs here (private peak 34.5-34.9 GB against 33.3-34.2 GB).
  • Picture: the 241 s shots match the base in runs 1, 5, 6 and 7. In run 3 the man's shirt on the boat is dark grey from 185 s to the end (same shirt and logo, the boat and his neck lit as in the others); in 19 other boat runs today (base and other PRs, checked at 241 s) it never was. One in five runs of the PR; I have not established whether it comes from the change or is the title's own variation.

Five runs of the PR with the switch, one scene, ray tracing off.

**@⁠gw1337x** on GitHub · 2026-11-27 09:39 UTC · [original](https://github.com/Belobug/VIctory-Belobug-AMD/pull/477#issuecomment-7214934563) Tested in the title on RDNA 3: RX 7800 XT 16 GB, driver 32.0.32015.7029, Ryzen 7 9800X3D, 32 GB RAM, Windows 11 26200 (Memory Integrity off). Diagnostics builds (`--profile diag --features diagnostics`) of `0834177` and its base `4eb6cfd`, same boot. Settings: `scripts/play.ps1` settings plus `VICTORY_PORT_CONSTANTS/DESCRIPTORS/CBV/GUARD/JOURNAL=1`, Series X profile, ray tracing off; the PR's runs add `VICTORY_WC_NO_BACK=1`. Method: 270 s hands-off from a Chapter I boat save; fps is the layer's 1 s figure from the window title, sampled every second, 45-265 s with 1000+ draws ("steady" from 205 s); per-frame figures from `VICTORY_TIMELINE` windows of 30 frames at 200 s and 240 s; screenshots every 5 s. | Run (order) | Build | steady fps (title / layer's log) | frame | card running / idle per frame | |---|---|---|---|---| | 1 | `0834177` NO_BACK | 30.0 / 30.0 | 32.8 ms | 30.6-30.8 / 2.1-2.2 ms | | 2 | `4eb6cfd` | 29.0 / 28.6 | 34.1-34.2 ms | 31.1-31.7 / 2.5-3.1 ms | | 3 | `0834177` NO_BACK | 30.0 / 30.0 | 32.7-32.8 ms | 31.0-31.1 / 1.5-1.9 ms | | 4 | `4eb6cfd` | 29.0 / 28.6 | 33.8-34.4 ms | 31.8-32.2 / 2.0-2.2 ms | | 5, 6 | `0834177` NO_BACK | - / 30.0, 30.0 | - | - | | 7 | `0834177` NO_BACK + `VICTORY_WC_CENSUS=1` | - / 30.0 | - | - | What showed: - With `VICTORY_WC_NO_BACK=1` the steady figure is 30.0 in all five runs against 28.6 in the two base runs here; frames are about 1-1.5 ms shorter. - Active: the `wc` line reports 800-1,300 declarations a frame left on the card in the boat scene; 5-12 MB a frame of small ones still copied back. - Census (run 7): 545-589 MB of ranges guarded through the boat scene; the title touched 0.000 MB a second of them, read or written, in all 51 lines. Guard pass 0.7 ms. So in this scene the title's processor does not read what is left on the card. - Peak commit 33.7-34.4 GB in the five NO_BACK runs against 32.5-33.5 GB for the two base runs here (private peak 34.5-34.9 GB against 33.3-34.2 GB). - Picture: the 241 s shots match the base in runs 1, 5, 6 and 7. In run 3 the man's shirt on the boat is dark grey from 185 s to the end (same shirt and logo, the boat and his neck lit as in the others); in 19 other boat runs today (base and other PRs, checked at 241 s) it never was. One in five runs of the PR; I have not established whether it comes from the change or is the title's own variation. Five runs of the PR with the switch, one scene, ray tracing off.
Author
Owner

@⁠gw1337x on GitHub · 2026-11-27 12:07 UTC · original

#477 and #470 stack, measured together. Memory Integrity was off.

PC: Ryzen 7 9800X3D, RX 7800 XT, 32 GB. Test: 270 s hands-off boat scene, RT off, Belobug launcher settings plus the 5 port switches. I made a local build of #477 (0834177) with #470's two commits cherry-picked on top (no conflicts) and ran it with VICTORY_WC_NO_BACK=1. Compared against 4eb6cfd, 3 runs each, interleaved.

#477 + #470 base 4eb6cfd
steady fps (last minute, layer log) 30.0 / 30.0 / 30.0 28.4 / 28.3 / 28.6
world on screen (first 1,000+ draws a frame), s after start 39.9 / 36.2 / 36.5 42.9 / 44.0 / 44.3
seconds under 15 fps (window title, 45-265 s, seconds with 1,000+ draws) 7 / 6 / 8 13 / 15 / 14
peak commit, GB 33.5 / 33.8 / 33.7 33.8 / 34.2 / 33.9
device loss lines 0 0
  • Both halves were active in every combo run: 8 file-cache opens per run, and NO_BACK lines in the log.
  • Pictures at 241 s look normal in all three.

Each PR keeps its own gain when they're combined: #477's steady fps and #470's faster load.

**@⁠gw1337x** on GitHub · 2026-11-27 12:07 UTC · [original](https://github.com/Belobug/VIctory-Belobug-AMD/pull/477#issuecomment-7217874958) #477 and #470 stack, measured together. Memory Integrity was off. PC: Ryzen 7 9800X3D, RX 7800 XT, 32 GB. Test: 270 s hands-off boat scene, RT off, Belobug launcher settings plus the 5 port switches. I made a local build of #477 (`0834177`) with #470's two commits cherry-picked on top (no conflicts) and ran it with `VICTORY_WC_NO_BACK=1`. Compared against `4eb6cfd`, 3 runs each, interleaved. | | #477 + #470 | base `4eb6cfd` | |---|---|---| | steady fps (last minute, layer log) | 30.0 / 30.0 / 30.0 | 28.4 / 28.3 / 28.6 | | world on screen (first 1,000+ draws a frame), s after start | 39.9 / 36.2 / 36.5 | 42.9 / 44.0 / 44.3 | | seconds under 15 fps (window title, 45-265 s, seconds with 1,000+ draws) | 7 / 6 / 8 | 13 / 15 / 14 | | peak commit, GB | 33.5 / 33.8 / 33.7 | 33.8 / 34.2 / 33.9 | | device loss lines | 0 | 0 | - Both halves were active in every combo run: 8 file-cache opens per run, and NO_BACK lines in the log. - Pictures at 241 s look normal in all three. Each PR keeps its own gain when they're combined: #477's steady fps and #470's faster load.
Author
Owner

@⁠gw1337x on GitHub · 2026-11-27 13:35 UTC · original

Follow-up: #477 with VICTORY_WC_NO_BACK=1 while driving, not just sitting in the boat. Memory Integrity was off.

PC: Ryzen 7 9800X3D, RX 7800 XT, 32 GB. RT off, Belobug launcher settings plus the 5 port switches, warm caches. #477 (0834177) on 4eb6cfd vs 4eb6cfd, interleaved (PR, base, PR, base, PR, base). Same boat scene; scripted full throttle from 190 s with no steering, run ends at 220 s.

Routes split after about 205 s even on base (same input, different heading), so the main window is 190-205 s, and the frame-time numbers come from the timelines taken at 190 s and 200 s (30 frames each, 60 per run).

#477 run 1 #477 run 2 #477 run 3 base run 1 base run 2 base run 3
Fps, 190-205 s (window title, median) 30.0 29.0 30.0 27.0 28.0 27.5
Lowest fps, 190-205 s 25 28 26 22 26 22
Frames over 40 ms (of 60) 1 3 1 12 9 9
Frame time p50 33.2 ms 33.6 ms 33.3 ms 35.5 ms 34.6 ms 35.0 ms
Frame time p95 38.3 ms 45.0 ms 38.0 ms 51.8 ms 51.8 ms 52.5 ms
  • 190-205 s: no overlap between the two sides on any row.
  • 205-220 s: the two sides overlap (25.0/28.0/28.0 vs 26.0/26.0/22.0 fps).
  • Routes: PR run 1 turned off course by 220 s. Base run 1 met a traffic yacht at about 201 s and stopped next to it by 210 s. Leaving base run 1 out, base is 28.0/27.5 fps for 190-205 s, still below #477.
  • Other checks: no device loss, and peak commit 33.7-34.0 GB vs 33.5-33.8 GB.

The #477 + #470 stack gave the same result in this test (190-205 s: 29.0-30.0 fps, 0-2 frames over 40 ms of 60), so the gain while driving comes from #477, as it does sitting still.

AI-assisted (Claude Code); numbers from the run logs and timelines.

**@⁠gw1337x** on GitHub · 2026-11-27 13:35 UTC · [original](https://github.com/Belobug/VIctory-Belobug-AMD/pull/477#issuecomment-7219680928) Follow-up: #477 with `VICTORY_WC_NO_BACK=1` while driving, not just sitting in the boat. Memory Integrity was off. PC: Ryzen 7 9800X3D, RX 7800 XT, 32 GB. RT off, Belobug launcher settings plus the 5 port switches, warm caches. #477 (`0834177`) on `4eb6cfd` vs `4eb6cfd`, interleaved (PR, base, PR, base, PR, base). Same boat scene; scripted full throttle from 190 s with no steering, run ends at 220 s. Routes split after about 205 s even on base (same input, different heading), so the main window is 190-205 s, and the frame-time numbers come from the timelines taken at 190 s and 200 s (30 frames each, 60 per run). | | #477 run 1 | #477 run 2 | #477 run 3 | base run 1 | base run 2 | base run 3 | |---|---|---|---|---|---|---| | Fps, 190-205 s (window title, median) | 30.0 | 29.0 | 30.0 | 27.0 | 28.0 | 27.5 | | Lowest fps, 190-205 s | 25 | 28 | 26 | 22 | 26 | 22 | | Frames over 40 ms (of 60) | 1 | 3 | 1 | 12 | 9 | 9 | | Frame time p50 | 33.2 ms | 33.6 ms | 33.3 ms | 35.5 ms | 34.6 ms | 35.0 ms | | Frame time p95 | 38.3 ms | 45.0 ms | 38.0 ms | 51.8 ms | 51.8 ms | 52.5 ms | - **190-205 s:** no overlap between the two sides on any row. - **205-220 s:** the two sides overlap (25.0/28.0/28.0 vs 26.0/26.0/22.0 fps). - **Routes:** PR run 1 turned off course by 220 s. Base run 1 met a traffic yacht at about 201 s and stopped next to it by 210 s. Leaving base run 1 out, base is 28.0/27.5 fps for 190-205 s, still below #477. - **Other checks:** no device loss, and peak commit 33.7-34.0 GB vs 33.5-33.8 GB. The #477 + #470 stack gave the same result in this test (190-205 s: 29.0-30.0 fps, 0-2 frames over 40 ms of 60), so the gain while driving comes from #477, as it does sitting still. AI-assisted (Claude Code); numbers from the run logs and timelines.
Author
Owner

@⁠luisaugustz on GitHub · 2026-11-27 14:59 UTC · original

Confirming on RX 9070 XT + Ryzen 7 5800X (a-publier 4eb6cfd + this PR, Series X, RT off, same save and spot):

fps ms/frame copy back
off 11.8 84.7 32.5 ms, ~21 MB
VICTORY_WC_NO_BACK=1 13.8 ~73 ~18-20 ms, 2.6 MB

Copy back fell from about 21 MB to 2.6 MB a frame. We have played with it on for several sessions since and have not noticed anything it breaks, though we did not do a careful visual A/B.

**@⁠luisaugustz** on GitHub · 2026-11-27 14:59 UTC · [original](https://github.com/Belobug/VIctory-Belobug-AMD/pull/477#issuecomment-7221480597) Confirming on RX 9070 XT + Ryzen 7 5800X (a-publier `4eb6cfd` + this PR, Series X, RT off, same save and spot): | | fps | ms/frame | copy back | |---|---|---|---| | off | 11.8 | 84.7 | 32.5 ms, ~21 MB | | `VICTORY_WC_NO_BACK=1` | 13.8 | ~73 | ~18-20 ms, 2.6 MB | Copy back fell from about 21 MB to 2.6 MB a frame. We have played with it on for several sessions since and have not noticed anything it breaks, though we did not do a careful visual A/B.
Author
Owner

@⁠gut0to on GitHub · 2026-11-27 15:10 UTC · original · reviewed

AI-assisted static review; I traced the page-arm failure path and the vectored exception handler. I did not run the test suite.

**@⁠gut0to** on GitHub · 2026-11-27 15:10 UTC · [original](https://github.com/Belobug/VIctory-Belobug-AMD/pull/477#pullrequestreview-6090158298) · **reviewed** AI-assisted static review; I traced the page-arm failure path and the vectored exception handler. I did not run the test suite.
@ -0,0 +265,4 @@
let pages = (region_end - at) / PAGE;
// The bits before the guard: a hit at once is then the census's.
for page in at / PAGE..region_end / PAGE {
ours()[page / 64].fetch_or(1u64 << (page % 64), Relaxed);
Author
Owner

@⁠gut0to on GitHub · 2026-11-27 15:10 UTC · original

AI-assisted review: these ours bits are set before VirtualProtect so an immediate census fault is recognized, but they are not rolled back when VirtualProtect fails. If the address is later reused and another owner installs PAGE_GUARD, on_guard will treat that unrelated exception as ours and return CONTINUE_EXECUTION, consuming the other guard. Could the arm state be rolled back safely on failure while preserving the immediate-fault case, with a test for a failed arm followed by a foreign guard?

**@⁠gut0to** on GitHub · 2026-11-27 15:10 UTC · [original](https://github.com/Belobug/VIctory-Belobug-AMD/pull/477#discussion_r4720996463) AI-assisted review: these `ours` bits are set before `VirtualProtect` so an immediate census fault is recognized, but they are not rolled back when `VirtualProtect` fails. If the address is later reused and another owner installs `PAGE_GUARD`, `on_guard` will treat that unrelated exception as ours and return `CONTINUE_EXECUTION`, consuming the other guard. Could the arm state be rolled back safely on failure while preserving the immediate-fault case, with a test for a failed arm followed by a foreign guard?
This pull request can be merged automatically.
You are not authorized to merge this pull request.
View command line instructions

Checkout

From your project repository, check out a new branch and test the changes.
git fetch -u origin '+refs/pull/477/head:github-bot/gh-477'
git switch 'github-bot/gh-477'

Merge

Merge the changes and update on Forgejo.
git switch 'a-publier'
git merge --no-ff 'github-bot/gh-477'
git switch 'github-bot/gh-477'
git rebase 'a-publier'
git switch 'a-publier'
git merge --ff-only 'github-bot/gh-477'
git switch 'github-bot/gh-477'
git rebase 'a-publier'
git switch 'a-publier'
git merge --no-ff 'github-bot/gh-477'
git switch 'a-publier'
git merge --squash 'github-bot/gh-477'
git switch 'a-publier'
git merge --ff-only 'github-bot/gh-477'
git switch 'a-publier'
git merge 'github-bot/gh-477'
git push origin 'a-publier'
This discussion has been locked. Commenting is limited to contributors.
No description provided.