perf: avoid redundant readback selection allocations #1226

Closed
spk-c wants to merge 2 commits from upstream-pr/1229 into main
spk-c commented 2026-11-26 00:59:46 +00:00 (Migrated from github.com)

Imported from fxceless/victory-fork. Originally posted by spk-c on 2026-11-26T00:59:46Z.


Summary

Stream flags directly into the selected-piece union, avoid temporary allocations, and reuse inflight ticket keys. Preserve forced-refetch counts, copy ranges, byte counts and synchronization. The synthetic parity regression covers 1,024 combinations.

Validation

All CI steps passed for this isolated change against the corrected test baseline in the fork: https://github.com/spk-c/victory-fork/actions/runs/45731809147.

This submission is a single commit rebased onto upstream a183ea2; exact-revision upstream CI is pending. Upstream's pre-existing CI failures are addressed separately in #1228. Draft pending baseline and upstream review. AI-assisted.

Refresh against upstream 52ac4ec

New head 6ca976192b1b33100cf4b9aaa6e39a57ed1ef469; the streamed selection versus two-pass selection regression passed. Clean isolated workspace Cargo Check and strict all-feature Clippy passed. Original commits are preserved. PR-only diff check passed. Full upstream CI approval and source-size policy fix #1357 remain pending.

<!-- greyfinch-sync:fxceless/victory-fork:issue:5501964376 --> Imported from [fxceless/victory-fork](https://github.com/fxceless/victory-fork/pull/1229). Originally posted by [spk-c](https://github.com/spk-c) on 2026-11-26T00:59:46Z. --- ## Summary Stream flags directly into the selected-piece union, avoid temporary allocations, and reuse inflight ticket keys. Preserve forced-refetch counts, copy ranges, byte counts and synchronization. The synthetic parity regression covers 1,024 combinations. ## Validation All CI steps passed for this isolated change against the corrected test baseline in the fork: https://github.com/spk-c/victory-fork/actions/runs/45731809147. This submission is a single commit rebased onto upstream a183ea2; exact-revision upstream CI is pending. Upstream's pre-existing CI failures are addressed separately in #1228. Draft pending baseline and upstream review. AI-assisted. ## Refresh against upstream 52ac4ec New head `6ca976192b1b33100cf4b9aaa6e39a57ed1ef469`; the streamed selection versus two-pass selection regression passed. Clean isolated workspace Cargo Check and strict all-feature Clippy passed. Original commits are preserved. PR-only diff check passed. Full upstream CI approval and source-size policy fix #1357 remain pending.
UncommonDLL commented 2026-11-26 19:44:43 +00:00 (Migrated from github.com)

Imported from fxceless/victory-fork. Originally posted by UncommonDLL on 2026-11-26T19:44:43Z.


Alpha validation of tested head f8a21a3d4d415c52f0eb06e849a3475d2ccab128 against direct parent a183ea275e48e047eeb18790b09cac19d6e4b8c2. These measurements cover CPU selection and range construction on the Ryzen 7 7800X3D and apply to those tested commits.

All 24 correctness checks passed. On the overlapping in-flight ticket workload, 2,304 input occurrences selected 1,365 pieces. Across 32 paired rounds, the median CPU saving was 72.944 µs per batch. Allocated bytes fell from 656,692 to 455,960.

Codex-assisted validation and write-up.

<!-- greyfinch-sync:fxceless/victory-fork:comment:7201915833 --> Imported from [fxceless/victory-fork](https://github.com/fxceless/victory-fork/pull/1229#issuecomment-7201915833). Originally posted by [UncommonDLL](https://github.com/UncommonDLL) on 2026-11-26T19:44:43Z. --- Alpha validation of tested head `f8a21a3d4d415c52f0eb06e849a3475d2ccab128` against direct parent `a183ea275e48e047eeb18790b09cac19d6e4b8c2`. These measurements cover CPU selection and range construction on the Ryzen 7 7800X3D and apply to those tested commits. All 24 correctness checks passed. On the overlapping in-flight ticket workload, 2,304 input occurrences selected 1,365 pieces. Across 32 paired rounds, the median CPU saving was **72.944 µs per batch**. Allocated bytes fell from **656,692 to 455,960**. Codex-assisted validation and write-up.

Pull request closed

Sign in to join this conversation.
No reviewers
No labels
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.

Reference
fxceless/victory-fork!1226
No description provided.