nx_bit_provenance.nx
buildroot/runtime/nx_bit_provenance.nx
about
nx_bit_provenance.nx -- bit-provenance ledger (silicon-to-death tracking).
Cardinal: feedback-no-skips-bit-provenance-silicon-to-death.
Every output bit the substrate produces carries an ID and an upstream
chain. Every consumer (the bit's "death") joins its observation to
the chain. Auditable end-to-end: query the ledger for orphans
(consumed-without-producer) and zombies (produced-without-consumer)
to find substrate honesty bugs.
API surface (V0):
let id: i64 = nx_bprov_alloc()
nx_bprov_emit(id, src_a_id, src_b_id, layer_tag, primitive_tag)
nx_bprov_emit3(id, src_a_id, src_b_id, src_c_id, layer_tag, primitive_tag)
nx_bprov_join(in_bit_id, layer_tag, primitive_tag)
nx_bprov_audit_zombies() -> i64 -- 0 = clean
nx_bprov_lookup_join(id) -> i64 -- the consumer layer, -1 if unjoined
nx_bprov_n_records() -> i64
Layer tags (sealed enum matching SMOKE_SCHEMA.md + CAR_DIAGRAM.md):
dependencies 1 imports · 3 importers
imports: syscalls.nx
imported by: nx_bit_provenance_pipeline_test.nxnx_bprov_chain.nxnx_matmul_traced.nx
call flow from main pre-order; caps 40 nodes / depth 6 declared; ↻ = already shown
structs
| none |
consts
| 24 | const NX_MAGIC_12345: i64 = 12345 |
| 25 | const NX_MAGIC_67890: i64 = 67890 |
| 26 | const NX_MAGIC_11111: i64 = 11111 |
| 27 | const NX_MAGIC_22222: i64 = 22222 |
| 28 | const NX_MAGIC_33333: i64 = 33333 |
| 29 | const NX_MAGIC_44444: i64 = 44444 |
| 30 | const NX_MAGIC_99999: i64 = 99999 |
| 32 | const NX_BPROV_L_NEG_1: i64 = -1 |
| 33 | const NX_BPROV_L_0: i64 = 0 |
| 34 | const NX_BPROV_L_1: i64 = 1 |
| 35 | const NX_BPROV_L_1S: i64 = 2 |
| 36 | const NX_BPROV_L_2: i64 = 3 |
| 37 | const NX_BPROV_L_3: i64 = 4 |
| 38 | const NX_BPROV_L_35: i64 = 5 |
| 39 | const NX_BPROV_L_36: i64 = 6 |
| 40 | const NX_BPROV_L_37: i64 = 7 |
| 41 | const NX_BPROV_L_4: i64 = 8 |
| 42 | const NX_BPROV_L_5: i64 = 9 |
| 43 | const NX_BPROV_L_6: i64 = 10 |
| 44 | const NX_BPROV_L_7: i64 = 11 |
| 45 | const NX_BPROV_L_IMG: i64 = 12 |
| 46 | const NX_BPROV_L_RC: i64 = 13 |
| 48 | const NX_BPROV_REC_SIZE: i64 = 64 // 8 i64 fields |
| 49 | const NX_BPROV_CHUNK_BYTES: i64 = 262144 // 4096 records |
functions
| 56 | func nx_bprov_init() -> i64 |
| 68 | func nx_bprov_alloc() -> i64 called by 8: mainmainnx_bprov_chain0nx_bprov_chain1nx_bprov_chain2nx_bprov_chain3+2 calls 1: nx_bprov_init |
| 75 | func _nx_bprov_write(id: i64, src_a: i64, src_b: i64, src_c: i64, |
| 93 | func nx_bprov_emit(id: i64, src_a: i64, src_b: i64, |
| 98 | func nx_bprov_emit3(id: i64, src_a: i64, src_b: i64, src_c: i64, |
| 103 | func nx_bprov_join(in_bit_id: i64, layer: i64, primitive: i64) -> i64 |
| 122 | func nx_bprov_audit_zombies() -> i64 |
| 135 | func nx_bprov_lookup_join(in_bit_id: i64) -> i64 |
| 150 | func nx_bprov_n_records() -> i64 |
| 158 | func main() -> i64 |