code wiki / _hdl_build / _cdc_fixture_gen.nx
_cdc_fixture_gen.nx
buildroot/runtime/_hdl_build/_cdc_fixture_gen.nx
about
_cdc_fixture_gen.nx -- LOCAL INSTRUMENT (2026-09-06): a seeded pseudo-random fixture generator and a chunk-length
census for the content-defined chunker, so a dedupe accept rule is measured on ENTROPY-BEARING bytes.
WHY: the first 64 MiB dedupe measurement used a generated PNG whose IDAT is a stored deflate block of a period-3
byte pattern (1 MiB gzips to 5,678 B). A gear fingerprint over period-3 content takes three values, none hit the
mask, so EVERY cut was forced at max (1339 x 48,402 + 28,970 = 64,839,248 exactly) -- fixed-size chunking wearing
a content-defined name -- and a one-byte insertion shifted every later cut, so reuse stopped at the insertion
point (661 of 1340 = the offset-preserving prefix, 49.3 percent = 32,000,000 / 64,839,248). That is a property of
the DATA every chunker shares; the accept rule needs a fixture whose cuts are content-defined.
verbs:
gen <out> <bytes> <seed> xorshift64* stream, deterministic for (bytes, seed)
insert <in> <out> <offset> <byte> copy with ONE byte inserted at offset (the dedupe workload)
chunks <file> <min> <avg> <max> cut with nx_cdc_lib at the door's own parameters; prints count, min/max/avg
length, how many cuts were FORCED at max, and the gzip-free entropy proxy
(distinct bytes in the first block)
exit: 0 ok | 2 usage | 1 io
dependencies 2 imports · 0 importers
imports: nx_syscalls.nxnx_cdc_lib.nx
imported by: nobody (leaf or entry point)
call flow from main pre-order; caps 40 nodes / depth 6 declared; ↻ = already shown
structs
| none |
consts
| 20 | const FG_BLOCK: i64 = 1048576 |
| 21 | const FG_EXIT_USAGE: i64 = 2 |
| 22 | const FG_EXIT_IO: i64 = 1 |
| 23 | const FG_MODE_644: i64 = 420 |
| 24 | const FG_XS_A: i64 = 12 |
| 25 | const FG_XS_B: i64 = 25 |
| 26 | const FG_XS_C: i64 = 27 |
| 27 | const FG_XS_MUL: i64 = 2685821657736338717 |
functions
| 29 | func fg_slen(s: *u8) -> i64 { var n: i64 = 0; while s[n] != (0 as u8) { n = n + 1 } return n } called by 1: fg_puts |
| 30 | func fg_puts(s: *u8) -> i64 { return sys_write(1, s, fg_slen(s)) } |
| 31 | func fg_putn(v: i64) -> i64 |
| 47 | func fg_parse(s: *u8) -> i64 called by 1: main |
| 54 | func fg_next(st: *i64) -> i64 called by 1: v_gen |
| 63 | func fg_write_all(fd: i64, b: *u8, n: i64) -> i64 |
| 68 | func v_gen(out: *u8, bytes: i64, seed: i64) -> i64 |
| 88 | func v_insert(inp: *u8, out: *u8, off: i64, byte: i64) -> i64 |
| 106 | func v_chunks(path: *u8, mn: i64, avg: i64, mx: i64) -> i64 |
| 147 | func main(argc: i64, argv: *i64) -> i64 |