Conversation
prtkgaur
force-pushed
the
gh51268-dbp-vector-prefix-sum
branch
6 times, most recently
from
September 18, 2026 21:09
83a5289 to
5f91b9b
Compare
The output buffer may alias decoder members of the same type, forcing repeated reloads after stores. Keep the frame and running value in locals, write back once, and preserve unsigned wrapping during reconstruction.
prtkgaur
force-pushed
the
gh51268-dbp-vector-prefix-sum
branch
from
October 4, 2026 00:13
8692d8c to
4e3aaeb
Compare
Adjacent equal-width miniblocks form one packed stream. Decode each run with one unpack call, bounded by the current block and output request; retain the zero-width path and cover width changes, partial reads, block boundaries, and both integer widths.
Replace the dependent scalar additions with an inclusive SIMD scan for batches of at least four lanes. Retain scalar handling for narrower batches and tails, preserve unsigned wrapping, and cover every residual width, both block sizes, and wrapped totals.
prtkgaur
force-pushed
the
gh51268-dbp-vector-prefix-sum
branch
from
October 4, 2026 02:36
4e3aaeb to
3e46ef0
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Rationale for this change
Prefix sum: a chain of dependent additions. A log-step inclusive scan computes it a register at a
time, in log2(lanes) shifted additions. Adding the frame of reference before the scan turns
its running multiple into a term the scan produces, rather than a multiply per lane.
What changes are included in this PR?
I replaced the sequential addition loop with a vectorized prefix sum (scan) to speed up decoding.
Are these changes tested?
Yes. I added a new typed test that explicitly forces the decoder through the vector loop, the scalar remainder loop, and the hand-off between them to ensure totals and wrapping behave correctly.
Benchmark
Same setup as #51250.
NarrowSortedis added by this PR and holds non-decreasing values,the shape DELTA_BINARY_PACKED is usually chosen for.
Decode_Int32_NarrowSortedDecode_Int32_NarrowDecode_Int32_WideDecode_Int64_NarrowSortedDecode_Int64_NarrowDecode_Int64_WideDecode_Int32_FixedDecode_Int64_FixedAre there any user-facing changes?
No. No API change, no format change, and decoded values are identical.