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.
|
|
@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 |
|
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 |
|
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).
…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).
|
@Czer0xx — ran a full 20-minute gameplay A/B of Verification
20-minute A/B (matched draw buckets)
Bottleneck Diagnosis (CPU-bound RTX 5080)Because an RTX 5080 at 1440p DLSS Quality is CPU-bound (
On GPU-bound cards (like 3060/3090/4070) the GPU barrier win easily outweighs the CPU work, whereas caching |
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.