code wiki / (root) / nx_matmul_traced.nx

nx_matmul_traced.nx

buildroot/runtime/nx_matmul_traced.nx

5429 B154 linesdepth 4pulls 4 transitivereach 0 importersview sourcekind tool
docsdependenciesstructsconstsfunctions

about

nx_matmul_traced.nx -- BP-3: real ML primitive (matmul) with full bit-provenance per output cell. Cardinal: feedback-no-skips-bit-provenance-silicon-to-death. Proves the user-asked pattern: every output bit of a real ML primitive is traceable to the input bits that contributed to it. A * B = C (2x2 i64 matrices) For each output cell C[i,j]: - allocate a new bit ID - emit3 the bit with up to 3 source contributions (since 2x2 needs sum of 2 products = up to 2 source layers; emit3 leaves slot for the layer-tag and primitive-tag) - the eventual consumer (display / dot / next layer) calls nx_bprov_join to close the chain expect_exit: 0

dependencies 1 imports · 0 importers

nx_bit_provenance.nx nx_matmul_traced.nx

imports: nx_bit_provenance.nx

imported by: nobody (leaf or entry point)

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

main nx_bprov_init nx_bprov_alloc nx_bprov_init ↻ nx_bprov_emit _nx_bprov_write nx_bprov_init ↻ nx_matmul_2x2_traced nx_bprov_alloc ↻ nx_bprov_emit3 _nx_bprov_write ↻ nx_bprov_audit_zombies nx_bprov_init ↻ nx_bprov_join nx_bprov_init ↻ nx_bprov_lookup_join nx_bprov_init ↻ nx_bprov_n_records nx_bprov_init ↻

structs

none

consts

22const TAG_MAGIC_4096: i64 = 4096
23const TAG_MAGIC_11111: i64 = 11111
24const TAG_MAGIC_22222: i64 = 22222
25const TAG_MAGIC_33333: i64 = 33333
28const TAG_MATMUL: i64 = 0xC0DEB1A5

functions

33func nx_matmul_2x2_traced(pa: *i64, pb: *i64, pc: *i64,
called by 1: main calls 2: nx_bprov_allocnx_bprov_emit3
80func main() -> i64