code wiki / (root) / nx_phash_test.nx

nx_phash_test.nx

buildroot/runtime/nx_phash_test.nx

3354 B75 linesdepth 6pulls 8 transitivereach 0 importersview sourcekind gate/prooftopic phash
docsdependenciesstructsconstsfunctions

about

nx_phash_test.nx -- KAT + benchmark for perceptual image hashing. Native sovereign lane; exit 0 = pass, N = assertion N failed. Prints the measured Hamming distances (the benchmark), then asserts the research-documented properties: deterministic; INVARIANT to uniform brightness (dHash's defining property); near-dup strictly closer than a different image; reverse-image lookup returns the right image.

dependencies 2 imports · 0 importers

fx.nx nx_phash.nx nx_phash_test.nx

imports: fx.nxnx_phash.nx

imported by: nobody (leaf or entry point)

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

main nx_phash_dhash nx_phash_downscale nx_simhash_hamming nx_bits_popcount64_soft nx_puts nx_putc nx_put_i64 nx_putc ↻ nx_putc ↻ nx_phash_nearest nx_simhash_hamming ↻

structs

none

consts

none

functions

11func nx_putc(c: i64) -> i64 { let b: *u8 = sys_mmap(1); b[0] = c; sys_write(1, b, 1); return 0 }
12func nx_puts(s: *u8) -> i64 { var i: i64 = 0; while (s[i] as i64) != 0 { nx_putc(s[i] as i64); i = i + 1 } return 0 }
called by 1: main calls 1: nx_putc
13func nx_put_i64(n: i64) -> i64
called by 1: main calls 1: nx_putc
21func main() -> i64