feat: basic BoolBuffer / BoolBufferMut
It's very annoying to do random in-place setting of bits in Arrow BooleanBufferBuilder. It's very append focused. For something like SparseArray in particular, you want to create a BoolArray against uninitialized memory and only set the bits corresponding to positions of non-null values.
Can we call this BitBuffer?
Sadly new_uninit leads to UB when you try and do inplace updates on it. I can't think of a great way to work around that without doing something like having a second bitset, which sort of defeats the point of avoiding the initialization cost anyway, so for now I'm just removing it.
Where are we at with this? Need someone to takeover while you poke at FFI bindings?
Maybe? I'm no longer sure there's a strong path forward that gives us something better than Arrow's BooleanBufferBuilder.
The big issue is that mapping a bitset on top of uninit memory causes UB when you try and set bits in-place. While it generally seems harmless it is technically a violation of Rust's memory model so not guaranteed to work across platforms.
Why does the memory have to be uninitialized? Even the ability to into_mut and update bits is valuable from an API perspective.
I will take over this pr
This now compiles but there's still a lot of tests to fix
CodSpeed Performance Report
Merging #2456 will degrade performances by 62.42%
Comparing aduffy/bool-buffer (d93320a) with develop (d37444a)
Summary
⚡ 15 improvements
❌ 140 regressions
✅ 1127 untouched
:warning: Please fix the performance issues or acknowledge them on CodSpeed.
Benchmarks breakdown
:information_source: Only the first 20 benchmarks are displayed. Go to the app to view all benchmarks.
I need to figure out all the slow downs - seems like arrows append_packed_range is faster than bitvec implementaion and forcing iterators to be owned adds a bunch of drops that could be avoided
coverage: 87.875% (+0.2%) from 87.72% when pulling 2d540e578180288f0ce9c84663d71c59f46e0d83 on aduffy/bool-buffer into aaf3e36ad46a8e3269b1c7f7b8a86e5d3fef4025 on develop.
Codecov Report
:x: Patch coverage is 89.21907% with 156 lines in your changes missing coverage. Please review.
:white_check_mark: Project coverage is 88.05%. Comparing base (87aa18b) to head (5a48fba).
:umbrella: View full report in Codecov by Sentry.
:loudspeaker: Have feedback on the report? Share it here.
:rocket: New features to boost your workflow:
- :snowflake: Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
- :package: JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.
Will make a new pr