GPU: a changed heap slot's view census costs ~25% less of its mirror (#3425) #3522

Open
KainanP wants to merge 1 commit from upstream-pr/3522 into main
KainanP commented 2026-11-27 13:37:52 +00:00 (Migrated from github.com)

Imported from Marvisak/VIctory. Originally posted by KainanP on 2026-11-27T13:37:52Z.


Part of #3425, the "Descriptor heap mirroring (384k slots), 18.1 ms, HostHeap::sync_slots" row.

Where a changed slot's ~1 µs goes

I timed each step of HostHeap::mirror (serialized rdtsc, temporary, not in this PR) in the sync_slots_bench shape from my #3425 comment: 393k slots a frame, ~9.5k changed, 1/8 null views, 1/8 constant buffers, 6/8 placed buffer views. That's the "other" mix #3233 measured in the world, where 68 % of the views made are constant buffers and memory views. Per changed slot on main, RTX 4060 Laptop:

step ns
bindless::Viewed::set (the census of what slots view) ~480-690
of which the slot HashMap insert/remove ~290
of which counting the old range out (BTreeMap entry + remove, tallies, hull rebuilt with an Arc clone) ~360 (non-serialized)
make (buffer_srv) ~310
of which CreateShaderResourceView ~100-140
keep (+ host::retire of the old resource) ~100
made/VIEWS locks and view_at ~60-100
prepare ~50
stride/address/mark tables ~35

The driver call is only about 10 % of the cost. A host-descriptor cache that turns Create*View into CopyDescriptorsSimple would save at most ~100 ns of the ~1 µs. The largest single cost is the census bookkeeping.

Change

  • Viewed.slots: a HashMap<u32, Seen> holding the heap's ~600k-1M slots (2^20-2^21 buckets) is replaced by pages of 1024 entries indexed by slot, created when a slot in them is first set. That is one memory access instead of hash probes that miss the cache, and it uses less memory once a heap is mostly set (32 B per slot vs ~37 B per bucket at 2x capacity).
  • Inner::count:
    • Range counts are a HashMap. Their order was only read by the diagnostics census, which now sorts before dedup.
    • Counts and start/end tallies take one lookup each (entry API instead of entry + remove).
    • The new view is counted before the old one goes, so a slot rewritten with the same range never drops to 0 and does no hull work.
    • A copy's hull is updated in place instead of being rebuilt with an Arc clone. The key's copy is the same object while ends holds it.
  • HostHeap::keep: when the slot gets a view of the resource it already holds, the old reference is not retired. Most buffer views sit on a few host copies. The slot still holds the resource, and any later change retires it as before, so it is freed only after the submissions in flight have run. This drops the RETIRED lock and one extra reference per slot until the next submission.

There is no change in what is made. The census's hulls, ranges and textures are identical.

Bench

sync_slots_bench from bench/sync-slots (f233390e), base = main 63bcca4. I ran 7 interleaved runs per tree, 20 frames each, and report medians with [min-max] across runs. RTX 4060 Laptop, Windows. The measured tree is bench/mirror-fix, whose code is this PR's before rustfmt.

changed slots/frame title threads main this PR title wait/frame
0 0 1.86 ms [1.60-2.10] 1.87 ms [1.57-2.08] ×1.01
0 5 1.88 ms [1.78-2.20] 1.92 ms [1.84-2.61] ×1.02 9.8 → 10.1 ms
~9.5k 0 10.82 ms [10.25-15.15] 8.50 ms [7.72-8.83] ×0.79
~9.5k 5 10.52 ms [10.06-14.55] 9.01 ms [8.45-9.89] ×0.86 53.8 → 45.2 ms
~85k 0 86.3 ms [69.8-106.2] 50.8 ms [46.6-56.5] ×0.59
~85k 5 94.3 ms [70.0-113.9] 67.2 ms [46.8-75.7] ×0.71 450 → 327 ms
  • A changed slot's mirror drops from ~0.94 µs to ~0.70 µs (−25 %). With more changed slots the gain grows (×0.59), because the old slot map's misses get worse as it fills.
  • Scanning unchanged slots is unchanged.
  • All 42 runs: 0 slots lost after a sync, 0 stale at the end. The bench checks every changed slot after each sync and every slot at the end.

