BitmapView
A serialized bitmap, read where it lies.
Nothing is deserialized. open validates the structure in one pass and keeps only the mapping, the container count and the cardinality; a contains afterwards is a binary search of u16 reads against the file, and a rank is that plus one search inside one block. This is the reason the bitmap format is rabosh's own rather than a library's: an index sidecar is consulted far more often than it is written, and a bitmap that had to be parsed into heap objects first would pay for the whole file to answer a question about one value.
val view = BitmapView.open(segment, offset = handle.offset, length = handle.length, file = name)
view.contains(ordinal)
view.and(other) // materialises one 8 KB block at a time, never the whole bitmapA view must not outlive the arena that mapped its segment. It holds no reference the runtime can see, so reading one after its arena has closed is a fault rather than a stale answer — the same rule Variant over a mapped segment follows, and the reason a Snapshot in the storage core is AutoCloseable.
What open checks and what it does not. It checks everything that decides where a byte is: the version, the container count, ascending keys, increasing prefix cardinalities, known container kinds, and that the blocks tile the slice exactly — offsets contiguous from the end of the directory to the last byte. What it does not do is walk the values. Confirming that a bitset's population count matches the cardinality the directory declares would mean reading 1024 words per block on a path whose whole point is to read one, and a bitmap always arrives inside a frame that has already been checksummed — phase 7's sidecar does for a bitmap what SegmentBytes.verifyBlock does for a segment's data block. verify is the deep pass, for tests and for anything that wants to audit a file it did not write.
Functions
The ordinals present in both.
How many ordinals the two share, without building the intersection.
The ordinals present here and not in other.
A walk over every present ordinal, ascending.
This bitmap in the layout BitmapFormat describes, canonically encoded.
The size encode will produce, without producing it.
Whether the two share an ordinal, without building the intersection.
The ordinals present in either.
Every present ordinal, ascending. For tests and for small results; a cursor does not allocate.
The ordinals present in exactly one of the two.