1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
//! 2026 Serialization Format for CLVM.
//!
//! Deduplicates atoms and pairs via interning, uses variable-length integer
//! encoding (varints), and groups atoms by length for better compression.
//!
//! ## Format Overview
//!
//! 1. Atom table: grouped by length, with varint-encoded counts (nil excluded)
//! 2. Instruction stream: stack-based operations to reconstruct the tree
//!
//! ## Instructions
//!
//! - `0`: Push nil
//! - `1`: Pop two items (left was pushed first), cons them, push result
//! - `-1`: Pop two items (right was pushed first), cons them, push result
//! - `>= 2` (positive varint N): Push atom at index N-2
//! - `<= -2` (negative varint N): Push already-constructed pair at index -N-2
//!
//! The current serializer always uses opcode `1` (left-first cons). The format
//! accepts `-1` so future serializers can choose right-first traversal when
//! that helps compression.
/// Magic prefix bytes for serde_2026 format.
///
/// - `0xfd 0xff` forces legacy/backref decoders down an invalid atom-length
/// path (fail-fast).
/// - `0x32 0x30 0x32 0x36` is ASCII `"2026"` for readable hexdumps.
pub const SERDE_2026_MAGIC_PREFIX: = ;
/// Maximum atoms/pairs that fit in i32 indices (used by instruction stream).
const MAX_INDEX: usize = i32MAX as usize;
/// Internal vocabulary for which serialization strategy to use. The public API
/// takes a `level: u32` and saturates to the highest implemented level; this
/// enum is the after-saturation result.
///
/// - `Fast` (level 0): left-first traversal. O(N) serialization.
pub
pub use ;
pub use ;
pub use ;