perf(vk): add per-thread texture/sampler and read-only SSBO descriptor memos #2920

Merged
HumanBean merged 2 commits from siantm/Longshot:perf/vk-tex-desc-memo into main 2026-12-01 00:43:39 +00:00
Contributor

Summary

Adds per-thread L2-resident descriptor memos in gpu/vk/tex_desc_memo.h so build_descriptors avoids repeating bank-word decoding, handle table lookups, view/layout checks, sampler lookups, and read-only SSBO gpu_buffer_bind calls across draws that cannot reuse the whole descriptor set (same_desc == false). Controlled by RX_VK_TEX_DESC_MEMO (1 on by default, 0 off, check live equivalence check against the unmemoized slow path).

Key changes:

  • gpu/vk/tex_desc_memo.h:
    • 2048 x 4-way set-associative Combined-Image-Sampler memo (64-byte POD Entry with c2_read_word, c2_handle_of, sync_generations bumping gen_tag only when (reg_gen, samp_gen) changes, round-robin eviction, per-entry destroy_gen + texture_still_resolved honoring RX_VK_EXACT_STALE, kOutDepth, and kOutDummy caching for non-zero dummy slots).
    • 256 x 2-way set-associative read-only SSBO BufferRef memo (SsboEntry keyed on aligned base, n, and gpu_bind_stamp() with inline c0_ssbo_read).
  • gpu/vk/vk_draw.cpp: wires tex_desc_memo_tls, tex_desc_memo_begin_recording(), and RX_VK_TEX_DESC_MEMO=0/1/check fast/check paths into the SSBO and texture descriptor loops in build_descriptors, honoring RX_VK_TOUCH_SLOW and RX_VK_ZERO_SAMPLER.
  • gpu/vk/switches.def: documents RX_VK_TEX_DESC_MEMO.
  • tests/test_tex_desc_memo.py & tests/test_hos_ab.py: standalone unit/oracle suite compiling gpu/vk/tex_desc_memo.h verbatim alongside real driver_bank_word / handle_of slices (including 3,000-op oracle trace and 9 broken MUST_FAIL variants) plus HOS_AB WIRED registration.

Read first: gpu/vk/tex_desc_memo.h, build_descriptors and tex_desc_memo_begin_recording in gpu/vk/vk_draw.cpp, and tests/test_tex_desc_memo.py.

Testing

Tested: Windows 11, NVIDIA GeForce RTX 4060 (driver 621.40), build-windows/rt-Longshot (1280x720):

  • Live RX_VK_TEX_DESC_MEMO=check in Market_Child (--repo-save market-entrance, 35s in-play headless run): 32,600,000 checks, 29,715,363 hits (91.2%), 2,884,637 misses, 0 mismatches.
  • python -I -B tests/run_all.py test_tex_desc_memo test_flat_map test_handle_lookup test_desc_clock test_handle_table_arrays test_tls_objects test_hos_ab test_hos_ab_table test_same_bind: 9 passed, 0 failed, 0 skipped.
  • python -I -B tests/test_desc_counts.py: PASS.
  • python -I -B tests/test_sampler_admission.py: PASS (147 sampler cache/admission/policy/limit cases passed).
  • python -I tests/test_switch_table.py: failed solely on pre-existing main mismatch (LONGSHOT_LAUNCHER_STARTUP in host/launcher_startup.h:9 has no row in gpu/vk/switches.def); RX_VK_TEX_DESC_MEMO passed cleanly.

Still to test:

  • @Beanstalk linux: build on Linux and run tests/test_tex_desc_memo.py and in-game RX_VK_TEX_DESC_MEMO=check, expecting 0 mismatches (@Beanstalk linux).

Measurements

Verdict: Cuts mean frame time in CPU-bound Market_Child by -0.377 ms (-2.68%, +1.95 Avg FPS from 70.97 to 72.92 fps across 51 paired HOS_AB periods, 95% CI +0.057 to +0.691 ms strictly excluding 0), reducing desc_ms by -0.324 ms (-10.2%, 3.170 to 2.846 ms) while lifting 1% Low (46.35 to 50.47 fps) and 0.1% Low (32.18 to 43.60 fps). Ships on by default (RX_VK_TEX_DESC_MEMO=1).