Share of the in-game 18.1 ms row: roughly 3 ms of the 18.1 ms is the scan, so if the other ~15 ms is changed-slot mirrors like these, this should take off about 3-4 ms (~20 %). The same mirror also runs for descriptor copies with new records (borosf's "heap slots the title copied" row) and for draws' make_read. @neonbyte1 (or anyone with the world loaded), could you A/B the frame line's heap sync on main vs this branch?

Tests

  • New: bindless::tests::slots_keep_what_each_index_sees covers set, replace, clear and retain across page boundaries, including a far slot that doesn't create the pages before it.
  • Extended: hulls_follow_the_ranges now also covers a slot rewritten with its own range, a range inside the hull, ranges sharing a start, the first start going and the far end going.
  • New: descriptor::host::tests::a_slot_made_again_on_its_resource_retires_nothing. It fails on main ("the same buffer again": 1 retire instead of 0) and checks that a view of another buffer and a null view still retire the old one.
  • cargo test -p victory-gpu --lib, results identical to main:
    • RTX 4060: 231 passed. The only failures are main's known dynamic_slots_are_held_until_released and lists_share_a_table_and_copies_keep_their_views; I skipped heap_direct_texture_reads_mark_their_heap_index, which crashes on main.
    • Intel UHD (local adapter hook): 230 passed. Same three failures as main with the hook (3/3 runs on main too): the two above plus a_texture_written_in_one_format_reads_in_another_through_a_placed_view.
    • WARP (--features diagnostics, VICTORY_D3D12_WARP=1): 248 passed, 0 failed.
  • cargo clippy -p victory-gpu --all-targets -D warnings, default and --all-features: clean. cargo xtask policy: ok. rustfmt applied to the changed lines only.

Overlaps

  • It merges cleanly with #3139, #3265, #2821, #3233, #3234, #3215 and #3288.
  • Small textual conflicts in Viewed::set with #3055 (set_with/set_batch) and #3213 (liveness re-check), and in descriptor::host::tests with #2895. Each resolves by keeping both sides, with Inner::put replacing the remove/insert pair. I'm happy to rebase on whichever lands first.

AI use: profiled, written, tested and benchmarked with Claude Code (Claude Opus 5.5).

🤖 Generated with Claude Code

<!-- greyfinch-sync:Marvisak/VIctory:issue:5527572935 --> Imported from [Marvisak/VIctory](https://github.com/Marvisak/VIctory/pull/3522). Originally posted by [KainanP](https://github.com/KainanP) on 2026-11-27T13:37:52Z. --- Part of #3425, the "Descriptor heap mirroring (384k slots), 18.1 ms, `HostHeap::sync_slots`" row. ## Where a changed slot's ~1 µs goes I timed each step of `HostHeap::mirror` (serialized `rdtsc`, temporary, not in this PR) in the `sync_slots_bench` shape from my [#3425 comment](https://github.com/Marvisak/VIctory/issues/3425#issuecomment-7219063899): 393k slots a frame, ~9.5k changed, 1/8 null views, 1/8 constant buffers, 6/8 placed buffer views. That's the "other" mix #3233 measured in the world, where 68 % of the views made are constant buffers and memory views. Per changed slot on `main`, RTX 4060 Laptop: | step | ns | |---|---| | `bindless::Viewed::set` (the census of what slots view) | **~480-690** | | of which the slot `HashMap` insert/remove | ~290 | | of which counting the old range out (`BTreeMap` entry + remove, tallies, hull rebuilt with an `Arc` clone) | ~360 (non-serialized) | | `make` (`buffer_srv`) | ~310 | | of which `CreateShaderResourceView` | ~100-140 | | `keep` (+ `host::retire` of the old resource) | ~100 | | made/`VIEWS` locks and `view_at` | ~60-100 | | `prepare` | ~50 | | stride/address/mark tables | ~35 | The driver call is only about 10 % of the cost. A host-descriptor cache that turns `Create*View` into `CopyDescriptorsSimple` would save at most ~100 ns of the ~1 µs. The largest single cost is the census bookkeeping. ## Change - **`Viewed.slots`**: a `HashMap<u32, Seen>` holding the heap's ~600k-1M slots (2^20-2^21 buckets) is replaced by pages of 1024 entries indexed by slot, created when a slot in them is first set. That is one memory access instead of hash probes that miss the cache, and it uses less memory once a heap is mostly set (32 B per slot vs ~37 B per bucket at 2x capacity). - **`Inner::count`**: - Range counts are a `HashMap`. Their order was only read by the `diagnostics` census, which now sorts before `dedup`. - Counts and start/end tallies take one lookup each (entry API instead of entry + remove). - The new view is counted before the old one goes, so a slot rewritten with the same range never drops to 0 and does no hull work. - A copy's hull is updated in place instead of being rebuilt with an `Arc` clone. The key's copy is the same object while `ends` holds it. - **`HostHeap::keep`**: when the slot gets a view of the resource it already holds, the old reference is not retired. Most buffer views sit on a few host copies. The slot still holds the resource, and any later change retires it as before, so it is freed only after the submissions in flight have run. This drops the `RETIRED` lock and one extra reference per slot until the next submission. There is no change in what is made. The census's hulls, ranges and textures are identical. ## Bench `sync_slots_bench` from [`bench/sync-slots`](https://github.com/KainanP/VIctory/commits/bench/sync-slots) (`f233390e`), base = `main` `63bcca4`. I ran 7 interleaved runs per tree, 20 frames each, and report medians with [min-max] across runs. RTX 4060 Laptop, Windows. The measured tree is [`bench/mirror-fix`](https://github.com/KainanP/VIctory/commits/bench/mirror-fix), whose code is this PR's before rustfmt. | changed slots/frame | title threads | `main` | this PR | | title wait/frame | |---|---|---|---|---|---| | 0 | 0 | 1.86 ms [1.60-2.10] | 1.87 ms [1.57-2.08] | ×1.01 | | | 0 | 5 | 1.88 ms [1.78-2.20] | 1.92 ms [1.84-2.61] | ×1.02 | 9.8 → 10.1 ms | | ~9.5k | 0 | 10.82 ms [10.25-15.15] | **8.50 ms** [7.72-8.83] | **×0.79** | | | ~9.5k | 5 | 10.52 ms [10.06-14.55] | **9.01 ms** [8.45-9.89] | **×0.86** | 53.8 → 45.2 ms | | ~85k | 0 | 86.3 ms [69.8-106.2] | **50.8 ms** [46.6-56.5] | **×0.59** | | | ~85k | 5 | 94.3 ms [70.0-113.9] | **67.2 ms** [46.8-75.7] | **×0.71** | 450 → 327 ms | - A changed slot's mirror drops from ~0.94 µs to ~0.70 µs (−25 %). With more changed slots the gain grows (×0.59), because the old slot map's misses get worse as it fills. - Scanning unchanged slots is unchanged. - All 42 runs: 0 slots lost after a sync, 0 stale at the end. The bench checks every changed slot after each sync and every slot at the end. **Share of the in-game 18.1 ms row:** roughly 3 ms of the 18.1 ms is the scan, so if the other ~15 ms is changed-slot mirrors like these, this should take off about 3-4 ms (~20 %). The same `mirror` also runs for descriptor copies with new records (borosf's "heap slots the title copied" row) and for draws' `make_read`. **@neonbyte1** (or anyone with the world loaded), could you A/B the frame line's heap sync on `main` vs this branch? ## Tests - New: `bindless::tests::slots_keep_what_each_index_sees` covers set, replace, clear and retain across page boundaries, including a far slot that doesn't create the pages before it. - Extended: `hulls_follow_the_ranges` now also covers a slot rewritten with its own range, a range inside the hull, ranges sharing a start, the first start going and the far end going. - New: `descriptor::host::tests::a_slot_made_again_on_its_resource_retires_nothing`. It **fails on `main`** ("the same buffer again": 1 retire instead of 0) and checks that a view of another buffer and a null view still retire the old one. - `cargo test -p victory-gpu --lib`, results identical to `main`: - RTX 4060: 231 passed. The only failures are `main`'s known `dynamic_slots_are_held_until_released` and `lists_share_a_table_and_copies_keep_their_views`; I skipped `heap_direct_texture_reads_mark_their_heap_index`, which crashes on `main`. - Intel UHD (local adapter hook): 230 passed. Same three failures as `main` with the hook (3/3 runs on `main` too): the two above plus `a_texture_written_in_one_format_reads_in_another_through_a_placed_view`. - WARP (`--features diagnostics`, `VICTORY_D3D12_WARP=1`): 248 passed, 0 failed. - `cargo clippy -p victory-gpu --all-targets -D warnings`, default and `--all-features`: clean. `cargo xtask policy`: ok. rustfmt applied to the changed lines only. ## Overlaps - It merges cleanly with #3139, #3265, #2821, #3233, #3234, #3215 and #3288. - Small textual conflicts in `Viewed::set` with #3055 (`set_with`/`set_batch`) and #3213 (liveness re-check), and in `descriptor::host::tests` with #2895. Each resolves by keeping both sides, with `Inner::put` replacing the remove/insert pair. I'm happy to rebase on whichever lands first. _AI use: profiled, written, tested and benchmarked with Claude Code (Claude Opus 5.5)._ 🤖 Generated with [Claude Code](https://claude.com/claude-code)
oni-swr commented 2026-11-27 14:17:17 +00:00 (Migrated from github.com)

Imported from Marvisak/VIctory. Originally posted by oni-swr on 2026-11-27T14:17:17Z.


Independent verification of babd4873 (base 63bcca4), claimed in #1633. WARP + CPU only.

Environment: AMD Ryzen 7 5700X3D (8C/16T), Windows 11 25H2 build 10.0.26200.9974, rustc/cargo 1.98.1, VICTORY_WARP=1 + VICTORY_D3D12_WARP=1, --features diagnostics, system WARP d3d10warp.dll 10.0.26100.9818. No physical GPU. The machine was shared with other verification builds, so absolute times are noisy; the runs were interleaved base/head.

Trees: base = 63bcca4; head = babd4873. Both plus KainanP's bench commits f34bcfb + f233390 (cherry-picked; they only add #[ignore]d tests and a 1-line change).

Tests (cargo test -p victory-gpu --lib --features diagnostics -- bindless descriptor --test-threads=1):

  • base: 26 passed, 0 failed, 3 ignored (the benches).
  • head: 28 passed, 0 failed, 3 ignored. The two extra are the PR's new bindless::tests::slots_keep_what_each_index_sees and descriptor::host::tests::a_slot_made_again_on_its_resource_retires_nothing; hulls_follow_the_ranges (extended) passes. I did not re-run the "fails on main" claim for the retire test, and did not run the whole victory-gpu lib.

Bench (sync_slots_bench, --release, 7 interleaved runs per tree, 20 frames each, WARP device). ns per changed slot = (median frame − the same run's 0-changed median) / changed slots; median over the 7 runs:

changed/frame title threads base head head/base
~9.5k 0 4230 ns (frame 42.0 ms) 3718 ns (37.6 ms) x0.88
~9.5k 5 4149 ns (42.8 ms) 3860 ns (39.0 ms) x0.93
~85k 0 3901 ns (334 ms) 3506 ns (301 ms) x0.90
~85k 5 3937 ns (338 ms) 3519 ns (302 ms) x0.89
0 0 / 5 2.0 / 3.0 ms 2.1 / 2.2 ms within noise

Ranges across runs do not overlap in the 0-thread rows (9.5k: base 40.5-43.6 ms, head 37.0-42.1 ms). 0 slots lost / 0 stale in all 14 runs. Saving is about 0.4-0.5 us per changed slot, which matches the PR's ~0.24 us absolute saving per slot up to the larger per-view cost here: on WARP CreateShaderResourceView is a software call, so the whole slot costs ~4 us and the census saving is a ~10% share, not 25%. It says the direction holds on a second CPU; it does not confirm the 25% on a hardware driver.

Diff read (bindless.rs, host.rs): no correctness problem found.

  • put counts the new view in before the old one out. Final counts are identical to remove-then-add; a same-range rewrite no longer hits 0, so no hull work. Different ranges are unaffected.
  • count: the single-lookup entry paths match the old behaviour: a decrement of a missing range is a no-op (old: saturating_sub on a fresh 0), tally never underflows because entries are removed at 0. The hull is rebuilt only when a range comes or goes, as before.
  • In-place hull update keeps the old Arc; safe because the key is the copy's pointer and ends holds that Arc while any range for it exists; the hull and ends entries are removed together. dirty_bit is still refreshed.
  • HashMap ranges: order was only used by diagnostics; it now sorts before dedup (needed, and done).
  • Slots: pages of 1024; retain does not count ranges down, same as the old retain on textures. Notes only: a page is never freed once created, and a bogus huge slot index would size the page vector by index/1024 (heap indices are bounded, so fine).
  • keep: skipping the retire when the slot's new resource is the same object is safe: the slot still holds it, and its later replacement retires it after submissions in flight at that time.

AI-assisted: Claude Code, Claude Sonnet 5.5.

<!-- greyfinch-sync:Marvisak/VIctory:comment:7220591097 --> Imported from [Marvisak/VIctory](https://github.com/Marvisak/VIctory/pull/3522#issuecomment-7220591097). Originally posted by [oni-swr](https://github.com/oni-swr) on 2026-11-27T14:17:17Z. --- Independent verification of babd4873 (base 63bcca4), claimed in #1633. WARP + CPU only. **Environment:** AMD Ryzen 7 5700X3D (8C/16T), Windows 11 25H2 build 10.0.26200.9974, rustc/cargo 1.98.1, `VICTORY_WARP=1` + `VICTORY_D3D12_WARP=1`, `--features diagnostics`, system WARP `d3d10warp.dll` 10.0.26100.9818. No physical GPU. The machine was shared with other verification builds, so absolute times are noisy; the runs were interleaved base/head. **Trees:** base = `63bcca4`; head = `babd4873`. Both plus KainanP's bench commits `f34bcfb` + `f233390` (cherry-picked; they only add `#[ignore]`d tests and a 1-line change). **Tests** (`cargo test -p victory-gpu --lib --features diagnostics -- bindless descriptor --test-threads=1`): - base: 26 passed, 0 failed, 3 ignored (the benches). - head: 28 passed, 0 failed, 3 ignored. The two extra are the PR's new `bindless::tests::slots_keep_what_each_index_sees` and `descriptor::host::tests::a_slot_made_again_on_its_resource_retires_nothing`; `hulls_follow_the_ranges` (extended) passes. I did not re-run the "fails on main" claim for the retire test, and did not run the whole `victory-gpu` lib. **Bench** (`sync_slots_bench`, `--release`, 7 interleaved runs per tree, 20 frames each, WARP device). ns per changed slot = (median frame − the same run's 0-changed median) / changed slots; median over the 7 runs: | changed/frame | title threads | base | head | head/base | |---|---|---|---|---| | ~9.5k | 0 | 4230 ns (frame 42.0 ms) | 3718 ns (37.6 ms) | x0.88 | | ~9.5k | 5 | 4149 ns (42.8 ms) | 3860 ns (39.0 ms) | x0.93 | | ~85k | 0 | 3901 ns (334 ms) | 3506 ns (301 ms) | x0.90 | | ~85k | 5 | 3937 ns (338 ms) | 3519 ns (302 ms) | x0.89 | | 0 | 0 / 5 | 2.0 / 3.0 ms | 2.1 / 2.2 ms | within noise | Ranges across runs do not overlap in the 0-thread rows (9.5k: base 40.5-43.6 ms, head 37.0-42.1 ms). 0 slots lost / 0 stale in all 14 runs. Saving is about 0.4-0.5 us per changed slot, which matches the PR's ~0.24 us absolute saving per slot up to the larger per-view cost here: on WARP `CreateShaderResourceView` is a software call, so the whole slot costs ~4 us and the census saving is a ~10% share, not 25%. It says the direction holds on a second CPU; it does not confirm the 25% on a hardware driver. **Diff read (bindless.rs, host.rs):** no correctness problem found. - `put` counts the new view in before the old one out. Final counts are identical to remove-then-add; a same-range rewrite no longer hits 0, so no hull work. Different ranges are unaffected. - `count`: the single-lookup entry paths match the old behaviour: a decrement of a missing range is a no-op (old: `saturating_sub` on a fresh 0), `tally` never underflows because entries are removed at 0. The hull is rebuilt only when a range comes or goes, as before. - In-place hull update keeps the old `Arc`; safe because the key is the copy's pointer and `ends` holds that Arc while any range for it exists; the hull and `ends` entries are removed together. `dirty_bit` is still refreshed. - `HashMap` ranges: order was only used by `diagnostics`; it now sorts before `dedup` (needed, and done). - `Slots`: pages of 1024; `retain` does not count ranges down, same as the old `retain` on textures. Notes only: a page is never freed once created, and a bogus huge slot index would size the page vector by `index/1024` (heap indices are bounded, so fine). - `keep`: skipping the retire when the slot's new resource is the same object is safe: the slot still holds it, and its later replacement retires it after submissions in flight at that time. AI-assisted: Claude Code, Claude Sonnet 5.5.
neonbyte1 commented 2026-11-27 14:18:53 +00:00 (Migrated from github.com)

Imported from Marvisak/VIctory. Originally posted by neonbyte1 on 2026-11-27T14:18:53Z.


@KainanP yes, happy to. I'm merging it onto our test stack now (it carries a few heap-sync changes of its own in descriptor/host.rs: the sync holds the heaps' lock a chunk of pages at a time, stops at the host heap's count (#3512), and skips the view lookup for unchanged slots), and it'll get an in-game A/B against an adjacent control, judged on the frame line's heap-sync time and slot counts first and frame time second. Our GPU queue is booked for the next couple of hours, so expect the numbers later today; I'll post them here.

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

<!-- greyfinch-sync:Marvisak/VIctory:comment:7220625886 --> Imported from [Marvisak/VIctory](https://github.com/Marvisak/VIctory/pull/3522#issuecomment-7220625886). Originally posted by [neonbyte1](https://github.com/neonbyte1) on 2026-11-27T14:18:53Z. --- @KainanP yes, happy to. I'm merging it onto our test stack now (it carries a few heap-sync changes of its own in `descriptor/host.rs`: the sync holds the heaps' lock a chunk of pages at a time, stops at the host heap's count (#3512), and skips the view lookup for unchanged slots), and it'll get an in-game A/B against an adjacent control, judged on the frame line's heap-sync time and slot counts first and frame time second. Our GPU queue is booked for the next couple of hours, so expect the numbers later today; I'll post them here. _AI-assisted (Claude); measured on my machine, no game data shared._
pickles976 commented 2026-11-27 14:21:48 +00:00 (Migrated from github.com)

Imported from Marvisak/VIctory. Originally posted by pickles976 on 2026-11-27T14:21:48Z.


Physical Wine/NVIDIA correctness check of exact clean head babd487363e56203efae1b02850884c446271c2e (base 63bcca4). RTX 4060 Laptop 8 GiB, NVIDIA 590.48.1, Wine 11.0, vkd3d-proton diagnostic build 2576c0b4adfae4a+ (relaxed-vtable; not stock certification), Rust 1.98.1 MSVC target, dxgi.hideNvidiaGpu = False, one test thread.

Fresh intended-worktree compilation was confirmed (Compiling victory-gpu .../VIctory-pr3522/crates/victory-gpu, 9.31 s). Focused results:

  • bindless::tests::slots_keep_what_each_index_sees: 1/1 pass — page boundary, far sparse page, replace/retain/remove.
  • bindless::tests::hulls_follow_the_ranges: 1/1 pass — actual RTX/vkd3d device initialized; no skip line; same-range rewrite and start/end/inside hull transitions all completed.
  • descriptor::host::tests::a_slot_made_again_on_its_resource_retires_nothing: 1/1 pass — actual RTX/vkd3d device initialized; same resource was not retired, replacement and null each retired once.

Total focused result: 3 passed, 0 failed, 0 ignored. No source edits, no title launch. I did not port the new retirement fixture to the parent, run the full library, or benchmark this host, so this confirms the changed ownership/range behavior on physical Wine/NVIDIA but not the claimed 25%/frame-time saving or a RAM-floor improvement.

Evidence: .compat-runtime/logs/verify-pr3522-changed-slot-fixtures.log.

AI-assisted verification; review-only, no code contribution.

<!-- greyfinch-sync:Marvisak/VIctory:comment:7220687361 --> Imported from [Marvisak/VIctory](https://github.com/Marvisak/VIctory/pull/3522#issuecomment-7220687361). Originally posted by [pickles976](https://github.com/pickles976) on 2026-11-27T14:21:48Z. --- Physical Wine/NVIDIA correctness check of exact clean head `babd487363e56203efae1b02850884c446271c2e` (base `63bcca4`). RTX 4060 Laptop 8 GiB, NVIDIA 590.48.1, Wine 11.0, vkd3d-proton diagnostic build `2576c0b4adfae4a+` (relaxed-vtable; not stock certification), Rust 1.98.1 MSVC target, `dxgi.hideNvidiaGpu = False`, one test thread. Fresh intended-worktree compilation was confirmed (`Compiling victory-gpu .../VIctory-pr3522/crates/victory-gpu`, 9.31 s). Focused results: - `bindless::tests::slots_keep_what_each_index_sees`: **1/1 pass** — page boundary, far sparse page, replace/retain/remove. - `bindless::tests::hulls_follow_the_ranges`: **1/1 pass** — actual RTX/vkd3d device initialized; no skip line; same-range rewrite and start/end/inside hull transitions all completed. - `descriptor::host::tests::a_slot_made_again_on_its_resource_retires_nothing`: **1/1 pass** — actual RTX/vkd3d device initialized; same resource was not retired, replacement and null each retired once. Total focused result: **3 passed, 0 failed, 0 ignored**. No source edits, no title launch. I did not port the new retirement fixture to the parent, run the full library, or benchmark this host, so this confirms the changed ownership/range behavior on physical Wine/NVIDIA but not the claimed 25%/frame-time saving or a RAM-floor improvement. Evidence: `.compat-runtime/logs/verify-pr3522-changed-slot-fixtures.log`. AI-assisted verification; review-only, no code contribution.
oddmaniv commented 2026-11-27 15:39:24 +00:00 (Migrated from github.com)

Imported from Marvisak/VIctory. Originally posted by oddmaniv on 2026-11-27T15:39:24Z.


Independent verification of the PR author's concurrent WARP pipeline/draw test at babd487363e56203efae1b02850884c446271c2e.

cargo test --locked -p victory-shader --lib emit::host::tests::parallel_warp_pipelines_and_draws -- --exact --nocapture

Tree Result
Unmodified PR head 1 passed, 0 failed, 0 ignored; native exit 0
Unmodified main 1 passed, 0 failed, 0 ignored; native exit 0
PR patch applied to pinned main 1 passed, 0 failed, 0 ignored; native exit 0

Main baseline pin: 63bcca43c6a00a758510398fa43096ce7e4f7df0.

Windows x86_64 MSVC native runs. Local and remote source snapshots matched before and after each check. The adaptation applies the PR diff without additional source edits.
This is focused regression coverage, not the full workspace suite, a gameplay test, or an independent validation of every behavior in the PR. No new fix is claimed.

AI-assisted verification.

<!-- greyfinch-sync:Marvisak/VIctory:comment:7222322710 --> Imported from [Marvisak/VIctory](https://github.com/Marvisak/VIctory/pull/3522#issuecomment-7222322710). Originally posted by [oddmaniv](https://github.com/oddmaniv) on 2026-11-27T15:39:24Z. --- Independent verification of the PR author's concurrent WARP pipeline/draw test at `babd487363e56203efae1b02850884c446271c2e`. `cargo test --locked -p victory-shader --lib emit::host::tests::parallel_warp_pipelines_and_draws -- --exact --nocapture` | Tree | Result | | --- | --- | | Unmodified PR head | 1 passed, 0 failed, 0 ignored; native exit 0 | | Unmodified main | 1 passed, 0 failed, 0 ignored; native exit 0 | | PR patch applied to pinned main | 1 passed, 0 failed, 0 ignored; native exit 0 | Main baseline pin: `63bcca43c6a00a758510398fa43096ce7e4f7df0`. Windows x86_64 MSVC native runs. Local and remote source snapshots matched before and after each check. The adaptation applies the PR diff without additional source edits. This is focused regression coverage, not the full workspace suite, a gameplay test, or an independent validation of every behavior in the PR. No new fix is claimed. AI-assisted verification.
neonbyte1 commented 2026-11-27 20:28:49 +00:00 (Migrated from github.com)

Imported from Marvisak/VIctory. Originally posted by neonbyte1 on 2026-11-27T20:28:49Z.


@KainanP in-game result as promised. RTX 5090 (driver 620.73.04), Linux, GE-Proton11-14 Wine with its vkd3d-proton, GTA VI's prison yard, Series X profile at 2560×1440. Base: main plus the unmerged PRs this setup needs (listed in #3425), with our own heap-sync changes (stop at the host heap's count as in #3512; skip unchanged view lookups). This PR merged on top; adjacent 420 s runs, medians of the last 30 frame-rate lines:

frame min preparing heap sync (heap slots the title copied) title threads waiting to write views
control 203.0 ms 196.5 ms 77.0 ms 17.1 ms 79.7 ms
with #3522 202.8 ms 193.9 ms 76.1 ms 15.6 ms 75.7 ms

The heap sync is 1.5 ms cheaper, in the direction your benchmark predicts but smaller here, probably because our base already skips unchanged slots and stops at the host heap's count. The frame doesn't move outside run-to-run noise on this setup: preparing still runs serially with the GPU and copy-back, so a 1-2 ms saving is within the spread. No faults, pictures unchanged.

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

<!-- greyfinch-sync:Marvisak/VIctory:comment:7227545995 --> Imported from [Marvisak/VIctory](https://github.com/Marvisak/VIctory/pull/3522#issuecomment-7227545995). Originally posted by [neonbyte1](https://github.com/neonbyte1) on 2026-11-27T20:28:49Z. --- @KainanP in-game result as promised. RTX 5090 (driver 620.73.04), Linux, GE-Proton11-14 Wine with its vkd3d-proton, GTA VI's prison yard, Series X profile at 2560×1440. Base: `main` plus the unmerged PRs this setup needs (listed in #3425), with our own heap-sync changes (stop at the host heap's count as in #3512; skip unchanged view lookups). This PR merged on top; adjacent 420 s runs, medians of the last 30 frame-rate lines: | | frame | min | preparing | heap sync (`heap slots the title copied`) | title threads waiting to write views | |---|---|---|---|---|---| | control | 203.0 ms | 196.5 ms | 77.0 ms | 17.1 ms | 79.7 ms | | with #3522 | 202.8 ms | 193.9 ms | 76.1 ms | **15.6 ms** | 75.7 ms | The heap sync is 1.5 ms cheaper, in the direction your benchmark predicts but smaller here, probably because our base already skips unchanged slots and stops at the host heap's count. The frame doesn't move outside run-to-run noise on this setup: preparing still runs serially with the GPU and copy-back, so a 1-2 ms saving is within the spread. No faults, pictures unchanged. _AI-assisted (Claude); measured on my machine, no game data shared._
KainanP commented 2026-11-28 13:15:20 +00:00 (Migrated from github.com)

Imported from Marvisak/VIctory. Originally posted by KainanP on 2026-11-28T13:15:20Z.


@neonbyte1 thank you for the in-game run. Heap sync dropped from 17.1 to 15.6 ms, with the frame unchanged and no faults. That matches what I'd expect on a base that already skips unchanged slots and stops at the host heap's count: #3522 only trims the census per changed slot, so most of its effect is already covered by those two changes on your stack. I'll leave this PR as a small standalone saving for trees without them, and won't claim a frame-time win from it.

<!-- greyfinch-sync:Marvisak/VIctory:comment:7239804999 --> Imported from [Marvisak/VIctory](https://github.com/Marvisak/VIctory/pull/3522#issuecomment-7239804999). Originally posted by [KainanP](https://github.com/KainanP) on 2026-11-28T13:15:20Z. --- @neonbyte1 thank you for the in-game run. Heap sync dropped from 17.1 to 15.6 ms, with the frame unchanged and no faults. That matches what I'd expect on a base that already skips unchanged slots and stops at the host heap's count: #3522 only trims the census per changed slot, so most of its effect is already covered by those two changes on your stack. I'll leave this PR as a small standalone saving for trees without them, and won't claim a frame-time win from it.
zed6000 commented 2026-11-29 19:13:03 +00:00 (Migrated from github.com)

Imported from Marvisak/VIctory. Originally posted by zed6000 on 2026-11-29T19:13:03Z.


In-game A/B of this PR on an RX 7900 XTX (native Windows 11, AMD driver 32.0.32029.2010, Ryzen 9 7900X3D), from neonbyte1/VIctory#64.

  • Port: the PR doesn't merge onto the neonbyte1/VIctory integration tree (8d9b82fd9), whose bindless carries #2940's reverse index, so I ported it: zed6000/VIctory branch eval/64-3522-port, 97b8e41e1.
    • The paged Slots, the single-lookup counts, the in-place hull and the keep change are as here. keep also compares the title-memory copy, which that tree retires with the resource.
    • One difference: with the reverse index (a set of slots per texture), a slot rewritten with the texture it views returns early, since counting it in and out would drop it from the set.
  • Runs: prison yard, diag builds sharing one warm pipeline library, median of the last 10 report blocks, 2 runs with the port against 4 controls.
ms a frame controls with this PR
heap slots the title copied 54.2-56.6 47.9 / 41.9
per slot made (35,000 a frame) 1.53-1.61 µs 1.36 / 1.19 µs
title frame 367.1-379.3 365.4 / 357.9
title threads waiting to write views 252-268 256 / 238
  • Result: the sync falls by 13-24 % at the same slot count, and the frame by about 9 ms against the adjacent controls; both runs are below every control. The picture is unchanged at frame 1350.
  • Why it shows here: on this box the frame follows the holds on the heaps' lock (neonbyte1/VIctory#146), so a cheaper slot is what moves it.
  • Tests on that tree: bindless:: and descriptor:: pass, this PR's a_slot_made_again_on_its_resource_retires_nothing included.

AI-assisted (Claude), posted for zed6000; counts and times from VIctory's own report lines; no game data shared.

<!-- greyfinch-sync:Marvisak/VIctory:comment:7261102590 --> Imported from [Marvisak/VIctory](https://github.com/Marvisak/VIctory/pull/3522#issuecomment-7261102590). Originally posted by [zed6000](https://github.com/zed6000) on 2026-11-29T19:13:03Z. --- In-game A/B of this PR on an RX 7900 XTX (native Windows 11, AMD driver 32.0.32029.2010, Ryzen 9 7900X3D), from neonbyte1/VIctory#64. - **Port:** the PR doesn't merge onto the neonbyte1/VIctory integration tree (`8d9b82fd9`), whose `bindless` carries #2940's reverse index, so I ported it: zed6000/VIctory branch `eval/64-3522-port`, `97b8e41e1`. - The paged `Slots`, the single-lookup counts, the in-place hull and the `keep` change are as here. `keep` also compares the title-memory copy, which that tree retires with the resource. - One difference: with the reverse index (a set of slots per texture), a slot rewritten with the texture it views returns early, since counting it in and out would drop it from the set. - **Runs:** prison yard, diag builds sharing one warm pipeline library, median of the last 10 report blocks, 2 runs with the port against 4 controls. | ms a frame | controls | with this PR | |---|---|---| | `heap slots the title copied` | 54.2-56.6 | **47.9 / 41.9** | | per slot made (35,000 a frame) | 1.53-1.61 µs | **1.36 / 1.19 µs** | | title frame | 367.1-379.3 | **365.4 / 357.9** | | `title threads waiting to write views` | 252-268 | 256 / 238 | - **Result:** the sync falls by 13-24 % at the same slot count, and the frame by about 9 ms against the adjacent controls; both runs are below every control. The picture is unchanged at frame 1350. - **Why it shows here:** on this box the frame follows the holds on the heaps' lock (neonbyte1/VIctory#146), so a cheaper slot is what moves it. - **Tests on that tree:** `bindless::` and `descriptor::` pass, this PR's `a_slot_made_again_on_its_resource_retires_nothing` included. _AI-assisted (Claude), posted for zed6000; counts and times from VIctory's own report lines; no game data shared._
KainanP commented 2026-11-29 21:29:39 +00:00 (Migrated from github.com)

Imported from Marvisak/VIctory. Originally posted by KainanP on 2026-11-29T21:29:39Z.


Thanks @zed6000 for porting and measuring this on the RX 7900 XTX. The 13–24 % drop in heap-slot sync and ~9 ms per frame, with both runs below every control, is what the change was aiming for. The early return for a slot rewritten with the same texture under #2940's reverse index looks right to me.

<!-- greyfinch-sync:Marvisak/VIctory:comment:7262918631 --> Imported from [Marvisak/VIctory](https://github.com/Marvisak/VIctory/pull/3522#issuecomment-7262918631). Originally posted by [KainanP](https://github.com/KainanP) on 2026-11-29T21:29:39Z. --- Thanks @zed6000 for porting and measuring this on the RX 7900 XTX. The 13–24 % drop in heap-slot sync and ~9 ms per frame, with both runs below every control, is what the change was aiming for. The early return for a slot rewritten with the same texture under #2940's reverse index looks right to me.
This pull request cannot be merged automatically due to conflicts.
Merge manually to resolve the conflicts.
View command line instructions

Checkout

From your project repository, check out a new branch and test the changes.
git fetch -u origin 'upstream-pr/3522:upstream-pr/3522'
git switch 'upstream-pr/3522'

Merge

Merge the changes and update on Forgejo.

Warning: The "Autodetect manual merge" setting is not enabled for this repository, you will have to mark this pull request as manually merged afterwards.

git switch 'main'
git merge --no-ff 'upstream-pr/3522'
git switch 'upstream-pr/3522'
git rebase 'main'
git switch 'main'
git merge --ff-only 'upstream-pr/3522'
git switch 'upstream-pr/3522'
git rebase 'main'
git switch 'main'
git merge --no-ff 'upstream-pr/3522'
git switch 'main'
git merge --squash 'upstream-pr/3522'
git switch 'main'
git merge --ff-only 'upstream-pr/3522'
git switch 'main'
git merge 'upstream-pr/3522'
git push origin 'main'
Sign in to join this conversation.
No reviewers
No labels
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.

Reference
Marvisak/VIctory!3522
No description provided.