code wiki / _hdl_build / _cdc_fixture_gen.nx

_cdc_fixture_gen.nx

buildroot/runtime/_hdl_build/_cdc_fixture_gen.nx

7747 B155 linesdepth 6pulls 6 transitivereach 0 importersview sourcekind tool
docsdependenciesstructsconstsfunctions

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

nx_syscalls.nx nx_cdc_lib.nx _cdc_fixture_gen.nx

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

main fg_puts sys_write fg_slen v_gen sys_mmap nxa_die sys_write ↻ sys_exit nxa_lock_take nxa_lock_addr sys_write ↻ nxa_lock_give nxa_lock_addr ↻ nxa_report_overrun sys_write ↻ nxa_dump_printable sys_write ↻ nxa_dump_sizes sys_write ↻ sys_openat_wr fg_puts ↻ fg_next fg_write_all sys_write ↻ sys_close fg_putn sys_mmap ↻ sys_write ↻ fg_parse v_insert sys_mmap ↻ sys_read_file sys_openat_rd sys_lseek sys_mmap ↻ sys_read sys_munmap sys_close ↻ fg_puts ↻

structs

none

consts

20const FG_BLOCK: i64 = 1048576
21const FG_EXIT_USAGE: i64 = 2
22const FG_EXIT_IO: i64 = 1
23const FG_MODE_644: i64 = 420
24const FG_XS_A: i64 = 12
25const FG_XS_B: i64 = 25
26const FG_XS_C: i64 = 27
27const FG_XS_MUL: i64 = 2685821657736338717

functions

29func 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
30func fg_puts(s: *u8) -> i64 { return sys_write(1, s, fg_slen(s)) }
31func fg_putn(v: i64) -> i64
47func fg_parse(s: *u8) -> i64
called by 1: main
54func fg_next(st: *i64) -> i64
called by 1: v_gen
63func fg_write_all(fd: i64, b: *u8, n: i64) -> i64
called by 2: v_genv_insert calls 1: sys_write
68func v_gen(out: *u8, bytes: i64, seed: i64) -> i64
88func v_insert(inp: *u8, out: *u8, off: i64, byte: i64) -> i64
106func v_chunks(path: *u8, mn: i64, avg: i64, mx: i64) -> i64
147func main(argc: i64, argv: *i64) -> i64