GPU: fast-skip clean/idle bindless textures and lazy-reset upload list #3484

Open
github-bot wants to merge 2 commits from github-bot/gh-3484 into main AGit
Owner

@⁠Desamodeth on GitHub · 2026-11-27 07:42 UTC · original
Desamodeth:opt/bindless-uploads → main · +423 −121 · 4 files · 2 commits · open

Problem

In #3425 (frame budget breakdown), bindless::uploads was measured at ~10.1 ms/frame with no open PR targeting it. On every submission (~24/frame), bindless::uploads currently:

  1. Unconditionally calls texture::recycle(), list.reset() (D3D12 CommandAllocator::Reset + CommandList::Reset), and list.close() even when zero textures changed.
  2. Allocates fresh done and staged HashSets every submission and holds viewed.inner.lock() across the entire scan of all bindless textures in the heap — calling resource::made_copy (Resource::host lock + Arc::clone), texture::staging (a second Resource::host lock + HostTexture::staging lock + GetCopyableFootprints / watch::track on first use!), and cloning every recent clean texture into work only for refresh_all to discard it.
  3. Clones clean table textures into work, allocates Vec<Mutex<Option<Upload>>> even for a single dirty texture, and issues one ResourceBarrier per texture for COPY_DEST transitions instead of batching them before copies.

Changes

  • crates/victory-gpu/src/resource.rs:
    • Add HostTexture::staging_dirty_bit: AtomicU32 (STAGING_UNINIT / STAGING_ALWAYS_DIRTY / watch::DIRTY bit) and bindless_upload_check(this, presented) to check dirty bit, used_recently_at(presented), and host_written under one Resource::host lock with zero Arc::clone for skipped textures.
    • Add monotonic STAMP_EPOCH bumped on host-copy attachment and HostTexture::stamp_at frame changes so idle/unstamped textures without staging skip Resource::host locks within the same epoch.
    • In give_up, call bindless::clear_texture_bits(&cleared) after dropping TEXTURES_AT/GIVEN_UP while gone still holds each evicted HostTexture alive (preventing stale dirty-bit reuse).
  • crates/victory-gpu/src/texture.rs:
    • Add staging_for(resource, copy) (reused by staging) to avoid a redundant Resource::host lock and publish copy.staging_dirty_bit on creation.
    • Add fast paths in refresh_all for 0 or 1 dirty texture (avoiding Vec<Mutex<...>> and thread-scope overhead).
    • Replace single-texture record_upload with record_uploads to batch COPY_DEST barriers into one ResourceBarrier before copies and SHADER_RESOURCE barriers into one ResourceBarrier after copies.
  • crates/victory-gpu/src/bindless.rs & crates/victory-gpu/src/host.rs:
    • Cache (slot_count, cached_dirty_bit, idle_epoch) in Inner::textures so clean tracked textures take a lock-free watch::clean_bit fast path and idle textures skip rescans within the same STAMP_EPOCH.
    • Skip done: HashSet for single-heap submissions and staged: HashSet for <=8 dirty textures.
    • Move texture::staging_for outside viewed.inner.lock() so title descriptor writes do not stall behind staging/watch setup.
    • Defer list.reset()/list.close() until at least one upload is actually ready, gate texture::recycle() on needs_recycle, and release held list references in Drop for Uploads via HostList::clear_held() so skipped resets never pin evicted HostTextures or staging buffers.

Verification (synthetic fixtures only, no game files)

  • Base: main @ 63bcca43
  • Lint & policy: cargo clippy --locked -p victory-gpu --lib --tests -- -D warnings (default and --features diagnostics) clean; cargo xtask policy (191 files ok).
  • RTX 5070 (Windows 11, Ryzen 7 9800X3D, --test-threads=1): bindless:: 5/5 (including 2 new regression tests: cached_dirty_bit_reuploads_after_write_and_after_evict_recreate and untracked_bindless_texture_reuploads_on_memory_change), texture:: 2/2, heap_textures 2/2, resource::tests:: 18/18 — all pass.
  • WARP (VICTORY_D3D12_WARP=1, --features diagnostics, --test-threads=1): bindless:: 5/5, texture:: 2/2, heap_textures 2/2, resource::tests:: 18/18 — all pass.

Release Benchmarks on RTX 5070 (6 forward+reverse interleaved pairs = 12 runs each, median [min..max])

Synthetic fixture: 2,048 tracked bindless 64x64 RGBA8 textures (512 recently stamped + 1,536 idle/unstamped) + 64 table textures, real D3D12 HostTexture/Staging/upload list on RTX 5070:

