Skip to content

refactor: make bitpacked chunk boundaries explicit - #10005

Closed
mhk197 wants to merge 4 commits into
mk/bitpacked-stack-03-width-childfrom
mk/bitpacked-stack-04-offset-child
Closed

mhk197 wants to merge 4 commits into
mk/bitpacked-stack-03-width-childfrom
mk/bitpacked-stack-04-offset-child

Conversation

@mhk197

@mhk197 mhk197 commented Sep 23, 2026 •

Copy link
Copy Markdown
Contributor

Make constructors accept the offsets child explicitly, so slices, casts, patch reconstruction, and other array transformations preserve the stored boundaries. Slices retain their original offset origin and share the backing buffer; addresses are computed relative to the first boundary.

Introduce ChunkLayout, which borrows a materialized offsets buffer and derives each chunk's bit width from adjacent boundaries. It validates boundary ordering, 128-byte alignment of chunk sizes, supported widths, and the total packed span. Encoders may supply temporary widths to build the boundaries, but the persistent array contains only the offsets child.

The scalar bit_width remains available to existing kernels. Arrays must still have materialized, uniform offsets consistent with that scalar. This prepares the array API for a later migration of CPU readers; v1 serialization continues to omit the offsets child. CUDA changes only adapt the constructor API.

Validation: 395 FastLanes/BtrBlocks tests passed (1 skipped). Focused Clippy passed with all targets, all features, and warnings denied.

Signed-off-by: "Matt Katz" <mhkatz97@gmail.com>

Signed-off-by: Matt Katz <mhkatz97@gmail.com>
Signed-off-by: "Matt Katz" <mhkatz97@gmail.com>
Signed-off-by: Matt Katz <mhkatz97@gmail.com>
@mhk197
mhk197 added this pull request to stack #10006 September 23, 2026 18:22
@codspeed

codspeed Bot commented Sep 23, 2026 •

Copy link
Copy Markdown

Merging this PR will improve performance by 79.16%

⚠️ Unknown Walltime execution environment detected

Using the Walltime instrument on standard Hosted Runners will lead to inconsistent data.

For the most accurate results, we recommend using CodSpeed Macro Runners: bare-metal machines fine-tuned for performance measurement consistency.

⚠️ 4 benchmarks measured no execution time

Nothing ran under measurement, usually because the compiler removed the code under test. These results are not comparable, so they count as unchanged.

Preventing compiler optimizations

⚡ 1 improved benchmark
✅ 2261 untouched benchmarks
⏩ 299 skipped benchmarks1
🗄️ 1 archived benchmark run2

Performance Changes

Mode Benchmark BASE HEAD Efficiency
⚡ Simulation take_fsl_random[128, 10] 58.5 µs 32.7 µs +79.16%
⚠️ Simulation take_fsl_u32_random[256, 10] < 1 ns < 1 ns N/A
⚠️ Simulation fixed_16_advancing_ptr_safe[100] < 1 ns < 1 ns N/A
⚠️ Simulation preverify_advancing_ptr_unchecked[1000] < 1 ns < 1 ns N/A
⚠️ Simulation preverify_advancing_ptr_unchecked[10000] < 1 ns < 1 ns N/A

Tip

Curious why performance improved? Comment @codspeedbot explain why performance improved on this PR, or directly use the CodSpeed MCP with your agent.


Comparing mk/bitpacked-stack-04-offset-child (06905e1) with mk/bitpacked-stack-03-width-child (9dc388a)

Open in CodSpeed

Footnotes

  1. 299 benchmarks were skipped, so the baseline results were used instead. If they were deleted from the codebase, click here and archive them to remove them from the performance reports. ↩

  2. 1 benchmark was run, but is now archived. If it was deleted in another branch, consider rebasing to remove it from the report. Instead if it was added back, click here to restore it. ↩

Signed-off-by: "Matt Katz" <mhkatz97@gmail.com>
Signed-off-by: Matt Katz <mhkatz97@gmail.com>
Signed-off-by: "Matt Katz" <mhkatz97@gmail.com>
Signed-off-by: Matt Katz <mhkatz97@gmail.com>
@mhk197
mhk197 removed this pull request from stack #10006 September 23, 2026 19:43
@mhk197
mhk197 added this pull request to stack #10012 September 23, 2026 19:43
@mhk197
mhk197 force-pushed the mk/bitpacked-stack-03-width-child branch from 6dc1734 to 9dc388a Compare September 23, 2026 19:43
@mhk197
mhk197 force-pushed the mk/bitpacked-stack-04-offset-child branch from ecd1bd3 to 06905e1 Compare September 23, 2026 19:43
@mhk197 mhk197 changed the title feat: add bitpacked chunk offset child refactor: make bitpacked chunk boundaries explicit Sep 23, 2026
@mhk197
mhk197 force-pushed the mk/bitpacked-stack-03-width-child branch from 9dc388a to 505f31f Compare October 1, 2026 15:43
@mhk197 mhk197 closed this Oct 2, 2026
@mhk197
mhk197 removed this pull request from stack #10012 October 2, 2026 02:46
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant