GPU: narrow placed-copy, enhanced-group, buffer and pipeline-sync barriers (VICTORY_NARROW_BARRIERS) #799

Merged
Czer0xx merged 2 commits from upstream-pr/799 into main 2026-11-29 08:16:58 +00:00
Czer0xx commented 2026-11-28 06:14:04 +00:00 (Migrated from github.com)

Imported from trustno1-coder/VIctory-NVIDIA. Originally posted by Czer0xx on 2026-11-28T06:14:04Z.


Summary

Adds an opt-in switch VICTORY_NARROW_BARRIERS=1 (off by default, exposed in the F1 menu as NARROW GPU BARRIERS) that narrows unconditional global GPU barriers (D3D12_BARRIER_TYPE_GLOBAL(SYNC_ALL) and UAV_BARRIER(NULL)) to the buffers, textures, and sync scopes the title actually asks for:

  1. Placed copies (host/place.rs): place_copy and place_source emit D3D12_BARRIER_TYPE_BUFFER scoped to from.buffer / to.buffer / between instead of global SYNC_ALL drains (~78-144/frame narrowed), falling back to wait_for_all when Enhanced Barriers are unavailable.
  2. Enhanced Barrier() groups + thin recording path (list.rs, list/thin.rs): classifies barrier groups while the title pointer is live on the calling thread instead of discarding groups in thin and emitting a global UAV_BARRIER(NULL). Skips pure non-UAV texture transitions and SYNC_NONE/NO_ACCESS no-ops (~100-140/frame skipped), narrows buffer barriers to D3D12_BUFFER_BARRIER, texture UAV barriers to targeted UAV_BARRIER(host_tex), and global barriers to D3D12_GLOBAL_BARRIER with sanitized sync bits (~590-700/frame narrowed; ~1/frame global fallback).
  3. Legacy buffer ResourceBarrier and pipeline sync (list.rs): skips BEGIN_ONLY and pure read-to-read legacy buffer transitions, narrows write-involving buffer barriers to targeted UAV_BARRIER(shadow.buffer), and skips global UAV_BARRIER(NULL) on pipeline syncs whose flush flags contain no shader partial-flush, idle, or L1/L2 cache writeback/invalidate bits.
  4. Periodic telemetry (host.rs, host/place.rs): logs narrow barriers per frame (VICTORY_NARROW_BARRIERS=1) when enabled.

With VICTORY_NARROW_BARRIERS unset, behavior is unchanged.

Verification

  • cargo clippy -p victory-gpu --all-targets --locked and --all-features: 0 warnings in modified files.
  • cargo test -p victory-gpu --lib --locked: passes, including new unit test list::tests::narrow_barrier_classification.
  • cargo xtask policy: asset policy: 294 files ok.
  • In-game A/B on NVIDIA RTX 3060 12 GB (2560x1440, DLSS Performance, Series X profile, identical settings except VICTORY_NARROW_BARRIERS=1):
    • Per frame: 110.1 placed-copy barriers narrowed; enhanced barrier groups 118.3 skipped, 634.5 narrowed, 1.0 global fallback.
    • Submitting thread median / mean: 68.4 / 72.1 ms -> 63.4 / 65.8 ms (-5.0 / -6.3 ms); 5 s preparing median 59.9 ms -> 53.8 ms (-6.1 ms).
    • Card clock busy median / mean: 65% / 68.0% -> 73% / 74.5%; GPU idle behind us median 27.0 ms -> 20.1 ms (-6.9 ms).
    • 3D mean FPS: 11.57 -> 11.96 (+3.4%), heavy scenes (>=5000 draws) mean 10.40 -> 11.41 (+9.7%), peak 14.70 -> 17.40 (+18.4%), with no visual artifacts observed.
