perf(gpu/submit): always lock-free pre-filter unchanged refresh spans #390

Manually merged
github merged 2 commits from github-bot/gh-390 into gh-pr/390/base 2026-12-03 13:49:47 +00:00 AGit
Owner

@⁠Androtim on GitHub · 2026-12-03 12:59 UTC · original
Androtim:perf/submit-lockfree-nothing-new → main · +407 −125 · 4 files · 2 commits · merged 2026-12-03 13:47 UTC

Summary

Eliminates the legacy \FEW = 32\ pre-filter bypass on the submit thread so large refresh batches (e.g. hundreds to thousands of buffer views per submission) always filter out provably unchanged spans lock-free before querying write-watches or waking worker chunks.

Changes

  • **\crates/victory-gpu/src/host.rs**:
    • Removed the \const FEW: usize = 32\ / \MANY_CHUNK\ bypass in \Batch::refresh_front\ and \Batch::flush_all\ (and pre-filtered \Batch::refresh_ahead) using shared \Batch::filter_unchanged\ and \Batch::ask_ahead_and_filter\ helpers.
    • Provably clean spans are dropped lock-free via \Shadow::nothing_new_with\ on the submitting thread before \sk_ahead\ and before \wide_each_scoped\ / \wide_run. When !kept, spans cleared by \sk_ahead\ are also re-filtered before dispatch; remaining genuinely dirty/uncertain spans dispatch at \wide_chunk()\ grain (and skip worker wakeups altogether when \
**@⁠Androtim** on GitHub · 2026-12-03 12:59 UTC · [original](https://github.com/Androtim/MiniVI/pull/390) `Androtim:perf/submit-lockfree-nothing-new` → `main` · +407 −125 · 4 files · 2 commits · merged 2026-12-03 13:47 UTC ## Summary Eliminates the legacy \FEW = 32\ pre-filter bypass on the submit thread so large refresh batches (e.g. hundreds to thousands of buffer views per submission) always filter out provably unchanged spans lock-free before querying write-watches or waking worker chunks. ### Changes - **\crates/victory-gpu/src/host.rs\**: - Removed the \const FEW: usize = 32\ / \MANY_CHUNK\ bypass in \Batch::refresh_front\ and \Batch::flush_all\ (and pre-filtered \Batch::refresh_ahead\) using shared \Batch::filter_unchanged\ and \Batch::ask_ahead_and_filter\ helpers. - Provably clean spans are dropped lock-free via \Shadow::nothing_new_with\ on the submitting thread before \sk_ahead\ and before \wide_each_scoped\ / \wide_run\. When \!kept\, spans cleared by \sk_ahead\ are also re-filtered before dispatch; remaining genuinely dirty/uncertain spans dispatch at \wide_chunk()\ grain (and skip worker wakeups altogether when \
- Remove the FEW = 32 bypass in Batch::refresh_front and Batch::flush_all (and pre-filter Batch::refresh_ahead) via shared Batch::filter_unchanged and Batch::ask_ahead_and_filter helpers so provably clean spans never trigger ask_ahead or wake wide_each_scoped workers.
- Optimize Shadow::gaps_nothing_new with a whole-range lock-free check before locking self.pending, enforce crate:⌚:light() in Shadow::nothing_new_with, and evaluate ranged_lockfree lazily inside PageEpochs::all_within_with only after published/ahead and copied-epoch checks require it.
- Add unit tests in shadow::hash_pool_tests and host::refresh_tests covering clean/dirty/unwatched/pending/ranged_seq-changed pre-filtering above 32 spans.
github-bot locked as GitHub sync and limited conversation to collaborators 2026-12-03 13:04:39 +00:00
Author
Owner

@⁠Androtim on GitHub · 2026-12-03 13:33 UTC · original

Triage (0b700caa, CI check PASS):

  • Gate 2 Reasoning Audit Pass #16 (#282 comment 7379381558): VERIFIED CLEAN (0 P0, 0 P1).
  • Holding auto-merge solely for Gate 3 plain --release A/B vs main (69d73a85) showing win/non-regression with 0 crashes/DRED. Ready to merge immediately once posted!
**@⁠Androtim** on GitHub · 2026-12-03 13:33 UTC · [original](https://github.com/Androtim/MiniVI/pull/390#issuecomment-7379990525) Triage (`0b700caa`, **CI `check` PASS**): - **Gate 2 Reasoning Audit Pass #16 (`#282` comment `7379381558`):** `VERIFIED CLEAN (0 P0, 0 P1)`. - Holding auto-merge solely for **Gate 3 plain `--release` A/B** vs `main` (`69d73a85`) showing win/non-regression with `0` crashes/DRED. Ready to merge immediately once posted!
github-bot changed target branch from main to gh-pr/390/base 2026-12-03 13:49:44 +00:00
github manually merged commit f8c5ddfa1a into gh-pr/390/base 2026-12-03 13:49:46 +00:00
This discussion has been locked. Commenting is limited to contributors.
No reviewers
No milestone
No assignees
1 participant
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
github/Androtim--MiniVI!390
No description provided.