code wiki / _hdl_build / nx_func_compare.nx

nx_func_compare.nx

buildroot/runtime/_hdl_build/nx_func_compare.nx

3955 B122 linesdepth 4pulls 6 transitivereach 0 importersview sourcekind tool
docsdependenciesstructsconstsfunctions

about

nx_func_compare.nx -- pure-NishiLang function-equivalence checker. Usage: nx_func_compare <file1> <file2> [<file3> ...] <function_name> For each file, extract the named function's body, normalize away comments and whitespace, compute FNV-1a 64-bit hash. Emit per-file hash + verdict. Verdict EQUIVALENT if all hashes match exactly. Verdict DIVERGE otherwise -- with first hash + first-diff file flagged. This is the substrate-native answer to "are these N functions actually the same?" before consolidation. No grep, no awk, no diff. genealogy_id: fowler_noll_vo_1991_fnv1a + clone_detection_lit lineage_id: content_hash_equivalence_test axioms: NX_AX_REL_TRANSITIVITY (chain hash equalities)

dependencies 3 imports · 0 importers

syscalls.nx runtime.nx nx_extract.nx nx_func_compare.nx

imports: syscalls.nxruntime.nxnx_extract.nx

imported by: nobody (leaf or entry point)

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

main println strlen sys_read_file sys_openat_rd sys_lseek sys_mmap sys_read sys_close print strlen ↻ nx_extract_func_hash nx_extract_func_body strlen ↻ strneq nx_extract_normalize nx_lex_is_ws nx_extract_hash compare_emit_file print ↻ print_i64 itoa println ↻ print_i64 ↻

structs

none

consts

30const NX_CMP_NORM_BUF: i64 = 65536

functions

33func compare_emit_file(file: *u8, fname: *u8, h: i64) -> i64
called by 1: main calls 3: printprint_i64println
44func main(argc: i64, argv: *i64) -> i64