Reduce bindless texture queue selection time #221

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

@⁠venglov on GitHub · 2026-11-24 22:48 UTC · original
venglov:perf/bound-texture-queue-sort → main · +114 −57 · 1 files · 1 commits · open

The bindless texture pass asks for up to 4,096 uploads at a time. With a large streaming backlog, selecting that batch used to sort every due slot and then scan the queue again for the frame counters.

This change counts slots during candidate collection and selects only the entries the pass can serve. Retries still go first in newest-write order, followed by alternating newest and oldest fresh writes. A regression checks the exact selected slots, write tokens, and counters for every cap on a mixed queue.

Measurement

Optimized Windows x64 synthetic benchmark under Wine 11.21 on Apple M1 Pro. Each figure is the median of 11 batches of 40 calls to selection and counting. Slot indices were shuffled relative to write order, and the selected entries and counters matched the baseline throughout.

Queued Due Retries Cap Before After
40,000 90% 10% 4,096 1.89 ms 0.87 ms
40,000 100% 50% 4,096 1.95 ms 0.74 ms
25,000 85% 10% 4,096 1.45 ms 0.68 ms
4,000 90% 10% 4,096 0.090 ms 0.063 ms
40,000 90% 10% 0 0.17 ms 0.23 ms

The production upload pass uses the 4,096-entry call. The benchmark measures CPU queue work only. In-game frame time is unmeasured.

Verification

  • Windows x64 victory-gpu library tests under Wine reported 111 passed by default and 118 passed with all features, with one ignored in each run. Tests that require a supported D3D12 device may skip under Wine.
  • victory-gpu Clippy passed for the Windows MSVC target with warnings denied in both feature configurations, using blake3/pure for cross-compilation.
  • cargo xtask policy and git diff --check passed.

AI-assisted with Codex. All test and benchmark inputs are synthetic.

**@⁠venglov** on GitHub · 2026-11-24 22:48 UTC · [original](https://github.com/fxceless/victory-fork/pull/221) `venglov:perf/bound-texture-queue-sort` → `main` · +114 −57 · 1 files · 1 commits · open The bindless texture pass asks for up to 4,096 uploads at a time. With a large streaming backlog, selecting that batch used to sort every due slot and then scan the queue again for the frame counters. This change counts slots during candidate collection and selects only the entries the pass can serve. Retries still go first in newest-write order, followed by alternating newest and oldest fresh writes. A regression checks the exact selected slots, write tokens, and counters for every cap on a mixed queue. ### Measurement Optimized Windows x64 synthetic benchmark under Wine 11.21 on Apple M1 Pro. Each figure is the median of 11 batches of 40 calls to selection and counting. Slot indices were shuffled relative to write order, and the selected entries and counters matched the baseline throughout. | Queued | Due | Retries | Cap | Before | After | | ---: | ---: | ---: | ---: | ---: | ---: | | 40,000 | 90% | 10% | 4,096 | 1.89 ms | 0.87 ms | | 40,000 | 100% | 50% | 4,096 | 1.95 ms | 0.74 ms | | 25,000 | 85% | 10% | 4,096 | 1.45 ms | 0.68 ms | | 4,000 | 90% | 10% | 4,096 | 0.090 ms | 0.063 ms | | 40,000 | 90% | 10% | 0 | 0.17 ms | 0.23 ms | The production upload pass uses the 4,096-entry call. The benchmark measures CPU queue work only. In-game frame time is unmeasured. ### Verification - Windows x64 `victory-gpu` library tests under Wine reported 111 passed by default and 118 passed with all features, with one ignored in each run. Tests that require a supported D3D12 device may skip under Wine. - `victory-gpu` Clippy passed for the Windows MSVC target with warnings denied in both feature configurations, using `blake3/pure` for cross-compilation. - `cargo xtask policy` and `git diff --check` passed. AI-assisted with Codex. All test and benchmark inputs are synthetic.
github-bot locked as GitHub sync and limited conversation to collaborators 2026-11-26 03:38:45 +00:00
Author
Owner

@⁠chatgpt-codex-connector[bot] on GitHub · 2026-11-24 22:48 UTC · original · edited 2026-11-24 22:50 UTC

Codex Review Summary: ✅ Completed

This comment shows the latest Codex review activity on this pull request.

Review Status Commit Review trigger
📝 Code Review ✅ Completed 2026-11-24T22:50:19.870644Z 5c7e9c9 PR opened
ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@⁠codex review" or "@⁠codex security review".

Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings.

**@⁠chatgpt-codex-connector[bot]** on GitHub · 2026-11-24 22:48 UTC · [original](https://github.com/fxceless/victory-fork/pull/221#issuecomment-7146667057) · edited 2026-11-24 22:50 UTC <!-- codex-pull-request-review-summary --> <!-- codex-review-state:v1 {"code_review":{"commit_sha":"5c7e9c990d59537bc06b7007ce180b7a17e83071","has_any_findings":false,"has_unresolved_findings":false,"status":"completed"},"security_review":{"commit_sha":null,"has_any_findings":null,"has_unresolved_findings":null,"status":null}} --> <details> <summary><strong>Codex Review Summary</strong>: ✅ Completed</summary> This comment shows the latest Codex review activity on this pull request. | Review | Status | Commit | Review trigger | | --- | --- | --- | --- | | 📝 **Code Review** | ✅ **Completed** <relative-time datetime="2026-11-24T22:50:19.870644Z">2026-11-24T22:50:19.870644Z</relative-time> | `5c7e9c9` | PR opened | <details> <summary>ℹ️ About Codex in GitHub</summary> <br/> [Your team has set up Codex to review pull requests in this repo](https://chatgpt.com/codex/cloud/settings/general). Reviews are triggered when you - Open a pull request for review - Mark a draft as ready - Comment "@⁠codex review" or "@⁠codex security review". Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings. </details> </details>
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/221/head:github-bot/gh-221'
git switch 'github-bot/gh-221'

Merge

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