code wiki / _hdl_build / nx_stream_store.nx

nx_stream_store.nx

buildroot/runtime/_hdl_build/nx_stream_store.nx

1854 B34 linesdepth 5pulls 5 transitivereach 3 importersview sourcekind librarytopic stream
docsdependenciesstructsconstsfunctions

about

nx_stream_store.nx -- LIB (M3): stream a large artifact in fixed-size chunks -> hash incrementally + append to disk, so a multi-GB .safetensors shard needs NO full-size buffer for either hashing OR storing. Composes the shipped streaming SHA-256 (nx_sha256: sha256_init/update/final) -- does not re-implement it. This is the transport half of a verified weights pull: the caller feeds fetched TCP chunks straight through ss_stream_store, then compares the returned digest to the HF lfs.oid (nx_hf_tree_parse) -- fail-closed if they differ. No TLS here -> no M32 collision with the fetch stack (transport + crypto stay in separate compilation units). license_tier: ORIGINAL

dependencies 2 imports · 2 importers

nx_sha256.nx nx_syscalls.nx nx_stream_store.nx nx_stream_store_gate.nx nx_weights_pull.nx

imports: nx_sha256.nxnx_syscalls.nx

imported by: nx_stream_store_gate.nxnx_weights_pull.nx

structs

none

consts

none

functions

11func ss_oneshot(src: *u8, n: i64, out32: *u8) -> i64 { sha256_digest(src, n, out32); return 0 }
called by 1: main calls 1: sha256_digest
16func ss_stream_store(src: *u8, n: i64, chunk: i64, dest_path: *u8, out32: *u8) -> i64