fix(buffer): reject ZSTs and address allocator review comments - #9807
Conversation
Signed-off-by: Nicholas Gates <nick@nickgates.com>
Merging this PR will improve performance by 11.82%
|
| Mode | Benchmark | BASE |
HEAD |
Efficiency | |
|---|---|---|---|---|---|
| ⚡ | Simulation | allocate_drop_arrow[0] |
456.9 ns | 402.7 ns | +13.45% |
| ⚡ | WallTime | mul_i32_nonnull_avx512 |
7.9 µs | 7 µs | +11.64% |
| ⚡ | Simulation | allocate_drop_bytes[0] |
575.7 ns | 521.6 ns | +10.39% |
Tip
Curious why performance improved? Comment @codspeedbot explain why performance improved on this PR, or directly use the CodSpeed MCP with your agent.
Comparing ngates/buffer-review-minimal (2a3f517) with develop (85b70cf)2
Footnotes
-
206 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. ↩
-
No successful run was found on
develop(5c8c397) during the generation of this report, so 85b70cf was used instead as the comparison base. There might be some changes unrelated to this pull request in this report. ↩
Signed-off-by: Nicholas Gates <nick@nickgates.com>
Signed-off-by: Nicholas Gates <nick@nickgates.com>
Signed-off-by: Nicholas Gates <nick@nickgates.com>
Signed-off-by: Nicholas Gates <nick@nickgates.com>
Signed-off-by: Nicholas Gates <nick@nickgates.com>
Brings in the allocator-backed buffers (#9668, #9669, #9807) and the exponent `Alignment` (#9730). Conflicts are resolved in favour of develop's buffer API and internals: the tagged-word storage from this branch is re-applied under that API in the next commit rather than merged line by line. `Alignment` stays in `vortex-bytes`, now with develop's `u8` exponent representation and without `Deref`. The two `scalars.rs` hunks keep `into_vec`, which the next commit restores. The library builds at this commit; `vortex-buffer`'s own tests and benches target the API the next commit restores. Signed-off-by: Claude <noreply@anthropic.com> Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01Bk1yU7fmfhiFrPzF888VmT
Reject zero-sized buffer elements at construction with compile-time assertions. ZST support was previously inconsistent; rejecting these types prevents division-by-zero and pointer-distance failures without adding iterator or growth special cases. Empty buffers of non-ZST types remain supported. Six compile-fail doctests cover the independent construction paths.
Remove the generic raw-owner constructor. Typed Vec adoption takes its pointer and element count directly from the Vec and retains that Vec for destruction. External byte owners continue to use
Bytes::from_ownerat the call site, without adding a buffer API.Address the allocator-stack review comments with field documentation, an explanation of the optional allocator, and tests for owner lifetime, allocator retention, empty/shared ownership, sliced-buffer growth, and alignment. The allocator representation, buffer layout, alignment policy, and allocation benchmarks are retained. Both iterator-extension implementations and the owned iterator match the merged baseline. This is a focused alternative to #9745.
Validation:
cargo nextest run -p vortex-buffer --all-features: 874 tests passed.cargo test --doc -p vortex-buffer --all-features: 8 ordinary and 6 compile-fail doctests passed.cargo clippy -p vortex-buffer --all-targets --all-features: passed.git diff --check: passed.Performance validation: