code wiki / _hdl_build / nx_weights_pull.nx

nx_weights_pull.nx

buildroot/runtime/_hdl_build/nx_weights_pull.nx

1943 B29 linesdepth 6pulls 6 transitivereach 1 importersview sourcekind library
docsdependenciesstructsconstsfunctions

about

nx_weights_pull.nx -- LIB: the per-shard VERIFIED-PULL decision logic that ties the weights ladder together. Composes nx_stream_store (M3: stream-hash + incremental store) -> given a shard's bytes and the expected sha256 (the HF lfs.oid from nx_hf_tree_parse / M2b), it streams the bytes to disk while hashing, then VERIFIES the streaming digest against the expected digest. FAIL-CLOSED: a corrupt / tampered / truncated shard NEVER passes (the live orchestrator unlinks dest on a 0 verdict). This is the network-independent brain of the pull; the live transport (nx_https_fetch_follow feeding the chunks) is the only piece that needs a healthy network. No TLS here -> shares a compilation unit with nx_sha256 cleanly (no M32 collision). license_tier: ORIGINAL

dependencies 2 imports · 1 importers

nx_stream_store.nx nx_syscalls.nx nx_weights_pull.nx nx_weights_pull_gate.nx

imports: nx_stream_store.nxnx_syscalls.nx

imported by: nx_weights_pull_gate.nx

structs

none

consts

none

functions

11func wp_hexenc(inp: *u8, n: i64, out: *u8) -> i64
called by 1: wp_pull_shard
17func wp_streq(a: *u8, b: *u8) -> i64 { var i: i64=0; while 1==1 { if a[i]!=b[i] {return 0} if a[i]==(0 as u8) {return 1} i=i+1 } return 1 }
called by 1: wp_pull_shard
22func wp_pull_shard(src: *u8, n: i64, expected_hex: *u8, dest: *u8, chunk: i64) -> i64