Record Class BoNode
java.lang.Object
java.lang.Record
ai.badmonkey.agentspaces.pdt.kinds.BoNode
- Record Components:
size- the bytes the node coversparents- the parent pairs,PARENT_BYTESeach, in pre-orderchildren- the childbonodes, empty on a leaf
A node of a blob's Bao outboard, kind
bo (PDT 2 phase 0, P2-B-02; srad/agentspaces-pdt2.md
§3.5): { k:"bo", g: 4, n: size, p: parent chaining values, c: [links to child bo nodes] },
over chunk groups of 2^g BLAKE3 chunks (16 KiB, decision 10). A bo tree is reached
only through the attribute pdt.bao (§6.10.3, rule 5).
The build pins the split rule of §3.5, so every port cuts the same tree. The owner ruled on 2026-11-09 that a leaf covers 8 MiB, about 32 KiB of outboard, so a 2 MiB verified window pays at most two leaves (PDT 2 phase 4 measures, P2-Q-PRF-05, §10.14); the phase 0 rule cut leaves of 256 MiB.
pis one byte string, the concatenated parent pairs (left CV then right CV, 64 bytes) in pre-order, as a Bao outboard stores them. A list of 64-byte strings would spend two bytes of header per parent.- A node over at most
LEAF_GROUPSgroups (8 MiB) is a leaf:pholds every parent of its BLAKE3 subtree,groups - 1of them, andcis empty. A full leaf encodes to 32,728 bytes. - A larger node over G groups takes the smallest j >= 1 with G <=
LEAF_GROUPSxFANOUT^j, cuts its subtree into aligned blocks ofLEAF_GROUPSxFANOUT^(j-1) groups, links one childbonode per block in order, and holds inpthe parents above the cut, one fewer than its children. BLAKE3's tree puts every left subtree on a power of two, so each block is a whole subtree. An upper node of 16 children encodes to about 1.6 KiB, so the path above a window's leaves stays short.
n alone, which the constructor checks.-
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final intThe most children an upper node links: 16, well underNodeCodec.MAX_LINKS.static final intThe bytes in one chunk group.static final intlog2 of the BLAKE3 chunks in one group: 16 chunks of 1 KiB (decision 10).static final intThe most groups a leaf covers: 2^9, 8 MiB of content in 511 parents (PDT 2 phase 4 measures, §10.14).static final intThe bytes of one parent pair: two 32-byte chaining values. -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionchildren()Returns the value of thechildrenrecord component.childSizes(long size) The sizes, in bytes, of the child blocks of a node oversizebytes; empty for a leaf.static BoNodeReads abonode.byte[]encode()The canonical node bytes.booleanIndicates whether some other object is "equal to" this one.static longgroups(long size) The chunk groups a blob ofsizebytes holds: at least one, since an empty blob is one empty chunk.inthashCode()Returns a hash code value for this object.byte[]parents()The parent pairs, copied.longsize()Returns the value of thesizerecord component.toString()Returns a string representation of this record class.
-
Field Details
-
GROUP_LOG
public static final int GROUP_LOGlog2 of the BLAKE3 chunks in one group: 16 chunks of 1 KiB (decision 10).- See Also:
-
GROUP_BYTES
public static final int GROUP_BYTESThe bytes in one chunk group.- See Also:
-
PARENT_BYTES
public static final int PARENT_BYTESThe bytes of one parent pair: two 32-byte chaining values.- See Also:
-
LEAF_GROUPS
public static final int LEAF_GROUPSThe most groups a leaf covers: 2^9, 8 MiB of content in 511 parents (PDT 2 phase 4 measures, §10.14).- See Also:
-
FANOUT
public static final int FANOUTThe most children an upper node links: 16, well underNodeCodec.MAX_LINKS.- See Also:
-
-
Constructor Details
-
BoNode
-
-
Method Details
-
groups
public static long groups(long size) The chunk groups a blob ofsizebytes holds: at least one, since an empty blob is one empty chunk. -
childSizes
-
encode
public byte[] encode()The canonical node bytes. -
decode
Reads abonode.- Parameters:
cid- the CID, named in a refusal; may be nullbytes- the node bytes- Returns:
- the node
- Throws:
NodeFormatException- on another kind, another group size, a missing key, or parents and children the size does not imply
-
equals
Indicates whether some other object is "equal to" this one. The objects are equal if the other object is of the same class and if all the record components are equal. Reference components are compared withObjects::equals(Object,Object); primitive components are compared with thecomparemethod from their corresponding wrapper classes. -
hashCode
-
toString
-
parents
public byte[] parents()The parent pairs, copied. -
size
-
children
-