code wiki / (root) / nx_gguf_load_lazy_test.nx

nx_gguf_load_lazy_test.nx

buildroot/runtime/nx_gguf_load_lazy_test.nx

6305 B158 linesdepth 8pulls 10 transitivereach 0 importersview sourcekind gate/prooftopic gguf
docsdependenciesstructsconstsfunctions

about

nx_gguf_load_lazy_test.nx -- smoke for nx_gguf_load_lazy.nx + QUANTITATIVE proof of lazy-vs-eager RAM footprint. Builds a GGUF with 2 tensors: "score" F32 [2,2] (4 values, 16 bytes raw) "weight" Q8_0 [32] (32 values, 34 bytes raw block) Test classes: A) Lazy load returns NxPlacedTensor with placement=MMAP and storage_bytes=0. B) Materialize on demand via nx_placed_tensor_get reproduces the same values nx_gguf_load_tensor would have produced. C) Demote returns to zero-storage state; re-materialize works. D) Footprint accounting: handle_bytes scales linearly with tensor count; eager would scale with tensor-DATA bytes. Verify lazy_handle_bytes(n) = n * 88. E) Not-found verdict propagated.

dependencies 8 imports · 0 importers

nx_syscalls.nx nx_tier.nx nx_le.nx nx_tensor.nx nx_gguf.nx nx_gguf_load.nx nx_placement.nx nx_gguf_load_lazy.nx nx_gguf_load_lazy_test.nx

imports: nx_syscalls.nxnx_tier.nxnx_le.nxnx_tensor.nxnx_gguf.nxnx_gguf_load.nxnx_placement.nxnx_gguf_load_lazy.nx

imported by: nobody (leaf or entry point)

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

main 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_le_write_u64 nx_le_write_u32 nx_le_write_u32 ↻ nx_le_write_u16 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 ↻ nx_gguf_load_tensor_lazy nx_gguf_find_tensor nx_gguf_tensor_at nx_gguf_name_equals nx_gguf_tensor_at ↻ nx_gguf_tensor_n_values sys_mmap ↻ nx_placed_tensor_new_lazy sys_mmap ↻ nx_placed_tensor_is_live nx_placed_tensor_storage_b

structs

none

consts

none

functions

28func main() -> i64