Expand description
graph section codecs (chunk-to-chunk csr adjacency and, later, the
entity/property-graph sections). all are OPTIONAL and EXCLUDED from
content_hash, additive within frozen format v1, and never touch the
embedding hot path. G1 ships only adjacency (SECTION_GRAPH_ADJACENCY,
0x0C); the entity sections (0x11..=0x13) land in G2.
Structs§
- CsrParts
- the validated csr columns the runtime
CsrIndexindexes in O(1):offsets(len n_nodes+1) bounds each node’s run inneighbors(absolute decoded dst ids) andedge_types(1:1 withneighbors). - Edge
- one directed edge:
src -> dstof a givenedge_type.
Constants§
- EDGE_
TYPE_ CITATION - EDGE_
TYPE_ NEXT_ CHUNK - edge type ids. a u8 column (iso single scalar when uniform).
- EDGE_
TYPE_ SEMANTIC - GRAPH_
ADJACENCY_ PAYLOAD_ VERSION - internal payload version for the csr layout. bumped on an internal
layout change, NEVER
URNA_FORMAT_VERSION(the same lane-c discipline asHNSW_PAYLOAD_VERSION). - GRAPH_
MAX_ DEGREE - hostile-input cap on a single node’s out-degree. a real chunk graph (NEXT_CHUNK + top-m semantic + citations) never approaches this, so it never rejects a valid file; it bounds an untrusted decoded degree before any allocation from a claim alone.
Functions§
- decode_
graph_ adjacency - decode the csr payload back to its canonical edge list (the exact order
encode_graph_adjacencyemitted: ascending src, edge_type, dst). typed errors on any truncation or hostile claim; never panics. - encode_
graph_ adjacency - encode
edgesovern_nodeschunk ordinals into the csr payload, byte- identical for the same edge set (canonical sort). everysrc/dst< n. - parse_
csr_ parts - parse the csr payload into validated owned columns (the single parser):
bounds-checks the header, monotone offsets, degree cap, column lengths,
and dst range, then de-gaps the neighbor ids into absolute ids so
neighbors[start..end]is a contiguous slice per node. never panics.