code wiki / (root) / nx_genfix.nx

nx_genfix.nx

buildroot/runtime/nx_genfix.nx

8035 B210 linesdepth 2pulls 2 transitivereach 16 importersview sourcekind library
docsdependenciesstructsconstsfunctions

about

nx_genfix.nx -- shared loader for image-generation oracle fixtures. MODEL-AGNOSTIC. WHY THIS EXISTS The sovereign gen migration verifies each re-implemented op against a tensor dumped from the engine that ships images today. Those dumps used to be produced by throwaway instrumentation into a per-session temp directory; both were reaped, and the 13 organs that depended on them each carried their own private copy of the dead path, so all 13 died at once and each needed its own edit. WHY IT IS NOT NAMED FOR A MODEL Z-Image is one model, not the lane. Flux, SD3/MMDiT, SDXL-UNet and Qwen-Image all need the same treatment, and they differ in dimensions, block naming and product capability (negative prompting, CFG, LoRA stacking). So nothing here may hardcode a model: the model id is an argument, and every SHAPE is read from the manifest.tsv the oracle tap writes beside the dumps. An organ that hardcodes 3840 is an organ that silently verifies the wrong model the first time it is pointed at another one. LAYOUT <root>/<model_id>/manifest.tsv name \t ne0 \t ne1 \t ne2 \t ne3 \t type \t nelem \t bytes <root>/<model_id>/<name>.f32 raw little-endian f32 license_tier: ORIGINAL

dependencies 1 imports · 16 importers

nx_syscalls.nx nx_genfix.nx nx_gen_adaln_gate_verify.nx nx_gen_blockrun.nx nx_gen_ditchain.nx nx_gen_ditfull.nx nx_gen_embed_verify.nx nx_gen_linear_verify.nx nx_gen_lora_repr.nx nx_gen_lora_verify.nx nx_gen_prenorm_mod_verify.nx nx_gen_qknorm_verify.nx

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

imports: nx_syscalls.nx

imported by: nx_gen_adaln_gate_verify.nxnx_gen_blockrun.nxnx_gen_ditchain.nxnx_gen_ditfull.nxnx_gen_embed_verify.nxnx_gen_linear_verify.nxnx_gen_lora_repr.nxnx_gen_lora_verify.nxnx_gen_prenorm_mod_verify.nxnx_gen_qknorm_verify.nxnx_gen_rmsnorm_verify.nxnx_gen_rope_verify.nxnx_gen_sdpa_verify.nxnx_gen_swiglu_verify.nxnx_gen_taedec.nxnx_genblock.nx

structs

none

consts

24const K_MAGIC_1024: i64 = 1024
25const K_MAGIC_1048576: i64 = 1048576

functions

28func nx_genfix_root() -> *u8
33func _gf_cpy(dst: *u8, at: i64, src: *u8, n: i64) -> i64
40func _gf_cpyz(dst: *u8, at: i64, src: *u8) -> i64
49func nx_genfix_name(out: *u8, scope: *u8, op: *u8, ol: i64) -> i64
called by 1: main calls 2: _gf_cpyz_gf_cpy
58func _gf_path(model: *u8, name: *u8, nl: i64) -> *u8
77func nx_genfix_load(model: *u8, name: *u8, nl: i64, n_floats: i64) -> *u8
96func _gf_path_raw(model: *u8, name: *u8, nl: i64) -> *u8
115func nx_genfix_load_raw(model: *u8, name: *u8, nl: i64, n_bytes: i64) -> *u8
136func _gf_read_manifest(model: *u8, out_len: *i64) -> *u8
162func nx_genfix_dims(model: *u8, name: *u8, nl: i64, ne: *i64) -> i64