Expand description
Format generation 0x06 (SPEC.md §4): everything a reader needs to plan a
query sits at the front of the file — a 128-byte header, the root block,
the Dataset Card, the planner statistics and every leaf directory — and the
payload follows, clustered by section.
0 header (128 B)
128 root block: section table + directory roots
card region: card | build record | slack
front sections: stats+schema, then the leaf directories
data_off data sections: dictionary chunks, index tiles, quad tiles,
label blocks, text postings, pyramid
file_len-8 footer "RETE" 06 00 00 00Payload blocks (dictionary chunks, index tiles, quad tiles, label blocks,
postings) are byte-identical to 0x05; only their framing and their
directories move. parts lifts a 0x05 file into parts::Parts,
write assembles a 0x06 file from them, open reads one.
Modules§
- kind
- Section kinds of the root’s section table.
- open
- Reading a
0x06file: the header and the root come with the first read; everything else is built lazily from them — the dictionary and the index as two-level directories whose leaves fault on demand and stay for the session, the text index likewise, the label index and the quad index through their own lazy machinery. - parts
- The logical parts of a file, independent of its generation: what the
0x06assembler (super::write) lays out.from_v05lifts them from a0x05file by reading its framing and directories; payload blocks are referenced by their byte range in the input and copied verbatim. - tag
- Unit-root tags inside the root block.
- write
- The
0x06assembler:super::parts::Partsin, a0x06file out. Every writer goes through here — the in-RAM build (via0x05section images),rete convert, and the memory-bounded build andmerge(which hand it their spill as an address space, seeextbuild_v06).recardonly re-lays the front.
Structs§
- Chunk
Ent - One dictionary chunk as a leaf lists it.
- Cur
- A bounds-checked cursor over untrusted bytes.
- Dict
SecRoot - The root of one dictionary section.
- Header06
- The parsed 128-byte header.
- Label
Root - The root of the label index: the 0x05 preamble and root node, and where the data blocks end in the 0x05 body coordinates (SPEC.md §6.4).
- LeafRef
- One leaf of a two-level directory, as the root describes it.
- Perm
Root - The root of one permutation’s tile directory.
- QTile
Ent - One quad tile as a leaf lists it.
- Quad
Order Root - One order of the quad index.
- Quad
Root - The root of the quad index.
- Root06
- The decoded root block.
- Sec06
- One entry of the root’s section table.
- Text
Root - The root of the text index.
- TileEnt
- One index tile as a leaf lists it.
- Token
Ent - One text token as a leaf lists it.
Constants§
- BLOCK_
CEILING - The decompression bound of a section whose largest block is not recorded (label blocks and nodes; the writer cuts them at 16 KiB).
- CARD_
MAX - The bound on the Dataset Card, decompressed.
- CARD_
SLACK_ MIN - Slack added to the card region beyond twice the card + record.
- FIRST_
READ - What a reader fetches first: header, root, card, statistics and, on a small file, every leaf directory (SPEC.md §9).
- FOOTER
- The 8-byte footer: the generation, then
RETE— so every reader that confirms a length by the file’s last four bytes finds the magic there. - F_NAMED
- Header flag: the file has named graphs (in the quad index).
- F_
QUAD_ GRAPH_ MAJOR - Header flag: quad tiles are clustered graph-major (all orders of a block of graphs adjacent) rather than order-major.
- F_
QUOTED - Header flag: some terms are RDF-star quoted triples.
- F_
TEXT_ NAMED - Header flag: the text index also covers the named graphs’ literals.
- HEADER_
LEN - Fixed header length.
- LEAF_
START - Starting (uncompressed) size of a leaf block.
- P_
LABELS - Presence bit: a label index.
- P_
PYRAMID - Presence bit: the community pyramid.
- P_QUAD
- Presence bit: the quad index.
- P_
SCHEMA - Presence bit: a stats + schema section.
- P_TEXT
- Presence bit: a text index.
- P_
TEXT_ PARTIAL - Presence bit: the text index leaves some predicates out (kind 11 in 0x05).
- ROOT_
BUDGET - The writer’s root budget: leaves grow until the stored root fits.
- SEC_
ENTRY_ LEN - Size of one section-table entry.
- UNIT_
MAX - The bound on the root’s unit roots, decompressed (Meta’s are ~100 KiB).
- VERSION
- The format byte of this generation.
Functions§
- content_
hash - The content hash of a header whose card and root digests are set (SPEC.md §5): the logical header fields, the card and the root, never an offset and never the build record.
- cut
- Cut
sizes(each entry’s encoded size) into leaves of abouttargetbytes:(start, end)index ranges, never empty, covering everything. - decode_
chunk_ leaf - Decode
nchunk entries. - decode_
dict_ root - Decode the dictionary unit root.
- decode_
index_ root - Decode the index unit root.
- decode_
label_ root - Decode the label unit root.
- decode_
qtile_ leaf - Decode
nquad tile entries of a leaf whose first tile sits atleaf_off. - decode_
quad_ root - Decode the quad unit root.
- decode_
text_ root - Decode the text unit root.
- decode_
tile_ leaf - Decode
ntile entries. - decode_
token_ leaf - Decode
ntoken entries. - digest16
- The first 16 bytes of a BLAKE3 digest.
- encode_
chunk_ leaf - Encode chunk entries (the first
first_runabsolute, then deltas). - encode_
dict_ root - Encode the dictionary unit root.
- encode_
index_ root - Encode the index unit root (permutations in section-index order).
- encode_
label_ root - Encode the label unit root.
- encode_
qtile_ leaf - Encode quad tile entries. A tile’s offset is written as
0when it follows the previous tile of the leaf (or, for the first, sits at the leaf’s root offset), else asoffset + 1(PMTiles’ clustered encoding). - encode_
quad_ root - Encode the quad unit root.
- encode_
text_ root - Encode the text unit root.
- encode_
tile_ leaf - Encode tile entries: the 0x05 directory rows, then the synopsis rows.
- encode_
token_ leaf - Encode token entries, front-coded within the leaf.
- id_
position_ names - Names of the four id positions, in field order, for display.
- id_
widths_ for - The width byte a writer stamps: every position
u32(0), after checking that the largest id of each position ([subjects, objects, predicates, graphs], SPEC §4.1) fits. It never truncates: an id that does not fit is an error. - logical_
header - A logical, 0x05-shaped
crate::header::Headerfor a 0x06 file, so code that asks presence questions (text_index_len > 0,label_index_section()) answers them the same for both formats. Its offsets all point at the end of the file, so a physical read that was not ported to 0x06 fails loudly instead of reading the wrong bytes. - put_lp
- Append a length-prefixed byte string.
Type Aliases§
- Quad
Leaf Root - A quad order’s leaf in the root: the leaf, the first tile’s first
(g, a), the last tile’s last(g, a), and the first tile’s offset inquad.