Expand description
The 0x06 assembler: super::parts::Parts in, a 0x06 file out. Every
writer goes through here — the in-RAM build (via 0x05 section images),
rete convert, and the memory-bounded build and merge (which hand it their
spill as an address space, see extbuild_v06). recard only re-lays the
front.
The front (root, card region, stats, leaf directories) is built in memory;
the data region is streamed from the input reader, hashed on the way. The
data is written first at its final offset, then the front at offset 0, so the
output needs Write + Seek and the input is read once.
Structs§
- Hooks
- What
assemble_withreports while it writes. - Write
Opts - Assembly options.
- Written
- What the assembler wrote.
Enums§
- NewCard
- The card a re-card writes.
- Quad
Clustering - How quad tiles are clustered in the data region.
Constants§
- MIN_
FILE_ LEN - The smallest
0x06file: 1 KiB, what every reader reads first anyway.
Functions§
- assemble
- Assemble a
0x06file fromparts, whose payload ranges point intoinput. - assemble_
with assemble, reporting throughhooks. The memory-bounded build deletes each spill file as soon as every range it feeds is in the output, so the output grows as the spill shrinks, and drives--progressfrom the byte count.- card_
region_ len - The card region’s length for a card and record of these stored lengths.
- commit_
header - Write
hover the first 128 bytes (the commit ofrecard_in_place). - convert
- Convert a
0x05file read throughinputintoout. - convert_
image - Convert a whole
0x05image held in memory to a0x06image. - convert_
with_ labels convert, giving the file the LABEL_INDEX sectionlabels(its0x05encoding, fromlabel_section) when it has none.- label_
section - The LABEL_INDEX section (
0x05encoding) of the default graph ofrete, computed asrete build --label-indexcomputes it — from the triples of the label predicates only, read through the index. Empty when the graph has no label predicate. - recard_
in_ place - Re-card a
0x06file in place, when the new card and record fit in a free gap of its card region (beside the old pair, which stays readable until the switch): they are written there and the new header is returned, not written. The caller syncs the file, thencommit_header— the 128-byte header is the one commit point, so a crash before it leaves the old file whole. A card equal to the current one stays where it is (only the record moves; the content hash does not change).Ok(None)when the pair does not fit: the caller copies instead (rewrite_card_stream). - replace_
card - Replace the card (and the build record) of a
0x06image held in memory: the front is re-laid out with the new card region; every section is copied byte for byte. The content hash follows the card. - rewrite_
card_ stream - Rewrite a
0x06file read throughsrcintooutwith a new card and build record —replace_cardwithout holding the file: the front is re-laid out around the new card region, the data region copied byte for byte (its digests, and so the root, unchanged).progressreceives the data bytes copied so far. - stamp_
card_ version - A card written into a
0x06file says"format_version":6. The cards the core builders derive stamp the0x05layout they were produced for (LEGACY_FORMAT_VERSION); every card entering a0x06file passes here, so a build, a converted build and a re-card agree on the stamp. Only the first compact"format_version":Nwith N below 6 is rewritten; anything else is returned unchanged.