code wiki / _hdl_build / nx_forkgrade.nx

nx_forkgrade.nx

buildroot/runtime/_hdl_build/nx_forkgrade.nx

20394 B402 linesdepth 5pulls 5 transitivereach 0 importersview sourcekind tool
docsdependenciesstructsconstsfunctions

about

nx_forkgrade.nx -- GRADE THE WHOLE CROSS-TREE FORK, IN ONE PROCESS, IN NISHILANG. WHY THIS EXISTS. Every reading of the cross-tree fork so far was a SAMPLE -- 40 files, then 120, then 250 of 2,845 -- and the reason was purely instrumental: nx_srcdiff is one process per pair, and driven from the laptop each spawn crosses WSL at ~2s, so the population cost ~95 minutes and I shrank the evidence to fit the tool. ★★★★★★WHEN AN INSTRUMENT IS EXPENSIVE, PAY THE COST OR FIX THE INSTRUMENT -- NEVER SHRINK THE POPULATION TO FIT IT. Forking the same ruler NAS-side costs ~10ms, so the whole population is seconds. AND IT COMPOSES, IT DOES NOT REIMPLEMENT. The ruler stays nx_srcdiff -- one ruler, one implementation. This organ only iterates and tallies. A second line-differ would be the duplicate-ruler defect that this lane has already paid for twice (a local symbol-set check that was weaker than nx_srcdiff, and a second flow-back with a second guard). It also exists because the tally is JUDGEMENT, and judgement belongs in an organ: a .ps1 that classifies verdicts and counts distributions is exactly the shell-side judging the doctrine forbids. Shell's remaining job is moving bytes between the two trees, which is irreducibly laptop-side. usage: nx_forkgrade <listfile> <dirA> <dirB> [outfile] listfile : one tree-relative path per line dirA : NAS tree root (e.g. buildroot/runtime) dirB : staged other tree (e.g. /tmp/lapfork) outfile : per-file rows "<verdict> <bpaired> <bunpaired> <relpath>"; stdout carries only the envelope so a payload cap can never bound coverage. UNKNOWN IS ITS OWN BUCKET: a pair whose ruler output carries no anchored verdict is counted UNREADABLE, never folded into a known class. The bucket an unrecognised value lands in becomes the number somebody plans against. license_tier: ORIGINAL expect_exit: 0

dependencies 2 imports · 0 importers

nx_syscalls.nx nx_tool_run.nx nx_forkgrade.nx

imports: nx_syscalls.nxnx_tool_run.nx

imported by: nobody (leaf or entry point)

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

main fg_puts sys_write sys_exit sys_mmap nxa_die sys_write ↻ sys_exit ↻ nxa_lock_take nxa_lock_addr sys_write ↻ nxa_lock_give nxa_lock_addr ↻ nxa_report_overrun sys_write ↻ nxa_dump_printable sys_write ↻ nxa_dump_sizes sys_write ↻ sys_read_file sys_openat_rd sys_lseek sys_mmap ↻ sys_read sys_munmap sys_close fg_join fg_cat tr_run_capture_to tr_run_capture_tr tr_run_capture_core tr_run_capture_core_owned tr_run_capture_core_eviden sys_mmap_shared tr_clock_ms sys_munmap ↻ sys_pipe2 sys_fork sys_close ↻ sys_default_signal

structs

none

consts

32const FG_MAGIC_2048: i64 = 2048
34const FG_STDOUT: i64 = 1
35const FG_LISTCAP: i64 = 4194304
36const FG_OUTCAP: i64 = 8388608
37const FG_RUNCAP: i64 = 262144
38const FG_PATHCAP: i64 = 1024
39const FG_DEADLINE: i64 = 20000
40const FG_RULER: *u8 = "nx_srcdiff.elf"
43const FG_IDENT: i64 = 0
44const FG_ASUP: i64 = 1
45const FG_BSUP: i64 = 2
46const FG_BIDI: i64 = 3
47const FG_UNREAD: i64 = 4
48const FG_TOTAL: i64 = 5
49const FG_BIDI_PAIRED0: i64 = 6 // BIDIRECTIONAL rows whose B-side is fully paired (looks like an edit)
56const FG_SB0: i64 = 7 // surplusB == 0
57const FG_SB1_3: i64 = 8 // 1..3
58const FG_SB4_20: i64 = 9 // 4..20
59const FG_SB21: i64 = 10 // >20
60const FG_BU0: i64 = 11 // bunpaired == 0
61const FG_BU1_3: i64 = 12
62const FG_BU4_20: i64 = 13
63const FG_BU21: i64 = 14
75const FG_SB_SEEN: i64 = 15 // pairs that yielded a parseable surplusB
76const FG_BU_SEEN: i64 = 16 // pairs that yielded a parseable bunpaired
77const FG_SLOTS: i64 = 24
177const FG_SPINE_PROD: *u8 = "knowledge/status/forkgrade.spine"
178const FG_PROD_DIRA: *u8 = "buildroot/runtime"
179const FG_SPINE_SIDECAR: *u8 = ".forkgrade.spine"
180const FG_SPINEBUF: i64 = 1024
181const FG_MODE644: i64 = 420
182const FG_PERMIL: i64 = 1000

functions

79func fg_puts(s: *u8) -> i64 { var n: i64 = 0; while s[n] != (0 as u8) { n = n + 1 } sys_write(FG_STDOUT, s, n); return 0 }
called by 2: fg_trendmain calls 1: sys_write
81func fg_num(v: i64) -> i64
called by 2: fg_trendmain calls 2: sys_mmapsys_write
95func fg_len(s: *u8) -> i64 { var n: i64 = 0; while s[n] != (0 as u8) { n = n + 1 } return n }
called by 2: fg_atfg_find_line
97func fg_cat(dst: *u8, o: i64, s: *u8) -> i64
called by 3: fg_joinfg_trendmain
103func fg_catn(dst: *u8, o: i64, v: i64) -> i64
called by 2: fg_trendmain calls 1: sys_mmap
115func fg_at(buf: *u8, n: i64, i: i64, pat: *u8) -> i64
called by 2: fg_find_linemain calls 1: fg_len
128func fg_find_line(buf: *u8, n: i64, pat: *u8) -> i64
called by 1: main calls 2: fg_lenfg_at
141func fg_int_at(buf: *u8, n: i64, i: i64) -> i64
called by 1: main
157func fg_join(dir: *u8, rel: *u8, out: *u8) -> i64
called by 1: main calls 1: fg_cat
183func fg_streq(a: *u8, b: *u8) -> i64 { var i: i64 = 0; while a[i] != (0 as u8) { if a[i] != b[i] { return 0 } i = i + 1 } if b[i] != (0 as u8) { return 0 } return 1 }
called by 1: fg_trend
184func fg_trend(ctr: *i64, dirA: *u8) -> i64
209func main(argc: i64, argv: *i64) -> i64