code wiki / (root) / nx_gen_ditchain.nx

nx_gen_ditchain.nx

buildroot/runtime/nx_gen_ditchain.nx

8276 B192 linesdepth 9pulls 24 transitivereach 0 importersview sourcekind tooltopic gen
docsdependenciesstructsconstsfunctions

about

nx_gen_ditchain.nx -- chain N sovereign DiT blocks, weights read straight from the GGUF. This is the sovereign DiT forward stack: given the layer-0 input, the timestep embedding and the rope table, it runs N transformer blocks back to back with NO oracle tensor of any kind in the loop -- every weight comes from the model file, every adaLN vector is computed, every activation is the previous block's own output. Usage: nx_gen_ditchain <model_id> <gguf_path> <n_layers> [n_workers] [reference_name] The reference defaults to `layers.<n_layers>.blk_in`, i.e. the oracle's input to the block AFTER the ones we ran -- so a 2-layer run is graded against layers.2.blk_in. WHAT THIS ANSWERS THAT nx_gen_blockrun DOES NOT blockrun proves ONE assembled block is correct. Chaining asks whether the error stays bounded as blocks compose: 36 layers is 36x the opportunity for a small bias to accumulate into a visibly different image. Per-op fidelity says nothing about that, and neither does one block. ⚠The pass band defaults to 1e-1 because the reference is the ORACLE, which carries its own activation-quantization error at every matmul of every layer it ran. Grading a MORE accurate implementation tightly against it would fail correct work. To ask "did OUR chain drift", grade against an exact reference instead. license_tier: ORIGINAL

dependencies 13 imports · 0 importers

nx_syscalls.nx nx_le.nx nx_f32.nx nx_f32_div.nx nx_f32_cvt.nx nx_f16.nx nx_f32_exp.nx nx_f32_activations.nx nx_strconv.nx nx_genfix.nx nx_gen_ditchain.nx

diagram shows first 10 each side; +3 more imports, +0 more importers in the complete lists below.

imports: nx_syscalls.nxnx_le.nxnx_f32.nxnx_f32_div.nxnx_f32_cvt.nxnx_f16.nxnx_f32_exp.nxnx_f32_activations.nxnx_strconv.nxnx_genfix.nxnx_genver.nxnx_genweights.nxnx_genblock.nx

imported by: nobody (leaf or entry point)

call flow from main pre-order; caps 40 nodes / depth 6 declared; ↻ = already shown

main dc_puts sys_write 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 ↻ nx_strconv_parse_i64 nx_ascii_is_digit nx_gw_open sys_mmap ↻ sys_map_file sys_openat_rd sys_lseek sys_close stl_header_len stl_u64le stl_data_start stl_u64le ↻ nx_gguf_parse nx_le_read_u32 nx_le_read_u64 nx_le_read_u32 ↻ _gguf_skip_value nx_le_read_u64 ↻ nx_le_read_u32 ↻ _gguf_skip_value ↻ sys_mmap ↻ br_arch_bind

structs

none

consts

none

functions

38func dc_puts(s: *u8) -> i64 {
called by 1: main calls 1: sys_write
44func main(argc: i64, argv: *i64) -> i64 {