Scenario main (63bcca43) opt/bindless-uploads Speedup
24 clean submissions (2,048 bindless + 64 table) 2,461.5 us [2,456.4..2,470.1] 74.8 us [69.6..80.7] -97.0% (32.9x)
24 submissions, 1 dirty bindless + 2,047 clean + 64 table 2,659.4 us [2,645.2..2,677.6] 269.0 us [263.2..372.0] -89.9% (9.9x)
1 submission, 16 dirty bindless + 2,032 clean + 64 table 367.2 us [344.2..397.6] 269.9 us [254.6..310.2] -26.5% (1.36x)
24 submissions, 1,536 idle unstamped (same epoch) 1,120.7 us [1,111.5..1,139.4] 60.7 us [57.2..66.7] -94.6% (18.5x)
24 submissions, 1,536 idle unstamped (epoch bumped every sub) 1,111.8 us [1,110.0..1,133.5] 371.9 us [370.0..381.7] -66.6% (3.0x)
Worst case: 64/64 table textures dirty (100% upload) 477.2 us [456.6..498.5] 471.5 us [456.9..558.2] -1.2% (parity)

(Microbenchmark timings only; full-title frame-time impact should be measured separately on a real scene.)

Trade-offs & Compatibility

  • Adds 4 bytes (AtomicU32) to HostTexture and 16 bytes (Option<u32> + u64) per distinct viewed texture in bindless::Viewed::textures.
  • Orthogonal to #2940 (Viewed::set / forget reverse index) and #3213 (Resource::drop guard).
  • Claimed in #1633 (#issuecomment-7212539762).

AI-assisted with Gemini 4 Neon.

