nx_gguf_load_lazy_test.nx
buildroot/runtime/nx_gguf_load_lazy_test.nx
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
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
structs
| none |
consts
| none |
functions
| 28 | func main() -> i64 |