GPU: narrow placed-copy, enhanced-group, buffer and pipeline-sync barriers (VICTORY_NARROW_BARRIERS) #799
Loading…
Reference in a new issue
No description provided.
Delete branch "upstream-pr/799"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Imported from 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 asNARROW GPU BARRIERS) that narrows unconditional global GPU barriers (D3D12_BARRIER_TYPE_GLOBAL(SYNC_ALL)andUAV_BARRIER(NULL)) to the buffers, textures, and sync scopes the title actually asks for:host/place.rs):place_copyandplace_sourceemitD3D12_BARRIER_TYPE_BUFFERscoped tofrom.buffer/to.buffer/betweeninstead of globalSYNC_ALLdrains (~78-144/frame narrowed), falling back towait_for_allwhen Enhanced Barriers are unavailable.Barrier()groups +thinrecording path (list.rs,list/thin.rs): classifies barrier groups while the title pointer is live on the calling thread instead of discardinggroupsinthinand emitting a globalUAV_BARRIER(NULL). Skips pure non-UAV texture transitions andSYNC_NONE/NO_ACCESSno-ops (~100-140/frame skipped), narrows buffer barriers toD3D12_BUFFER_BARRIER, texture UAV barriers to targetedUAV_BARRIER(host_tex), and global barriers toD3D12_GLOBAL_BARRIERwith sanitized sync bits (~590-700/frame narrowed; ~1/frame global fallback).ResourceBarrierand pipeline sync (list.rs): skipsBEGIN_ONLYand pure read-to-read legacy buffer transitions, narrows write-involving buffer barriers to targetedUAV_BARRIER(shadow.buffer), and skips globalUAV_BARRIER(NULL)on pipeline syncs whose flush flags contain no shader partial-flush, idle, or L1/L2 cache writeback/invalidate bits.host.rs,host/place.rs): logsnarrow barriers per frame (VICTORY_NARROW_BARRIERS=1)when enabled.With
VICTORY_NARROW_BARRIERSunset, behavior is unchanged.Verification
cargo clippy -p victory-gpu --all-targets --lockedand--all-features: 0 warnings in modified files.cargo test -p victory-gpu --lib --locked: passes, including new unit testlist::tests::narrow_barrier_classification.cargo xtask policy:asset policy: 294 files ok.VICTORY_NARROW_BARRIERS=1):110.1placed-copy barriers narrowed; enhanced barrier groups118.3skipped,634.5narrowed,1.0global fallback.68.4 / 72.1 ms->63.4 / 65.8 ms(-5.0 / -6.3 ms); 5 spreparingmedian59.9 ms->53.8 ms(-6.1 ms).65% / 68.0%->73% / 74.5%; GPU idle behind us median27.0 ms->20.1 ms(-6.9 ms).11.57->11.96(+3.4%), heavy scenes (>=5000draws) mean10.40->11.41(+9.7%), peak14.70->17.40(+18.4%), with no visual artifacts observed.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.
Imported from trustno1-coder/VIctory-NVIDIA. Originally posted by grosterr on 2026-11-28T12:19:57Z.
On our build
VICTORY_NARROW_BARRIERS=1turns most of the picture white.RTX 3060 12 GB (driver 621.40), Ryzen 7 5700X, 32 GB, Windows 11. Main
63b902fwith 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.5dc3b25986622949also left out)VICTORY_NARROW_BARRIERS=1aloneVICTORY_NARROW_BARRIERS=1+VICTORY_PLACED_FILLS=1The 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 BUSY48–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
Imported from trustno1-coder/VIctory-NVIDIA. Originally posted by shiman1901 on 2026-11-28T14:13:36Z.
@Czer0xx @grosterr Audited commit
517048cto track down whyVICTORY_NARROW_BARRIERS=1latches 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
517048cthat can let a tone-map / exposure pass read stale/unflushed data:1.
ACCESS_NO_ACCESSexecution barriers are silently dropped (list.rs,global_barrier_needs_host&buffer_barrier_needs_host)falsewhenaccess_before == NO_ACCESSoraccess_after == NO_ACCESS.SyncBefore/SyncAfterandACCESS_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_uavdropsRENDER_TARGET / DSV_WRITE -> SHADER_RESOURCE(list.rs)texture_barrier_needs_uavreturnsfalsewheneveraccess_before != 0and neither side hasUAV_ACCESS, sosync_before=0x40 (RENDER_TARGET) -> sync_after=0x10 (PIXEL_SHADING),access_before=0x8 (RENDER_TARGET) -> access_after=0x80 (SHADER_RESOURCE)resolves toPackedGroups::Skip(explicitly asserted innarrow_barrier_classification).CompactBarrierdoesn't storelayout_before/layout_after, andreplay_narrow_barrier_groups(kind == 1) emits a legacyBarrier { kind: 2 }(UAV barrier) ontwin_resource/host_resourcerather than a realD3D12_TEXTURE_BARRIER.3.
sync_flags_need_uavskips color/depth block flushes (0x4 | 0x8)4.
place.rs(place_copy/place_source) misses aliasing views / card sideswait_for_allwithD3D12_BUFFER_BARRIERon onlyfrom.buffer / to.buffer / betweendoesn't cover writes made through aHostTexture/ colour twin, placed view, or the VRAMCardside aliasing the same address range. (This also fits @grosterr's Run B where combining#799+#740 VICTORY_PLACED_FILLSadded magenta face corruption on top of the white screen.)Quickest way to bisect & fix
VICTORY_NARROW_BARRIERSinto 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.NO_ACCESSbarriers (access_before == NO_ACCESS || access_after == NO_ACCESS => truewhen syncs are non-zero).0x4 | 0x8CB/DB flushes insync_flags_need_uav.texture_barrier_needs_uav, treat any write access (RTV | DSV | UAV | COPY_DEST) as needing synchronization and fall back toPackedGroups::GlobaluntilCompactBarriercarries layouts for a realD3D12_TEXTURE_BARRIER.place.rs, fall back towait_for_all(or include the card/twin resource) whenfrom/tois 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!
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
63b902fplus 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.
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 theplace / groups / syncsub-modes or the minimal fix (keepingNO_ACCESSexecution barriers,0x4 | 0x8CB/DB flushes, andWRITEtexture fallback), having @claudeFrancoisAI's scripted repro route means it can be verified in one pass!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
main63b902fwith this PR's517048capplied (the tree also had #419 atkeepand #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.VICTORY_NARROW_BARRIERS=1the 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.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.
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_ACCESSexecution barrier,0x4 | 0x8CB flush, orplace.rsaliasing 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_BARRIERSintoplace / groups / sync!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), with517048capplied on top as a patch.63b902fitself 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
63b902fplus517048c, 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.
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%.list.rs/list/thin.rs), not placed copies or legacy buffer barriers, at least in this scene.ERRORline.This fits shiman1901's first hole (execution barriers with
ACCESS_NO_ACCESSdropped 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.
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+QueryWorkingSetExprobe (mirroringcopystat.rs) across 21 test cases on an RTX 3060 (driver621.35):65 × 64.00 MB (4,158 MB)is mostly VRAM (pool::TEXTURES), NOT host staging buffers:621.35,CreateHeap(D3D12_HEAP_TYPE_DEFAULT, 64 MiB)withpool.rs:826-835's exact flags (ALLOW_ONLY_NON_RT_DS_TEXTURES | CREATE_NOT_RESIDENT) shows up inVirtualQueryas64.00 MB PAGE_WRITECOMBINE,committed = 64.00 MB,resident = 0.00 MB.58 × 64 MB(pool::TEXTURES=3,712 MBVRAM) +5 × 64 MB(pool::STAGING=320 MB) +2allocated between the two unsynchronized log prints =65 × 64.00 MB!ID3D12CommandAllocator(32 allocators × 50,000 commands = 0 bytes ofPAGE_WRITECOMBINE) andshared_buffer(CUSTOM / WRITE_BACK / L0= 0 bytes WC).94 × 32.00 MB (2,664 MB, avg 28.34 MB)is NVIDIA's 32 MiB small-resource arena fragmentation:≤ ~2 MiBUPLOADresources are sub-allocated by the driver into 32.00 MiB WC arenas.1,500 × 1 MiBUPLOAD->48 × 32.00 MBarenas at31.64 MBavg commit -> freeing every 2nd buffer) kept the exact same48 × 32.00 MBarenas while the driverMEM_DECOMMITted the holes down to26.30 MBavg commit (whole = 32.00 MB,committed < 32 MB,regions > 1).Why
8,630 MB committedvs1,545 MB in memorymakes total sense:DEFAULTVRAM (resident = 0by definition), and coldUPLOADpages are trimmed out of the working set by Windows while keeping their commit charge (verified withEmptyWorkingSet:2.68 GBcommitted ->1.5 MBresident, commit unchanged).Practical takeaway
write-combinedline — actual host RAM there is ~1.5 GB (and touchingpool::TEXTURESwouldn't save RAM).copystat.rs:727-740: because NVIDIA exposesDEFAULTVRAM heaps asPAGE_WRITECOMBINE(resident = 0), the label"write-combined (buffers shared with the card)"mixes pure VRAM with host upload buffers. Printing per-grouppresent(in memory) next tocommittedwould instantly make65 of 64.00 MB (320 MB in memory)self-explanatory in future memory-map dumps.texture.rs:538) + trimmingSTAGING_KEPT(pool.rs:37,8 -> 2),host/send.rs:123(768 -> 256 MB), and scratchSPARE_KEPT(host.rs:2244,1 GB -> 256 MB) — easy to cross-check against thestaging of textures: N alive X MBline in a memory-map log.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-barriersontomain(9ce3cf9) and pushed2ccdf84with fixes for the barrier ordering holes found in the audit (plus a few additional hazards spotted while reviewing the paths) and sub-mode support forVICTORY_NARROW_BARRIERS:Fixes in
2ccdf84ACCESS_NO_ACCESSand WAR (read -> write) barriers (list.rs):global_barrier_needs_host,buffer_barrier_needs_host, andclassify_texture_barriernow keepNO_ACCESSexecution/flush barriers (whenever both sync scopes are non-zero) and check bothaccess_beforeandaccess_aftersoSHADER_RESOURCE -> UNORDERED_ACCESS / RENDER_TARGET / COPY_DESTWAR transitions are no longer dropped. OnlySYNC_NONEand pure read -> read transitions are skipped.list.rs): texture barriers involvingRENDER_TARGET,DEPTH_STENCIL_WRITE,COPY_DEST,RESOLVE_DEST,COMMON,NO_ACCESS, orUAV <-> SRV(and aliased textures) now emit a deduplicated stage-scopedD3D12_GLOBAL_BARRIER(safe_sync(sync_before) -> safe_sync(sync_after)) instead of being skipped or downgraded to a legacy UAV-only barrier. Pure non-aliasedUAV -> UAVtexture barriers still narrow to a targeted texture UAV barrier.sync_flags_need_uav(list.rs): color/depth block and metadata flush bits (0x3F, including0x4 | 0x8) are now kept.state.synced()on skippedbarrier_groups(list.rs,list/thin.rs):PackedGroups::Skipstill invokesstate.synced()(via a zero-item marker inthin.rs) so open indirect-clamp batches are still closed after shader writes.shadow.rs,list.rs,host/place.rs):shadow::peek_overlappingso legacy and enhanced buffer barriers cover every overlapping buffer shadow and loose window (and legacy buffer barriers useD3D12_BUFFER_BARRIER(SYNC_ALL, SYNC_ALL, COMMON, COMMON)when Enhanced Barriers are available).from.buffer(SYNC_COPY -> SYNC_ALL,COPY_SOURCE -> COMMON) post-barrier inplace_copyandplace_sourceto prevent subsequent writes from racing the copy read.Sub-modes for bisecting
VICTORY_NARROW_BARRIERSstill accepts1(orall) for full narrowing, and now also accepts comma-separated sub-modes:place,groups,legacy,sync(for exampleVICTORY_NARROW_BARRIERS=place,VICTORY_NARROW_BARRIERS=groups,VICTORY_NARROW_BARRIERS=place,sync). The per-frame telemetry line now logs the activemask.@claudeFrancoisAI @x-nihil0 @grosterr If you have a moment to re-test
2ccdf84withVICTORY_NARROW_BARRIERS=1first (and withplace/groups/legacy/syncindividually only if any white-screen or corruption still shows up), that would be a huge help.Imported from trustno1-coder/VIctory-NVIDIA. Originally posted by shiman1901 on 2026-11-28T17:53:43Z.
@Czer0xx Super clean turnaround on
2ccdf84— great catches onstate.synced()for skipped groups,shadow::peek_overlapping, and thefrom.bufferpost-barrier too!Tagging @nick0451 as well since your posts crossed by a couple minutes — with
place=0/sync=0on the balcony save reproducing 4/4 in 40 s, re-testing2ccdf84there (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!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
9ce3cf9next to the older tree, so2ccdf84can 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
517048cwith 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); then2ccdf84with =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.
Imported from trustno1-coder/VIctory-NVIDIA. Originally posted by nick0451 on 2026-11-28T19:23:19Z.
Re-tested
2ccdf84on the same balcony save where517048cwas 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(on9ce3cf9) against main at9300875; 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=1show the same steady view.Barrier counts (log, per frame,
=1, mask0xf): place 109 narrowed; groups 23 skipped, 914 narrowed, 0 global; legacy and sync 0. With=groupsalone: 24 skipped, 887 narrowed. So the group path now narrows about 900 groups a frame (one a frame on517048c) without the white.Speed, three rounds:
9300875=1=groupsNo 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
ERRORline in any run.Tested with an AI assistant (Claude Code); results are from this PC.
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-modesmask=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
narrow_barriers_submode_parsing+narrow_barrier_classification2/2 PASS (0.00s).0errors over 20 minutes,refused=2, zero white-screen or barrier artifacts across all 16 captured screenshots.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)
NARROW_BARRIERS=0)VICTORY_NARROW_BARRIERS=1)62.3 ms)60.8 ms)-1.5 ms)67.4 ms)83.9 ms)86.8 ms)93.6 ms)67.4 ms)73.5 ms)steps 28.3 ms)steps 36.5 ms)+8.2 mssteps)>100ms(5s bins)Bottleneck Diagnosis (CPU-bound RTX 5080)
Because an RTX 5080 at 1440p DLSS Quality is CPU-bound (
0.0–0.3 mswaiting on the GPU),replay_narrow_barrier_groupsrunning 653–816 times per frame introduces measurable CPU overhead on the submitting/recording thread:list.list.cast::<ID3D12GraphicsCommandList7>()(QueryInterface+Release~800x/frame) — cachingOption<ID3D12GraphicsCommandList7>once onHostListeliminates this completely.Vecallocations per call (globals,buffers,seen_bufs,legacy_uavs) — small stack/reusable scratch buffers (SmallVecor thread-local/list-owned scratchVecs cleared per call) would remove ~3,200 heap alloc/frees per frame.shadow::peek_overlapping+ COMclone()/ManuallyDrop::dropinside the hot loop.On GPU-bound cards (like 3060/3090/4070) the GPU barrier win easily outweighs the CPU work, whereas caching
ID3D12GraphicsCommandList7+ reusing scratchVecs would makeVICTORY_NARROW_BARRIERS=1a net win on CPU-bound 5080/4090 setups as well!Imported from trustno1-coder/VIctory-NVIDIA. Originally posted by claudeFrancoisAI on 2026-11-29T00:02:02Z.
Retest of
5cd5faffon 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
5cd5faffand of main at923e38cc(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 rebuild517048ctonight. 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=0and as main. Near-white share of the screenshot: main 1.8%,=02.0%,=12.0%.Barrier counts (
=1, mask0xf, 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:
923e38cc=0=1Two 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=1and one with=0; the next=0start and the next=1start loaded and gave the figures above. The same evening, 0 of 5 starts of other builds did it (one of main923e38cc, four of9ce3cf9with 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
ERRORline is Streamline's, the one main logs too.Tested with an AI assistant (Claude Code); results are from this PC.