License
BSD-3-Clause
The builder layer of ddn.df: mutable, single-use buffers that seal into immutable ArrayData chunks (D3; ADR-2026-10-18-09).
A builder owns its buffer, appends values and validity bits, and finish() trims over-allocated capacity, seals through ddn.columnar.memory.sealBytes (never the cast-on-call form GDC miscompiles, fact 18) and nulls its slice so no mutable alias survives. Using a builder after finish asserts.
Builds a chunk of a physical element type T (the integer and float types; long for the temporal kinds through the dtype parameter of finish).
private T[] _valuesprivate BitmapBuilder _validityprivate size_t _lengthprivate bool _anyNullprivate bool _sealedvoid appendValues(const(T)[] values) @safe pure nothrowAppends a dense run of valid values in one copy (the bulk path for gather and rebuild kernels).void appendValues(const(T)[] values, const(ulong)[] validWords) @safe pure nothrowAppends values with packed validity bits, one bit per slot, LSB-first (`ddn.columnar.vector` layout). Values at invalid slots are copied verbatim: null slots hold arbitrary bits (D14).T[] bulkWindow(size_t n) @safe pure nothrowOpens a bulk-transform window (the parallel-kernel producer, amending ADR-2026-10-18-07 alongside `appendRepeated`): reserves `n` slots at the current end and returns them as a writable window, so ...void commitBulk(size_t n) @safe pure nothrowCommits `n` slots of the open bulk window as all valid (values already written by the caller's window writes).void commitBulk(size_t n, const(ulong)[] validWords) @safe pure nothrowDitto, with packed validity words (`1` = valid) for the commit's run - byte-identical to `appendValues(values, validWords)` over the same slots.void appendRange(const(Nullable!T)[] values) @safe pure nothrowAppends a range of optional values; `null` entries append null slots.Builds a BOOLEAN chunk: packed value bits plus validity.
private BitmapBuilder _bitsprivate BitmapBuilder _validityprivate size_t _lengthprivate bool _anyNullprivate bool _sealedvoid appendBits(ulong valueBits, ulong validBits, size_t n) @safe pure nothrowAppends `n` slots from packed words: one value bit and one validity bit per slot, LSB-first. The bits at or above `n` are ignored. This is the bulk path of the packed-bit kernels.void appendRange(const(Nullable!bool)[] values) @safe pure nothrowAppends a range of optional values; `null` entries append null slots.Builds a STRING chunk: UTF-8 payload plus long offsets plus validity.
private long[] _offsetsprivate ubyte[] _bytesprivate BitmapBuilder _validityprivate size_t _lengthprivate bool _anyNullprivate bool _sealedvoid reserve(size_t bytes, size_t elements) @safe pure nothrowEnsures capacity for at least `n` more bytes and their offsets.void append(scope const(char)[] value) @safe pure nothrowAppends one string (copied into the payload buffer).void appendRepeated(scope const(char)[] value, size_t n) @safe pure nothrowAppends one string `n` times in one bulk pass (the unpivot amending ADR-2026-10-18-07: bulk producers live INSIDE the builder layer so hot paths never hand-assemble chunks). The payload tiles throu...void appendRange(const(Nullable!string)[] values) @safe pure nothrowAppends a range of optional strings; `null` entries append null slots.void appendView(const(StringArray) view) @safe pure nothrowAppends every element of a typed STRING view in one pass: the payload of the valid slots is copied in one block and the offsets re-based, null slots become empty invalid windows. This is the bulk p...bool anyUnset(const(ulong)[] words, size_t n) @safe pure nothrowWhether any of the first `n` packed bits is clear; the bits past `n` in the last word are ignored.Builds a one-chunk ArrayData from values, with no nulls.
values | the column values |