code wiki / _hdl_build / nx_func_compare.nx
nx_func_compare.nx
buildroot/runtime/_hdl_build/nx_func_compare.nx
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
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
structs
| none |
consts
| 30 | const NX_CMP_NORM_BUF: i64 = 65536 |
functions
| 33 | func compare_emit_file(file: *u8, fname: *u8, h: i64) -> i64 |
| 44 | func main(argc: i64, argv: *i64) -> i64 |