code wiki / (root) / _simhash_popcount_gate.nx

_simhash_popcount_gate.nx

buildroot/runtime/_simhash_popcount_gate.nx

2839 B51 linesdepth 5pulls 7 transitivereach 0 importersview sourcekind gate/proof
docsdependenciesstructsconstsfunctions

about

_simhash_popcount_gate.nx -- byte-identity KAT for SPD-ALG-SEARCH-01 (search-popcount-swar). Proves nx_simhash_hamming (now the SWAR nx_bits_popcount64_soft) returns the EXACT Hamming distance over ALL distances 0..64 + sign-bit/high-bit vectors (the SWAR arithmetic-shift hazard), with a NEG control proving the gate has teeth (a constant-returning impl is rejected). The old 64-iter bit-test loop and the new SWAR both equal popcount(a^b), so equality here = byte-identical. Emits the SPDGATE probe the speed census (speed_audit_ref.tsv) re_has-matches. Sovereign native lane: exit 0 = GREEN, N = first failed assertion. Judge by exit/printed marker (LM-010), one build+run.

dependencies 2 imports · 0 importers

syscalls.nx nx_simhash.nx _simhash_popcount_gate.nx

imports: syscalls.nxnx_simhash.nx

imported by: nobody (leaf or entry point)

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

main nx_simhash_hamming nx_bits_popcount64_soft gw sys_openat_append

structs

none

consts

11const SG_LOG: *u8 = "knowledge/status/speed_gate.log"

functions

13func gw(fd: i64, s: *u8) -> i64 { var n: i64 = 0; while s[n] != (0 as u8) { n = n + 1 } sys_write(fd, s, n); return 0 }
called by 1: main
15func main() -> i64