code wiki / (root) / nx_gguf_fixture_tiny.nx

nx_gguf_fixture_tiny.nx

buildroot/runtime/nx_gguf_fixture_tiny.nx

11526 B297 linesdepth 6pulls 14 transitivereach 21 importersview sourcekind librarytopic gguf
docsdependenciesstructsconstsfunctions

about

nx_gguf_fixture_tiny.nx -- reusable tiny-Llama GGUF fixture builder. Encapsulates the ~150 lines of byte-by-byte synthetic GGUF construction that test smokes for nx_llm_run_v2 and the v2 LLM actor adapters currently duplicate. V1 builds the canonical n_layers=1, hidden=2, head=2, vocab=4, ffn=4 shape with all-zero F32 weights -- the same fixture nx_llm_run_v2_test.nx ships -- plus the BPE vocab (4 single-byte tokens 'a' 'b' 'c' 'd'), PRNG, model spec, and a vocab-id-to-byte map for autoregressive smokes to roll the previous token's bytes into the next prompt. One call -> entire test fixture ready to feed nx_llm_generate_one_v2 or any actor adapter that wraps it. Closes the combined-autoreg- over-real-transformer smoke gap documented in nx_actor_role_llm_v2_autoreg_test.nx. Honest scope: V1 is a SINGLE-shape fixture -- there are no knobs. Future V2 will add a builder-pattern (caller-set hidden_dim / vocab_size / n_layers). V1 keeps the API surface tiny.

dependencies 8 imports · 21 importers

nx_syscalls.nx nx_tier.nx nx_le.nx nx_gguf.nx nx_gguf_load.nx nx_bpe.nx nx_model_spec.nx nx_prng.nx nx_gguf_fixture_tiny.nx nx_actor_role_llm_v2_real_autoreg_ nx_bench_dist_emit_test.nx nx_bench_dist_persist_test.nx nx_bench_scale_dist_emit_test.nx nx_bench_scale_test.nx nx_bench_stress_autoreg_test.nx nx_bench_stress_emit_test.nx nx_bench_v1_vs_v2_test.nx nx_dual_real_llm_compose_test.nx nx_dual_real_llm_emit_test.nx

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

imports: nx_syscalls.nxnx_tier.nxnx_le.nxnx_gguf.nxnx_gguf_load.nxnx_bpe.nxnx_model_spec.nxnx_prng.nx

imported by: nx_actor_role_llm_v2_real_autoreg_test.nxnx_bench_dist_emit_test.nxnx_bench_dist_persist_test.nxnx_bench_scale_dist_emit_test.nxnx_bench_scale_test.nxnx_bench_stress_autoreg_test.nxnx_bench_stress_emit_test.nxnx_bench_v1_vs_v2_test.nxnx_dual_real_llm_compose_test.nxnx_dual_real_llm_emit_test.nxnx_f32_llama_layer_lazy_load_test.nxnx_f32_llama_layer_load_test.nxnx_f32_llm_e2e_test.nxnx_f32_llm_load_test.nxnx_f32_llm_run_test.nxnx_f32_llm_run_v2_test.nxnx_f32_llm_run_v3_test.nxnx_f32_llm_v4_test.nxnx_gguf_fixture_tiny_test.nxnx_quad_real_emit_test.nxnx_session_real_llm_compose_test.nx

structs

48struct NxGgufFixtureBundle

consts

29const NX_MAGIC_4096: i64 = 4096
33const NX_GFT_OK: nx_int = 0
34const NX_GFT_ERR_PARSE: nx_int = 1
35const NX_GFT_ERR_SPEC_INVALID: nx_int = 2
36const NX_GFT_ERR_BPE_BUILD: nx_int = 3
37const NX_GFT_ERR_NULL: nx_int = 4
38const NX_GFT_N: nx_int = 5
65const NX_GFT_BUNDLE_BYTES: nx_int = 112 // 14 fields * 8

functions

40func nx_gft_v_is_valid(v: nx_int) -> nx_int
called by 1: main
69func _gft_write_ti(buf: *u8, off: i64,
86func _gft_mk_blk_name(suffix: *u8, suffix_len: nx_int, out: *u8) -> nx_int
102func nx_gft_build_tiny_llama(prng_seed: i64) -> *NxGgufFixtureBundle
276func nx_gft_verdict(b: *NxGgufFixtureBundle) -> nx_int
called by 1: main
281func nx_gft_vocab_byte(b: *NxGgufFixtureBundle, token_id: nx_int) -> nx_int
288func nx_gft_is_built(b: *NxGgufFixtureBundle) -> nx_int