code wiki / _hdl_build / nx_stream_store.nx
nx_stream_store.nx
buildroot/runtime/_hdl_build/nx_stream_store.nx
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
imports: nx_sha256.nxnx_syscalls.nx
imported by: nx_stream_store_gate.nxnx_weights_pull.nx
structs
| none |
consts
| none |
functions
| 11 | func ss_oneshot(src: *u8, n: i64, out32: *u8) -> i64 { sha256_digest(src, n, out32); return 0 } |
| 16 | func ss_stream_store(src: *u8, n: i64, chunk: i64, dest_path: *u8, out32: *u8) -> i64 called by 2: mainwp_pull_shard calls 7: sys_mmapsha256_initsys_openat_wrsha256_updatesys_writesys_close+1 |