Expand description
§PERTARO
Pruned Expert Regrounding Trie via Answer-set Reduct Optimization.
A #![no_std], zero-heap neuro-symbolic micro-expert primitive that packs a
5-tier ternary decision trie (3^5 = 243 leaves) plus a 13-state in-band
control envelope (243..=255) into one exact 256-byte cache-aligned word.
§Byte contract
One byte has 256 states: 0..243 are 5-trit coordinates, 243..=255 are
the 13 Sentinel control states. A Word256 is header-first:
| offset | field | meaning |
|---|---|---|
0..8 | hash: u64 | xorshift64 seed of the default leaf field |
8..12 | parent: u32 | lineage link to the parent horizon word |
12..255 | trits[0..243] | 243 leaf deltas or in-band sentinels |
255 | trits[243] | root sentinel: the active horizon phase |
§Default field
The seed’s xorshift64 stream is turned into 243 uniform Z_243 digits by
radix-243 extraction: 243^8 < 2^64, so every state below 243^8 holds
eight exact, independent digits; states at or above it are rejected, not
reduced. No % 243 bias anywhere.
Structs§
- Pertaro
Expert243 - Zero-cost view over
Word256: the payload as a 5-tier micro-expert. - Word256
- Sealed 256-byte header-first word, aligned to 256 bytes (four cache lines).
Enums§
- Sentinel
- The 13 in-band control states, bytes
243..=255.
Constants§
- DIGITS_
PER_ WORD - Digits one accepted xorshift64 state yields.
- FNV1
A64_ BASIS - Canonical FNV-1a 64-bit offset basis.
- FNV1
A64_ PRIME - Canonical FNV-1a 64-bit prime.
- LEAVES
- Trie leaves:
3^5 = 243, one byte each. - MAX_
PACKED - Count of 5-trit coordinate values in one byte:
3^5 = 243. - PAYLOAD_
BYTES - Payload width: 243 leaves + 1 root sentinel.
- RADIX_
243_ POW_ 8 243^8: the rejection threshold for unbiased radix-243 extraction.- ROOT_
SENTINEL - Payload index of the root sentinel byte, the one byte past the leaves.
- SENTINEL_
COUNT - Count of in-band control states:
256 - 243 = 13. - TIERS
- Trie depth: five ternary tiers address one leaf.
Functions§
- fnv1a64_
fold - FNV-1a 64-bit fold of
bytesonto a runninghash. Start fromFNV1A64_BASIS. The single FNV home in this crate. - xorshift64
- One xorshift64 step (
13, 7, 17).0is a fixed point.