Setup: Windows 11, RTX 4060 (621.40), Market_Child (--repo-save market-entrance), 1280x720 (resolution=0, threaded_rendering=0, descriptor_reuse=1), HOS_FPS_MAX=1000, HOS_AUDIO=0, RX_VK_IMMEDIATE=1, RX_VK_FRAME_TRACE=1, HOS_AB=RX_VK_TEX_DESC_MEMO=0,3,50 across 3 sequential pre-dusk headless runs (51 periods pooled via scripts/perf.py ab, where side 1 RX_VK_TEX_DESC_MEMO=0 runs main's unmemoized build_descriptors path).
Baseline: origin/main @ 28cb22b9e (this PR @ 1312ed6fc with RX_VK_TEX_DESC_MEMO=0).

Metric Before: main @ 28cb22b9e After: this PR @ 1312ed6fc Delta
Frames kept 4599 5317 51 periods (24 OFF, 27 ON across 3 runs)
Mean frame time 14.091 ms (70.97 fps) 13.714 ms (72.92 fps) -0.377 ms (-2.68%, +2.75% fps)
Median (P50) 13.740 ms (72.78 fps) 13.390 ms (74.68 fps) -0.350 ms (+2.61% fps)
P99 frame time 18.790 ms 17.980 ms -0.810 ms
1% Low FPS 46.35 fps (21.577 ms) 50.47 fps (19.813 ms) +8.89%
0.1% Low FPS 32.18 fps (31.076 ms) 43.60 fps (22.933 ms) +35.49%
desc_ms mean 3.170 ms 2.846 ms -0.324 ms (-10.22%)
draw_ms mean 8.246 ms 7.865 ms -0.381 ms (-4.62%)
Frames 16.7 ms or slower 4.4% 2.7% -1.7 pp
95% CI (side 1 - side 0) — — +0.057 to +0.691 ms (side 1 is slower)

Risks

  • Adds ~520 KB of thread_local memo storage per recording thread (2048 x 4 x 64 B texture memo + 256 x 2 x 56 B SSBO memo). Dynamic (gpu_written) textures, depth-feedback edges, writable SSBO bindings, and virtual SSBO mappings bypass the memo, and per-entry generation/epoch checks invalidate stale entries on eviction or bank registration changes.
  • RX_VK_TEX_DESC_MEMO=0 switches back to the unmemoized slow path at recording boundaries without rebuilding or changing saves, shader caches, or longshot_options.ini.

Checklist

Ready for review

  • One topic, on current main; the title is a Conventional Commit.
  • Tested on my own PC, in the game for a change the game runs, as Testing says.
  • mise run test passes (any failure that also fails on main is named).
  • Measured against main, or Measurements says why there is nothing to measure.
  • No game files, build output or hand-edited generated files; third_party/ untouched; nothing GPL-incompatible.

When it applies

  • A switch added or changed: it ships at the default the measurements chose, with its row in gpu/vk/switches.def.
  • A check under tests/ that reads changed source is updated, not weakened.
  • AI assistance recorded with Assisted-by: / Co-Authored-By: trailers.

Ready to merge

  • Everything in Still to test has run, its results in Tested.
  • Tier 1 hardware it can affect is tested (docs/dev/standards.md, "Hardware tiers").
  • Approved in review, every comment answered.
  • CI passes on the head; on current main, measured again or a comment says why the numbers still hold.
## Summary Adds per-thread L2-resident descriptor memos in `gpu/vk/tex_desc_memo.h` so `build_descriptors` avoids repeating bank-word decoding, handle table lookups, view/layout checks, sampler lookups, and read-only SSBO `gpu_buffer_bind` calls across draws that cannot reuse the whole descriptor set (`same_desc == false`). Controlled by `RX_VK_TEX_DESC_MEMO` (`1` on by default, `0` off, `check` live equivalence check against the unmemoized slow path). Key changes: - `gpu/vk/tex_desc_memo.h`: - `2048 x 4-way` set-associative Combined-Image-Sampler memo (`64`-byte POD `Entry` with `c2_read_word`, `c2_handle_of`, `sync_generations` bumping `gen_tag` only when `(reg_gen, samp_gen)` changes, round-robin eviction, per-entry `destroy_gen` + `texture_still_resolved` honoring `RX_VK_EXACT_STALE`, `kOutDepth`, and `kOutDummy` caching for non-zero dummy slots). - `256 x 2-way` set-associative read-only SSBO `BufferRef` memo (`SsboEntry` keyed on aligned `base`, `n`, and `gpu_bind_stamp()` with inline `c0_ssbo_read`). - `gpu/vk/vk_draw.cpp`: wires `tex_desc_memo_tls`, `tex_desc_memo_begin_recording()`, and `RX_VK_TEX_DESC_MEMO=0/1/check` fast/check paths into the SSBO and texture descriptor loops in `build_descriptors`, honoring `RX_VK_TOUCH_SLOW` and `RX_VK_ZERO_SAMPLER`. - `gpu/vk/switches.def`: documents `RX_VK_TEX_DESC_MEMO`. - `tests/test_tex_desc_memo.py` & `tests/test_hos_ab.py`: standalone unit/oracle suite compiling `gpu/vk/tex_desc_memo.h` verbatim alongside real `driver_bank_word` / `handle_of` slices (including `3,000`-op oracle trace and 9 broken `MUST_FAIL` variants) plus `HOS_AB` `WIRED` registration. Read first: `gpu/vk/tex_desc_memo.h`, `build_descriptors` and `tex_desc_memo_begin_recording` in `gpu/vk/vk_draw.cpp`, and `tests/test_tex_desc_memo.py`. ## Testing **Tested:** Windows 11, NVIDIA GeForce RTX 4060 (driver `621.40`), `build-windows/rt-Longshot` (`1280x720`): - Live `RX_VK_TEX_DESC_MEMO=check` in `Market_Child` (`--repo-save market-entrance`, 35s in-play headless run): `32,600,000 checks, 29,715,363 hits (91.2%), 2,884,637 misses, 0 mismatches`. - `python -I -B tests/run_all.py test_tex_desc_memo test_flat_map test_handle_lookup test_desc_clock test_handle_table_arrays test_tls_objects test_hos_ab test_hos_ab_table test_same_bind`: `9 passed, 0 failed, 0 skipped`. - `python -I -B tests/test_desc_counts.py`: `PASS`. - `python -I -B tests/test_sampler_admission.py`: `PASS` (`147 sampler cache/admission/policy/limit cases passed`). - `python -I tests/test_switch_table.py`: failed solely on pre-existing `main` mismatch (`LONGSHOT_LAUNCHER_STARTUP` in `host/launcher_startup.h:9` has no row in `gpu/vk/switches.def`); `RX_VK_TEX_DESC_MEMO` passed cleanly. **Still to test:** - `@Beanstalk linux`: build on Linux and run `tests/test_tex_desc_memo.py` and in-game `RX_VK_TEX_DESC_MEMO=check`, expecting `0 mismatches` (`@Beanstalk linux`). ## Measurements **Verdict:** Cuts mean frame time in CPU-bound `Market_Child` by **-0.377 ms** (**-2.68%**, **+1.95 Avg FPS** from `70.97` to `72.92` fps across `51` paired `HOS_AB` periods, 95% CI `+0.057` to `+0.691 ms` strictly excluding `0`), reducing `desc_ms` by **-0.324 ms** (`-10.2%`, `3.170` to `2.846 ms`) while lifting `1%` Low (`46.35` to `50.47` fps) and `0.1%` Low (`32.18` to `43.60` fps). Ships on by default (`RX_VK_TEX_DESC_MEMO=1`). Setup: Windows 11, RTX 4060 (`621.40`), `Market_Child` (`--repo-save market-entrance`), `1280x720` (`resolution=0`, `threaded_rendering=0`, `descriptor_reuse=1`), `HOS_FPS_MAX=1000`, `HOS_AUDIO=0`, `RX_VK_IMMEDIATE=1`, `RX_VK_FRAME_TRACE=1`, `HOS_AB=RX_VK_TEX_DESC_MEMO=0,3,50` across 3 sequential pre-dusk headless runs (`51` periods pooled via `scripts/perf.py ab`, where side 1 `RX_VK_TEX_DESC_MEMO=0` runs `main`'s unmemoized `build_descriptors` path). Baseline: `origin/main @ 28cb22b9e` (`this PR @ 1312ed6fc` with `RX_VK_TEX_DESC_MEMO=0`). | Metric | Before: main @ 28cb22b9e | After: this PR @ 1312ed6fc | Delta | |---|---:|---:|---| | Frames kept | 4599 | 5317 | 51 periods (24 OFF, 27 ON across 3 runs) | | Mean frame time | 14.091 ms (70.97 fps) | 13.714 ms (72.92 fps) | **-0.377 ms (-2.68%, +2.75% fps)** | | Median (P50) | 13.740 ms (72.78 fps) | 13.390 ms (74.68 fps) | **-0.350 ms (+2.61% fps)** | | P99 frame time | 18.790 ms | 17.980 ms | **-0.810 ms** | | 1% Low FPS | 46.35 fps (21.577 ms) | 50.47 fps (19.813 ms) | **+8.89%** | | 0.1% Low FPS | 32.18 fps (31.076 ms) | 43.60 fps (22.933 ms) | **+35.49%** | | `desc_ms` mean | 3.170 ms | 2.846 ms | **-0.324 ms (-10.22%)** | | `draw_ms` mean | 8.246 ms | 7.865 ms | **-0.381 ms (-4.62%)** | | Frames 16.7 ms or slower | 4.4% | 2.7% | **-1.7 pp** | | 95% CI (side 1 - side 0) | — | — | `+0.057` to `+0.691 ms` (`side 1 is slower`) | ## Risks - Adds ~520 KB of `thread_local` memo storage per recording thread (`2048 x 4 x 64 B` texture memo + `256 x 2 x 56 B` SSBO memo). Dynamic (`gpu_written`) textures, depth-feedback edges, writable SSBO bindings, and virtual SSBO mappings bypass the memo, and per-entry generation/epoch checks invalidate stale entries on eviction or bank registration changes. - `RX_VK_TEX_DESC_MEMO=0` switches back to the unmemoized slow path at recording boundaries without rebuilding or changing saves, shader caches, or `longshot_options.ini`. ## Checklist ### Ready for review - [x] One topic, on current `main`; the title is a Conventional Commit. - [x] Tested on my own PC, in the game for a change the game runs, as Testing says. - [ ] `mise run test` passes (any failure that also fails on `main` is named). - [x] Measured against `main`, or Measurements says why there is nothing to measure. - [x] No game files, build output or hand-edited generated files; `third_party/` untouched; nothing GPL-incompatible. ### When it applies - [x] A switch added or changed: it ships at the default the measurements chose, with its row in `gpu/vk/switches.def`. - [x] A check under `tests/` that reads changed source is updated, not weakened. - [x] AI assistance recorded with `Assisted-by:` / `Co-Authored-By:` trailers. ### Ready to merge - [ ] Everything in Still to test has run, its results in Tested. - [ ] Tier 1 hardware it can affect is tested (docs/dev/standards.md, "Hardware tiers"). - [ ] Approved in review, every comment answered. - [ ] CI passes on the head; on current `main`, measured again or a comment says why the numbers still hold.
perf(vk): add per-thread texture/sampler and read-only SSBO descriptor memos
Some checks failed
PR description / Title and description (pull_request_target) Successful in 5s
beanstalk/approval approved by HumanBean (reviewed)
beanstalk/linux 0/1 pass, 2 running, 0 queued
beanstalk/nvidia 0/1 pass, 2 running, 0 queued
beanstalk/windows+nvidia 0/1 pass, 2 running, 0 queued
beanstalk/windows+amd 0/1 pass, 2 running, 0 queued
beanstalk/linux+radv 0/1 pass, 2 running, 0 queued
beanstalk/intel 0/1 pass, 0 running, 2 queued
CI / What the change needs (pull_request) Has been cancelled
CI / Lint (pre-commit, ShellCheck, actionlint) (pull_request) Has been cancelled
CI / Third-party parts and guide screenshots (pull_request) Has been cancelled
CI / Rust (rustfmt, clippy, cargo test, end to end) (pull_request) Has been cancelled
CI / Host C for Windows (llvm-mingw, compile only) (pull_request) Has been cancelled
CI / Renderer build check (Windows, compile --only renderer, without and with FSR 4) (pull_request) Has been cancelled
CI / Renderer build check (Linux, compile --only renderer, without and with FSR 4) (pull_request) Has been cancelled
CI / Game-free checks (run_all.py, part 1/2) (pull_request) Has been cancelled
CI / Game-free checks (run_all.py, part 2/2) (pull_request) Has been cancelled
CI / Website build and checks (pull_request) Has been cancelled
1312ed6fce
Add gpu/vk/tex_desc_memo.h with per-thread L2-resident caches for combined image samplers (2048 x 4-way, per-entry destroy_gen + RX_VK_EXACT_STALE validation, non-zero dummy caching) and read-only SSBO BufferRef lookups (256 x 2-way, keyed on aligned base, size, and gpu_bind_stamp()), controlled by RX_VK_TEX_DESC_MEMO (0/1/check, default 1).

Verified 0 mismatches across 32,600,000 live checks in Market_Child and -0.377 ms (-2.68%, 95% CI [+0.057, +0.691] ms) frame-time improvement across 51 paired HOS_AB periods.

Assisted-by: Antigravity
Author
Contributor

Tested in game: Windows 11, RTX 4060 (driver 621.40), build-windows/rt-Longshot in Market_Child (--repo-save market-entrance, 1280x720): RX_VK_TEX_DESC_MEMO=check logged 32,600,000 checks, 29,715,363 hits (91.2%), 0 mismatches; 51 paired HOS_AB periods across 3 pre-dusk runs measured -0.377 ms (-2.68%, 70.97 -> 72.92 Avg FPS, 95% CI +0.057 to +0.691 ms).

Tested in game: Windows 11, RTX 4060 (driver 621.40), build-windows/rt-Longshot in Market_Child (--repo-save market-entrance, 1280x720): RX_VK_TEX_DESC_MEMO=check logged 32,600,000 checks, 29,715,363 hits (91.2%), 0 mismatches; 51 paired HOS_AB periods across 3 pre-dusk runs measured -0.377 ms (-2.68%, 70.97 -> 72.92 Avg FPS, 95% CI +0.057 to +0.691 ms).
Member

Possibly related, for context:

  • PR #2899 perf(vk): add UBO descriptor delta fast path, 8-slot ub_gap_cache, and lock-free invalidate exits — Open Vulkan descriptor hot-path optimization; check overlap in build_descriptors.
  • PR #794 WIP: perf(vk): a stage's descriptors are kept across draws in a recording part while what they were resolved from stands — Earlier attempt to retain resolved descriptors across draws; related approach, though not merged.
  • PR #2343 perf(vk): exact handle staleness, blocks-hash memo, zero depth clears (three from #2273) — Merged exact texture-staleness mechanism reused by this memo's validity checks.
Possibly related, for context: - PR #2899 perf(vk): add UBO descriptor delta fast path, 8-slot ub_gap_cache, and lock-free invalidate exits — Open Vulkan descriptor hot-path optimization; check overlap in build_descriptors. - PR #794 WIP: perf(vk): a stage's descriptors are kept across draws in a recording part while what they were resolved from stands — Earlier attempt to retain resolved descriptors across draws; related approach, though not merged. - PR #2343 perf(vk): exact handle staleness, blocks-hash memo, zero depth clears (three from #2273) — Merged exact texture-staleness mechanism reused by this memo's validity checks.
Owner

@Beanstalk

@Beanstalk
Owner
@review
Member
Beanstalk test farm · an earlier run: commit 1312ed6 (the newer results are in a comment below)

Commit 1312ed6 · approved by HumanBean (reviewed) · dashboard

⚠️ Note: The farm cannot run the standalone Python oracle suite, and this plan cannot establish the claimed 2.68% speed-up or descriptor-specific timing at its noise threshold.
⚠️ Note: The live check fails on logged mismatches but does not require a check-count log, so absence of a mismatch alone does not prove that every descriptor branch was exercised.
⚠️ Note: The check-mode cell is diagnostic rather than a performance comparison; the default-on path is compared with main separately.

Started at 00:30 UTC.

Estimate: done in about 3 h, from the queue and the testers online now; some jobs can't start yet.

Target Result Reports Frame time p99 (ms), main → PR VRAM peak (MB) Crashes
linux 🔄 running 0 of 1 — — —
nvidia 🔄 running 0 of 1 — — —
windows+nvidia 🔄 running 0 of 1 — — —
windows+amd 🔄 running 0 of 1 — — —
linux+radv 🔄 running 0 of 1 — — —
intel ⏳ queued 0 of 1 — — —
What was tested

What will be tested · AI plan (gpt-6.1-terra)

The plan compares uncapped, CPU-oriented frame times against main in the Market and Hyrule Field, with three starts per side and 20-second measurements at each place. It also compares stationary pictures and runs the memo’s live equivalence-check mode through both areas. A crash, descriptor mismatch log, excessive picture difference, or a frame-time regression over the specified limits fails the pull request. Linux, Windows/NVIDIA, Windows/AMD, RADV, NVIDIA, and Intel targets report separately.

  • Where: linux (1-2 reports), nvidia (1-2 reports), windows+nvidia (1-2 reports), windows+amd (1-2 reports), linux+radv (1-2 reports), intel (1-2 reports).
  • Matrix: 1 cell, each on main and the PR: RX_VK_TEX_DESC_MEMO check (PR only).
  • performance-and-pictures: from the repository's save market-entrance (settings vsync=2, resolution=1, frame_rate_cap=6, quality_preset=0, descriptor_reuse=1; switches HOS_OUTPUT_RES=1280x720, RX_VK_AUTO_TUNE=0), then teleport to Market, take the picture market to compare with main, measure market for 20 s (after 10 s warm-up), teleport to Hyrule Field, take the picture field to compare with main, measure field for 20 s (after 10 s warm-up); 3 runs on each side.
  • live-equivalence: from the repository's save market-entrance (settings vsync=2, resolution=1, frame_rate_cap=6, quality_preset=0, descriptor_reuse=1; switches HOS_OUTPUT_RES=1280x720, RX_VK_AUTO_TUNE=0), then teleport to Market, teleport to Hyrule Field; 1 run on each side.
  • Measured: crashes, frame times, stutters and hitches, the game's log.
  • The PR fails if: it crashes; or a picture differs from main by more than 20%; or median frame time is more than 10% above main; or frame time (p99) is more than 15% above main; or forbidden log lines is above 0; or frame time (worst 1%) is more than 15% above main.
  • Time: about 49 min of game runs per tester (8 game starts), plus the two builds.
<!-- beanstalk:previous --> <details><summary>Beanstalk test farm · an earlier run: commit <code>1312ed6</code> (the newer results are in a comment below)</summary> Commit `1312ed6` · approved by HumanBean (reviewed) · [dashboard](https://beanstalk.magicbean.dev/prs/2920) ⚠️ **Note:** The farm cannot run the standalone Python oracle suite, and this plan cannot establish the claimed 2.68% speed-up or descriptor-specific timing at its noise threshold. ⚠️ **Note:** The live check fails on logged mismatches but does not require a check-count log, so absence of a mismatch alone does not prove that every descriptor branch was exercised. ⚠️ **Note:** The check-mode cell is diagnostic rather than a performance comparison; the default-on path is compared with main separately. Started at 00:30 UTC. **Estimate:** done in about 3 h, from the queue and the testers online now; some jobs can't start yet. | Target | Result | Reports | Frame time p99 (ms), main → PR | VRAM peak (MB) | Crashes | | --- | --- | --- | --- | --- | --- | | `linux` | 🔄 running | 0 of 1 | — | — | — | | `nvidia` | 🔄 running | 0 of 1 | — | — | — | | `windows+nvidia` | 🔄 running | 0 of 1 | — | — | — | | `windows+amd` | 🔄 running | 0 of 1 | — | — | — | | `linux+radv` | 🔄 running | 0 of 1 | — | — | — | | `intel` | ⏳ queued | 0 of 1 | — | — | — | <details><summary>What was tested</summary> **What will be tested** · AI plan (`gpt-6.1-terra`) The plan compares uncapped, CPU-oriented frame times against main in the Market and Hyrule Field, with three starts per side and 20-second measurements at each place. It also compares stationary pictures and runs the memo’s live equivalence-check mode through both areas. A crash, descriptor mismatch log, excessive picture difference, or a frame-time regression over the specified limits fails the pull request. Linux, Windows/NVIDIA, Windows/AMD, RADV, NVIDIA, and Intel targets report separately. - **Where:** linux (1-2 reports), nvidia (1-2 reports), windows+nvidia (1-2 reports), windows+amd (1-2 reports), linux+radv (1-2 reports), intel (1-2 reports). - **Matrix:** 1 cell, each on main and the PR: RX_VK_TEX_DESC_MEMO `check` (PR only). - **performance-and-pictures:** from the repository's save `market-entrance` (settings vsync=2, resolution=1, frame_rate_cap=6, quality_preset=0, descriptor_reuse=1; switches `HOS_OUTPUT_RES=1280x720`, `RX_VK_AUTO_TUNE=0`), then teleport to Market, take the picture market to compare with main, measure market for 20 s (after 10 s warm-up), teleport to Hyrule Field, take the picture field to compare with main, measure field for 20 s (after 10 s warm-up); 3 runs on each side. - **live-equivalence:** from the repository's save `market-entrance` (settings vsync=2, resolution=1, frame_rate_cap=6, quality_preset=0, descriptor_reuse=1; switches `HOS_OUTPUT_RES=1280x720`, `RX_VK_AUTO_TUNE=0`), then teleport to Market, teleport to Hyrule Field; 1 run on each side. - **Measured:** crashes, frame times, stutters and hitches, the game's log. - **The PR fails if:** it crashes; or a picture differs from main by more than 20%; or median frame time is more than 10% above main; or frame time (p99) is more than 15% above main; or forbidden log lines is above 0; or frame time (worst 1%) is more than 15% above main. - **Time:** about 49 min of game runs per tester (8 game starts), plus the two builds. </details> </details>
BeanBot left a comment

Recommendation: Request changes. The read-only SSBO memo can reuse a binding after its virtual address is remapped, producing the wrong buffer contents. The reported performance gain also needs comparison against the actual base build and coverage of the other affected Tier 1 systems.

The change caches texture, sampler and read-only storage-buffer descriptor resolution per recording thread. It reports a 0.377 ms mean frame-time reduction on one Windows/NVIDIA setup, at a cost of roughly 540 KiB of memo storage per recording thread and additional invalidation logic.

Blocking (1): must change before merging.

  1. L1 gpu/vk/vk_draw.cpp:4959: The SSBO memo keys virtual GPU addresses without tracking their page mappings, bypassing the translation and contiguous-range validation performed by gpu_buffer_bind. (more on the line) Do: Include the virtual mapping generation in the memo validity check and revalidate the mapping and contiguous range, or bypass this memo for virtual addresses. Add a test that remaps and unmaps a cached address.

Should fix (1): not blocking, but worth doing before merging.

  • L2 gpu/vk/vk_draw.cpp:5384: Check mode does not compare the fast path's handle decoding or its touch behavior with the slow path. (more on the line) Do: Have check mode compare the fast decoded handle and exercise or independently validate the fast lookup's touch and resulting descriptor state; cover those comparisons with a test that fails when each is broken.

Testing before merging (2) (runs on the systems it can change; it doesn't hold the recommendation)

  • L3: The reported A/B comparison uses the PR's disabled path as its baseline, so it does not measure the complete change against main under player settings. When: The disabled path still contains the new mode checks and surrounding code; its timing can differ from the base even when the memo is off. The measured 2.68% difference therefore does not establish the net change from the base build. Do: Run interleaved base and head builds on the same scene and player settings, reporting per-run frame times, average FPS and 1% lows, including a heavy area.
  • L4: The default-on renderer change has not been exercised on the other affected Tier 1 systems. When: Linux, AMD and Steam Deck recording paths use the same memo and resource invalidation logic, but the supplied live check and timing cover only Windows on NVIDIA. Do: Run the corrected equivalence check and representative base-versus-head gameplay on Linux and the remaining Tier 1 hardware, including AMD and Steam Deck; report frame pacing and memory as well as correctness.

@fix can do L1 and L2.

Checks: Still running: 10 checks.

More: does it help, other systems, switches, what was read

Does it help: Unproven against the base: the reported 70.97 to 72.92 average FPS and 46.35 to 50.47 FPS 1% low come from toggling the switch within the PR build, rather than running base commit 28cb22b9ed. The comparison covers one scene and Windows RTX 4060.

Other systems: The descriptor paths affect graphics and compute recordings, virtual buffer mappings, texture uploads and descriptor reuse on both Windows and Linux. The supplied live check covers Windows/NVIDIA only; AMD, Linux and Steam Deck results are still needed.

Switches: RX_VK_TEX_DESC_MEMO is added, defaulting to 1; 0 disables the memo and check enables the live comparison. It has a switches.def row, but the default has only been measured on one system.

Reviewed: 1312ed6fce against 28cb22b9ed: Read AGENTS.md, CONTRIBUTING.md, the pull request template, docs/dev/standards.md, the commit and diff, tex_desc_memo.h, the changed descriptor and recording paths and their buffer, texture and bank dependencies. Skimmed the test harness, HOS_AB registration and switch table; vk_draw.cpp and test_hos_ab.py were not read in full. docs/review-checklist.md and the adjacent Tooling checkout were absent. No recorded run artifacts or generated files were supplied.; nothing run (a code review).

Checked and fine:

  • The new switch has a switches.def row and an HOS_AB registration.
  • The commit records AI assistance, and the changed files do not include generated shader headers or third-party files.
  • The memo's owned thread-local allocation is deleted when its thread exits.

Testing: No commands from the project, builds or tests were run, as requested. The supplied Windows live check reports 32.6 million checks and zero mismatches; its coverage limitation is noted above. CI is still running.

Overlaps and merge order: Not checked; the network is closed.


Automated code review by BeanBot (gpt-6.1-terra), asked for by HumanBean. Nothing was run; a maintainer decides.

**Recommendation: Request changes.** The read-only SSBO memo can reuse a binding after its virtual address is remapped, producing the wrong buffer contents. The reported performance gain also needs comparison against the actual base build and coverage of the other affected Tier 1 systems. The change caches texture, sampler and read-only storage-buffer descriptor resolution per recording thread. It reports a 0.377 ms mean frame-time reduction on one Windows/NVIDIA setup, at a cost of roughly 540 KiB of memo storage per recording thread and additional invalidation logic. **Blocking (1)**: must change before merging. 1. **L1** `gpu/vk/vk_draw.cpp:4959`: The SSBO memo keys virtual GPU addresses without tracking their page mappings, bypassing the translation and contiguous-range validation performed by gpu_buffer_bind. (more on the line) **Do:** Include the virtual mapping generation in the memo validity check and revalidate the mapping and contiguous range, or bypass this memo for virtual addresses. Add a test that remaps and unmaps a cached address. **Should fix (1)**: not blocking, but worth doing before merging. - **L2** `gpu/vk/vk_draw.cpp:5384`: Check mode does not compare the fast path's handle decoding or its touch behavior with the slow path. (more on the line) **Do:** Have check mode compare the fast decoded handle and exercise or independently validate the fast lookup's touch and resulting descriptor state; cover those comparisons with a test that fails when each is broken. **Testing before merging (2)** (runs on the systems it can change; it doesn't hold the recommendation) - **L3**: The reported A/B comparison uses the PR's disabled path as its baseline, so it does not measure the complete change against main under player settings. *When:* The disabled path still contains the new mode checks and surrounding code; its timing can differ from the base even when the memo is off. The measured 2.68% difference therefore does not establish the net change from the base build. **Do:** Run interleaved base and head builds on the same scene and player settings, reporting per-run frame times, average FPS and 1% lows, including a heavy area. - **L4**: The default-on renderer change has not been exercised on the other affected Tier 1 systems. *When:* Linux, AMD and Steam Deck recording paths use the same memo and resource invalidation logic, but the supplied live check and timing cover only Windows on NVIDIA. **Do:** Run the corrected equivalence check and representative base-versus-head gameplay on Linux and the remaining Tier 1 hardware, including AMD and Steam Deck; report frame pacing and memory as well as correctness. `@fix` can do L1 and L2. **Checks:** Still running: 10 checks. <details> <summary>More: does it help, other systems, switches, what was read</summary> **Does it help:** Unproven against the base: the reported 70.97 to 72.92 average FPS and 46.35 to 50.47 FPS 1% low come from toggling the switch within the PR build, rather than running base commit 28cb22b9ed23. The comparison covers one scene and Windows RTX 4060. **Other systems:** The descriptor paths affect graphics and compute recordings, virtual buffer mappings, texture uploads and descriptor reuse on both Windows and Linux. The supplied live check covers Windows/NVIDIA only; AMD, Linux and Steam Deck results are still needed. **Switches:** RX_VK_TEX_DESC_MEMO is added, defaulting to 1; 0 disables the memo and check enables the live comparison. It has a switches.def row, but the default has only been measured on one system. **Reviewed:** 1312ed6fcef6 against 28cb22b9ed23: Read AGENTS.md, CONTRIBUTING.md, the pull request template, docs/dev/standards.md, the commit and diff, tex_desc_memo.h, the changed descriptor and recording paths and their buffer, texture and bank dependencies. Skimmed the test harness, HOS_AB registration and switch table; vk_draw.cpp and test_hos_ab.py were not read in full. docs/review-checklist.md and the adjacent Tooling checkout were absent. No recorded run artifacts or generated files were supplied.; nothing run (a code review). **Checked and fine:** - The new switch has a switches.def row and an HOS_AB registration. - The commit records AI assistance, and the changed files do not include generated shader headers or third-party files. - The memo's owned thread-local allocation is deleted when its thread exits. **Testing:** No commands from the project, builds or tests were run, as requested. The supplied Windows live check reports 32.6 million checks and zero mismatches; its coverage limitation is noted above. CI is still running. **Overlaps and merge order:** Not checked; the network is closed. </details> --- <sub>Automated code review by BeanBot (gpt-6.1-terra), asked for by HumanBean. Nothing was run; a maintainer decides.</sub>
@ -4869,0 +4956,4 @@
const uint64_t n = std::max<uint64_t>(((size + (addr - base)) + 3) & ~3ull, 16);
BufferRef cached_ref;
if (tex_desc_memo::ssbo_lookup(*sm_st, base, n, sm_stamp, cached_ref)) {
if (page_table_cover_wanted(base, false)) gp_table_cover(p.key, st, base, n, cached_ref);
Member

L1 (blocking): The SSBO memo keys virtual GPU addresses without tracking their page mappings, bypassing the translation and contiguous-range validation performed by gpu_buffer_bind.

When: A read-only SSBO at a virtual address is cached, then its virtual pages are remapped or unmapped without changing pools_gen or mirror_epoch. A subsequent lookup with the same address and size returns the old BufferRef instead of translating the new mapping or returning an unbound descriptor, so the shader reads the previous pool.

Do: Include the virtual mapping generation in the memo validity check and revalidate the mapping and contiguous range, or bypass this memo for virtual addresses. Add a test that remaps and unmaps a cached address.

**L1** (blocking): The SSBO memo keys virtual GPU addresses without tracking their page mappings, bypassing the translation and contiguous-range validation performed by gpu_buffer_bind. *When:* A read-only SSBO at a virtual address is cached, then its virtual pages are remapped or unmapped without changing pools_gen or mirror_epoch. A subsequent lookup with the same address and size returns the old BufferRef instead of translating the new mapping or returning an unbound descriptor, so the shader reads the previous pool. **Do:** Include the virtual mapping generation in the memo validity check and revalidate the mapping and contiguous range, or bypass this memo for virtual addresses. Add a test that remaps and unmaps a cached address.
@ -5159,6 +5381,13 @@ void build_descriptors(const NvnState& s, const Program& p) {
const uint32_t handle = is_table ? table[k]
: (st.vk_stage == VK_SHADER_STAGE_FRAGMENT_BIT && handle_is_storage_pointer(info, d, k))
? 0u : handle_of(s, st, d, k);
const tex_desc_memo::PeekResult peek_res =
Member

L2 (should fix): Check mode does not compare the fast path's handle decoding or its touch behavior with the slow path.

When: For a non-table c2 descriptor, check mode computes the handle with handle_of and only peeks at the cache; it never calls c2_handle_of or the fast lookup's touch callback. A decoding or touch regression can therefore produce wrong textures with the default enabled while the live check reports zero mismatches.

Do: Have check mode compare the fast decoded handle and exercise or independently validate the fast lookup's touch and resulting descriptor state; cover those comparisons with a test that fails when each is broken.

**L2** (should fix): Check mode does not compare the fast path's handle decoding or its touch behavior with the slow path. *When:* For a non-table c2 descriptor, check mode computes the handle with handle_of and only peeks at the cache; it never calls c2_handle_of or the fast lookup's touch callback. A decoding or touch regression can therefore produce wrong textures with the default enabled while the live check reports zero mismatches. **Do:** Have check mode compare the fast decoded handle and exercise or independently validate the fast lookup's touch and resulting descriptor state; cover those comparisons with a test that fails when each is broken.
Owner
@fix
BeanBot force-pushed perf/vk-tex-desc-memo from 1312ed6fce
Some checks failed
PR description / Title and description (pull_request_target) Successful in 5s
beanstalk/approval approved by HumanBean (reviewed)
beanstalk/linux 0/1 pass, 2 running, 0 queued
beanstalk/nvidia 0/1 pass, 2 running, 0 queued
beanstalk/windows+nvidia 0/1 pass, 2 running, 0 queued
beanstalk/windows+amd 0/1 pass, 2 running, 0 queued
beanstalk/linux+radv 0/1 pass, 2 running, 0 queued
beanstalk/intel 0/1 pass, 0 running, 2 queued
CI / What the change needs (pull_request) Has been cancelled
CI / Lint (pre-commit, ShellCheck, actionlint) (pull_request) Has been cancelled
CI / Third-party parts and guide screenshots (pull_request) Has been cancelled
CI / Rust (rustfmt, clippy, cargo test, end to end) (pull_request) Has been cancelled
CI / Host C for Windows (llvm-mingw, compile only) (pull_request) Has been cancelled
CI / Renderer build check (Windows, compile --only renderer, without and with FSR 4) (pull_request) Has been cancelled
CI / Renderer build check (Linux, compile --only renderer, without and with FSR 4) (pull_request) Has been cancelled
CI / Game-free checks (run_all.py, part 1/2) (pull_request) Has been cancelled
CI / Game-free checks (run_all.py, part 2/2) (pull_request) Has been cancelled
CI / Website build and checks (pull_request) Has been cancelled
to 914c6a204c
Some checks failed
beanstalk/approval not approved yet
PR description / Title and description (pull_request_target) Failing after 7s
CI / What the change needs (pull_request) Successful in 9s
CI / Third-party parts and guide screenshots (pull_request) Failing after 11s
CI / Lint (pre-commit, ShellCheck, actionlint) (pull_request) Successful in 16s
CI / Rust (rustfmt, clippy, cargo test, end to end) (pull_request) Successful in 4m6s
CI / Host C for Windows (llvm-mingw, compile only) (pull_request) Successful in 2m13s
CI / Renderer build check (Windows, compile --only renderer, without and with FSR 4) (pull_request) Successful in 5m1s
CI / Renderer build check (Linux, compile --only renderer, without and with FSR 4) (pull_request) Successful in 5m0s
CI / Website build and checks (pull_request) Failing after 35s
CI / Game-free checks (run_all.py, part 1/2) (pull_request) Failing after 22m44s
CI / Game-free checks (run_all.py, part 2/2) (pull_request) Failing after 39m30s
2026-12-01 00:42:57 +00:00
Compare
Member

Beanstalk test farm

Commit 914c6a2 · approved by nobody yet · dashboard

A member of BigBeans can review this commit and comment @Beanstalk to test it.

<!-- beanstalk:sticky --> ### Beanstalk test farm Commit `914c6a2` · approved by nobody yet · [dashboard](https://beanstalk.magicbean.dev/prs/2920) A member of `BigBeans` can review this commit and comment `@Beanstalk` to test it.
BeanBot left a comment

Recommendation: Approve. The reported gain compares the memo against the PR’s disabled path, so the net gain against main under player settings remains unproven. The other affected Tier 1 systems also need runs, and check mode still does not independently compare texture touches. Nothing blocking is left: what remains is for the author before merging (below). Recommend approval; not approved on the forge.

What @fix changed
I changed this pull request: the new head is 914c6a204c. I rebased it onto main (d1ce3f3f18). I edited its description to match the change.

Changed

  • Virtual SSBO mappings: Bypassed SSBO memoization for virtual addresses in gpu/vk/tex_desc_memo.h:301 and added remap and unmap coverage in tests/test_tex_desc_memo.py:412. Tests were not run as instructed.

Not done

  • Independent touch comparison in gpu/vk/vk_draw.cpp:5384: The check still runs the memo touch before the slow lookup. Comparing their effects needs an isolated or instrumented execution of both paths: texture touches can update shared cache state and record GPU uploads, so restoring only the texture epoch would not give the slow path an independent reference.

Nothing was built or run: the checks run again on the new head.

The change caches texture descriptors and read-only buffer bindings per recording thread to reduce repeated work. It adds roughly 520 KB of thread-local storage per recording thread and introduces cache invalidation and check-mode complexity.

Should fix (1): not blocking, but worth doing before merging.

  • L2 gpu/vk/vk_draw.cpp:5384: Check mode's touch expectation comes from the memo's own state rather than the slow path, so it cannot establish equivalent touch behavior. When: On a memo hit, lookup invokes the touch callback before texture_view_of runs; touch_expected merely checks the same cached texture and epoch condition. A difference in the work or state produced by the fast touch can therefore be masked before the slow path is observed. Do: Compare the fast and slow touch decisions and resulting relevant state independently, without the first path changing the state used as the other's reference. (for the author: @fix couldn't: At gpu/vk/vk_draw.cpp:5475, the expected touch still comes from the memo entry's epoch, and the memo lookup touches shared state before the slow lookup. The slow path does not provide an independent t)

Testing before merging (2) (runs on the systems it can change; it doesn't hold the recommendation)

  • L3: The reported A/B comparison uses the PR's disabled path as its baseline, so it does not measure the complete change against main under player settings. When: The disabled path still contains the new mode checks and surrounding code; its timing can differ from the base even when the memo is off. The measured 2.68% difference therefore does not establish the net change from the base build. Do: Run interleaved base and head builds on the same scene and player settings, reporting per-run frame times, average FPS and 1% lows, including a heavy area.
  • L4: The default-on renderer change has not been exercised on the other affected Tier 1 systems. When: Linux, AMD and Steam Deck recording paths use the same memo and resource invalidation logic, but the supplied live check and timing cover only Windows on NVIDIA. Do: Run the corrected equivalence check and representative base-versus-head gameplay on Linux and the remaining Tier 1 hardware, including AMD and Steam Deck; report frame pacing and memory as well as correctness.

Checks: they run again on this head; a failure shows on the pull request.

Also noticed (3; not asked for, not blocking)
  • The new virtual-address test models binder results; an in-game run is still needed to exercise the real translation path.
  • The specified base diff contains 52 changed files, while the PR lists five.
  • The virtual-address guard bypasses SSBO memo lookup and storage for addresses at or above 1 TiB.
More: does it help, other systems, switches, what was read

Does it help: Unproven against main: the reported Windows RTX 4060 A/B run measured a 0.377 ms mean frame-time reduction across 51 periods, but its baseline was the PR with the memo disabled rather than a main build.

Other systems: The renderer change can affect Vulkan systems beyond the tested Windows NVIDIA configuration. Linux and the other affected Tier 1 systems have no reported results.

Switches: RX_VK_TEX_DESC_MEMO is added, defaults to 1, and also accepts 0 and check. The default's net cost and benefit against main and on other affected systems remain unmeasured.

Reviewed: 914c6a204c against d1ce3f3f18: Read the fix diff and the relevant descriptor and memo paths; skimmed the rules, PR description, reported runs, tests and base diff. The full changed code was not read: the specified base diff contains 52 files, including changes outside the five files listed in the PR.; nothing run (a code review).

Checked and fine:

  • The virtual SSBO bypass preserves memoization for non-virtual addresses.
  • The fix retains the default-on texture and non-virtual SSBO memo paths.

Testing: No commands that build or run code were executed. The reported Windows check-mode run recorded 32.6 million checks and zero mismatches, but its touch comparison has the limitation described in L2; CI has not run on this head.

Overlaps and merge order: Not checked; network access is closed.


Automated code review by BeanBot (gpt-6.1-terra), asked for by BeanBot, after its fix. Nothing was run; a maintainer decides.

**Recommendation: Approve.** The reported gain compares the memo against the PR’s disabled path, so the net gain against main under player settings remains unproven. The other affected Tier 1 systems also need runs, and check mode still does not independently compare texture touches. Nothing blocking is left: what remains is for the author before merging (below). Recommend approval; not approved on the forge. **What `@fix` changed** I changed this pull request: the new head is 914c6a204c6e. I rebased it onto `main` (d1ce3f3f1817). I edited its description to match the change. **Changed** - **Virtual SSBO mappings**: Bypassed SSBO memoization for virtual addresses in gpu/vk/tex_desc_memo.h:301 and added remap and unmap coverage in tests/test_tex_desc_memo.py:412. Tests were not run as instructed. **Not done** - **Independent touch comparison in gpu/vk/vk_draw.cpp:5384**: The check still runs the memo touch before the slow lookup. Comparing their effects needs an isolated or instrumented execution of both paths: texture touches can update shared cache state and record GPU uploads, so restoring only the texture epoch would not give the slow path an independent reference. Nothing was built or run: the checks run again on the new head. The change caches texture descriptors and read-only buffer bindings per recording thread to reduce repeated work. It adds roughly 520 KB of thread-local storage per recording thread and introduces cache invalidation and check-mode complexity. **Should fix (1)**: not blocking, but worth doing before merging. - **L2** `gpu/vk/vk_draw.cpp:5384`: Check mode's touch expectation comes from the memo's own state rather than the slow path, so it cannot establish equivalent touch behavior. *When:* On a memo hit, lookup invokes the touch callback before texture_view_of runs; touch_expected merely checks the same cached texture and epoch condition. A difference in the work or state produced by the fast touch can therefore be masked before the slow path is observed. **Do:** Compare the fast and slow touch decisions and resulting relevant state independently, without the first path changing the state used as the other's reference. *(for the author: `@fix` couldn't: At gpu/vk/vk_draw.cpp:5475, the expected touch still comes from the memo entry's epoch, and the memo lookup touches shared state before the slow lookup. The slow path does not provide an independent t)* **Testing before merging (2)** (runs on the systems it can change; it doesn't hold the recommendation) - **L3**: The reported A/B comparison uses the PR's disabled path as its baseline, so it does not measure the complete change against main under player settings. *When:* The disabled path still contains the new mode checks and surrounding code; its timing can differ from the base even when the memo is off. The measured 2.68% difference therefore does not establish the net change from the base build. **Do:** Run interleaved base and head builds on the same scene and player settings, reporting per-run frame times, average FPS and 1% lows, including a heavy area. - **L4**: The default-on renderer change has not been exercised on the other affected Tier 1 systems. *When:* Linux, AMD and Steam Deck recording paths use the same memo and resource invalidation logic, but the supplied live check and timing cover only Windows on NVIDIA. **Do:** Run the corrected equivalence check and representative base-versus-head gameplay on Linux and the remaining Tier 1 hardware, including AMD and Steam Deck; report frame pacing and memory as well as correctness. **Checks:** they run again on this head; a failure shows on the pull request. <details> <summary>Also noticed (3; not asked for, not blocking)</summary> - The new virtual-address test models binder results; an in-game run is still needed to exercise the real translation path. - The specified base diff contains 52 changed files, while the PR lists five. - The virtual-address guard bypasses SSBO memo lookup and storage for addresses at or above 1 TiB. </details> <details> <summary>More: does it help, other systems, switches, what was read</summary> **Does it help:** Unproven against main: the reported Windows RTX 4060 A/B run measured a 0.377 ms mean frame-time reduction across 51 periods, but its baseline was the PR with the memo disabled rather than a main build. **Other systems:** The renderer change can affect Vulkan systems beyond the tested Windows NVIDIA configuration. Linux and the other affected Tier 1 systems have no reported results. **Switches:** RX_VK_TEX_DESC_MEMO is added, defaults to 1, and also accepts 0 and check. The default's net cost and benefit against main and on other affected systems remain unmeasured. **Reviewed:** 914c6a204c6e against d1ce3f3f1817: Read the fix diff and the relevant descriptor and memo paths; skimmed the rules, PR description, reported runs, tests and base diff. The full changed code was not read: the specified base diff contains 52 files, including changes outside the five files listed in the PR.; nothing run (a code review). **Checked and fine:** - The virtual SSBO bypass preserves memoization for non-virtual addresses. - The fix retains the default-on texture and non-virtual SSBO memo paths. **Testing:** No commands that build or run code were executed. The reported Windows check-mode run recorded 32.6 million checks and zero mismatches, but its touch comparison has the limitation described in L2; CI has not run on this head. **Overlaps and merge order:** Not checked; network access is closed. </details> --- <sub>Automated code review by BeanBot (gpt-6.1-terra), asked for by BeanBot, after its fix. Nothing was run; a maintainer decides.</sub>
HumanBean deleted branch perf/vk-tex-desc-memo 2026-12-01 00:43:39 +00:00
Author
Contributor

Answering what was still open here after the merge. Line numbers are for main b4d56f526.

L1 (blocking: SSBO memo on virtual addresses): @fix fixed this in 914c6a204 and that is what was merged. ssbo_lookup and ssbo_store skip every base at or above 1 << 40 (gpu/vk/tex_desc_memo.h:337-338 and :355), so a virtual pool always goes through gpu_buffer_bind's translation and contiguity check. This is the same 1 << 40 virtual-pool boundary that ubo_ssbo_fast.h:82 and vk_draw.cpp:382 use. The remap and unmap cases are in tests/test_tex_desc_memo.py:422. As BeanBot noted, that test models the binder's results; only a game run in a scene with virtual-pool SSBOs exercises the real translation path, and none has been done.

L2 (check mode: fast handle decoding and touch): half done.

  • Handle decoding is compared now. Check mode decodes with c2_handle_of the way the fast path does (vk_draw.cpp:6104-6108) and compares the result with the slow path's handle (fast_handle == handle, :6188).
  • Touch is still not compared independently. The memo lookup's touch runs first (:6120, through tex_desc_touch_slow, :5479), and its expected value comes from the memo entry's own epoch (touch_expected, :6187). By the time texture_view_of runs on the slow path, the texture has already been touched. A fast touch that skips work the slow path would do (an upload, a destroy-generation bump) therefore still reports 0 mismatches.
  • What's still owed: in check mode, hold back the memo's touch until after the slow lookup; record the slow path's own touch decision (whether texture_touch_quick declined and texture_touch did work); compare the two; and add a test that fails when the memo skips a touch the slow path makes. That needs a follow-up PR checked in the game (RX_VK_TEX_DESC_MEMO=check, 0 mismatches). I'm not opening it now because I can't do that game run here.

L3 (base vs head at player settings), L4 (Linux, AMD, Steam Deck): still open. What has run: Windows 11 on an RTX 4060 only, Market_Child at 1280x720. Check mode logged 32.6M checks and 0 mismatches. The paired HOS_AB compared memo on and off inside the PR build: -0.377 ms, 95% CI +0.057..+0.691 ms. No interleaved base-vs-head runs, no player-settings runs and no other hardware. Beanstalk never posted results: the run on 1312ed6 was superseded, and 914c6a2 was not approved. These need the farm or someone with the hardware, on main.

Also noticed: the "52 changed files" figure came from diffing against an older base; the merged change is the five files listed. Nothing was run for this comment; the farm runs above have not been done.

Answering what was still open here after the merge. Line numbers are for main `b4d56f526`. **L1 (blocking: SSBO memo on virtual addresses):** `@fix` fixed this in 914c6a204 and that is what was merged. `ssbo_lookup` and `ssbo_store` skip every base at or above `1 << 40` (`gpu/vk/tex_desc_memo.h:337-338` and `:355`), so a virtual pool always goes through `gpu_buffer_bind`'s translation and contiguity check. This is the same `1 << 40` virtual-pool boundary that `ubo_ssbo_fast.h:82` and `vk_draw.cpp:382` use. The remap and unmap cases are in `tests/test_tex_desc_memo.py:422`. As BeanBot noted, that test models the binder's results; only a game run in a scene with virtual-pool SSBOs exercises the real translation path, and none has been done. **L2 (check mode: fast handle decoding and touch):** half done. - Handle decoding is compared now. Check mode decodes with `c2_handle_of` the way the fast path does (`vk_draw.cpp:6104-6108`) and compares the result with the slow path's handle (`fast_handle == handle`, `:6188`). - Touch is still not compared independently. The memo lookup's touch runs first (`:6120`, through `tex_desc_touch_slow`, `:5479`), and its expected value comes from the memo entry's own epoch (`touch_expected`, `:6187`). By the time `texture_view_of` runs on the slow path, the texture has already been touched. A fast touch that skips work the slow path would do (an upload, a destroy-generation bump) therefore still reports 0 mismatches. - What's still owed: in check mode, hold back the memo's touch until after the slow lookup; record the slow path's own touch decision (whether `texture_touch_quick` declined and `texture_touch` did work); compare the two; and add a test that fails when the memo skips a touch the slow path makes. That needs a follow-up PR checked in the game (`RX_VK_TEX_DESC_MEMO=check`, 0 mismatches). I'm not opening it now because I can't do that game run here. **L3 (base vs head at player settings), L4 (Linux, AMD, Steam Deck):** still open. What has run: Windows 11 on an RTX 4060 only, `Market_Child` at 1280x720. Check mode logged 32.6M checks and 0 mismatches. The paired HOS_AB compared memo on and off inside the PR build: -0.377 ms, 95% CI +0.057..+0.691 ms. No interleaved base-vs-head runs, no player-settings runs and no other hardware. Beanstalk never posted results: the run on 1312ed6 was superseded, and 914c6a2 was not approved. These need the farm or someone with the hardware, on main. **Also noticed:** the "52 changed files" figure came from diffing against an older base; the merged change is the five files listed. Nothing was run for this comment; the farm runs above have not been done.
Sign in to join this conversation.
No reviewers
No milestone
No project
No assignees
4 participants
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
MagicBeanDev/Longshot!2920
No description provided.