nx_diff.nx
buildroot/runtime/nx_diff.nx
about
nx_diff.nx -- byte-level binary diff (sovereign cmp / xxd | diff).
The F6 reproducibility gate compares the SHA-256 of compiled
outputs. When a build fails the gate, you get "hashes differ"
and nothing else -- you have to dig in to find WHERE. This
module implements the digging:
- cmp-style: first differing byte offset (or -1 if equal).
- hex-window: dump 16-byte windows around each difference so
you can eyeball whether the diff is endian, padding, a
symbol-name string, or a relocation patch.
- diff stats: total differing bytes + % similarity.
Pairs with bench/f6_manifest.txt + bootstrap_proof.sh. When a
stage-N hash drifts, run nx_diff against the stage-1 baseline to
find what changed.
Not a textual diff -- this is for binaries. For source-level
diffs use git diff.
dependencies 1 imports · 0 importers
imports: syscalls.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
| none |
functions
| 32 | func nx_diff_first(a: *u8, b: *u8, len: i64) -> i64 |
| 43 | func nx_diff_count(a: *u8, b: *u8, len: i64) -> i64 |
| 54 | func nx_diff_hex_byte(fd: i64, v: i64) -> i64 called by 1: nx_diff_hex_window |
| 66 | func nx_diff_hex_window(fd: i64, p: *u8, len: i64) -> i64 |
| 90 | func nx_diff_dec(fd: i64, v: i64) -> i64 called by 1: nx_diff_report |
| 114 | func nx_diff_report(fd: i64, a: *u8, b: *u8, len_a: i64, len_b: i64) -> i64 |
| 159 | func main() -> i64 |