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
//! Streaming pipeline for very large enumerations.
//!
//! Three independently invocable stages; all share `-o <output_dir>`:
//!
//! ```text
//! Stage 1 --mode stream -> out_dir/runs/run_tNN_rMM.bin (sorted runs)
//! Stage 2 --mode merge -> out_dir/unique.bin + certificate.json
//! Stage 3 --mode build -> out_dir/dafsa/ (blocked RatDafsa asset)
//! ```
//!
//! What this buys us: peak memory bounded by the per-thread sort
//! buffer (Stage 1) and then by the in-progress DAFSA structure
//! (Stage 3), never by the final set size. ZZ12 n=14+ becomes
//! feasible on a commodity workstation without `--mode list-seeds`
//! orchestration. Stage 3 is the streaming equivalent of
//! `--mode dafsa-blocks` -- both write the same on-disk format, but
//! Stage 3 doesn't materialize the rat set in a `Vec<Vec<i8>>` first.
//!
//! Records are **length-prefixed and bias-encoded**:
//! * byte 0: length L (0..=255)
//! * bytes 1..=L: each angle byte = (i8 angle + 128) as u8
//!
//! Bias-encoding makes byte-lex order equal `(length asc, integer-lex
//! asc)`, which is the same order the DAFSA expects. So sorted runs
//! and the merged `unique.bin` are already in the right order for
//! Stage 3 without any in-memory unsort pass.
//!
//! See [`records`] for encode/decode helpers, [`runs`] for the
//! per-thread sort-buffer + flush writer, [`enumerate`] for the
//! `stream_enum_parallel` entry point that wires it all together.
pub use ;
pub use ;
pub use ;
pub use RunWriter;