nx_gen_ditfull.nx
buildroot/runtime/nx_gen_ditfull.nx
about
nx_gen_ditfull.nx -- the COMPLETE sovereign Z-Image DiT forward, weights from the GGUF.
txt_embed --[context_refiner x2, UNMODULATED]--> txt
img_embed --[noise_refiner x2, modulated ]--> img
concat(txt, img) --[layers x30, modulated]--> h --[final layer]--> [64, L]
Everything after the text encoder and the latent embedding. No oracle tensor in the loop:
weights are read from the model file, adaLN is computed per block, and every activation is the
previous stage's own output.
Usage: nx_gen_ditfull <model_id> <gguf_path> [workers] [reference]
THE FINAL LAYER IS NOT A BLOCK and does not reuse br_block:
scale = W_ada1 . silu(t_emb) + b <- silu HERE, unlike the blocks' adaLN
x = LayerNorm(x) <- LayerNorm (mean-centred), NOT RMSNorm, no affine
x = x * (1 + scale)
x = W_lin . x + b
Both differences were read out of FinalLayer::forward, not assumed. Reusing the block's adaLN
path here would apply no silu and subtract no mean, and would still produce a finite tensor.
⚠TOKEN PADDING IS NOT IMPLEMENTED: this shape needs none (512 text and 256 image tokens are both
multiples of SEQ_MULTI_OF=32, so n_pad=0). A shape that needs padding must append the learned
cap_pad_token / x_pad_token first; this organ REFUSES rather than silently skipping it.
license_tier: ORIGINAL
dependencies 13 imports · 0 importers
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
structs
| none |
consts
| 40 | const DF_SEQ_MULTI: i64 = 32 |
| 41 | const DF_EMB: i64 = 256 |
functions
| 43 | func df_puts(s: *u8) -> i64 { |
| 50 | func df_final(gw: *i64, x: *u8, t_emb: *u8, out: *u8, T: i64, D: i64, OUTD: i64, NW: i64) -> i64 { |
| 129 | func main(argc: i64, argv: *i64) -> i64 { |