host: use zero-allocation wide_each_scoped in sift_front and sift_refreshes #3332

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

@⁠Maverick0351a on GitHub · 2026-11-29 21:54 UTC · original
Maverick0351a:perf/parallel-sift-refreshes → main · +36 −40 · 1 files · 1 commits · closed without merging

Summary

  • sift_front (VICTORY_FRONT_SIFT=1, on by default) and sift_refreshes (VICTORY_FLUSH_SIFT=1) currently call wide_each(sift.len(), 32, ...) when !new_batch && sift.len() >= 128.
  • Unlike wide_each_scoped, wide_each wraps the closure in an Arc<dyn Fn(usize) + Send + Sync> per dispatch, prevents borrowing stack slices directly (&self.resources, &ranges, &sift, &out) without SendPtr wrappers, and is bypassed entirely if VICTORY_NEW_BATCH=1 is set (which runs nothing_new_all single-threaded on the submitting thread and allocates a Vec<u64> per span while locking j.written).
  • Replacing wide_each + SendPtr in sift_front and sift_refreshes with wide_each_scoped(sift.len(), 32, ...) eliminates the per-flush Arc heap allocation and SendPtr boilerplate while keeping lock-free parallel WRITTEN_EPOCHS sifting across the worker pool.

Live Telemetry (RTX 5080 Laptop GPU 16 GB, GTA VI v1.0.2.1)

  • With VICTORY_FRONT_SIFT=1 and VICTORY_FLUSH_SIFT=1 using wide_each_scoped(..., 32, ...):
    • refreshes dropped from 22.9 ms/frame (35.4-37.9 ms/frame with VICTORY_NEW_BATCH=1) down to 11.9-14.2 ms/frame across 41-44 flushes of 6,728-11,196 spans (5,674-9,918 sifted out as known to copy nothing, 1,048-1,271 refreshed across worker threads).
    • Total submitting-thread preparing per frame dropped to 35.6 ms/frame (24.8 ms in the lists' steps).
**@⁠Maverick0351a** on GitHub · 2026-11-29 21:54 UTC · [original](https://github.com/trustno1-coder/VIctory-NVIDIA/pull/3332) `Maverick0351a:perf/parallel-sift-refreshes` → `main` · +36 −40 · 1 files · 1 commits · closed without merging ## Summary - `sift_front` (`VICTORY_FRONT_SIFT=1`, on by default) and `sift_refreshes` (`VICTORY_FLUSH_SIFT=1`) currently call `wide_each(sift.len(), 32, ...)` when `!new_batch && sift.len() >= 128`. - Unlike `wide_each_scoped`, `wide_each` wraps the closure in an `Arc<dyn Fn(usize) + Send + Sync>` per dispatch, prevents borrowing stack slices directly (`&self.resources`, `&ranges`, `&sift`, `&out`) without `SendPtr` wrappers, and is bypassed entirely if `VICTORY_NEW_BATCH=1` is set (which runs `nothing_new_all` single-threaded on the submitting thread and allocates a `Vec<u64>` per span while locking `j.written`). - Replacing `wide_each` + `SendPtr` in `sift_front` and `sift_refreshes` with `wide_each_scoped(sift.len(), 32, ...)` eliminates the per-flush `Arc` heap allocation and `SendPtr` boilerplate while keeping lock-free parallel `WRITTEN_EPOCHS` sifting across the worker pool. ## Live Telemetry (RTX 5080 Laptop GPU 16 GB, GTA VI `v1.0.2.1`) - With `VICTORY_FRONT_SIFT=1` and `VICTORY_FLUSH_SIFT=1` using `wide_each_scoped(..., 32, ...)`: - `refreshes` dropped from `22.9 ms/frame` (`35.4-37.9 ms/frame` with `VICTORY_NEW_BATCH=1`) down to `11.9-14.2 ms/frame` across 41-44 flushes of `6,728-11,196` spans (`5,674-9,918` sifted out as `known to copy nothing`, `1,048-1,271` refreshed across worker threads). - Total submitting-thread `preparing per frame` dropped to `35.6 ms/frame` (`24.8 ms in the lists' steps`).
github-bot locked as GitHub sync and limited conversation to collaborators 2026-11-29 21:55:39 +00:00
github-bot force-pushed github-bot/gh-3332 from a97ca7cb70 to cdfd133e73 2026-11-29 22:35:12 +00:00 Compare
github-bot closed this pull request 2026-11-30 21:35:10 +00:00
Author
Owner

@⁠Maverick0351a on GitHub · 2026-11-30 21:32 UTC · original

Superseded by 79b22c5 and #3762 (d7f42429), which landed wide_each_scoped +
othing_new_with in sift_spans on main.

**@⁠Maverick0351a** on GitHub · 2026-11-30 21:32 UTC · [original](https://github.com/trustno1-coder/VIctory-NVIDIA/pull/3332#issuecomment-7292541915) Superseded by 79b22c5 and #3762 (d7f42429), which landed wide_each_scoped + othing_new_with in sift_spans on main.

Pull request closed

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/trustno1-coder--VIctory-NVIDIA!3332
No description provided.