vkback: no texture provider call or SipHash per descriptor slot #267

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

@⁠Flezzonkeys on GitHub · 2026-12-02 19:04 UTC · original
Flezzonkeys:slot-path-lean → main · +3 −12 · 4 files · 1 commits · open

What

Takes two pieces of counter work off the descriptor slot path (docs/TASKS.md "Renderer CPU: index slots"). 3 lines added, 12 removed, no change to what is written.

  • The mip-linear view probe (#152) goes. For every SRV slot written of a texture with mips it called the texture provider (lock, lookup, TextureInfo clone or a full TextureInfo::build, umem query) to learn whether the texture is linear. Its question is answered: no view of a single level in #152's house and boat runs, and none in three play sessions here (one level 0, several 6167 / 5668 / 3634). So the split shapes in "Linear textures with mipmaps are not bound in place" cannot serve these views.
  • Arena::held_new and Arena::fresh use crate::fx, like the crate's other per-op maps. held_read (#236) asks held_new at every slot read and hold_new asks fresh at every image slot write; both used std's SipHash.

The reference

No counterpart: both are our own bookkeeping.

Evidence

Ryzen 7 9800X3D, RX 9070 XT, CachyOS, Proton Experimental.

  • How often it runs (88d66ae plus a local counter, free play, 67 windows of 60 presents with at least 5,000 recorded draws/dispatches a frame): ~368k slot reads a frame, 37 % of them while a slot was held, so with a non-empty held_new. ~65k placed and resource SRV slots written a frame.
  • Cost of one call, microbenchmarks outside the game:
before after
held_new lookup, set not empty ~5 ns ~1 ns
provider, placed texture (without the umem query) 26 ns gone
provider, object texture (full build) 280 ns gone
  • In the game: no fps gain measured, and no A B B A run. I played an earlier version of this change (a cheap linear check instead of removing the probe, plus a small change to maporder::check_all). Placed slot writes went from 135 to 119 ns and resource SRV writes from 172 to 143 ns, but kinds it does not touch also got about 12 % faster, so part of that is the run. My estimate is about 1 ms of renderer CPU a frame. The heavy scenes here are at 45-50 ms GPU, which hides it.
  • This commit in the game: free play, about 3 minutes in the world, the picture looked right, normal exit, no device loss, no panic, no issue kind that the runs on 88d66ae did not have. Slot reads took 38.8 ns each (all slot_reads time over all reads) against 46.3 ns on plain 88d66ae: single runs on different routes, so not a proof. Renderer CPU per recorded draw/dispatch was not lower (3.49 against 3.32 ms per 1,000).
  • Why keep it without a measured gain (rule 24): it can help where the renderer is the limit, and it is less code.
  • Tests on this commit: vkback 172 passed, policy 6 passed, clippy --all-targets -D warnings clean.
  • No validation run (rule 30): the Vulkan calls stay the same, only a counter and two hashers change.

Checklist (docs/AGENTS.md)

  • One topic (rule 31); docs/TASKS.md not edited, the fixed item named above (rule 29)
  • "Allow edits by maintainers" on; after review, no force-push and no close-and-reopen (it drops the maintainers' commits)
  • No fallback or second path for a case that can't happen, in title data or in our own setup (rule 33); unexpected input fails loudly (rule 9)
  • Constants come from the console, the hardware or the title's data, not tuned by eye or ear (rule 9b)
  • Every switch is listed, read in one place, and a bad value stops the start (rule 2)
  • Queues and other externally synchronized Vulkan objects are used under their lock (rule 35)
  • Every unsafe block has a // SAFETY: comment; no raw pointer around the borrow checker (rule 36)
  • Clippy clean; tests call the production code; TRANSLATOR_VERSION bumped if the translator's output changes (rule 27)
  • Comments say what is true now and name functions, not line numbers (rule 3)
  • Nothing from the title, and no pointers to where non-free data can be found (hard constraints)
**@⁠Flezzonkeys** on GitHub · 2026-12-02 19:04 UTC · [original](https://github.com/vktory6/VKtory/pull/267) `Flezzonkeys:slot-path-lean` → `main` · +3 −12 · 4 files · 1 commits · open ## What Takes two pieces of counter work off the descriptor slot path (docs/TASKS.md "Renderer CPU: index slots"). 3 lines added, 12 removed, no change to what is written. - **The mip-linear view probe (#152) goes.** For every SRV slot written of a texture with mips it called the texture provider (lock, lookup, `TextureInfo` clone or a full `TextureInfo::build`, umem query) to learn whether the texture is linear. Its question is answered: no view of a single level in #152's house and boat runs, and none in three play sessions here (`one level 0, several 6167 / 5668 / 3634`). So the split shapes in "Linear textures with mipmaps are not bound in place" cannot serve these views. - **`Arena::held_new` and `Arena::fresh` use `crate::fx`**, like the crate's other per-op maps. `held_read` (#236) asks `held_new` at every slot read and `hold_new` asks `fresh` at every image slot write; both used std's SipHash. ## The reference No counterpart: both are our own bookkeeping. ## Evidence Ryzen 7 9800X3D, RX 9070 XT, CachyOS, Proton Experimental. - **How often it runs** (88d66ae plus a local counter, free play, 67 windows of 60 presents with at least 5,000 recorded draws/dispatches a frame): ~368k slot reads a frame, 37 % of them while a slot was held, so with a non-empty `held_new`. ~65k placed and resource SRV slots written a frame. - **Cost of one call, microbenchmarks outside the game:** | | before | after | |---|---:|---:| | `held_new` lookup, set not empty | ~5 ns | ~1 ns | | provider, placed texture (without the umem query) | 26 ns | gone | | provider, object texture (full build) | 280 ns | gone | - **In the game: no fps gain measured, and no A B B A run.** I played an earlier version of this change (a cheap linear check instead of removing the probe, plus a small change to `maporder::check_all`). Placed slot writes went from 135 to 119 ns and resource SRV writes from 172 to 143 ns, but kinds it does not touch also got about 12 % faster, so part of that is the run. My estimate is about 1 ms of renderer CPU a frame. The heavy scenes here are at 45-50 ms GPU, which hides it. - **This commit in the game:** free play, about 3 minutes in the world, the picture looked right, normal exit, no device loss, no panic, no issue kind that the runs on 88d66ae did not have. Slot reads took 38.8 ns each (all `slot_reads` time over all reads) against 46.3 ns on plain 88d66ae: single runs on different routes, so not a proof. Renderer CPU per recorded draw/dispatch was not lower (3.49 against 3.32 ms per 1,000). - **Why keep it without a measured gain (rule 24):** it can help where the renderer is the limit, and it is less code. - Tests on this commit: vkback 172 passed, policy 6 passed, clippy `--all-targets -D warnings` clean. - No validation run (rule 30): the Vulkan calls stay the same, only a counter and two hashers change. ## Checklist (docs/AGENTS.md) - [x] One topic (rule 31); `docs/TASKS.md` not edited, the fixed item named above (rule 29) - [x] "Allow edits by maintainers" on; after review, no force-push and no close-and-reopen (it drops the maintainers' commits) - [x] No fallback or second path for a case that can't happen, in title data or in our own setup (rule 33); unexpected input fails loudly (rule 9) - [x] Constants come from the console, the hardware or the title's data, not tuned by eye or ear (rule 9b) - [x] Every switch is listed, read in one place, and a bad value stops the start (rule 2) - [x] Queues and other externally synchronized Vulkan objects are used under their lock (rule 35) - [x] Every `unsafe` block has a `// SAFETY:` comment; no raw pointer around the borrow checker (rule 36) - [x] Clippy clean; tests call the production code; `TRANSLATOR_VERSION` bumped if the translator's output changes (rule 27) - [x] Comments say what is true now and name functions, not line numbers (rule 3) - [x] Nothing from the title, and no pointers to where non-free data can be found (hard constraints)
github-bot locked as GitHub sync and limited conversation to collaborators 2026-12-02 19:38:51 +00:00
This pull request can be merged automatically.
This branch is out-of-date with the base branch
You are not authorized to merge this pull request.
View command line instructions

Checkout

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

Merge

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