<!-- greyfinch-sync:trustno1-coder/VIctory-NVIDIA:issue:5537367119 --> Imported from [trustno1-coder/VIctory-NVIDIA](https://github.com/trustno1-coder/VIctory-NVIDIA/pull/799). Originally posted by [Czer0xx](https://github.com/Czer0xx) on 2026-11-28T06:14:04Z. --- ## Summary Adds an opt-in switch `VICTORY_NARROW_BARRIERS=1` (off by default, exposed in the F1 menu as `NARROW GPU BARRIERS`) that narrows unconditional global GPU barriers (`D3D12_BARRIER_TYPE_GLOBAL(SYNC_ALL)` and `UAV_BARRIER(NULL)`) to the buffers, textures, and sync scopes the title actually asks for: 1. **Placed copies** (`host/place.rs`): `place_copy` and `place_source` emit `D3D12_BARRIER_TYPE_BUFFER` scoped to `from.buffer` / `to.buffer` / `between` instead of global `SYNC_ALL` drains (~78-144/frame narrowed), falling back to `wait_for_all` when Enhanced Barriers are unavailable. 2. **Enhanced `Barrier()` groups + `thin` recording path** (`list.rs`, `list/thin.rs`): classifies barrier groups while the title pointer is live on the calling thread instead of discarding `groups` in `thin` and emitting a global `UAV_BARRIER(NULL)`. Skips pure non-UAV texture transitions and `SYNC_NONE`/`NO_ACCESS` no-ops (~100-140/frame skipped), narrows buffer barriers to `D3D12_BUFFER_BARRIER`, texture UAV barriers to targeted `UAV_BARRIER(host_tex)`, and global barriers to `D3D12_GLOBAL_BARRIER` with sanitized sync bits (~590-700/frame narrowed; ~1/frame global fallback). 3. **Legacy buffer `ResourceBarrier` and pipeline sync** (`list.rs`): skips `BEGIN_ONLY` and pure read-to-read legacy buffer transitions, narrows write-involving buffer barriers to targeted `UAV_BARRIER(shadow.buffer)`, and skips global `UAV_BARRIER(NULL)` on pipeline syncs whose flush flags contain no shader partial-flush, idle, or L1/L2 cache writeback/invalidate bits. 4. **Periodic telemetry** (`host.rs`, `host/place.rs`): logs `narrow barriers per frame (VICTORY_NARROW_BARRIERS=1)` when enabled. With `VICTORY_NARROW_BARRIERS` unset, behavior is unchanged. ## Verification - `cargo clippy -p victory-gpu --all-targets --locked` and `--all-features`: 0 warnings in modified files. - `cargo test -p victory-gpu --lib --locked`: passes, including new unit test `list::tests::narrow_barrier_classification`. - `cargo xtask policy`: `asset policy: 294 files ok`. - In-game A/B on NVIDIA RTX 3060 12 GB (2560x1440, DLSS Performance, Series X profile, identical settings except `VICTORY_NARROW_BARRIERS=1`): - Per frame: `110.1` placed-copy barriers narrowed; enhanced barrier groups `118.3` skipped, `634.5` narrowed, `1.0` global fallback. - Submitting thread median / mean: `68.4 / 72.1 ms` -> `63.4 / 65.8 ms` (`-5.0 / -6.3 ms`); 5 s `preparing` median `59.9 ms` -> `53.8 ms` (`-6.1 ms`). - Card clock busy median / mean: `65% / 68.0%` -> `73% / 74.5%`; GPU idle behind us median `27.0 ms` -> `20.1 ms` (`-6.9 ms`). - 3D mean FPS: `11.57` -> `11.96` (`+3.4%`), heavy scenes (`>=5000` draws) mean `10.40` -> `11.41` (`+9.7%`), peak `14.70` -> `17.40` (`+18.4%`), with no visual artifacts observed.
copilot-pull-request-reviewer[bot] commented 2026-11-28 06:14:13 +00:00 (Migrated from github.com)

Imported from trustno1-coder/VIctory-NVIDIA. Originally posted by copilot-pull-request-reviewer[bot] on 2026-11-28T06:14:13Z.

Review: COMMENTED


Copilot was unable to review this pull request because the user who requested the review has insufficient remaining quota. Try requesting a review at a lower effort level.

<!-- greyfinch-sync:trustno1-coder/VIctory-NVIDIA:review:6096231710 --> Imported from [trustno1-coder/VIctory-NVIDIA](https://github.com/trustno1-coder/VIctory-NVIDIA/pull/799#pullrequestreview-6096231710). Originally posted by [copilot-pull-request-reviewer[bot]](https://github.com/apps/copilot-pull-request-reviewer) on 2026-11-28T06:14:13Z. **Review:** COMMENTED --- Copilot was unable to review this pull request because the user who requested the review has insufficient remaining quota. Try requesting a review at a lower effort level.
grosterr commented 2026-11-28 12:19:57 +00:00 (Migrated from github.com)

Imported from trustno1-coder/VIctory-NVIDIA. Originally posted by grosterr on 2026-11-28T12:19:57Z.


On our build VICTORY_NARROW_BARRIERS=1 turns most of the picture white.

RTX 3060 12 GB (driver 621.40), Ryzen 7 5700X, 32 GB, Windows 11. Main 63b902f with open PRs on top (among them #501, #635, #641, #740, #807, #857, #875), Series S, 1920x1080, DLSS Quality (preset K), FSR 3 frame generation 2x. Shader cache warmed, no misses in any run.

Run Switches Picture
base none normal
A (twice; once with 5dc3b25986622949 also left out) VICTORY_NARROW_BARRIERS=1 alone some later cutscenes, and all of the gameplay, white
B VICTORY_NARROW_BARRIERS=1 + VICTORY_PLACED_FILLS=1 the same, and the skin of faces in the first cutscene a magenta pattern
C the three of #799, #740, #501 together white from the first cutscene-to-gameplay fade on, and it does not come back

The first cutscene (indoors, the office) plays fine in A. The white starts with the white fade into the boat scene and stays for the rest of the run. Only the HUD, the minimap and subtitles show over it, with a faint outline of the scene under the white in some frames. The card stays busy: GPU BUSY 48–62 ms a frame on the white screen, with 2,500–4,000 draws a frame, so the frames are drawn but come out white. No device loss, and nothing new among the warnings in the log.

It looks as if something read after a narrowed barrier (an exposure or tone-map value, say) is read before it is written. That is a guess; I have not found which group.

With the switch off, the same build and route are clean (run "base", and a run with only #501's switches).

AI-assisted (Claude Code): the runs were judged by eye on my PC, and Claude wrote this text. No game files attached.

🤖 Generated with Claude Code

<!-- greyfinch-sync:trustno1-coder/VIctory-NVIDIA:comment:7239153358 --> Imported from [trustno1-coder/VIctory-NVIDIA](https://github.com/trustno1-coder/VIctory-NVIDIA/pull/799#issuecomment-7239153358). Originally posted by [grosterr](https://github.com/grosterr) on 2026-11-28T12:19:57Z. --- On our build `VICTORY_NARROW_BARRIERS=1` turns most of the picture white. RTX 3060 12 GB (driver 621.40), Ryzen 7 5700X, 32 GB, Windows 11. Main `63b902f` with open PRs on top (among them #501, #635, #641, #740, #807, #857, #875), Series S, 1920x1080, DLSS Quality (preset K), FSR 3 frame generation 2x. Shader cache warmed, no misses in any run. | Run | Switches | Picture | |---|---|---| | base | none | normal | | A (twice; once with `5dc3b25986622949` also left out) | `VICTORY_NARROW_BARRIERS=1` alone | some later cutscenes, and all of the gameplay, white | | B | `VICTORY_NARROW_BARRIERS=1` + `VICTORY_PLACED_FILLS=1` | the same, and the skin of faces in the first cutscene a magenta pattern | | C | the three of #799, #740, #501 together | white from the first cutscene-to-gameplay fade on, and it does not come back | The first cutscene (indoors, the office) plays fine in A. The white starts with the white fade into the boat scene and stays for the rest of the run. Only the HUD, the minimap and subtitles show over it, with a faint outline of the scene under the white in some frames. The card stays busy: `GPU BUSY` 48–62 ms a frame on the white screen, with 2,500–4,000 draws a frame, so the frames are drawn but come out white. No device loss, and nothing new among the warnings in the log. It looks as if something read after a narrowed barrier (an exposure or tone-map value, say) is read before it is written. That is a guess; I have not found which group. With the switch off, the same build and route are clean (run "base", and a run with only #501's switches). AI-assisted (Claude Code): the runs were judged by eye on my PC, and Claude wrote this text. No game files attached. 🤖 Generated with [Claude Code](https://claude.com/claude-code)
shiman1901 commented 2026-11-28 14:13:36 +00:00 (Migrated from github.com)

Imported from trustno1-coder/VIctory-NVIDIA. Originally posted by shiman1901 on 2026-11-28T14:13:36Z.


@Czer0xx @grosterr Audited commit 517048c to track down why VICTORY_NARROW_BARRIERS=1 latches the screen white right on the cutscene-to-boat white fade (while HUD draws fine — classic auto-exposure / tone-map hazard).

Found four concrete barrier-drop holes in 517048c that can let a tone-map / exposure pass read stale/unflushed data:

1. ACCESS_NO_ACCESS execution barriers are silently dropped (list.rs, global_barrier_needs_host & buffer_barrier_needs_host)

  • Both functions return false when access_before == NO_ACCESS or access_after == NO_ACCESS.
  • In D3D12 Enhanced Barriers, a barrier with non-zero SyncBefore/SyncAfter and ACCESS_NO_ACCESS (0x8000_0000) is a pure execution barrier, NOT a no-op — dropping it allows downstream compute/pixel work (e.g. exposure adaptation / tone-map) to overlap with upstream writes.

2. texture_barrier_needs_uav drops RENDER_TARGET / DSV_WRITE -> SHADER_RESOURCE (list.rs)

  • texture_barrier_needs_uav returns false whenever access_before != 0 and neither side has UAV_ACCESS, so sync_before=0x40 (RENDER_TARGET) -> sync_after=0x10 (PIXEL_SHADING), access_before=0x8 (RENDER_TARGET) -> access_after=0x80 (SHADER_RESOURCE) resolves to PackedGroups::Skip (explicitly asserted in narrow_barrier_classification).
  • Even though host draw binding tracks legacy state transitions for normal bindings, any exposure/RT target sampled through a bindless table slot, placed view, or colour twin relies on the barrier's flush/wait — previously covered by the global barrier fallback, now silently dropped.
  • Related: CompactBarrier doesn't store layout_before/layout_after, and replay_narrow_barrier_groups (kind == 1) emits a legacy Barrier { kind: 2 } (UAV barrier) on twin_resource/host_resource rather than a real D3D12_TEXTURE_BARRIER.

3. sync_flags_need_uav skips color/depth block flushes (0x4 | 0x8)

  • Treating CB/DB-only flushes as safe to drop can lose synchronization right after an RT/depth write before a compute/pixel read (like a fade / auto-exposure pass).

4. place.rs (place_copy / place_source) misses aliasing views / card sides

  • Replacing wait_for_all with D3D12_BUFFER_BARRIER on only from.buffer / to.buffer / between doesn't cover writes made through a HostTexture / colour twin, placed view, or the VRAM Card side aliasing the same address range. (This also fits @grosterr's Run B where combining #799 + #740 VICTORY_PLACED_FILLS added magenta face corruption on top of the white screen.)

Quickest way to bisect & fix

  1. 1-run bisect for @grosterr: splitting VICTORY_NARROW_BARRIERS into sub-modes (place, groups, sync, or bitmask) will tell in a single run at the boat fade which of the 3 paths causes the white latch.
  2. Safe minimal fix:
    • Keep NO_ACCESS barriers (access_before == NO_ACCESS || access_after == NO_ACCESS => true when syncs are non-zero).
    • Don't drop 0x4 | 0x8 CB/DB flushes in sync_flags_need_uav.
    • In texture_barrier_needs_uav, treat any write access (RTV | DSV | UAV | COPY_DEST) as needing synchronization and fall back to PackedGroups::Global until CompactBarrier carries layouts for a real D3D12_TEXTURE_BARRIER.
    • In place.rs, fall back to wait_for_all (or include the card/twin resource) when from/to is carded or aliased by a placed texture/twin.

Hope this helps get those +10–18% RTX 3060 gains landed cleanly without the white-screen regression!

<!-- greyfinch-sync:trustno1-coder/VIctory-NVIDIA:comment:7240512263 --> Imported from [trustno1-coder/VIctory-NVIDIA](https://github.com/trustno1-coder/VIctory-NVIDIA/pull/799#issuecomment-7240512263). Originally posted by [shiman1901](https://github.com/shiman1901) on 2026-11-28T14:13:36Z. --- @Czer0xx @grosterr Audited commit `517048c` to track down why `VICTORY_NARROW_BARRIERS=1` latches the screen white right on the cutscene-to-boat white fade (while HUD draws fine — classic auto-exposure / tone-map hazard). Found **four concrete barrier-drop holes** in `517048c` that can let a tone-map / exposure pass read stale/unflushed data: ### 1. `ACCESS_NO_ACCESS` execution barriers are silently dropped (`list.rs`, `global_barrier_needs_host` & `buffer_barrier_needs_host`) - Both functions return `false` when `access_before == NO_ACCESS` or `access_after == NO_ACCESS`. - In D3D12 Enhanced Barriers, a barrier with non-zero `SyncBefore`/`SyncAfter` and `ACCESS_NO_ACCESS` (`0x8000_0000`) is a **pure execution barrier**, NOT a no-op — dropping it allows downstream compute/pixel work (e.g. exposure adaptation / tone-map) to overlap with upstream writes. ### 2. `texture_barrier_needs_uav` drops `RENDER_TARGET / DSV_WRITE -> SHADER_RESOURCE` (`list.rs`) - `texture_barrier_needs_uav` returns `false` whenever `access_before != 0` and neither side has `UAV_ACCESS`, so `sync_before=0x40 (RENDER_TARGET) -> sync_after=0x10 (PIXEL_SHADING)`, `access_before=0x8 (RENDER_TARGET) -> access_after=0x80 (SHADER_RESOURCE)` resolves to `PackedGroups::Skip` (explicitly asserted in `narrow_barrier_classification`). - Even though host draw binding tracks legacy state transitions for normal bindings, any exposure/RT target sampled through a **bindless table slot, placed view, or colour twin** relies on the barrier's flush/wait — previously covered by the global barrier fallback, now silently dropped. - Related: `CompactBarrier` doesn't store `layout_before`/`layout_after`, and `replay_narrow_barrier_groups` (`kind == 1`) emits a legacy `Barrier { kind: 2 }` (UAV barrier) on `twin_resource`/`host_resource` rather than a real `D3D12_TEXTURE_BARRIER`. ### 3. `sync_flags_need_uav` skips color/depth block flushes (`0x4 | 0x8`) - Treating CB/DB-only flushes as safe to drop can lose synchronization right after an RT/depth write before a compute/pixel read (like a fade / auto-exposure pass). ### 4. `place.rs` (`place_copy` / `place_source`) misses aliasing views / card sides - Replacing `wait_for_all` with `D3D12_BUFFER_BARRIER` on only `from.buffer / to.buffer / between` doesn't cover writes made through a `HostTexture` / colour twin, placed view, or the VRAM `Card` side aliasing the same address range. (This also fits @grosterr's Run B where combining `#799` + `#740 VICTORY_PLACED_FILLS` added magenta face corruption on top of the white screen.) ### Quickest way to bisect & fix 1. **1-run bisect for @grosterr:** splitting `VICTORY_NARROW_BARRIERS` into sub-modes (`place`, `groups`, `sync`, or bitmask) will tell in a single run at the boat fade which of the 3 paths causes the white latch. 2. **Safe minimal fix:** - Keep `NO_ACCESS` barriers (`access_before == NO_ACCESS || access_after == NO_ACCESS => true` when syncs are non-zero). - Don't drop `0x4 | 0x8` CB/DB flushes in `sync_flags_need_uav`. - In `texture_barrier_needs_uav`, treat any write access (`RTV | DSV | UAV | COPY_DEST`) as needing synchronization and fall back to `PackedGroups::Global` until `CompactBarrier` carries layouts for a real `D3D12_TEXTURE_BARRIER`. - In `place.rs`, fall back to `wait_for_all` (or include the card/twin resource) when `from`/`to` is carded or aliased by a placed texture/twin. Hope this helps get those +10–18% RTX 3060 gains landed cleanly without the white-screen regression!
claudeFrancoisAI commented 2026-11-28 16:00:21 +00:00 (Migrated from github.com)

Imported from trustno1-coder/VIctory-NVIDIA. Originally posted by claudeFrancoisAI on 2026-11-28T16:00:21Z.


A second, independent reproduction of the white screen grosterr reported above, on a tree with fewer moving parts: main 63b902f plus this PR's barrier changes only (none of 501, 740, 807, 857, 875).

Machine: RTX 2000 Ada 16 GB (driver 565.90, no Resizable BAR), 16 GB RAM, 4 cores / 8 threads, Series S profile, DLSS Quality, FSR 3 frame generation 2X.

Where: the store robbery flashback that opens on the white fade right after the office cutscene (the "Hold LT to aim" tutorial). Before that, in the prison dormitory and common room, the picture is identical with the switch on, and the card is about 8 points less busy (86 % to 78 % by the layer's clock).

What it looks like here: not a full latch at first. While the tutorial waits, the 3D picture pulses between a washed-out view of the store and white; while aiming (LT held) it is entirely white. HUD, crosshair and subtitles are correct, about 7,000 draws a frame, no warning in the log.

Runs, same route each time (dormitory, common room, office cutscene skipped, store, LT held 20 s, screenshots at 7 s and 20 s):

NARROW_BARRIERS=1, 43 programs in VICTORY_LEAVE_OUT: white (2 runs)
NARROW_BARRIERS=1, the 2 default programs: white (1 run)
NARROW_BARRIERS unset, the 2 default programs: correct (1 run)
NARROW_BARRIERS unset, 43 programs: correct (1 run)

(Release and diagnostics builds on both sides; the last run also had an unrelated local memory patch on.)

So it follows this switch alone, with no other open PR involved, and it does not depend on the leave-out list. That fits the audit above (a fade or exposure pass reading before a dropped barrier): the scene opens on a white fade. A diagnostics build showed nothing unusual in the drop reasons there (the extra 2,700 dropped draws a frame are stages of the ray-tracing structure builder, which is off).

The route to that scene takes about ten minutes from a cold start and I have it scripted, so I can test a build with the switch split into sub-modes (place / groups / sync) or with the minimal fix if someone pushes one.

<!-- greyfinch-sync:trustno1-coder/VIctory-NVIDIA:comment:7241900271 --> Imported from [trustno1-coder/VIctory-NVIDIA](https://github.com/trustno1-coder/VIctory-NVIDIA/pull/799#issuecomment-7241900271). Originally posted by [claudeFrancoisAI](https://github.com/claudeFrancoisAI) on 2026-11-28T16:00:21Z. --- A second, independent reproduction of the white screen grosterr reported above, on a tree with fewer moving parts: main 63b902f plus this PR's barrier changes only (none of 501, 740, 807, 857, 875). Machine: RTX 2000 Ada 16 GB (driver 565.90, no Resizable BAR), 16 GB RAM, 4 cores / 8 threads, Series S profile, DLSS Quality, FSR 3 frame generation 2X. Where: the store robbery flashback that opens on the white fade right after the office cutscene (the "Hold LT to aim" tutorial). Before that, in the prison dormitory and common room, the picture is identical with the switch on, and the card is about 8 points less busy (86 % to 78 % by the layer's clock). What it looks like here: not a full latch at first. While the tutorial waits, the 3D picture pulses between a washed-out view of the store and white; while aiming (LT held) it is entirely white. HUD, crosshair and subtitles are correct, about 7,000 draws a frame, no warning in the log. Runs, same route each time (dormitory, common room, office cutscene skipped, store, LT held 20 s, screenshots at 7 s and 20 s): NARROW_BARRIERS=1, 43 programs in VICTORY_LEAVE_OUT: white (2 runs) NARROW_BARRIERS=1, the 2 default programs: white (1 run) NARROW_BARRIERS unset, the 2 default programs: correct (1 run) NARROW_BARRIERS unset, 43 programs: correct (1 run) (Release and diagnostics builds on both sides; the last run also had an unrelated local memory patch on.) So it follows this switch alone, with no other open PR involved, and it does not depend on the leave-out list. That fits the audit above (a fade or exposure pass reading before a dropped barrier): the scene opens on a white fade. A diagnostics build showed nothing unusual in the drop reasons there (the extra 2,700 dropped draws a frame are stages of the ray-tracing structure builder, which is off). The route to that scene takes about ten minutes from a cold start and I have it scripted, so I can test a build with the switch split into sub-modes (place / groups / sync) or with the minimal fix if someone pushes one.
shiman1901 commented 2026-11-28 16:37:46 +00:00 (Migrated from github.com)

Imported from trustno1-coder/VIctory-NVIDIA. Originally posted by shiman1901 on 2026-11-28T16:37:46Z.


@claudeFrancoisAI Thanks for the clean isolated repro on stock 63b902f — ruling out all the other PRs and the leave-out list nails it down 100% to #799!

That extra observation is a huge clue too: pulsing between washed-out and white at idle, then going solid white while holding LT (aiming) — aiming triggers Rockstar's DoF / post-process / exposure adaptation pass chain, which screams missing barrier between an RT/compute post-process write and the subsequent sample/tone-map read.

Seeing GPU busy drop 8 points (86% -> 78%) cleanly before the fade shows how much real win is sitting in this PR once that barrier hole is plugged. @Czer0xx if you push either the place / groups / sync sub-modes or the minimal fix (keeping NO_ACCESS execution barriers, 0x4 | 0x8 CB/DB flushes, and WRITE texture fallback), having @claudeFrancoisAI's scripted repro route means it can be verified in one pass!

<!-- greyfinch-sync:trustno1-coder/VIctory-NVIDIA:comment:7242389236 --> Imported from [trustno1-coder/VIctory-NVIDIA](https://github.com/trustno1-coder/VIctory-NVIDIA/pull/799#issuecomment-7242389236). Originally posted by [shiman1901](https://github.com/shiman1901) on 2026-11-28T16:37:46Z. --- @claudeFrancoisAI Thanks for the clean isolated repro on stock `63b902f` — ruling out all the other PRs and the leave-out list nails it down 100% to `#799`! That extra observation is a huge clue too: **pulsing between washed-out and white at idle, then going solid white while holding `LT` (aiming)** — aiming triggers Rockstar's DoF / post-process / exposure adaptation pass chain, which screams missing barrier between an RT/compute post-process write and the subsequent sample/tone-map read. Seeing GPU busy drop 8 points (`86% -> 78%`) cleanly before the fade shows how much real win is sitting in this PR once that barrier hole is plugged. @Czer0xx if you push either the `place / groups / sync` sub-modes or the minimal fix (keeping `NO_ACCESS` execution barriers, `0x4 | 0x8` CB/DB flushes, and `WRITE` texture fallback), having @claudeFrancoisAI's scripted repro route means it can be verified in one pass!
x-nihil0 commented 2026-11-28 16:38:09 +00:00 (Migrated from github.com)

Imported from trustno1-coder/VIctory-NVIDIA. Originally posted by x-nihil0 on 2026-11-28T16:38:09Z.


A third card with the white picture (RTX 5080, driver 621.40), and here it starts without a fade

Machine: Intel Core Ultra 9 285, 64 GB RAM, RTX 5080 16 GB, driver 621.40, Windows 11. Release build of main 63b902f with this PR's 517048c applied (the tree also had #419 at keep and #501 with its switches off). The release launcher's set: Series X profile, 1440p, DLSS Quality, frame generation not made ready. Unattended 300 s runs from a save in the open world, warm caches, window grabs every 30 s.

  • With VICTORY_NARROW_BARRIERS=1 the first two grabs (the start screen at 2 s, the logo at 32 s) looked the same as in the runs without it. From the grab at 62 s to the end of the run every grab was 97-100 % near-white: the loading screen's picture white with only its message box drawn, then the world white with only a few HUD marks in the minimap corner. That happened in both runs that set it, once alone and once together with other switches.
  • None of the other 22 runs on these builds, checked the same way, showed it.
  • Here it began on the loading screen, before the first frame of the world and with no cutscene before it, so on this path it doesn't need the white fade that @claudeFrancoisAI and @shiman1901 tie it to.

I left out the speed figures of the white runs, since a white picture can skip work. No game files, captures or saves are attached. Made with AI help; the figures come from the run logs.

<!-- greyfinch-sync:trustno1-coder/VIctory-NVIDIA:comment:7242394357 --> Imported from [trustno1-coder/VIctory-NVIDIA](https://github.com/trustno1-coder/VIctory-NVIDIA/pull/799#issuecomment-7242394357). Originally posted by [x-nihil0](https://github.com/x-nihil0) on 2026-11-28T16:38:09Z. --- **A third card with the white picture (RTX 5080, driver 621.40), and here it starts without a fade** Machine: Intel Core Ultra 9 285, 64 GB RAM, RTX 5080 16 GB, driver 621.40, Windows 11. Release build of `main` `63b902f` with this PR's `517048c` applied (the tree also had #419 at `keep` and #501 with its switches off). The release launcher's set: Series X profile, 1440p, DLSS Quality, frame generation not made ready. Unattended 300 s runs from a save in the open world, warm caches, window grabs every 30 s. - With `VICTORY_NARROW_BARRIERS=1` the first two grabs (the start screen at 2 s, the logo at 32 s) looked the same as in the runs without it. From the grab at 62 s to the end of the run every grab was 97-100 % near-white: the loading screen's picture white with only its message box drawn, then the world white with only a few HUD marks in the minimap corner. That happened in both runs that set it, once alone and once together with other switches. - None of the other 22 runs on these builds, checked the same way, showed it. - Here it began on the loading screen, before the first frame of the world and with no cutscene before it, so on this path it doesn't need the white fade that @claudeFrancoisAI and @shiman1901 tie it to. I left out the speed figures of the white runs, since a white picture can skip work. No game files, captures or saves are attached. Made with AI help; the figures come from the run logs.
shiman1901 commented 2026-11-28 16:44:57 +00:00 (Migrated from github.com)

Imported from trustno1-coder/VIctory-NVIDIA. Originally posted by shiman1901 on 2026-11-28T16:44:57Z.


@x-nihil0 Huge catch — reproducing it right on the loading screen at ~60 s (with the message box / UI plane still intact on top) rules out a 3D fade/DoF-only trigger and points even more directly at a fundamental scene-RT / composite barrier (like the dropped RENDER_TARGET -> SHADER_RESOURCE, NO_ACCESS execution barrier, 0x4 | 0x8 CB flush, or place.rs aliasing from the audit).

Even better: that cuts bisect time from 10 minutes down to ~60 seconds on a single open-world load once someone splits VICTORY_NARROW_BARRIERS into place / groups / sync!

<!-- greyfinch-sync:trustno1-coder/VIctory-NVIDIA:comment:7242481814 --> Imported from [trustno1-coder/VIctory-NVIDIA](https://github.com/trustno1-coder/VIctory-NVIDIA/pull/799#issuecomment-7242481814). Originally posted by [shiman1901](https://github.com/shiman1901) on 2026-11-28T16:44:57Z. --- @x-nihil0 Huge catch — reproducing it right on the loading screen at ~60 s (with the message box / UI plane still intact on top) rules out a 3D fade/DoF-only trigger and points even more directly at a fundamental scene-RT / composite barrier (like the dropped `RENDER_TARGET -> SHADER_RESOURCE`, `NO_ACCESS` execution barrier, `0x4 | 0x8` CB flush, or `place.rs` aliasing from the audit). Even better: that cuts bisect time from 10 minutes down to ~60 seconds on a single open-world load once someone splits `VICTORY_NARROW_BARRIERS` into `place / groups / sync`!
claudeFrancoisAI commented 2026-11-28 16:45:08 +00:00 (Migrated from github.com)

Imported from trustno1-coder/VIctory-NVIDIA. Originally posted by claudeFrancoisAI on 2026-11-28T16:45:08Z.


A correction to my report above, since it is being relied on: my tree is not stock 63b902f. I mislabelled it.

It is main at df2daafe (27 Nov) plus eleven community commits (launcher and memory defaults for 16 GB PCs, sweeps, preload jobs, an indirect budget change, a shader translator change), with 517048c applied on top as a patch. 63b902f itself is not in it.

What matters for this PR still holds: none of 501, 740, 807, 857, 875 is in that tree, and the white follows VICTORY_NARROW_BARRIERS alone on the same sources (3 runs with it, 2 without). Together with x-nihil0's runs on 63b902f plus 517048c, that makes the result independent of the base, and their start on a loading screen with no fade is a better clue than mine.

The offer stands: I can run a split or fixed version of this change over the scripted route, applied to this same tree.

<!-- greyfinch-sync:trustno1-coder/VIctory-NVIDIA:comment:7242484186 --> Imported from [trustno1-coder/VIctory-NVIDIA](https://github.com/trustno1-coder/VIctory-NVIDIA/pull/799#issuecomment-7242484186). Originally posted by [claudeFrancoisAI](https://github.com/claudeFrancoisAI) on 2026-11-28T16:45:08Z. --- A correction to my report above, since it is being relied on: my tree is not stock 63b902f. I mislabelled it. It is main at df2daafe (27 Nov) plus eleven community commits (launcher and memory defaults for 16 GB PCs, sweeps, preload jobs, an indirect budget change, a shader translator change), with 517048c applied on top as a patch. 63b902f itself is not in it. What matters for this PR still holds: none of 501, 740, 807, 857, 875 is in that tree, and the white follows VICTORY_NARROW_BARRIERS alone on the same sources (3 runs with it, 2 without). Together with x-nihil0's runs on 63b902f plus 517048c, that makes the result independent of the base, and their start on a loading screen with no fade is a better clue than mine. The offer stands: I can run a split or fixed version of this change over the scripted route, applied to this same tree.
nick0451 commented 2026-11-28 17:24:06 +00:00 (Migrated from github.com)

Imported from trustno1-coder/VIctory-NVIDIA. Originally posted by nick0451 on 2026-11-28T17:24:06Z.


Reproduced the white picture here, without a fade: VICTORY_NARROW_BARRIERS=1, ordinary play standing still on a balcony, no cutscene and no fade before it.

RTX 3090 24 GB (driver 610.88), i9-14900K, 32 GB, Windows 11. A release build of this PR merged onto main at 63b902f. Series S, DLSS Performance, frame generation off. Every run used the same frozen save, outdoors on a balcony by the water (about 5,900 draws a frame), standing still. One warm-up start per build, then main and four PR builds were run in turn, three rounds each. Each run is 40 s to settle, 60 s measured, then a screenshot. An A/A run of main against itself in this setup differs by 2-3%.

  • Picture: white in 4 of 4 runs (the warm-up and three measured runs). In each end-of-run screenshot 98.8% of the frame is pure white (mean luma 252 of 255), with only the HUD drawn (the money counter). Main and three other PR builds in the same rotation are normal (0.1% white).
  • Barrier counts from the log (per frame): groups 4-6 skipped, 1 narrowed, 1 global; place 0 narrowed; legacy buffer and sync 0. So the white comes with the group path (list.rs / list/thin.rs), not placed copies or legacy buffer barriers, at least in this scene.
  • Speed: 24.4 fps median against 24.6 for main (runs 20.7, 24.4, 24.9). Not meaningful while the picture is wrong.
  • No crash, device loss or ERROR line.

This fits shiman1901's first hole (execution barriers with ACCESS_NO_ACCESS dropped as no-ops): here it does not need the fade, only one of the skipped groups landing before an exposure or tone-map read. I'm happy to rerun a fixed commit here, since it reproduces in every run.

Tested with an AI assistant (Claude Code); results are from this PC.

<!-- greyfinch-sync:trustno1-coder/VIctory-NVIDIA:comment:7242987643 --> Imported from [trustno1-coder/VIctory-NVIDIA](https://github.com/trustno1-coder/VIctory-NVIDIA/pull/799#issuecomment-7242987643). Originally posted by [nick0451](https://github.com/nick0451) on 2026-11-28T17:24:06Z. --- **Reproduced the white picture here, without a fade:** `VICTORY_NARROW_BARRIERS=1`, ordinary play standing still on a balcony, no cutscene and no fade before it. RTX 3090 24 GB (driver 610.88), i9-14900K, 32 GB, Windows 11. A release build of this PR merged onto main at `63b902f`. Series S, DLSS Performance, frame generation off. Every run used the same frozen save, outdoors on a balcony by the water (about 5,900 draws a frame), standing still. One warm-up start per build, then main and four PR builds were run in turn, three rounds each. Each run is 40 s to settle, 60 s measured, then a screenshot. An A/A run of main against itself in this setup differs by 2-3%. - **Picture:** white in **4 of 4 runs** (the warm-up and three measured runs). In each end-of-run screenshot 98.8% of the frame is pure white (mean luma 252 of 255), with only the HUD drawn (the money counter). Main and three other PR builds in the same rotation are normal (0.1% white). - **Barrier counts from the log (per frame):** groups 4-6 skipped, 1 narrowed, 1 global; place 0 narrowed; legacy buffer and sync 0. So the white comes with the group path (`list.rs` / `list/thin.rs`), not placed copies or legacy buffer barriers, at least in this scene. - **Speed:** 24.4 fps median against 24.6 for main (runs 20.7, 24.4, 24.9). Not meaningful while the picture is wrong. - No crash, device loss or `ERROR` line. This fits shiman1901's first hole (execution barriers with `ACCESS_NO_ACCESS` dropped as no-ops): here it does not need the fade, only one of the skipped groups landing before an exposure or tone-map read. I'm happy to rerun a fixed commit here, since it reproduces in every run. Tested with an AI assistant (Claude Code); results are from this PC.
shiman1901 commented 2026-11-28 17:33:27 +00:00 (Migrated from github.com)

Imported from trustno1-coder/VIctory-NVIDIA. Originally posted by shiman1901 on 2026-11-28T17:33:27Z.


@nick0451 Quick follow-up on the 8,630 MB write-combined / 1,545 MB resident mystery from your dump — turns out my initial impression ("7 GB of cold shared upload overhead") was mostly a WDDM / NVIDIA driver quirk, and we nailed it down empirically!

We ran an isolated D3D12 VirtualQuery + QueryWorkingSetEx probe (mirroring copystat.rs) across 21 test cases on an RTX 3060 (driver 621.35):

  1. 65 × 64.00 MB (4,158 MB) is mostly VRAM (pool::TEXTURES), NOT host staging buffers:

    • On NVIDIA driver 621.35, CreateHeap(D3D12_HEAP_TYPE_DEFAULT, 64 MiB) with pool.rs:826-835's exact flags (ALLOW_ONLY_NON_RT_DS_TEXTURES | CREATE_NOT_RESIDENT) shows up in VirtualQuery as 64.00 MB PAGE_WRITECOMBINE, committed = 64.00 MB, resident = 0.00 MB.
    • That matches your log almost to the block: 58 × 64 MB (pool::TEXTURES = 3,712 MB VRAM) + 5 × 64 MB (pool::STAGING = 320 MB) + 2 allocated between the two unsynchronized log prints = 65 × 64.00 MB!
    • Also ruled out ID3D12CommandAllocator (32 allocators × 50,000 commands = 0 bytes of PAGE_WRITECOMBINE) and shared_buffer (CUSTOM / WRITE_BACK / L0 = 0 bytes WC).
  2. 94 × 32.00 MB (2,664 MB, avg 28.34 MB) is NVIDIA's 32 MiB small-resource arena fragmentation:

    • Resources ≥ 4 MiB get dedicated bases of their exact size (no rounding to 32/64 MiB), whereas small ≤ ~2 MiB UPLOAD resources are sub-allocated by the driver into 32.00 MiB WC arenas.
    • Reproducing churn (1,500 × 1 MiB UPLOAD -> 48 × 32.00 MB arenas at 31.64 MB avg commit -> freeing every 2nd buffer) kept the exact same 48 × 32.00 MB arenas while the driver MEM_DECOMMITted the holes down to 26.30 MB avg commit (whole = 32.00 MB, committed < 32 MB, regions > 1).
  3. Why 8,630 MB committed vs 1,545 MB in memory makes total sense:

    • ~3.7+ GB is pure DEFAULT VRAM (resident = 0 by definition), and cold UPLOAD pages are trimmed out of the working set by Windows while keeping their commit charge (verified with EmptyWorkingSet: 2.68 GB committed -> 1.5 MB resident, commit unchanged).

Practical takeaway

  • So there is no 7 GB host-RAM leak hiding in that write-combined line — actual host RAM there is ~1.5 GB (and touching pool::TEXTURES wouldn't save RAM).
  • Tiny diagnostic win for copystat.rs:727-740: because NVIDIA exposes DEFAULT VRAM heaps as PAGE_WRITECOMBINE (resident = 0), the label "write-combined (buffers shared with the card)" mixes pure VRAM with host upload buffers. Printing per-group present (in memory) next to committed would instantly make 65 of 64.00 MB (320 MB in memory) self-explanatory in future memory-map dumps.
  • For real host RAM / commit savings on 16–32 GB rigs (a realistic ~0.5–1 GB), the actual knobs are capping idle texture staging (texture.rs:538) + trimming STAGING_KEPT (pool.rs:37, 8 -> 2), host/send.rs:123 (768 -> 256 MB), and scratch SPARE_KEPT (host.rs:2244, 1 GB -> 256 MB) — easy to cross-check against the staging of textures: N alive X MB line in a memory-map log.
<!-- greyfinch-sync:trustno1-coder/VIctory-NVIDIA:comment:7243108250 --> Imported from [trustno1-coder/VIctory-NVIDIA](https://github.com/trustno1-coder/VIctory-NVIDIA/pull/799#issuecomment-7243108250). Originally posted by [shiman1901](https://github.com/shiman1901) on 2026-11-28T17:33:27Z. --- @nick0451 Quick follow-up on the **8,630 MB `write-combined` / 1,545 MB resident** mystery from your dump — turns out my initial impression ("7 GB of cold shared upload overhead") was mostly a **WDDM / NVIDIA driver quirk**, and we nailed it down empirically! We ran an isolated D3D12 `VirtualQuery` + `QueryWorkingSetEx` probe (mirroring `copystat.rs`) across 21 test cases on an RTX 3060 (driver `621.35`): 1. **`65 × 64.00 MB (4,158 MB)` is mostly VRAM (`pool::TEXTURES`), NOT host staging buffers:** - On NVIDIA driver `621.35`, `CreateHeap(D3D12_HEAP_TYPE_DEFAULT, 64 MiB)` with `pool.rs:826-835`'s exact flags (`ALLOW_ONLY_NON_RT_DS_TEXTURES | CREATE_NOT_RESIDENT`) shows up in `VirtualQuery` as **`64.00 MB PAGE_WRITECOMBINE`, `committed = 64.00 MB`, `resident = 0.00 MB`**. - That matches your log almost to the block: **`58 × 64 MB`** (`pool::TEXTURES` = `3,712 MB` VRAM) + **`5 × 64 MB`** (`pool::STAGING` = `320 MB`) + **`2`** allocated between the two unsynchronized log prints = **`65 × 64.00 MB`**! - Also ruled out `ID3D12CommandAllocator` (32 allocators × 50,000 commands = **0 bytes** of `PAGE_WRITECOMBINE`) and `shared_buffer` (`CUSTOM / WRITE_BACK / L0` = **0 bytes** WC). 2. **`94 × 32.00 MB (2,664 MB, avg 28.34 MB)` is NVIDIA's 32 MiB small-resource arena fragmentation:** - Resources ≥ 4 MiB get dedicated bases of their exact size (no rounding to 32/64 MiB), whereas small `≤ ~2 MiB` `UPLOAD` resources are sub-allocated by the driver into 32.00 MiB WC arenas. - Reproducing churn (`1,500 × 1 MiB` `UPLOAD` -> `48 × 32.00 MB` arenas at `31.64 MB` avg commit -> freeing every 2nd buffer) kept the exact same `48 × 32.00 MB` arenas while the driver `MEM_DECOMMIT`ted the holes down to `26.30 MB` avg commit (`whole = 32.00 MB`, `committed < 32 MB`, `regions > 1`). 3. **Why `8,630 MB committed` vs `1,545 MB in memory` makes total sense:** - ~3.7+ GB is pure `DEFAULT` VRAM (`resident = 0` by definition), and cold `UPLOAD` pages are trimmed out of the working set by Windows while keeping their commit charge (verified with `EmptyWorkingSet`: `2.68 GB` committed -> `1.5 MB` resident, commit unchanged). ### Practical takeaway - So there is **no 7 GB host-RAM leak** hiding in that `write-combined` line — actual host RAM there is ~1.5 GB (and touching `pool::TEXTURES` wouldn't save RAM). - **Tiny diagnostic win for `copystat.rs:727-740`:** because NVIDIA exposes `DEFAULT` VRAM heaps as `PAGE_WRITECOMBINE` (`resident = 0`), the label `"write-combined (buffers shared with the card)"` mixes pure VRAM with host upload buffers. Printing per-group `present` (`in memory`) next to `committed` would instantly make `65 of 64.00 MB (320 MB in memory)` self-explanatory in future memory-map dumps. - For real host RAM / commit savings on 16–32 GB rigs (a realistic ~0.5–1 GB), the actual knobs are capping idle texture staging (`texture.rs:538`) + trimming `STAGING_KEPT` (`pool.rs:37`, `8 -> 2`), `host/send.rs:123` (`768 -> 256 MB`), and scratch `SPARE_KEPT` (`host.rs:2244`, `1 GB -> 256 MB`) — easy to cross-check against the `staging of textures: N alive X MB` line in a memory-map log.
Czer0xx commented 2026-11-28 17:38:07 +00:00 (Migrated from github.com)

Imported from trustno1-coder/VIctory-NVIDIA. Originally posted by Czer0xx on 2026-11-28T17:38:07Z.


Thanks @grosterr, @claudeFrancoisAI, and @x-nihil0 for the detailed repros, and @shiman1901 for the audit!

I rebased pr/narrow-barriers onto main (9ce3cf9) and pushed 2ccdf84 with fixes for the barrier ordering holes found in the audit (plus a few additional hazards spotted while reviewing the paths) and sub-mode support for VICTORY_NARROW_BARRIERS:

Fixes in 2ccdf84

  1. Preserve ACCESS_NO_ACCESS and WAR (read -> write) barriers (list.rs): global_barrier_needs_host, buffer_barrier_needs_host, and classify_texture_barrier now keep NO_ACCESS execution/flush barriers (whenever both sync scopes are non-zero) and check both access_before and access_after so SHADER_RESOURCE -> UNORDERED_ACCESS / RENDER_TARGET / COPY_DEST WAR transitions are no longer dropped. Only SYNC_NONE and pure read -> read transitions are skipped.
  2. Stop dropping non-UAV texture write barriers (list.rs): texture barriers involving RENDER_TARGET, DEPTH_STENCIL_WRITE, COPY_DEST, RESOLVE_DEST, COMMON, NO_ACCESS, or UAV <-> SRV (and aliased textures) now emit a deduplicated stage-scoped D3D12_GLOBAL_BARRIER (safe_sync(sync_before) -> safe_sync(sync_after)) instead of being skipped or downgraded to a legacy UAV-only barrier. Pure non-aliased UAV -> UAV texture barriers still narrow to a targeted texture UAV barrier.
  3. Preserve CB/DB flushes in sync_flags_need_uav (list.rs): color/depth block and metadata flush bits (0x3F, including 0x4 | 0x8) are now kept.
  4. Always run state.synced() on skipped barrier_groups (list.rs, list/thin.rs): PackedGroups::Skip still invokes state.synced() (via a zero-item marker in thin.rs) so open indirect-clamp batches are still closed after shader writes.
  5. Cover all overlapping buffer shadows and source-buffer WAR in placed copies (shadow.rs, list.rs, host/place.rs):
    • Added shadow::peek_overlapping so legacy and enhanced buffer barriers cover every overlapping buffer shadow and loose window (and legacy buffer barriers use D3D12_BUFFER_BARRIER(SYNC_ALL, SYNC_ALL, COMMON, COMMON) when Enhanced Barriers are available).
    • Added the missing from.buffer (SYNC_COPY -> SYNC_ALL, COPY_SOURCE -> COMMON) post-barrier in place_copy and place_source to prevent subsequent writes from racing the copy read.

Sub-modes for bisecting

VICTORY_NARROW_BARRIERS still accepts 1 (or all) for full narrowing, and now also accepts comma-separated sub-modes: place, groups, legacy, sync (for example VICTORY_NARROW_BARRIERS=place, VICTORY_NARROW_BARRIERS=groups, VICTORY_NARROW_BARRIERS=place,sync). The per-frame telemetry line now logs the active mask.

@claudeFrancoisAI @x-nihil0 @grosterr If you have a moment to re-test 2ccdf84 with VICTORY_NARROW_BARRIERS=1 first (and with place / groups / legacy / sync individually only if any white-screen or corruption still shows up), that would be a huge help.

<!-- greyfinch-sync:trustno1-coder/VIctory-NVIDIA:comment:7243167836 --> Imported from [trustno1-coder/VIctory-NVIDIA](https://github.com/trustno1-coder/VIctory-NVIDIA/pull/799#issuecomment-7243167836). Originally posted by [Czer0xx](https://github.com/Czer0xx) on 2026-11-28T17:38:07Z. --- Thanks @grosterr, @claudeFrancoisAI, and @x-nihil0 for the detailed repros, and @shiman1901 for the audit! I rebased `pr/narrow-barriers` onto `main` (`9ce3cf9`) and pushed `2ccdf84` with fixes for the barrier ordering holes found in the audit (plus a few additional hazards spotted while reviewing the paths) and sub-mode support for `VICTORY_NARROW_BARRIERS`: ### Fixes in `2ccdf84` 1. **Preserve `ACCESS_NO_ACCESS` and WAR (read -> write) barriers (`list.rs`)**: `global_barrier_needs_host`, `buffer_barrier_needs_host`, and `classify_texture_barrier` now keep `NO_ACCESS` execution/flush barriers (whenever both sync scopes are non-zero) and check both `access_before` and `access_after` so `SHADER_RESOURCE -> UNORDERED_ACCESS / RENDER_TARGET / COPY_DEST` WAR transitions are no longer dropped. Only `SYNC_NONE` and pure read -> read transitions are skipped. 2. **Stop dropping non-UAV texture write barriers (`list.rs`)**: texture barriers involving `RENDER_TARGET`, `DEPTH_STENCIL_WRITE`, `COPY_DEST`, `RESOLVE_DEST`, `COMMON`, `NO_ACCESS`, or `UAV <-> SRV` (and aliased textures) now emit a deduplicated stage-scoped `D3D12_GLOBAL_BARRIER` (`safe_sync(sync_before) -> safe_sync(sync_after)`) instead of being skipped or downgraded to a legacy UAV-only barrier. Pure non-aliased `UAV -> UAV` texture barriers still narrow to a targeted texture UAV barrier. 3. **Preserve CB/DB flushes in `sync_flags_need_uav` (`list.rs`)**: color/depth block and metadata flush bits (`0x3F`, including `0x4 | 0x8`) are now kept. 4. **Always run `state.synced()` on skipped `barrier_groups` (`list.rs`, `list/thin.rs`)**: `PackedGroups::Skip` still invokes `state.synced()` (via a zero-item marker in `thin.rs`) so open indirect-clamp batches are still closed after shader writes. 5. **Cover all overlapping buffer shadows and source-buffer WAR in placed copies (`shadow.rs`, `list.rs`, `host/place.rs`)**: - Added `shadow::peek_overlapping` so legacy and enhanced buffer barriers cover every overlapping buffer shadow and loose window (and legacy buffer barriers use `D3D12_BUFFER_BARRIER(SYNC_ALL, SYNC_ALL, COMMON, COMMON)` when Enhanced Barriers are available). - Added the missing `from.buffer` (`SYNC_COPY -> SYNC_ALL`, `COPY_SOURCE -> COMMON`) post-barrier in `place_copy` and `place_source` to prevent subsequent writes from racing the copy read. ### Sub-modes for bisecting `VICTORY_NARROW_BARRIERS` still accepts `1` (or `all`) for full narrowing, and now also accepts comma-separated sub-modes: `place`, `groups`, `legacy`, `sync` (for example `VICTORY_NARROW_BARRIERS=place`, `VICTORY_NARROW_BARRIERS=groups`, `VICTORY_NARROW_BARRIERS=place,sync`). The per-frame telemetry line now logs the active `mask`. @claudeFrancoisAI @x-nihil0 @grosterr If you have a moment to re-test `2ccdf84` with `VICTORY_NARROW_BARRIERS=1` first (and with `place` / `groups` / `legacy` / `sync` individually only if any white-screen or corruption still shows up), that would be a huge help.
shiman1901 commented 2026-11-28 17:53:43 +00:00 (Migrated from github.com)

Imported from trustno1-coder/VIctory-NVIDIA. Originally posted by shiman1901 on 2026-11-28T17:53:43Z.


@Czer0xx Super clean turnaround on 2ccdf84 — great catches on state.synced() for skipped groups, shadow::peek_overlapping, and the from.buffer post-barrier too!

Tagging @nick0451 as well since your posts crossed by a couple minutes — with place=0 / sync=0 on the balcony save reproducing 4/4 in 40 s, re-testing 2ccdf84 there (plus @claudeFrancoisAI / @x-nihil0 / @grosterr) should tell us right away if the white screen is completely gone and how much of the FPS win holds!

<!-- greyfinch-sync:trustno1-coder/VIctory-NVIDIA:comment:7243370627 --> Imported from [trustno1-coder/VIctory-NVIDIA](https://github.com/trustno1-coder/VIctory-NVIDIA/pull/799#issuecomment-7243370627). Originally posted by [shiman1901](https://github.com/shiman1901) on 2026-11-28T17:53:43Z. --- @Czer0xx Super clean turnaround on `2ccdf84` — great catches on `state.synced()` for skipped groups, `shadow::peek_overlapping`, and the `from.buffer` post-barrier too! Tagging @nick0451 as well since your posts crossed by a couple minutes — with `place=0` / `sync=0` on the balcony save reproducing 4/4 in 40 s, re-testing `2ccdf84` there (plus @claudeFrancoisAI / @x-nihil0 / @grosterr) should tell us right away if the white screen is completely gone and how much of the FPS win holds!
claudeFrancoisAI commented 2026-11-28 17:55:17 +00:00 (Migrated from github.com)

Imported from trustno1-coder/VIctory-NVIDIA. Originally posted by claudeFrancoisAI on 2026-11-28T17:55:17Z.


Will do. Good timing: I have just set up a second build on main 9ce3cf9 next to the older tree, so 2ccdf84 can go on it as it is this time, no port.

One change on my side: the save has moved past the store flashback, and the run now starts on the boat at the beginning of the next mission. So the plan is, on the same view each time: first 517048c with VICTORY_NARROW_BARRIERS=1 on the old tree, to confirm that this scene turns white here too (grosterr saw the white start at the fade into it); then 2ccdf84 with =1; then place / groups / legacy / sync one by one only if anything is still wrong. I will post screenshots judged by near-white share, the barrier counts from the log line, and the card's clock with and without the switch.

The shader cache for the new base is being preloaded now, so results later today.

<!-- greyfinch-sync:trustno1-coder/VIctory-NVIDIA:comment:7243390074 --> Imported from [trustno1-coder/VIctory-NVIDIA](https://github.com/trustno1-coder/VIctory-NVIDIA/pull/799#issuecomment-7243390074). Originally posted by [claudeFrancoisAI](https://github.com/claudeFrancoisAI) on 2026-11-28T17:55:17Z. --- Will do. Good timing: I have just set up a second build on main 9ce3cf9 next to the older tree, so 2ccdf84 can go on it as it is this time, no port. One change on my side: the save has moved past the store flashback, and the run now starts on the boat at the beginning of the next mission. So the plan is, on the same view each time: first 517048c with VICTORY_NARROW_BARRIERS=1 on the old tree, to confirm that this scene turns white here too (grosterr saw the white start at the fade into it); then 2ccdf84 with =1; then place / groups / legacy / sync one by one only if anything is still wrong. I will post screenshots judged by near-white share, the barrier counts from the log line, and the card's clock with and without the switch. The shader cache for the new base is being preloaded now, so results later today.
nick0451 commented 2026-11-28 19:23:19 +00:00 (Migrated from github.com)

Imported from trustno1-coder/VIctory-NVIDIA. Originally posted by nick0451 on 2026-11-28T19:23:19Z.


Re-tested 2ccdf84 on the same balcony save where 517048c was white 4 of 4: the white picture is gone.

Setup: RTX 3090 24 GB (driver 610.88), i9-14900K, Windows 11, release builds. This PR at 2ccdf84 (on 9ce3cf9) against main at 9300875; the only difference between those two is a workflow file. Series S, DLSS Performance, frame generation off, the same frozen save standing still. One warm-up start per variant, then the variants in turn. Each run is 40 s to settle, 60 s measured, then a screenshot.

Picture: across two sessions, 21 measured screenshots with the switch on (=1, =groups, =place,legacy,sync) and none white. The near-white share is 0.0-1.2%, the same as main's (0.0-0.7%). In the clean session (below), main and =1 show the same steady view.

Barrier counts (log, per frame, =1, mask 0xf): place 109 narrowed; groups 23 skipped, 914 narrowed, 0 global; legacy and sync 0. With =groups alone: 24 skipped, 887 narrowed. So the group path now narrows about 900 groups a frame (one a frame on 517048c) without the white.

Speed, three rounds:

fps (runs) median frame preparing card busy
main 9300875 23.3, 22.5, 22.9 22.9 43.6 ms 23.7 ms 94%
=1 23.0, 23.4, 22.7 23.0 43.5 ms 25.5 ms 95%
=groups 22.7, 23.4 (one run in another scene, left out) 23.1 43.4 ms 25.9 ms 94%

No change in fps here: the card is about 95% busy in this scene, so narrower barriers cannot show. A first session suggested +8%, but in that one the game went to its idle camera, and the view differed from run to run. I don't count it; the table above holds the camera still.

No crash, device loss or ERROR line in any run.

Tested with an AI assistant (Claude Code); results are from this PC.

<!-- greyfinch-sync:trustno1-coder/VIctory-NVIDIA:comment:7244506527 --> Imported from [trustno1-coder/VIctory-NVIDIA](https://github.com/trustno1-coder/VIctory-NVIDIA/pull/799#issuecomment-7244506527). Originally posted by [nick0451](https://github.com/nick0451) on 2026-11-28T19:23:19Z. --- Re-tested `2ccdf84` on the same balcony save where `517048c` was white 4 of 4: **the white picture is gone.** **Setup:** RTX 3090 24 GB (driver 610.88), i9-14900K, Windows 11, release builds. This PR at `2ccdf84` (on `9ce3cf9`) against main at `9300875`; the only difference between those two is a workflow file. Series S, DLSS Performance, frame generation off, the same frozen save standing still. One warm-up start per variant, then the variants in turn. Each run is 40 s to settle, 60 s measured, then a screenshot. **Picture:** across two sessions, 21 measured screenshots with the switch on (`=1`, `=groups`, `=place,legacy,sync`) and none white. The near-white share is 0.0-1.2%, the same as main's (0.0-0.7%). In the clean session (below), main and `=1` show the same steady view. **Barrier counts (log, per frame, `=1`, mask `0xf`):** place 109 narrowed; groups 23 skipped, 914 narrowed, 0 global; legacy and sync 0. With `=groups` alone: 24 skipped, 887 narrowed. So the group path now narrows about 900 groups a frame (one a frame on `517048c`) without the white. **Speed, three rounds:** | | fps (runs) | median | frame | preparing | card busy | |---|---|---|---|---|---| | main `9300875` | 23.3, 22.5, 22.9 | 22.9 | 43.6 ms | 23.7 ms | 94% | | `=1` | 23.0, 23.4, 22.7 | 23.0 | 43.5 ms | 25.5 ms | 95% | | `=groups` | 22.7, 23.4 (one run in another scene, left out) | 23.1 | 43.4 ms | 25.9 ms | 94% | No change in fps here: the card is about 95% busy in this scene, so narrower barriers cannot show. A first session suggested +8%, but in that one the game went to its idle camera, and the view differed from run to run. I don't count it; the table above holds the camera still. No crash, device loss or `ERROR` line in any run. Tested with an AI assistant (Claude Code); results are from this PC.
POMXARK commented 2026-11-28 22:49:01 +00:00 (Migrated from github.com)

Imported from trustno1-coder/VIctory-NVIDIA. Originally posted by POMXARK on 2026-11-28T22:49:01Z.


@Czer0xx — ran a full 20-minute gameplay A/B of 5cd5faf (VICTORY_NARROW_BARRIERS=1, all 4 sub-modes mask=0xf) on Windows 11 (RTX 5080 16 GB, Ryzen 7 5700X 8C/16T, 32 GB RAM, Series X 1440p, DLSS Quality + MFG 4x, release build, matched save & switches):

Verification

  • Unit tests: narrow_barriers_submode_parsing + narrow_barrier_classification 2/2 PASS (0.00s).
  • Stability & Visuals: 0 errors over 20 minutes, refused=2, zero white-screen or barrier artifacts across all 16 captured screenshots.
  • Narrowing telemetry (steady gameplay):
    place 96–201 narrowed; groups ~20 skipped, 653–816 narrowed, 0.0 global; legacy_buf 0.0; sync 0.0 (100% of enhanced barrier groups handled with 0 global fallbacks!).

20-minute A/B (matched draw buckets)

Metric Baseline (NARROW_BARRIERS=0) PR #799 (VICTORY_NARROW_BARRIERS=1) Delta
1k–4k draws p50 16.05 FPS (62.3 ms) 16.40 FPS (60.8 ms) +2.2% (-1.5 ms)
4k–7k draws p50 14.80 FPS (67.4 ms) 11.90 FPS (83.9 ms) -19.6%
7k–10k draws p50 11.50 FPS (86.8 ms) 10.70 FPS (93.6 ms) -7.0%
ALL 3D p50 14.80 FPS (67.4 ms) 13.60 FPS (73.5 ms) -8.1%
Copy-back med 13.6 ms 10.9 ms -2.7 ms
Submitting thread med 59.3 ms (steps 28.3 ms) 70.9 ms (steps 36.5 ms) +11.6 ms (+8.2 ms steps)
Frame p95 / >100ms (5s bins) 117.3 ms / 31 135.1 ms / 42 +17.8 ms

Bottleneck Diagnosis (CPU-bound RTX 5080)

Because an RTX 5080 at 1440p DLSS Quality is CPU-bound (0.0–0.3 ms waiting on the GPU), replay_narrow_barrier_groups running 653–816 times per frame introduces measurable CPU overhead on the submitting/recording thread:

  1. Per-call list.list.cast::<ID3D12GraphicsCommandList7>() (QueryInterface + Release ~800x/frame) — caching Option<ID3D12GraphicsCommandList7> once on HostList eliminates this completely.
  2. Four heap Vec allocations per call (globals, buffers, seen_bufs, legacy_uavs) — small stack/reusable scratch buffers (SmallVec or thread-local/list-owned scratch Vecs cleared per call) would remove ~3,200 heap alloc/frees per frame.
  3. Per-buffer shadow::peek_overlapping + COM clone()/ManuallyDrop::drop inside the hot loop.

On GPU-bound cards (like 3060/3090/4070) the GPU barrier win easily outweighs the CPU work, whereas caching ID3D12GraphicsCommandList7 + reusing scratch Vecs would make VICTORY_NARROW_BARRIERS=1 a net win on CPU-bound 5080/4090 setups as well!

<!-- greyfinch-sync:trustno1-coder/VIctory-NVIDIA:comment:7247003274 --> Imported from [trustno1-coder/VIctory-NVIDIA](https://github.com/trustno1-coder/VIctory-NVIDIA/pull/799#issuecomment-7247003274). Originally posted by [POMXARK](https://github.com/POMXARK) on 2026-11-28T22:49:01Z. --- @Czer0xx — ran a full 20-minute gameplay A/B of `5cd5faf` (`VICTORY_NARROW_BARRIERS=1`, all 4 sub-modes `mask=0xf`) on Windows 11 (RTX 5080 16 GB, Ryzen 7 5700X 8C/16T, 32 GB RAM, Series X 1440p, DLSS Quality + MFG 4x, release build, matched save & switches): ### Verification - **Unit tests:** `narrow_barriers_submode_parsing` + `narrow_barrier_classification` **2/2 PASS** (`0.00s`). - **Stability & Visuals:** `0` errors over 20 minutes, `refused=2`, **zero white-screen or barrier artifacts** across all 16 captured screenshots. - **Narrowing telemetry (steady gameplay):** `place 96–201 narrowed; groups ~20 skipped, 653–816 narrowed, 0.0 global; legacy_buf 0.0; sync 0.0` (100% of enhanced barrier groups handled with 0 global fallbacks!). ### 20-minute A/B (matched draw buckets) | Metric | Baseline (`NARROW_BARRIERS=0`) | PR #799 (`VICTORY_NARROW_BARRIERS=1`) | Delta | |---|---:|---:|---:| | **1k–4k draws p50** | 16.05 FPS (`62.3 ms`) | **16.40 FPS** (`60.8 ms`) | **+2.2% (`-1.5 ms`)** | | **4k–7k draws p50** | **14.80 FPS** (`67.4 ms`) | 11.90 FPS (`83.9 ms`) | -19.6% | | **7k–10k draws p50** | **11.50 FPS** (`86.8 ms`) | 10.70 FPS (`93.6 ms`) | -7.0% | | **ALL 3D p50** | **14.80 FPS** (`67.4 ms`) | 13.60 FPS (`73.5 ms`) | -8.1% | | **Copy-back med** | 13.6 ms | **10.9 ms** | **-2.7 ms** | | Submitting thread med | **59.3 ms** (`steps 28.3 ms`) | 70.9 ms (`steps 36.5 ms`) | +11.6 ms (`+8.2 ms` steps) | | Frame p95 / `>100ms` (5s bins) | **117.3 ms / 31** | 135.1 ms / 42 | +17.8 ms | ### Bottleneck Diagnosis (CPU-bound RTX 5080) Because an RTX 5080 at 1440p DLSS Quality is **CPU-bound** (`0.0–0.3 ms` waiting on the GPU), `replay_narrow_barrier_groups` running **653–816 times per frame** introduces measurable CPU overhead on the submitting/recording thread: 1. Per-call `list.list.cast::<ID3D12GraphicsCommandList7>()` (`QueryInterface` + `Release` ~800x/frame) — caching `Option<ID3D12GraphicsCommandList7>` once on `HostList` eliminates this completely. 2. Four heap `Vec` allocations per call (`globals`, `buffers`, `seen_bufs`, `legacy_uavs`) — small stack/reusable scratch buffers (`SmallVec` or thread-local/list-owned scratch `Vec`s cleared per call) would remove ~3,200 heap alloc/frees per frame. 3. Per-buffer `shadow::peek_overlapping` + COM `clone()`/`ManuallyDrop::drop` inside the hot loop. On GPU-bound cards (like 3060/3090/4070) the GPU barrier win easily outweighs the CPU work, whereas caching `ID3D12GraphicsCommandList7` + reusing scratch `Vec`s would make `VICTORY_NARROW_BARRIERS=1` a net win on CPU-bound 5080/4090 setups as well!
claudeFrancoisAI commented 2026-11-29 00:02:02 +00:00 (Migrated from github.com)

Imported from trustno1-coder/VIctory-NVIDIA. Originally posted by claudeFrancoisAI on 2026-11-29T00:02:02Z.


Retest of 5cd5faff on the 16 GB machine, as promised. Short version: the picture is correct with the switch on, no speed change measurable here, and one thing to watch at load.

Setup: RTX 2000 Ada 16 GB (driver 565.90, no Resizable BAR), 4 cores / 8 threads, 16 GB RAM, Windows 11. Series S, DLSS Quality, FSR 3 frame generation 2X. Release builds of this PR at 5cd5faff and of main at 923e38cc (its base), same settings file. Same save, standing still on the boat at the start of the fishing mission; 40 s to settle, 100 s measured, then a screenshot.

What I could not do: the step I announced first, confirming that this view is white with 517048c. The store flashback where I saw it is no longer reachable from my save, and I did not rebuild 517048c tonight. So this is a new view with the fix, not a before/after of the white picture.

Picture: correct with =1, and the same as with =0 and as main. Near-white share of the screenshot: main 1.8%, =0 2.0%, =1 2.0%.

Barrier counts (=1, mask 0xf, per frame, on the boat): place 106.4 narrowed; groups 16.5 skipped, 852.2 narrowed, 0.0 global; legacy 0; sync 0. Close to the 3090's figures above.

Speed, one run each:

fps frame, median 95th percentile
main 923e38cc 14.3 66.1 ms 91.4 ms
this PR, =0 13.6 70.9 ms 94.8 ms
this PR, =1 14.0 68.6 ms 89.5 ms

Two runs of one build differ by about 0.5 fps on this PC, so I read this as no change. The CPU sets the frame here (4 cores), so that is expected.

One thing to watch: 3 of the 5 starts of this build ended while the save was loading, about 110 s after launch: the title's own crash, 0xc0000005 writing 0x0 at victory-image+0x23cf683, and its crash report names an unsignaled cross-queue barrier with the streaming state at Prestream. Two of those were with =1 and one with =0; the next =0 start and the next =1 start loaded and gave the figures above. The same evening, 0 of 5 starts of other builds did it (one of main 923e38cc, four of 9ce3cf9 with a local patch). I saw that same crash address once the day before on an older tree without this PR, so it is not this PR's alone, and 3 of 5 against 0 of 5 can still be chance. I cannot tie it to the change; I mention it in case someone else sees load crashes with this branch.

No device loss in the runs that loaded. Their only ERROR line is Streamline's, the one main logs too.

Tested with an AI assistant (Claude Code); results are from this PC.

<!-- greyfinch-sync:trustno1-coder/VIctory-NVIDIA:comment:7247826593 --> Imported from [trustno1-coder/VIctory-NVIDIA](https://github.com/trustno1-coder/VIctory-NVIDIA/pull/799#issuecomment-7247826593). Originally posted by [claudeFrancoisAI](https://github.com/claudeFrancoisAI) on 2026-11-29T00:02:02Z. --- Retest of 5cd5faff on the 16 GB machine, as promised. Short version: the picture is correct with the switch on, no speed change measurable here, and one thing to watch at load. **Setup:** RTX 2000 Ada 16 GB (driver 565.90, no Resizable BAR), 4 cores / 8 threads, 16 GB RAM, Windows 11. Series S, DLSS Quality, FSR 3 frame generation 2X. Release builds of this PR at 5cd5faff and of main at 923e38cc (its base), same settings file. Same save, standing still on the boat at the start of the fishing mission; 40 s to settle, 100 s measured, then a screenshot. **What I could not do:** the step I announced first, confirming that this view is white with 517048c. The store flashback where I saw it is no longer reachable from my save, and I did not rebuild 517048c tonight. So this is a new view with the fix, not a before/after of the white picture. **Picture:** correct with `=1`, and the same as with `=0` and as main. Near-white share of the screenshot: main 1.8%, `=0` 2.0%, `=1` 2.0%. **Barrier counts (`=1`, mask `0xf`, per frame, on the boat):** place 106.4 narrowed; groups 16.5 skipped, 852.2 narrowed, 0.0 global; legacy 0; sync 0. Close to the 3090's figures above. **Speed, one run each:** | | fps | frame, median | 95th percentile | |---|---|---|---| | main 923e38cc | 14.3 | 66.1 ms | 91.4 ms | | this PR, `=0` | 13.6 | 70.9 ms | 94.8 ms | | this PR, `=1` | 14.0 | 68.6 ms | 89.5 ms | Two runs of one build differ by about 0.5 fps on this PC, so I read this as no change. The CPU sets the frame here (4 cores), so that is expected. **One thing to watch:** 3 of the 5 starts of this build ended while the save was loading, about 110 s after launch: the title's own crash, 0xc0000005 writing 0x0 at `victory-image+0x23cf683`, and its crash report names an unsignaled cross-queue barrier with the streaming state at Prestream. Two of those were with `=1` and one with `=0`; the next `=0` start and the next `=1` start loaded and gave the figures above. The same evening, 0 of 5 starts of other builds did it (one of main 923e38cc, four of 9ce3cf9 with a local patch). I saw that same crash address once the day before on an older tree without this PR, so it is not this PR's alone, and 3 of 5 against 0 of 5 can still be chance. I cannot tie it to the change; I mention it in case someone else sees load crashes with this branch. No device loss in the runs that loaded. Their only `ERROR` line is Streamline's, the one main logs too. Tested with an AI assistant (Claude Code); results are from this PC.
Sign in to join this conversation.
No reviewers
No labels
No milestone
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Reference
trustno1-coder/VIctory-NVIDIA!799
No description provided.