Let bindless draws take the cheap check once the frame's rechecks are spent #61

Closed
github-bot wants to merge 1 commit from github-bot/gh-61 into main AGit
Owner

@⁠romainhedouin on GitHub · 2026-11-25 13:14 UTC · original
romainhedouin:perf/bindless-recheck-early-return → main · +10 −1 · 1 files · 1 commits · closed without merging

Bindless draws start with a cheap check ("anything to do for this heap?") and return at once when there is nothing. One of its conditions is the frame at which queued texture rechecks are next due. Once a frame's recheck quota (32) was used up, that value was still set to a due frame (≤ the current one), so the cheap check never passed again for the rest of the frame: every later bindless draw took the recording flag, read the clock twice and tried the heap's lock, only to find it could not recheck anything. Now, when the quota is spent, the next due frame is set to the next frame. Which textures are rechecked, and when, is unchanged.

Per bindless draw after the frame's quota is spent Before After
Locked atomic operations 3 0
Clock reads 2 0
Draws taking the full path (model, 2.7 M draws, ~1% with changed slots) 2,566,366 27,782

The model is a standalone re-implementation of this state machine; over 300 frames and 12 configurations it gave identical uploads, rechecks and queues for the old and new code. Type-checked for Windows (cargo clippy --target x86_64-pc-windows-msvc, with and without --all-features, no new warnings); not run.

Separate finding, not changed here: the recheck pop loop can pop more entries than the remaining quota, and the extra ones are dropped without being re-queued (descriptor/host.rs ~1439 and ~1579), so such a texture is not rechecked again until a slot reaches it or it is rewritten.

🤖 Generated with Claude Code

**@⁠romainhedouin** on GitHub · 2026-11-25 13:14 UTC · [original](https://github.com/Belobug/VIctory-Belobug-AMD/pull/61) `romainhedouin:perf/bindless-recheck-early-return` → `main` · +10 −1 · 1 files · 1 commits · closed without merging Bindless draws start with a cheap check ("anything to do for this heap?") and return at once when there is nothing. One of its conditions is the frame at which queued texture rechecks are next due. Once a frame's recheck quota (32) was used up, that value was still set to a due frame (≤ the current one), so the cheap check never passed again for the rest of the frame: every later bindless draw took the recording flag, read the clock twice and tried the heap's lock, only to find it could not recheck anything. Now, when the quota is spent, the next due frame is set to the next frame. Which textures are rechecked, and when, is unchanged. | Per bindless draw after the frame's quota is spent | Before | After | |---|---|---| | Locked atomic operations | 3 | 0 | | Clock reads | 2 | 0 | | Draws taking the full path (model, 2.7 M draws, ~1% with changed slots) | 2,566,366 | 27,782 | The model is a standalone re-implementation of this state machine; over 300 frames and 12 configurations it gave identical uploads, rechecks and queues for the old and new code. Type-checked for Windows (`cargo clippy --target x86_64-pc-windows-msvc`, with and without `--all-features`, no new warnings); not run. Separate finding, not changed here: the recheck pop loop can pop more entries than the remaining quota, and the extra ones are dropped without being re-queued (`descriptor/host.rs` ~1439 and ~1579), so such a texture is not rechecked again until a slot reaches it or it is rewritten. 🤖 Generated with [Claude Code](https://claude.com/claude-code)
github-bot locked as GitHub sync and limited conversation to collaborators 2026-11-26 03:34:46 +00:00
github-bot closed this pull request 2026-11-27 01:00:07 +00:00
Author
Owner

@⁠romainhedouin on GitHub · 2026-11-26 22:24 UTC · original

Closing: the recheck quota this PR fixed (recheck_at, RECHECKS) doesn't exist on a-publier, whose texture queue is a different design (texture_slots_due, descriptor/host.rs:1939).

**@⁠romainhedouin** on GitHub · 2026-11-26 22:24 UTC · [original](https://github.com/Belobug/VIctory-Belobug-AMD/pull/61#issuecomment-7204653860) Closing: the recheck quota this PR fixed (`recheck_at`, `RECHECKS`) doesn't exist on `a-publier`, whose texture queue is a different design (`texture_slots_due`, descriptor/host.rs:1939).

Pull request closed

This discussion has been locked. Commenting is limited to contributors.
No description provided.