code wiki / (root) / nx_optimizer_milestone_attest.nx

nx_optimizer_milestone_attest.nx

buildroot/runtime/nx_optimizer_milestone_attest.nx

6519 B130 linesdepth 7pulls 8 transitivereach 0 importersview sourcekind tool
docsdependenciesstructsconstsfunctions

about

nx_optimizer_milestone_attest.nx -- substrate-native attribution for the alloca-load-fold peephole shipped 2026-05-20. REPLACES "the right commit message" with a hash-chained attestation that cannot be silently overwritten by parallel-agent `git add -A`. Per [[NISHI_STORAGE_SUBSTRATE_ROADMAP]] vs Git row of the EXCEED matrix: native SHA-256 + L1 append-only journal + tamper-detect chain. Git only has refs.log; we ship cryptographic linkage. What this program emits: 1. nx_blob_store_put(patched_codegen_source) -> hash A content-address of nx_x86_64_ctx.nx after the peephole edit 2. nx_blob_store_put(emitted_asm) -> hash B content-address of peephole_tightloop.s the self-host produced 3. nx_blob_store_put(attestation_payload) -> hash C content-address of the metrics description 4. nx_journal_log_append three entries (schema 20260520) -> seq 0,1,2 5. nx_journal_log_verify_chain -> must return -1 (chain intact) 6. nx_journal_log_latest_hash -> the chain head; the canonical identity of this optimizer milestone, independent of git To re-verify any time later: rerun this program against the same inputs; identical hashes mean nothing was tampered.

dependencies 4 imports · 0 importers

nx_syscalls.nx nx_blob_store.nx nx_journal_log.nx nx_hex.nx nx_optimizer_milestone_attest.

imports: nx_syscalls.nxnx_blob_store.nxnx_journal_log.nxnx_hex.nx

imported by: nobody (leaf or entry point)

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

main nx_blob_store_new sys_mmap nx_journal_log_new sys_mmap ↻ nx_journal_log_is_valid sys_mmap ↻ sys_read_file sys_openat_rd sys_lseek sys_mmap ↻ sys_read sys_close nx_blob_hash_new sys_mmap ↻ nx_blob_store_put nx_blob_store_is_valid _hash_bytes_to_struct sys_mmap ↻ sha256_digest sys_mmap ↻ sha256_init sys_mmap ↻ sha256_k sha256_update sha256_compress_ni_blocks blk_set_byte sha256_compress sha256_compress_ni blk_word sha256_final blk_set_byte ↻ sha256_compress ↻ _load_i64_le _find_entry_idx _entry_hash_eq _alloc_entry sys_mmap ↻ nx_journal_log_append nx_journal_log_is_valid ↻

structs

none

consts

31const K_MAGIC_20260520: i64 = 20260520

functions

33func _puts(fd: i64, s: *u8) -> i64
called by 2: _put_hashmain calls 1: sys_write
40func _put_hash(fd: i64, label: *u8, w0: i64, w1: i64, w2: i64, w3: i64) -> i64
called by 1: main calls 2: _putsnx_hex_i64
50func main() -> i64