Add opt-in GPU-direct zero-CPU-copy 3-way sync engine (VICTORY_GPU_SYNC=1) #279

Open
github-bot wants to merge 1 commit from github-bot/gh-279 into main AGit
Owner

@⁠Vladimir-Human on GitHub · 2026-11-27 13:30 UTC · original
Vladimir-Human:perf/gpu-direct-3way-sync → main · +4288 −22 · 5 files · 1 commits · open

Summary

Adds an opt-in (VICTORY_GPU_SYNC=1, off by default) GPU-direct zero-CPU-copy bidirectional 3-way sync compute + DMA engine over OpenExistingHeapFromAddress1 (crates/victory-gpu/src/gpu_sync.rs), targeting the CPU buffer-copy and readback-merge bottleneck measured in #212 (16.7 ms copy + 10.0 ms copy-back = 26.7 ms/frame).

When VICTORY_GPU_SYNC is unset or 0, default behavior is completely unchanged.

Architecture

  • Zero CPU staging allocations for synced ranges: Eligible large local-VRAM buffers (shadow.rs::lookup) reserve local card VRAM (card_for) before attaching a SyncedShadow (OpenExistingHeapFromAddress1 L0 write-back view of the title's 64 KiB pages + device-local L1 before_buffer baseline twin), avoiding title_shared_buffer CPU staging allocations and CPU copy-back scans (host.rs).
  • Live hardware capability probe (probe_device): Probed once per device (ID3D12Device13, OpenExistingHeapFromAddress1, D3D12_FEATURE_ARCHITECTURE1::CacheCoherentUMA, L0 compute SRV, L0 compute UAV, L0 InterlockedCompareExchange atomics, L0<->L1 CopyBufferRegion, and ID3D12InfoQueue debug validation), selecting cleanly between:
    • SyncMode::BidirectionalUav: Full zero-CPU-copy bidirectional 3-way sync in compute (SYNC_BIDIR_HLSL, branchless SWAR byte-inequality masks, 4x coalesced 16-byte unrolling, InterlockedCompareExchange L0 CAS for all partial and full-dword GPU writes, UAV barrier between disjoint ranges sharing a 32-bit dword boundary) + DMA L0->L1 + L1->L1 Init (record_init_dma).
    • SyncMode::SrvDirectUpload: Adaptive fallback when a driver allows L0 compute SRV reads while rejecting L0 compute UAV writes — zero-CPU-staging L0->L1 upload and L1 3-way diff emitting 16-byte (w_off, gpu_word, gpu_mask, base_t) delta records with bounded overflow draining, applied safely via host::read_into, per-byte cur == base title-wins check, watch::landing, and safecopy/write_mapped, plus pre-refresh needs_settle() at the top of Host::submit.
    • SyncMode::Unsupported: Automatic fallback to the existing CPU path, plus per-buffer eligibility fallback (check_eligibility) when unaligned, empty/>1 GiB, overlapping views (shown_runs over the full 64 KiB-rounded locked range), or uncommitted/non-RW (private_whole).
  • Soundness invariants:
    • Byte-exact 3-way conflict resolution: CPU/title write wins whenever both CPU and GPU modify the same byte (T != B -> S, B; T == B && S != B -> T, B).
    • Per-64 KiB-page initialization tracking: SyncedShadow::initialized_pages ensures Shadow::writing without prior refresh and merge_under_writes on fresh shadows auto-Init in the pre-list before title command lists run.
    • TOCTOU-free placed_copy baseline staging: stage_placed_snapshots uploads exact batch.placed byte snapshots into a transient UPLOAD buffer and copies upload -> before_buffer with explicit D3D12 state barriers without touching shadow.buffer or re-reading live title RAM.
    • 64 KiB-rounded page-lock detach: inplace::title_memory_freeing -> shadow::gpu_sync_let_go detaches any synced shadow whose 64 KiB-rounded OpenExistingHeapFromAddress1 page lock overlaps the freed range.

Live Hardware & WARP Capability Probe (VICTORY_D3D12_DEBUG=1, 0 debug errors)

Adapter device13 open srv uav copy L0->L1 copy L1->L0 atomics heap_flags Selected Mode Debug Errors
NVIDIA GeForce RTX 4070 SUPER true true true true true true true 0x421 BidirectionalUav 0
Microsoft Basic Render Driver (WARP) true true true true true true true 0x421 BidirectionalUav 0

ID3D12QueryHeap GPU Timestamp Benchmarks (RTX 4070 SUPER, --release, VICTORY_D3D12_DEBUG=0, post-full-CAS)

Region Size Init DMA (L0->L1 + L1->L1) 3-Way Clean (0% dirty) 3-Way Bidirectional (10% CPU + 10% GPU dirty) CPU Submit Overhead Release CPU 3-Way Oracle GPU Speedup / CPU Reduction (Dirty)
4 MiB 228.4 us (18.37 GB/s) 329.7 us (12.72 GB/s) 670.7 us (6.25 GB/s) 96.3 us 3,983.3 us (1.05 GB/s) 5.9x GPU / 41.4x CPU
16 MiB 901.1 us (18.62 GB/s) 1,231.9 us (13.62 GB/s) 1,246.2 us (13.46 GB/s) 110.9 us 16,021.3 us (1.05 GB/s) 12.9x GPU / 144.5x CPU
64 MiB 3,793.9 us (17.69 GB/s) 5,140.5 us (13.05 GB/s) 5,673.0 us (11.83 GB/s) 149.6 us 73,099.8 us (0.92 GB/s) 12.9x GPU / 488.6x CPU

(CPU submit overhead remains O(1) at ~30-150 us regardless of synced buffer size, with zero CPU staging memory copies.)

Verification (rustc 1.98.1, VICTORY_D3D12_DEBUG=1, --test-threads=1, 0 D3D12/GBV errors)

  • cargo clippy -p victory-gpu --all-targets --locked -- -D warnings (default & --features diagnostics): 0 warnings
  • cargo test -p victory-gpu --locked gpu_sync::tests -- --test-threads=1 (HW & WARP, default & --features diagnostics): 10/10 passed (coalescing, fallbacks, live HW probe + timestamps, HW + WARP 3-way merge oracle parity across unaligned/overlapping/concurrent-write cases & forced-overflow SrvDirectUpload, HW + WARP same-dword & full-dword atomic CAS, end-to-end zero-staging + TOCTOU placed_copy + VirtualFree(MEM_DECOMMIT) detach, auto-Init on fresh Shadow::writing, SrvDirectUpload guarded RO/concurrent delta apply, and 64 KiB-rounded gpu_sync_let_go)
  • Active GPU-Based Validation (VICTORY_D3D12_DEBUG=1, VICTORY_D3D12_GBV=1, ID3D12Debug1::SetEnableGPUBasedValidation(true)): gpu_sync::tests 10/10 passed (0 GBV errors)
  • cargo test -p victory-gpu --locked inplace::tests -- --test-threads=1: 8/8 passed
  • cargo test -p victory-gpu --locked shadow:: -- --test-threads=1: 59/59 passed (4 ignored)
  • cargo xtask policy (314 files ok), cargo test -p xtask --locked (11/11 passed), git diff --check clean.
**@⁠Vladimir-Human** on GitHub · 2026-11-27 13:30 UTC · [original](https://github.com/TaynanGT/Vice-Tay/pull/279) `Vladimir-Human:perf/gpu-direct-3way-sync` → `main` · +4288 −22 · 5 files · 1 commits · open ## Summary Adds an **opt-in (`VICTORY_GPU_SYNC=1`, off by default)** GPU-direct zero-CPU-copy bidirectional 3-way sync compute + DMA engine over `OpenExistingHeapFromAddress1` (`crates/victory-gpu/src/gpu_sync.rs`), targeting the CPU buffer-copy and readback-merge bottleneck measured in #212 (`16.7 ms` copy + `10.0 ms` copy-back = `26.7 ms/frame`). When `VICTORY_GPU_SYNC` is unset or `0`, default behavior is completely unchanged. ### Architecture - **Zero CPU staging allocations for synced ranges:** Eligible large local-VRAM buffers (`shadow.rs::lookup`) reserve local card VRAM (`card_for`) before attaching a `SyncedShadow` (`OpenExistingHeapFromAddress1` L0 write-back view of the title's 64 KiB pages + device-local L1 `before_buffer` baseline twin), avoiding `title_shared_buffer` CPU staging allocations and CPU copy-back scans (`host.rs`). - **Live hardware capability probe (`probe_device`):** Probed once per device (`ID3D12Device13`, `OpenExistingHeapFromAddress1`, `D3D12_FEATURE_ARCHITECTURE1::CacheCoherentUMA`, L0 compute `SRV`, L0 compute `UAV`, L0 `InterlockedCompareExchange` atomics, `L0<->L1` `CopyBufferRegion`, and `ID3D12InfoQueue` debug validation), selecting cleanly between: - `SyncMode::BidirectionalUav`: Full zero-CPU-copy bidirectional 3-way sync in compute (`SYNC_BIDIR_HLSL`, branchless SWAR byte-inequality masks, 4x coalesced 16-byte unrolling, `InterlockedCompareExchange` L0 CAS for all partial and full-dword GPU writes, UAV barrier between disjoint ranges sharing a 32-bit dword boundary) + DMA `L0->L1` + `L1->L1` `Init` (`record_init_dma`). - `SyncMode::SrvDirectUpload`: Adaptive fallback when a driver allows L0 compute SRV reads while rejecting L0 compute UAV writes — zero-CPU-staging `L0->L1` upload and L1 3-way diff emitting 16-byte `(w_off, gpu_word, gpu_mask, base_t)` delta records with bounded overflow draining, applied safely via `host::read_into`, per-byte `cur == base` title-wins check, `watch::landing`, and `safecopy`/`write_mapped`, plus pre-refresh `needs_settle()` at the top of `Host::submit`. - `SyncMode::Unsupported`: Automatic fallback to the existing CPU path, plus per-buffer eligibility fallback (`check_eligibility`) when unaligned, empty/`>1 GiB`, overlapping views (`shown_runs` over the full 64 KiB-rounded locked range), or uncommitted/non-RW (`private_whole`). - **Soundness invariants:** - **Byte-exact 3-way conflict resolution:** CPU/title write wins whenever both CPU and GPU modify the same byte (`T != B -> S, B`; `T == B && S != B -> T, B`). - **Per-64 KiB-page initialization tracking:** `SyncedShadow::initialized_pages` ensures `Shadow::writing` without prior `refresh` and `merge_under_writes` on fresh shadows auto-`Init` in the pre-list before title command lists run. - **TOCTOU-free `placed_copy` baseline staging:** `stage_placed_snapshots` uploads exact `batch.placed` byte snapshots into a transient `UPLOAD` buffer and copies `upload -> before_buffer` with explicit D3D12 state barriers without touching `shadow.buffer` or re-reading live title RAM. - **64 KiB-rounded page-lock detach:** `inplace::title_memory_freeing` -> `shadow::gpu_sync_let_go` detaches any synced shadow whose 64 KiB-rounded `OpenExistingHeapFromAddress1` page lock overlaps the freed range. ### Live Hardware & WARP Capability Probe (`VICTORY_D3D12_DEBUG=1`, `0` debug errors) | Adapter | `device13` | `open` | `srv` | `uav` | `copy L0->L1` | `copy L1->L0` | `atomics` | `heap_flags` | Selected Mode | Debug Errors | |---|---|---|---|---|---|---|---|---|---|---| | **NVIDIA GeForce RTX 4070 SUPER** | `true` | `true` | `true` | `true` | `true` | `true` | `true` | `0x421` | `BidirectionalUav` | `0` | | **Microsoft Basic Render Driver (WARP)** | `true` | `true` | `true` | `true` | `true` | `true` | `true` | `0x421` | `BidirectionalUav` | `0` | ### `ID3D12QueryHeap` GPU Timestamp Benchmarks (RTX 4070 SUPER, `--release`, `VICTORY_D3D12_DEBUG=0`, post-full-CAS) | Region Size | Init DMA (`L0->L1 + L1->L1`) | 3-Way Clean (0% dirty) | 3-Way Bidirectional (10% CPU + 10% GPU dirty) | CPU Submit Overhead | Release CPU 3-Way Oracle | GPU Speedup / CPU Reduction (Dirty) | |---:|---|---|---|---|---|---| | **4 MiB** | `228.4 us` (`18.37 GB/s`) | `329.7 us` (`12.72 GB/s`) | `670.7 us` (`6.25 GB/s`) | `96.3 us` | `3,983.3 us` (`1.05 GB/s`) | **5.9x GPU / 41.4x CPU** | | **16 MiB** | `901.1 us` (`18.62 GB/s`) | `1,231.9 us` (`13.62 GB/s`) | `1,246.2 us` (`13.46 GB/s`) | `110.9 us` | `16,021.3 us` (`1.05 GB/s`) | **12.9x GPU / 144.5x CPU** | | **64 MiB** | `3,793.9 us` (`17.69 GB/s`) | `5,140.5 us` (`13.05 GB/s`) | `5,673.0 us` (`11.83 GB/s`) | `149.6 us` | `73,099.8 us` (`0.92 GB/s`) | **12.9x GPU / 488.6x CPU** | *(CPU submit overhead remains `O(1)` at ~`30-150 us` regardless of synced buffer size, with zero CPU staging memory copies.)* ### Verification (`rustc 1.98.1`, `VICTORY_D3D12_DEBUG=1`, `--test-threads=1`, `0` D3D12/GBV errors) - `cargo clippy -p victory-gpu --all-targets --locked -- -D warnings` (default & `--features diagnostics`): **0 warnings** - `cargo test -p victory-gpu --locked gpu_sync::tests -- --test-threads=1` (HW & WARP, default & `--features diagnostics`): **10/10 passed** (coalescing, fallbacks, live HW probe + timestamps, HW + WARP 3-way merge oracle parity across unaligned/overlapping/concurrent-write cases & forced-overflow `SrvDirectUpload`, HW + WARP same-dword & full-dword atomic CAS, end-to-end zero-staging + TOCTOU `placed_copy` + `VirtualFree(MEM_DECOMMIT)` detach, auto-`Init` on fresh `Shadow::writing`, `SrvDirectUpload` guarded RO/concurrent delta apply, and 64 KiB-rounded `gpu_sync_let_go`) - Active GPU-Based Validation (`VICTORY_D3D12_DEBUG=1`, `VICTORY_D3D12_GBV=1`, `ID3D12Debug1::SetEnableGPUBasedValidation(true)`): `gpu_sync::tests` **10/10 passed** (`0` GBV errors) - `cargo test -p victory-gpu --locked inplace::tests -- --test-threads=1`: **8/8 passed** - `cargo test -p victory-gpu --locked shadow:: -- --test-threads=1`: **59/59 passed** (4 ignored) - `cargo xtask policy` (`314 files ok`), `cargo test -p xtask --locked` (**11/11 passed**), `git diff --check` clean.
Introduces an opt-in compute/DMA synchronization engine (`VICTORY_GPU_SYNC=1`,
off by default) over `OpenExistingHeapFromAddress1` that eliminates CPU staging
buffers and CPU readback merges for eligible large local-VRAM title buffers:

- Live device capability probe (`probe_device`, incl. `CacheCoherentUMA`)
  selecting between:
  - `BidirectionalUav`: L0 `OpenExistingHeapFromAddress1` supports compute SRV
    reads and UAV writes (plus L0 `InterlockedCompareExchange` atomics routed
    for all partial and full-dword GPU writes and DMA `L0->L1` + `L1->L1`
    `Init`), performing full byte-exact 3-way sync directly on the GPU.
  - `SrvDirectUpload`: adaptive fallback when a driver allows L0 compute SRV
    reads but rejects L0 compute UAV writes (zero-CPU-staging `L0->L1` upload,
    L1 3-way diff emitting 16-byte `(off, gpu_word, mask, base_t)` deltas
    applied safely via `host::read_into`, `watch::landing`, and `safecopy`
    preserving concurrent CPU writes, plus pre-refresh `needs_settle()`).
  - `Unsupported`: automatic fallback to the existing CPU path, plus per-buffer
    eligibility checks over the 64 KiB-rounded locked range (`shown_runs`,
    `private_whole`) and card-budget admission before opening an L0 heap.
- Byte-exact 3-way conflict resolution (CPU/title write wins when both CPU and
  GPU modify the same byte), per-64 KiB-page initialization tracking so
  `Shadow::writing` / `merge_under_writes` on fresh shadows auto-`Init` before
  title lists execute, transient-upload `placed_copy` baseline staging (free of
  TOCTOU reads of live title RAM), and 64 KiB-rounded page-lock detach on title
  memory free (`inplace::title_memory_freeing` -> `shadow::gpu_sync_let_go`).
- Verified with `VICTORY_D3D12_DEBUG=1` (0 debug errors) and real
  `VICTORY_D3D12_GBV=1` (`ID3D12Debug1::SetEnableGPUBasedValidation(true)`),
  HW (RTX 4070 SUPER) + WARP tests against a CPU 3-way merge oracle across
  unaligned, overlapping, and concurrent-write cases, plus `ID3D12QueryHeap`
  timestamp throughput benchmarks.
github-bot locked as GitHub sync and limited conversation to collaborators 2026-11-27 13:34:47 +00:00
Author
Owner

@⁠TaynanGT on GitHub · 2026-11-27 13:37 UTC · original

@⁠Vladimir-Human The hardware probe and fallback are important for a GPU-direct path. I’ll check that simultaneous CPU and GPU changes preserve the expected bytes and that fallback leaves the original snapshot valid. The in-game test can then compare copy, copy-back and frame time with the option as the only change.

**@⁠TaynanGT** on GitHub · 2026-11-27 13:37 UTC · [original](https://github.com/TaynanGT/Vice-Tay/pull/279#issuecomment-7219732845) @⁠Vladimir-Human The hardware probe and fallback are important for a GPU-direct path. I’ll check that simultaneous CPU and GPU changes preserve the expected bytes and that fallback leaves the original snapshot valid. The in-game test can then compare copy, copy-back and frame time with the option as the only change.
Author
Owner

@⁠Vladimir-Human on GitHub · 2026-11-27 13:52 UTC · original

Thanks @⁠TaynanGT - here are the exact tests and fallback paths in crates/victory-gpu/src/gpu_sync.rs (all 4 CI checks green on 70a150e):

  • Hardware probe & adaptive modes: hw_capability_probe_and_timestamp_benchmark (gpu_sync.rs:3041) exercises probe_device live (ID3D12Device13, L0 SRV/UAV/CopyBufferRegion/atomics, CacheCoherentUMA, 0 debug errors) with ID3D12QueryHeap timestamps.
  • Simultaneous CPU+GPU byte conflicts (title wins): hw_three_way_merge_matches_cpu_oracle (gpu_sync.rs:3231) and warp_three_way_merge_matches_cpu_oracle (gpu_sync.rs:3239) verify byte-exact parity against cpu_three_way_merge_oracle across unaligned, overlapping, and concurrent writes in both BidirectionalUav and forced-overflow SrvDirectUpload, alongside hw_and_warp_same_dword_concurrent_byte_writes_with_atomics (gpu_sync.rs:3532), srv_delta_apply_preserves_concurrent_cpu_writes_and_guards_readonly (gpu_sync.rs:3883), and end_to_end_shadow_zero_staging_and_detach_lifecycle (gpu_sync.rs:3543, including TOCTOU placed_copy snapshot preservation).
  • Fallback & original snapshot preservation: fallback_when_unaligned_or_unopenable (gpu_sync.rs:3248), uninitialized_shadow_writing_auto_inits_before_bidir_sync (gpu_sync.rs:3779), and gpu_sync_let_go_detaches_on_64k_rounded_boundary_frees (gpu_sync.rs:3948) verify fallback rejection, fresh-shadow baseline auto-init, and 64 KiB page-lock detach; in shadow.rs::lookup, any VICTORY_GPU_SYNC=0/unset, ineligible, or failed try_attach rolls back CARD_BYTES[0] and falls straight through to the untouched title_shared_buffer + original snapshot path so VICTORY_GPU_SYNC=1 stays a clean single-switch A/B comparison.
**@⁠Vladimir-Human** on GitHub · 2026-11-27 13:52 UTC · [original](https://github.com/TaynanGT/Vice-Tay/pull/279#issuecomment-7220045553) Thanks @⁠TaynanGT - here are the exact tests and fallback paths in `crates/victory-gpu/src/gpu_sync.rs` (all 4 CI checks green on `70a150e`): - **Hardware probe & adaptive modes:** `hw_capability_probe_and_timestamp_benchmark` (`gpu_sync.rs:3041`) exercises `probe_device` live (`ID3D12Device13`, L0 `SRV`/`UAV`/`CopyBufferRegion`/atomics, `CacheCoherentUMA`, `0` debug errors) with `ID3D12QueryHeap` timestamps. - **Simultaneous CPU+GPU byte conflicts (`title` wins):** `hw_three_way_merge_matches_cpu_oracle` (`gpu_sync.rs:3231`) and `warp_three_way_merge_matches_cpu_oracle` (`gpu_sync.rs:3239`) verify byte-exact parity against `cpu_three_way_merge_oracle` across unaligned, overlapping, and concurrent writes in both `BidirectionalUav` and forced-overflow `SrvDirectUpload`, alongside `hw_and_warp_same_dword_concurrent_byte_writes_with_atomics` (`gpu_sync.rs:3532`), `srv_delta_apply_preserves_concurrent_cpu_writes_and_guards_readonly` (`gpu_sync.rs:3883`), and `end_to_end_shadow_zero_staging_and_detach_lifecycle` (`gpu_sync.rs:3543`, including TOCTOU `placed_copy` snapshot preservation). - **Fallback & original snapshot preservation:** `fallback_when_unaligned_or_unopenable` (`gpu_sync.rs:3248`), `uninitialized_shadow_writing_auto_inits_before_bidir_sync` (`gpu_sync.rs:3779`), and `gpu_sync_let_go_detaches_on_64k_rounded_boundary_frees` (`gpu_sync.rs:3948`) verify fallback rejection, fresh-shadow baseline auto-init, and 64 KiB page-lock detach; in `shadow.rs::lookup`, any `VICTORY_GPU_SYNC=0`/unset, ineligible, or failed `try_attach` rolls back `CARD_BYTES[0]` and falls straight through to the untouched `title_shared_buffer` + original snapshot path so `VICTORY_GPU_SYNC=1` stays a clean single-switch A/B comparison.
Author
Owner

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

@⁠Vladimir-Human The same-dword tests and the attach-failure rollback cover the two correctness questions. For the in-game A/B, keep VICTORY_GPU_SYNC as the only change and include the selected mode and eligible bytes alongside copy, copy-back and frame time. That tells us which path actually ran.

**@⁠TaynanGT** on GitHub · 2026-11-27 14:11 UTC · [original](https://github.com/TaynanGT/Vice-Tay/pull/279#issuecomment-7220457929) @⁠Vladimir-Human The same-dword tests and the attach-failure rollback cover the two correctness questions. For the in-game A/B, keep `VICTORY_GPU_SYNC` as the only change and include the selected mode and eligible bytes alongside copy, copy-back and frame time. That tells us which path actually ran.
Author
Owner

@⁠CowboyBingus on GitHub · 2026-11-27 14:28 UTC · original

In-game A/B on an RTX 5070 Ti 16 GB, Ryzen 7 9800X3D, 64 GB, Windows 11, with VICTORY_GPU_SYNC as the only change.

Setup: one exe for both runs (md5 D4823FA78BB10CF499686A3CF6615DB0), a diag build (--profile diag -p victory --features diagnostics) of this PR's head 70a150e merged with #206 (292adb5) and then with main at 877a40e. scripts\play.ps1 -Console series-s -Machine 4070 -Windowed -Dlss quality (DRED at the launcher default, faults; the logs show breadcrumbs=false). Our deviations, the same in both runs: -Windowed, -Machine 4070, the reflection hold (VICTORY_AMBIENT_REFLECT=1, VICTORY_AMBIENT_REFLECT_IN=CS_TemporalResolve2_Opaque,CS_TemporalResolve1_Alpha), Enter presses (held 0.3 s) written to a keys file (VICTORY_KEYS_FILE) by a background job that begins no new round after 62 s on its clock, and a window capture after each 3 s wait while the game window was up. Same session: GS1 (VICTORY_GPU_SYNC=1, 450 s), then GO1 (switch unset), which we stopped after about 210 s, so it has fewer lines. No second round was run.

Selected mode (GS1 log, the only gpu_sync line in it):

INFO victory_gpu::gpu_sync: VICTORY_GPU_SYNC=1 capability probe adapter=NVIDIA GeForce RTX 5070 Ti software=false cache_coherent_uma=false device13=true mode=BidirectionalUav l0_srv=true l0_uav=true l0_copy_to_l1=true l0_copy_from_l1=true l0_atomics=true heap_flags=0x421 debug_errors=0

The log has no line with eligible bytes.

Frame-meter lines with > 1000 draws and 0 pipelines being made; medians (mean of the two middle lines for an even count, rounded half up); p10/p90 by nearest rank; with fewer than 100 lines per run, the 1% low is the lowest line.

Run lines used / all fps median p10 p90 1% low ms/frame preparing copies ms / MB textures ms / MB GPU ms copying back ms / MB draws dropped draws
GS1 (VICTORY_GPU_SYNC=1) 34 / 78 5.2 4.8 5.7 4.5 192.9 46.8 8.0 / 41.3 0.9 / 22.9 139.0 22.6 / 11.2 4392 262
GO1 (unset) 18 / 40 24.5 20.0 25.6 18.1 40.9 33.4 8.8 / 52.3 0.3 / 20.2 0.3 18.5 / 27.3 4457 268

The GPU ms column is a CPU-side wall-clock timer (std::time::Instant values summed in SUBMISSION_US[1], host.rs), not a measurement on the card. The on-screen overlay in a GS1 capture at 367 s shows "GPU EST 320.9 MS".

**@⁠CowboyBingus** on GitHub · 2026-11-27 14:28 UTC · [original](https://github.com/TaynanGT/Vice-Tay/pull/279#issuecomment-7220833903) In-game A/B on an RTX 5070 Ti 16 GB, Ryzen 7 9800X3D, 64 GB, Windows 11, with `VICTORY_GPU_SYNC` as the only change. **Setup:** one exe for both runs (md5 `D4823FA78BB10CF499686A3CF6615DB0`), a diag build (`--profile diag -p victory --features diagnostics`) of this PR's head `70a150e` merged with #206 (`292adb5`) and then with `main` at `877a40e`. `scripts\play.ps1 -Console series-s -Machine 4070 -Windowed -Dlss quality` (DRED at the launcher default, `faults`; the logs show `breadcrumbs=false`). Our deviations, the same in both runs: `-Windowed`, `-Machine 4070`, the reflection hold (`VICTORY_AMBIENT_REFLECT=1`, `VICTORY_AMBIENT_REFLECT_IN=CS_TemporalResolve2_Opaque,CS_TemporalResolve1_Alpha`), Enter presses (held 0.3 s) written to a keys file (`VICTORY_KEYS_FILE`) by a background job that begins no new round after 62 s on its clock, and a window capture after each 3 s wait while the game window was up. Same session: GS1 (`VICTORY_GPU_SYNC=1`, 450 s), then GO1 (switch unset), which we stopped after about 210 s, so it has fewer lines. No second round was run. **Selected mode** (GS1 log, the only `gpu_sync` line in it): ``` INFO victory_gpu::gpu_sync: VICTORY_GPU_SYNC=1 capability probe adapter=NVIDIA GeForce RTX 5070 Ti software=false cache_coherent_uma=false device13=true mode=BidirectionalUav l0_srv=true l0_uav=true l0_copy_to_l1=true l0_copy_from_l1=true l0_atomics=true heap_flags=0x421 debug_errors=0 ``` The log has no line with eligible bytes. Frame-meter lines with > 1000 draws and 0 pipelines being made; medians (mean of the two middle lines for an even count, rounded half up); p10/p90 by nearest rank; with fewer than 100 lines per run, the 1% low is the lowest line. | Run | lines used / all | fps median | p10 | p90 | 1% low | ms/frame | preparing | copies ms / MB | textures ms / MB | GPU ms | copying back ms / MB | draws | dropped draws | |---|---|---|---|---|---|---|---|---|---|---|---|---|---| | GS1 (`VICTORY_GPU_SYNC=1`) | 34 / 78 | 5.2 | 4.8 | 5.7 | 4.5 | 192.9 | 46.8 | 8.0 / 41.3 | 0.9 / 22.9 | 139.0 | 22.6 / 11.2 | 4392 | 262 | | GO1 (unset) | 18 / 40 | 24.5 | 20.0 | 25.6 | 18.1 | 40.9 | 33.4 | 8.8 / 52.3 | 0.3 / 20.2 | 0.3 | 18.5 / 27.3 | 4457 | 268 | The GPU ms column is a CPU-side wall-clock timer (`std::time::Instant` values summed in `SUBMISSION_US[1]`, `host.rs`), not a measurement on the card. The on-screen overlay in a GS1 capture at 367 s shows "GPU EST 320.9 MS".
Author
Owner

@⁠TaynanGT on GitHub · 2026-11-27 14:38 UTC · original

@⁠CowboyBingus That’s a clear regression on this 5070 Ti run: BidirectionalUav took 192.9 ms per frame versus 40.9 ms in the control. I’ll keep it out of the recommended profile. Eligible bytes, time spent waiting for its fences, and GPU dispatch time are the useful next counters. The existing CPU timer can’t distinguish them.

**@⁠TaynanGT** on GitHub · 2026-11-27 14:38 UTC · [original](https://github.com/TaynanGT/Vice-Tay/pull/279#issuecomment-7221047113) @⁠CowboyBingus That’s a clear regression on this 5070 Ti run: `BidirectionalUav` took 192.9 ms per frame versus 40.9 ms in the control. I’ll keep it out of the recommended profile. Eligible bytes, time spent waiting for its fences, and GPU dispatch time are the useful next counters. The existing CPU timer can’t distinguish them.
This pull request can be merged automatically.
This branch is out-of-date with the base branch
You are not authorized to merge this pull request.
View command line instructions

Checkout

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

Merge

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