**@⁠Desamodeth** on GitHub · 2026-11-27 07:42 UTC · [original](https://github.com/Marvisak/VIctory/pull/3484) `Desamodeth:opt/bindless-uploads` → `main` · +423 −121 · 4 files · 2 commits · open ### Problem In #3425 (frame budget breakdown), `bindless::uploads` was measured at **~10.1 ms/frame** with no open PR targeting it. On every submission (~24/frame), `bindless::uploads` currently: 1. Unconditionally calls `texture::recycle()`, `list.reset()` (D3D12 `CommandAllocator::Reset` + `CommandList::Reset`), and `list.close()` even when zero textures changed. 2. Allocates fresh `done` and `staged` `HashSet`s every submission and holds `viewed.inner.lock()` across the entire scan of all bindless textures in the heap — calling `resource::made_copy` (`Resource::host` lock + `Arc::clone`), `texture::staging` (a second `Resource::host` lock + `HostTexture::staging` lock + `GetCopyableFootprints` / `watch::track` on first use!), and cloning every recent clean texture into `work` only for `refresh_all` to discard it. 3. Clones clean table textures into `work`, allocates `Vec<Mutex<Option<Upload>>>` even for a single dirty texture, and issues one `ResourceBarrier` per texture for `COPY_DEST` transitions instead of batching them before copies. ### Changes - **`crates/victory-gpu/src/resource.rs`**: - Add `HostTexture::staging_dirty_bit: AtomicU32` (`STAGING_UNINIT` / `STAGING_ALWAYS_DIRTY` / `watch::DIRTY` bit) and `bindless_upload_check(this, presented)` to check dirty bit, `used_recently_at(presented)`, and `host_written` under one `Resource::host` lock with zero `Arc::clone` for skipped textures. - Add monotonic `STAMP_EPOCH` bumped on host-copy attachment and `HostTexture::stamp_at` frame changes so idle/unstamped textures without staging skip `Resource::host` locks within the same epoch. - In `give_up`, call `bindless::clear_texture_bits(&cleared)` after dropping `TEXTURES_AT`/`GIVEN_UP` while `gone` still holds each evicted `HostTexture` alive (preventing stale dirty-bit reuse). - **`crates/victory-gpu/src/texture.rs`**: - Add `staging_for(resource, copy)` (reused by `staging`) to avoid a redundant `Resource::host` lock and publish `copy.staging_dirty_bit` on creation. - Add fast paths in `refresh_all` for 0 or 1 dirty texture (avoiding `Vec<Mutex<...>>` and thread-scope overhead). - Replace single-texture `record_upload` with `record_uploads` to batch `COPY_DEST` barriers into one `ResourceBarrier` before copies and `SHADER_RESOURCE` barriers into one `ResourceBarrier` after copies. - **`crates/victory-gpu/src/bindless.rs` & `crates/victory-gpu/src/host.rs`**: - Cache `(slot_count, cached_dirty_bit, idle_epoch)` in `Inner::textures` so clean tracked textures take a lock-free `watch::clean_bit` fast path and idle textures skip rescans within the same `STAMP_EPOCH`. - Skip `done: HashSet` for single-heap submissions and `staged: HashSet` for <=8 dirty textures. - Move `texture::staging_for` outside `viewed.inner.lock()` so title descriptor writes do not stall behind staging/watch setup. - Defer `list.reset()`/`list.close()` until at least one upload is actually ready, gate `texture::recycle()` on `needs_recycle`, and release held list references in `Drop for Uploads` via `HostList::clear_held()` so skipped resets never pin evicted `HostTexture`s or staging buffers. ### Verification (synthetic fixtures only, no game files) - **Base:** `main` @ `63bcca43` - **Lint & policy:** `cargo clippy --locked -p victory-gpu --lib --tests -- -D warnings` (default and `--features diagnostics`) clean; `cargo xtask policy` (`191 files ok`). - **RTX 5070 (Windows 11, Ryzen 7 9800X3D, `--test-threads=1`):** `bindless::` **5/5** (including 2 new regression tests: `cached_dirty_bit_reuploads_after_write_and_after_evict_recreate` and `untracked_bindless_texture_reuploads_on_memory_change`), `texture::` **2/2**, `heap_textures` **2/2**, `resource::tests::` **18/18** — all pass. - **WARP (`VICTORY_D3D12_WARP=1`, `--features diagnostics`, `--test-threads=1`):** `bindless::` **5/5**, `texture::` **2/2**, `heap_textures` **2/2**, `resource::tests::` **18/18** — all pass. ### Release Benchmarks on RTX 5070 (6 forward+reverse interleaved pairs = 12 runs each, median `[min..max]`) Synthetic fixture: 2,048 tracked bindless 64x64 RGBA8 textures (512 recently stamped + 1,536 idle/unstamped) + 64 table textures, real D3D12 `HostTexture`/`Staging`/upload list on RTX 5070: | Scenario | `main` (`63bcca43`) | `opt/bindless-uploads` | Speedup | |---|---:|---:|---:| | 24 clean submissions (2,048 bindless + 64 table) | 2,461.5 us `[2,456.4..2,470.1]` | **74.8 us** `[69.6..80.7]` | **-97.0% (32.9x)** | | 24 submissions, 1 dirty bindless + 2,047 clean + 64 table | 2,659.4 us `[2,645.2..2,677.6]` | **269.0 us** `[263.2..372.0]` | **-89.9% (9.9x)** | | 1 submission, 16 dirty bindless + 2,032 clean + 64 table | 367.2 us `[344.2..397.6]` | **269.9 us** `[254.6..310.2]` | **-26.5% (1.36x)** | | 24 submissions, 1,536 idle unstamped (same epoch) | 1,120.7 us `[1,111.5..1,139.4]` | **60.7 us** `[57.2..66.7]` | **-94.6% (18.5x)** | | 24 submissions, 1,536 idle unstamped (epoch bumped every sub) | 1,111.8 us `[1,110.0..1,133.5]` | **371.9 us** `[370.0..381.7]` | **-66.6% (3.0x)** | | Worst case: 64/64 table textures dirty (100% upload) | 477.2 us `[456.6..498.5]` | **471.5 us** `[456.9..558.2]` | **-1.2% (parity)** | *(Microbenchmark timings only; full-title frame-time impact should be measured separately on a real scene.)* ### Trade-offs & Compatibility - Adds 4 bytes (`AtomicU32`) to `HostTexture` and 16 bytes (`Option<u32>` + `u64`) per distinct viewed texture in `bindless::Viewed::textures`. - Orthogonal to #2940 (`Viewed::set` / `forget` reverse index) and #3213 (`Resource::drop` guard). - Claimed in #1633 (`#issuecomment-7212539762`). AI-assisted with Gemini 4 Neon.
Eliminates redundant per-submission locks, Arc clones, HashSet allocations,
and empty D3D12 command list Reset/Close pairs in bindless::uploads (#3425):

- Cache each tracked texture's watch::DIRTY bit in HostTexture and
  bindless::Viewed so clean textures skip Resource::host and Staging locks
  via watch::clean_bit. Clear cached bits on eviction while evicted
  HostTextures are still alive so dirty bits cannot be recycled first.
- Track a monotonic STAMP_EPOCH bumped on host-copy attachment and frame-stamp
  changes so idle/unstamped textures without staging are skipped without
  taking Resource::host locks within the same epoch.
- Move texture::staging_for outside viewed.inner.lock() and avoid redundant
  Resource::host locks and Arc clones for clean or host-written textures.
- Filter clean table textures before deduplication/cloning, skip D3D12
  list.reset()/list.close() and recycle() when no textures need uploading,
  release held resources in Uploads::drop via HostList::clear_held(), and
  batch COPY_DEST barriers before copies in texture::record_uploads.

AI-assisted with Gemini 4 Neon.
github-bot locked as GitHub sync and limited conversation to collaborators 2026-11-27 07:45:01 +00:00
Author
Owner

@⁠oni-swr on GitHub · 2026-11-27 08:05 UTC · original

WARP verification of PR #3484 (claimed on #1633). No physical GPU, no game files.

Setup: Windows 11 build 26200, WARP adapter (VICTORY_WARP=1, VICTORY_D3D12_WARP=1, dxil.dll from Windows Kit 10.0.26100 x64), rustc 1.98.1. cargo test -p victory-gpu --features diagnostics (the feature is needed, or VICTORY_D3D12_WARP is ignored in host.rs), --test-threads=1. Base 63bcca43 vs head 3b18e7ab, built in separate checkouts.

Tests:

  • base: 246 passed, 0 failed, 1 ignored
  • head: 248 passed, 0 failed, 1 ignored

The two extra tests are the PR's new ones, cached_dirty_bit_reuploads_after_write_and_after_evict_recreate and untracked_bindless_texture_reuploads_on_memory_change. Both ran and passed. Their no host GPU early return was not taken: with it replaced by a panic in a throwaway local edit, they still passed.

Review (read the diff, nothing found that blocks):

  • Stale uploads: a texture is skipped only when its cached watch::DIRTY bit reads clean. Writes set the bit, so the next submission re-uploads (the new test covers this). Textures with no bit (untracked, or bit pool full) stay STAGING_ALWAYS_DIRTY and are still checked by maybe_changed(), as before.
  • Idle stamp: the per-entry epoch is read before the scan and is bumped on a new host copy and on a texture's first stamp in a frame, so a stale skip is conservative. host_written only goes false to true, so skipping it is stable.
  • Eviction: give_up clears the cached bits (clear_texture_bits) while the evicted HostTexture is still alive, so a recycled bit can't make a recreated copy look clean.
  • Lazy list reset: the list is reset only when uploads are recorded. needs_recycle defers texture::recycle() to the next non-empty submission. Pending uploads are not dropped: the dirty bit is consumed only inside refresh_all, and anything it returns is recorded. Drop for Uploads clears held resources after the wait.
  • Locks: the order is the same as before (list lock, then each heap's inner, then Resource::host). Staging creation now happens outside the heap lock, so it takes fewer locks than base.
  • Nits:
    • bindless.rs gains a leading BOM (U+FEFF).
    • The new STAGING_* consts and STAMP_EPOCH sit between HostTexture's doc comment and the struct, so that doc now attaches to the const.
    • staging() has an unused _texture parameter.

Timing: not measured (no real GPU, and WARP timings wouldn't say much about the real upload path).

AI-assisted: verification run with Claude Code (Claude Sonnet 5.5).

**@⁠oni-swr** on GitHub · 2026-11-27 08:05 UTC · [original](https://github.com/Marvisak/VIctory/pull/3484#issuecomment-7213132965) **WARP verification of PR #3484** (claimed on #1633). No physical GPU, no game files. **Setup:** Windows 11 build 26200, WARP adapter (`VICTORY_WARP=1`, `VICTORY_D3D12_WARP=1`, dxil.dll from Windows Kit 10.0.26100 x64), rustc 1.98.1. `cargo test -p victory-gpu --features diagnostics` (the feature is needed, or `VICTORY_D3D12_WARP` is ignored in `host.rs`), `--test-threads=1`. Base `63bcca43` vs head `3b18e7ab`, built in separate checkouts. **Tests:** - base: 246 passed, 0 failed, 1 ignored - head: 248 passed, 0 failed, 1 ignored The two extra tests are the PR's new ones, `cached_dirty_bit_reuploads_after_write_and_after_evict_recreate` and `untracked_bindless_texture_reuploads_on_memory_change`. Both ran and passed. Their `no host GPU` early return was not taken: with it replaced by a panic in a throwaway local edit, they still passed. **Review (read the diff, nothing found that blocks):** - *Stale uploads:* a texture is skipped only when its cached `watch::DIRTY` bit reads clean. Writes set the bit, so the next submission re-uploads (the new test covers this). Textures with no bit (untracked, or bit pool full) stay `STAGING_ALWAYS_DIRTY` and are still checked by `maybe_changed()`, as before. - *Idle stamp:* the per-entry epoch is read before the scan and is bumped on a new host copy and on a texture's first stamp in a frame, so a stale skip is conservative. `host_written` only goes false to true, so skipping it is stable. - *Eviction:* `give_up` clears the cached bits (`clear_texture_bits`) while the evicted `HostTexture` is still alive, so a recycled bit can't make a recreated copy look clean. - *Lazy list reset:* the list is reset only when uploads are recorded. `needs_recycle` defers `texture::recycle()` to the next non-empty submission. Pending uploads are not dropped: the dirty bit is consumed only inside `refresh_all`, and anything it returns is recorded. `Drop for Uploads` clears held resources after the wait. - *Locks:* the order is the same as before (list lock, then each heap's `inner`, then `Resource::host`). Staging creation now happens outside the heap lock, so it takes fewer locks than base. - *Nits:* - `bindless.rs` gains a leading BOM (U+FEFF). - The new `STAGING_*` consts and `STAMP_EPOCH` sit between `HostTexture`'s doc comment and the struct, so that doc now attaches to the const. - `staging()` has an unused `_texture` parameter. **Timing:** not measured (no real GPU, and WARP timings wouldn't say much about the real upload path). AI-assisted: verification run with Claude Code (Claude Sonnet 5.5).
Restore the HostTexture documentation, drop the unused texture argument from staging, and remove the leading BOM from bindless.rs.

AI-assisted with Codex Astra 6.2 High.
Author
Owner

@⁠Desamodeth on GitHub · 2026-11-27 12:12 UTC · original

Tested 74722f9c on a native Windows RTX 5070 12 GB (621.40) in the opening car cutscene. Four A/B/B/A runs used the same save and cache seed, with 128 matched Present intervals per run. Both builds included #2885 and identical instrumentation.

Mean CPU time in bindless upload preparation fell from 34.94 to 20.53 ms/frame in the first pair and 28.31 to 21.50 ms/frame in the reverse-order pair. Full-frame p95 also fell (1,136 → 964 ms and 1,048 → 990 ms). Median frame time moved in opposite directions (564 → 571 ms and 563 → 558 ms). The preparation saving reproduced on hardware. These runs show no consistent change in median frame time or peak local VRAM.

Measured locally with Codex assistance.

**@⁠Desamodeth** on GitHub · 2026-11-27 12:12 UTC · [original](https://github.com/Marvisak/VIctory/pull/3484#issuecomment-7217957037) Tested `74722f9c` on a native Windows RTX 5070 12 GB (621.40) in the opening car cutscene. Four A/B/B/A runs used the same save and cache seed, with 128 matched Present intervals per run. Both builds included #2885 and identical instrumentation. Mean CPU time in bindless upload preparation fell from **34.94 to 20.53 ms/frame** in the first pair and **28.31 to 21.50 ms/frame** in the reverse-order pair. Full-frame p95 also fell (1,136 → 964 ms and 1,048 → 990 ms). Median frame time moved in opposite directions (564 → 571 ms and 563 → 558 ms). The preparation saving reproduced on hardware. These runs show no consistent change in median frame time or peak local VRAM. Measured locally with Codex assistance.
Author
Owner

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

Tested in game on an RTX 5090 (driver 620.73.04), Linux, GE-Proton11-14 Wine with its vkd3d-proton, GTA VI's opening prison yard, warm caches. Base: main plus the unmerged PRs this setup needs (listed in #3425); this PR (head 3b18e7ab) merged on top with one conflict in host.rs's list reset (our base had grown that body; it now sits in a clear_held that reset and the lazy reset both call). 420 s runs, medians of the last 30 frame-rate lines; the controls ran directly before and after.

control (before) with this PR control (after)
frame 196.1 ms 188.4 ms 196.9 ms
fastest 5 s block 191.8 ms 181.9 ms 189.9 ms
preparing (CPU) 75.8 ms 66.3 ms 75.8 ms
on the GPU 73.5 ms 74.7 ms 74.3 ms

So about −8.5 ms a frame, all of it on the CPU's preparing side, which is where bindless::uploads sits (~10 ms a frame on this setup, from an earlier breakdown in #3425). This build has no time counter for that function itself, so the attribution is by where the time went, not a direct reading. No crash, no device removal; the pictures at frames 1700 and 2048 have the same lighting as the controls, and differ from them less than the two controls differ from each other (camera framing and hint timing).

Not run here: the PR's own bindless regression test, which needs a D3D12 device.

AI-assisted (Claude); measured on my machine, no game data shared.

**@⁠neonbyte1** on GitHub · 2026-11-27 14:11 UTC · [original](https://github.com/Marvisak/VIctory/pull/3484#issuecomment-7220477019) Tested in game on an RTX 5090 (driver 620.73.04), Linux, GE-Proton11-14 Wine with its vkd3d-proton, GTA VI's opening prison yard, warm caches. Base: `main` plus the unmerged PRs this setup needs (listed in #3425); this PR (head `3b18e7ab`) merged on top with one conflict in `host.rs`'s list reset (our base had grown that body; it now sits in a `clear_held` that `reset` and the lazy reset both call). 420 s runs, medians of the last 30 frame-rate lines; the controls ran directly before and after. | | control (before) | **with this PR** | control (after) | |---|---|---|---| | frame | 196.1 ms | **188.4 ms** | 196.9 ms | | fastest 5 s block | 191.8 ms | 181.9 ms | 189.9 ms | | preparing (CPU) | 75.8 ms | **66.3 ms** | 75.8 ms | | on the GPU | 73.5 ms | 74.7 ms | 74.3 ms | So about −8.5 ms a frame, all of it on the CPU's preparing side, which is where `bindless::uploads` sits (~10 ms a frame on this setup, from an earlier breakdown in #3425). This build has no time counter for that function itself, so the attribution is by where the time went, not a direct reading. No crash, no device removal; the pictures at frames 1700 and 2048 have the same lighting as the controls, and differ from them less than the two controls differ from each other (camera framing and hint timing). Not run here: the PR's own bindless regression test, which needs a D3D12 device. _AI-assisted (Claude); measured on my machine, no game data shared._
Author
Owner

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

Focused Wine/NVIDIA verification of exact head 74722f9cc302d1f0823726eef4e395cdee3cceae:

  • Linux 6.17, Wine 11.0, RTX 4060 Laptop GPU / NVIDIA 590.48.1, 16 GiB host RAM, Rust 1.98.1, DXVK_CONFIG='dxgi.hideNvidiaGpu = False'.
  • Diagnostic vkd3d-proton 3.2.0 build 2576c0b4adfae4a+ (local console-vtable assertion relaxations; not stock-vkd3d certification).
  • Fresh intended-worktree provenance: Compiling victory-gpu v0.1.0 (.../VIctory-pr3484/crates/victory-gpu).
  • cargo test -p victory-gpu --lib 'bindless::' -- --nocapture --test-threads=1: 5 passed, 0 failed, 0 ignored in 0.70 s.
  • The physical NVIDIA adapter opened. Both new regressions passed: cached_dirty_bit_reuploads_after_write_and_after_evict_recreate and untracked_bindless_texture_reuploads_on_memory_change, alongside the existing heap-view/range cases.

Evidence: local log .compat-runtime/logs/verify-pr3484-wine-bindless.log.

This verifies the changed bindless ownership/dirty-tracking behavior on Wine/RTX 4060. I did not run the release microbenchmark or a matched title loading trace, so this result does not independently establish the reported speedup or full-title frame-time impact.

**@⁠pickles976** on GitHub · 2026-11-27 14:42 UTC · [original](https://github.com/Marvisak/VIctory/pull/3484#issuecomment-7221121688) Focused Wine/NVIDIA verification of exact head `74722f9cc302d1f0823726eef4e395cdee3cceae`: - Linux 6.17, Wine 11.0, RTX 4060 Laptop GPU / NVIDIA 590.48.1, 16 GiB host RAM, Rust 1.98.1, `DXVK_CONFIG='dxgi.hideNvidiaGpu = False'`. - Diagnostic vkd3d-proton 3.2.0 build `2576c0b4adfae4a+` (local console-vtable assertion relaxations; not stock-vkd3d certification). - Fresh intended-worktree provenance: `Compiling victory-gpu v0.1.0 (.../VIctory-pr3484/crates/victory-gpu)`. - `cargo test -p victory-gpu --lib 'bindless::' -- --nocapture --test-threads=1`: **5 passed, 0 failed, 0 ignored** in 0.70 s. - The physical NVIDIA adapter opened. Both new regressions passed: `cached_dirty_bit_reuploads_after_write_and_after_evict_recreate` and `untracked_bindless_texture_reuploads_on_memory_change`, alongside the existing heap-view/range cases. Evidence: local log `.compat-runtime/logs/verify-pr3484-wine-bindless.log`. This verifies the changed bindless ownership/dirty-tracking behavior on Wine/RTX 4060. I did not run the release microbenchmark or a matched title loading trace, so this result does not independently establish the reported speedup or full-title frame-time impact.
Author
Owner

@⁠pickles976 on GitHub · 2026-11-27 15:28 UTC · original

Local matched upload-preparation benchmark now corroborates the clean/sparse-write fast path on Wine 11 / Linux 6.17 / i7-13620H / 16 GiB / RTX 4060 Laptop 8 GiB, NVIDIA 590.48.1. Exact production base 63bcca43c6a00a758510398fa43096ce7e4f7df0 versus head 74722f9cc302d1f0823726eef4e395cdee3cceae, identical temporary ignored benchmark on both. Fresh intended-worktree release builds (including local dependency roots), vendor masking disabled, diagnostic-relaxed vkd3d 2576c0b4adfae4a+; not stock certification.

2,048 tracked 64x64 RGBA8 textures, 512 stamped active. After initial preparation and clean warm-up, 21 samples of 24 bindless::uploads preparations for each dirty count. Dirty texture bytes change on every preparation; fixture checks list presence and exact upload-count increments. Timing includes CPU writes/VEH, preparation and dropping the upload holder. Real host resources, but the recorded upload lists are not submitted: this measures CPU preparation, not GPU upload completion, rendered frame time or a retail loading sequence. Same current title/shader cache was not involved.

Dirty textures per preparation Base median us / 24 calls Head median us / 24 calls Base range us Head range us
0 6704.0 99.4 6682.9–7049.7 97.8–141.0
1 7205.2 456.0 7086.2–7478.4 449.3–554.0
16 27639.0 16530.3 18869.3–48686.0 12864.6–38448.6

Clean/single-dirty medians fall 98.5%/93.7%, with non-overlapping sample ranges. The 16-dirty ranges overlap widely; do not interpret its median alone as a stable speedup. One base→head process pair, no title A/B. Both fixtures passed 1/1 with no skips. Across these two guarded commands, GPU peak310 MiB, minimum availableRAM11552.6 MiB, disk minimum14.464 GiB; 9 GiB/512 MiB scope/global guards unchanged.

The first draft benchmark rewrote the same byte on repeated calls yet asserted every call must upload; the base correctly skipped an unchanged hash and that harness failed. Changed the stimulus to distinct bytes before the matched passing pair; not a PR defect.

Evidence .compat-runtime/logs/verify-VIctory-pr3484-bench-base-bindless-bench-changing-20261127T152635Z/ and verify-VIctory-pr3484-bindless-bench-changing-20261127T152711Z/. Temporary includes removed after measuring; exact local fixture archived as bindless-bench-source.txt for reproduction. Together with the preceding 5/5 functional bindless checks, this supports the optimization mechanism locally. It does not establish that our loading stutter is fixed or clear the unrelated Wave64/BVH title-promotion blockers.

**@⁠pickles976** on GitHub · 2026-11-27 15:28 UTC · [original](https://github.com/Marvisak/VIctory/pull/3484#issuecomment-7222102430) Local matched upload-preparation benchmark now corroborates the clean/sparse-write fast path on Wine 11 / Linux 6.17 / i7-13620H / 16 GiB / RTX 4060 Laptop 8 GiB, NVIDIA 590.48.1. Exact production base `63bcca43c6a00a758510398fa43096ce7e4f7df0` versus head `74722f9cc302d1f0823726eef4e395cdee3cceae`, identical temporary ignored benchmark on both. Fresh intended-worktree release builds (including local dependency roots), vendor masking disabled, diagnostic-relaxed vkd3d `2576c0b4adfae4a+`; not stock certification. 2,048 tracked 64x64 RGBA8 textures, 512 stamped active. After initial preparation and clean warm-up, 21 samples of 24 `bindless::uploads` preparations for each dirty count. Dirty texture bytes change on every preparation; fixture checks list presence and exact upload-count increments. Timing includes CPU writes/VEH, preparation and dropping the upload holder. Real host resources, but the recorded upload lists are not submitted: this measures CPU preparation, not GPU upload completion, rendered frame time or a retail loading sequence. Same current title/shader cache was not involved. | Dirty textures per preparation | Base median us / 24 calls | Head median us / 24 calls | Base range us | Head range us | |---|---:|---:|---:|---:| | 0 | 6704.0 | 99.4 | 6682.9–7049.7 | 97.8–141.0 | | 1 | 7205.2 | 456.0 | 7086.2–7478.4 | 449.3–554.0 | | 16 | 27639.0 | 16530.3 | 18869.3–48686.0 | 12864.6–38448.6 | Clean/single-dirty medians fall 98.5%/93.7%, with non-overlapping sample ranges. The 16-dirty ranges overlap widely; do not interpret its median alone as a stable speedup. One base→head process pair, no title A/B. Both fixtures passed 1/1 with no skips. Across these two guarded commands, GPU peak310 MiB, minimum availableRAM11552.6 MiB, disk minimum14.464 GiB; 9 GiB/512 MiB scope/global guards unchanged. The first draft benchmark rewrote the same byte on repeated calls yet asserted every call must upload; the base correctly skipped an unchanged hash and that harness failed. Changed the stimulus to distinct bytes before the matched passing pair; not a PR defect. Evidence `.compat-runtime/logs/verify-VIctory-pr3484-bench-base-bindless-bench-changing-20261127T152635Z/` and `verify-VIctory-pr3484-bindless-bench-changing-20261127T152711Z/`. Temporary includes removed after measuring; exact local fixture archived as `bindless-bench-source.txt` for reproduction. Together with the preceding 5/5 functional bindless checks, this supports the optimization mechanism locally. It does not establish that our loading stutter is fixed or clear the unrelated Wave64/BVH title-promotion blockers.
Author
Owner

@⁠pickles976 on GitHub · 2026-11-27 15:50 UTC · original

Early-loading follow-through on the same exact production refs: base 63bcca43c6a00a758510398fa43096ce7e4f7df0 versus #3484 74722f9cc302d1f0823726eef4e395cdee3cceae. Fresh diagnostics release builds (43.95/42.37s); no engine source probes or shader-backend substitutions. Same Linux6.17/Wine11/i7-13620H/16GiB/RTX4060Laptop8GiB/NVIDIA590.48.1 and diagnostic-relaxed vkd3d 2576c0b4adfae4a+, vendor unmasked; not stock certification.

One base→head pair, 60s each. Each gets a fresh copy of the identical saved cache/data/vkd3d-cache seed, using a temporary lab-launcher path override; original live state is untouched and the launcher is restored afterwards. Both visibly show the account picker, one focus-checked live A at ~29s advances to the six-star intro, and the 35s/55s observations show the same intro/loading-art stages. No scene or gameplay. No shader approximation or guard changes.

Existing VICTORY_LOG=info,victory_gpu::frame=debug timestamps measure CPU intervals after Present returns, not GPU-completed/displayed frame times; existing code ignores Present's HRESULT. Preselected comparison window: 5–25s after the live input call begins; nearest-rank percentiles, no token gaps.

Metric Base #3484
Intervals 592 594
Median ms 33.360 33.320
p95 ms 36.120 36.334
p99 ms 40.740 58.724
Maximum ms 80.819 105.170
Intervals >50ms 2 6
Intervals >100ms 0 1

This pair does not demonstrate a tail-latency improvement attributable to #3484; one pair with uncontrolled OS/driver warmth is also insufficient to establish a regression. The local user watching the latest run independently reports a “buttery smooth splash screen” and “a little bit of stutter during loading, but significantly less.” Record that observed improvement separately: its comparison baseline was not specified, and the narrow controlled pair does not isolate its cause. The earlier preparation microbenchmark still establishes the clean/sparse-write CPU saving.

Both stopped at the 60s wall limit/137, not a resource cutoff. Base/head minimum available RAM4547.7/4653.8MiB, GPUpeak3341/3337MiB, scopepeak5643.2/6019.5MiB, diskminimum13.924/13.720GiB. Starting availableRAM11915.7/12207.7MiB. Both scopes inactive/success; queried kernel intervals empty. Requested mode1920x1080/window1280x720, actual swapchain3840x2160; native FFX context reports1280x720→1920x1080. These loading observations do not certify gameplay resolution or frame rate.

Evidence .compat-runtime/logs/loading3484-20261127T154000Z/{cadence-summary.json,hitch-times.json,rendering-configuration.json}, guard prefixes 20261127T154507Z and 20261127T154702Z, exact binary hashes/build logs/input timestamps retained. Screenshots remain local. The preliminary namespace-isolation attempt never launched Wine (nested namespace denied); corrected launcher-path isolation then passed a separate20s startup before this pair. No additional loading retry is justified by these results alone; later-loading/display-pacing attribution still needs a shader-cleared runtime and a consumer-visible timing capture.

**@⁠pickles976** on GitHub · 2026-11-27 15:50 UTC · [original](https://github.com/Marvisak/VIctory/pull/3484#issuecomment-7222551095) Early-loading follow-through on the same exact production refs: base `63bcca43c6a00a758510398fa43096ce7e4f7df0` versus #3484 `74722f9cc302d1f0823726eef4e395cdee3cceae`. Fresh diagnostics release builds (43.95/42.37s); no engine source probes or shader-backend substitutions. Same Linux6.17/Wine11/i7-13620H/16GiB/RTX4060Laptop8GiB/NVIDIA590.48.1 and diagnostic-relaxed vkd3d `2576c0b4adfae4a+`, vendor unmasked; not stock certification. One base→head pair, 60s each. Each gets a fresh copy of the identical saved cache/data/vkd3d-cache seed, using a temporary lab-launcher path override; original live state is untouched and the launcher is restored afterwards. Both visibly show the account picker, one focus-checked live A at ~29s advances to the six-star intro, and the 35s/55s observations show the same intro/loading-art stages. No scene or gameplay. No shader approximation or guard changes. Existing `VICTORY_LOG=info,victory_gpu::frame=debug` timestamps measure CPU intervals **after `Present` returns**, not GPU-completed/displayed frame times; existing code ignores Present's HRESULT. Preselected comparison window: 5–25s after the live input call begins; nearest-rank percentiles, no token gaps. | Metric | Base | #3484 | |---|---:|---:| | Intervals | 592 | 594 | | Median ms | 33.360 | 33.320 | | p95 ms | 36.120 | 36.334 | | p99 ms | 40.740 | 58.724 | | Maximum ms | 80.819 | 105.170 | | Intervals >50ms | 2 | 6 | | Intervals >100ms | 0 | 1 | This pair does **not** demonstrate a tail-latency improvement attributable to #3484; one pair with uncontrolled OS/driver warmth is also insufficient to establish a regression. The local user watching the latest run independently reports a “buttery smooth splash screen” and “a little bit of stutter during loading, but significantly less.” Record that observed improvement separately: its comparison baseline was not specified, and the narrow controlled pair does not isolate its cause. The earlier preparation microbenchmark still establishes the clean/sparse-write CPU saving. Both stopped at the 60s wall limit/137, not a resource cutoff. Base/head minimum available RAM4547.7/4653.8MiB, GPUpeak3341/3337MiB, scopepeak5643.2/6019.5MiB, diskminimum13.924/13.720GiB. Starting availableRAM11915.7/12207.7MiB. Both scopes inactive/success; queried kernel intervals empty. Requested mode1920x1080/window1280x720, actual swapchain3840x2160; native FFX context reports1280x720→1920x1080. These loading observations do not certify gameplay resolution or frame rate. Evidence `.compat-runtime/logs/loading3484-20261127T154000Z/{cadence-summary.json,hitch-times.json,rendering-configuration.json}`, guard prefixes `20261127T154507Z` and `20261127T154702Z`, exact binary hashes/build logs/input timestamps retained. Screenshots remain local. The preliminary namespace-isolation attempt never launched Wine (nested namespace denied); corrected launcher-path isolation then passed a separate20s startup before this pair. No additional loading retry is justified by these results alone; later-loading/display-pacing attribution still needs a shader-cleared runtime and a consumer-visible timing capture.
This pull request can be merged automatically.
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/3484/head:github-bot/gh-3484'
git switch 'github-bot/gh-3484'

Merge

Merge the changes and update on Forgejo.
git switch 'main'
git merge --no-ff 'github-bot/gh-3484'
git switch 'github-bot/gh-3484'
git rebase 'main'
git switch 'main'
git merge --ff-only 'github-bot/gh-3484'
git switch 'github-bot/gh-3484'
git rebase 'main'
git switch 'main'
git merge --no-ff 'github-bot/gh-3484'
git switch 'main'
git merge --squash 'github-bot/gh-3484'
git switch 'main'
git merge --ff-only 'github-bot/gh-3484'
git switch 'main'
git merge 'github-bot/gh-3484'
git push origin 'main'
This discussion has been locked. Commenting is limited to contributors.
No reviewers
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.

Dependencies

No dependencies set

Reference
github/Marvisak--VIctory!3484
No description provided.