Skip uniform words that sit in a gap between inline updates #322

Closed
SkippySteve wants to merge 1 commit from fix/ub-hole into main
SkippySteve commented 2026-11-07 20:44:23 +00:00 (Migrated from github.com)

Summary

  • ub_read and ub_overlay walked every UPDATE_UB for each word of a uniform or storage buffer, to copy the bytes an inline update had written over the capture. Most words are not inside any update.
  • The first miss remembers the open gap around that word. Later reads that sit entirely in the gap return the memory already read, until an update is added or an old one is dropped. A word inside an update still walks the list and applies every overlap, in order.

Test plan

  • python -I -B tests/test_ub_gap.py passes: a query between [100,110) and [200,210) remembers [110, 200), an overlapping query does not, and both adding and dropping an update bump the generation the gap is keyed on
  • Removing the overlap check fails the test, and so does leaving the generation unbumped when an update is pushed
  • CI: "Check uniform words skip a known gap"
## Summary - `ub_read` and `ub_overlay` walked every `UPDATE_UB` for each word of a uniform or storage buffer, to copy the bytes an inline update had written over the capture. Most words are not inside any update. - The first miss remembers the open gap around that word. Later reads that sit entirely in the gap return the memory already read, until an update is added or an old one is dropped. A word inside an update still walks the list and applies every overlap, in order. ## Test plan - [x] `python -I -B tests/test_ub_gap.py` passes: a query between `[100,110)` and `[200,210)` remembers `[110, 200)`, an overlapping query does not, and both adding and dropping an update bump the generation the gap is keyed on - [x] Removing the overlap check fails the test, and so does leaving the generation unbumped when an update is pushed - [ ] CI: "Check uniform words skip a known gap"
NotRexed commented 2026-11-07 23:46:28 +00:00 (Migrated from github.com)

Thanks! This went into main by hand in c3459dc (with you credited as co-author), and later #373 (your follow-up) replaced the gap cache with the per-word one when both landed: the two collided in ub_read/ub_overlay, so main keeps #373's. Measured together with #345/#349/#362: 27.1 -> 30.9 fps median in Kokiri, no extra one-frame flashes.

Thanks! This went into main by hand in c3459dc (with you credited as co-author), and later #373 (your follow-up) replaced the gap cache with the per-word one when both landed: the two collided in ub_read/ub_overlay, so main keeps #373's. Measured together with #345/#349/#362: 27.1 -> 30.9 fps median in Kokiri, no extra one-frame flashes.
Commenting is not possible because the repository is archived.
No description provided.