Repository navigation
GPU: narrow placed-copy, enhanced-group, buffer and pipeline-sync barriers (VICTORY_NARROW_BARRIERS) - #799
GPU: narrow placed-copy, enhanced-group, buffer and pipeline-sync barriers (VICTORY_NARROW_BARRIERS)#799Czer0xx wants to merge 2 commits into
Conversation
…HADER_OPT=127 measured in the open world; about 13 fps is the 3070 Ti's spot today Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01SGw6DM2fQu3WKmCUhFxrrM
Integrate upstream PRs trustno1-coder#850, trustno1-coder#448, trustno1-coder#630/trustno1-coder#682, trustno1-coder#340, trustno1-coder#799 and trustno1-coder#849. Preserve existing refresh batching and facial half views; retain narrow barriers as opt-in. Cover combined half-view dirty tracking and isolate synthetic raw descriptor heaps.
|
On our build RTX 3060 12 GB (driver 621.40), Ryzen 7 5700X, 32 GB, Windows 11. Main
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: 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 |
|
@Czer0xx @grosterr Audited commit Found four concrete barrier-drop holes in 1.
|
|
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) (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. |
|
@claudeFrancoisAI Thanks for the clean isolated repro on stock That extra observation is a huge clue too: pulsing between washed-out and white at idle, then going solid white while holding Seeing GPU busy drop 8 points ( |
|
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
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. |
|
@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 Even better: that cuts bisect time from 10 minutes down to ~60 seconds on a single open-world load once someone splits |
|
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 df2daaf (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. |
|
Reproduced the white picture here, without a fade: RTX 3090 24 GB (driver 610.88), i9-14900K, 32 GB, Windows 11. A release build of this PR merged onto main at
This fits shiman1901's first hole (execution barriers with Tested with an AI assistant (Claude Code); results are from this PC. |
517048c to
2ccdf84
Compare
|
Thanks @grosterr, @claudeFrancoisAI, and @x-nihil0 for the detailed repros, and @shiman1901 for the audit! I rebased Fixes in
|
|
@Czer0xx Super clean turnaround on Tagging @nick0451 as well since your posts crossed by a couple minutes — with |
|
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. |
|
Re-tested Setup: RTX 3090 24 GB (driver 610.88), i9-14900K, Windows 11, release builds. This PR at Picture: across two sessions, 21 measured screenshots with the switch on ( Barrier counts (log, per frame, Speed, three rounds:
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 Tested with an AI assistant (Claude Code); results are from this PC. |
2ccdf84 to
5e2719d
Compare
…riers (VICTORY_NARROW_BARRIERS)
5e2719d to
5cd5faf
Compare
…le-buffered swap chain A/B verified Wave 6 optimizations on RTX 3080 10 GB: - PR trustno1-coder#1298 (non-overlapping hunks): AVX2 forward loop in safecopy (+135% on 256B upload copies, +80% plain RAM), single-lock batched list::recycle with u64 bitmask, and late_helper land() offload when !apart. - PR trustno1-coder#1322: split immutable CardShared out of CARD_WORK and gather flagged pieces directly via collect_flagged_range/flagged_in_range (fetch gather -76..78%, read-backs and lists -33..41%). - PR trustno1-coder#941: strip FILE_FLAG_NO_BUFFERING | FILE_FLAG_RANDOM_ACCESS on read-only synchronous title opens (VICTORY_FILE_BUFFERED=1 default; ReadFile 131.6 -> 8.9 us/call, -10.7s world load). - PR trustno1-coder#1193: triple-buffered swap chain (VICTORY_SWAP_BUFFERS=3 default, 2..=4; submit card wait -34% med / -50% max, steady GPU wait -60%). - Rejected PR trustno1-coder#799 (VICTORY_NARROW_BARRIERS=1) after live VICTORY_AB showed zero GPU gain and alternating over-exposure; kept OFF (diagnostics ab::pick hook only).
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.