code wiki / _hdl_build / nx_anchorsweep.nx

nx_anchorsweep.nx

buildroot/runtime/_hdl_build/nx_anchorsweep.nx

18101 B358 linesdepth 5pulls 6 transitivereach 0 importersview sourcekind tool
docsdependenciesstructsconstsfunctions

about

nx_anchorsweep.nx -- DRIVE THE ANCHOR RUNG OVER THE 860-GATE NOANCHOR FAMILY. ★WHY THIS EXISTS AND WHY IT IS NOT A DESIGN DECISION. I reported the NOANCHOR family as blocked on human judgement -- "establishing a verdict= tail where none exists" -- and filed that as the reason the D001 lane could not be finished. TWO CALLS REFUTED IT (debt 1786239110): on nx_aa_gate, nx_gate_anchor_edit proposed a candidate and nx_gate_migrate anchor answered exit-code IDENTICAL / PASS-FAIL vector IDENTICAL / before anchor-free YES / after emits anchor YES / verdict==exit AGREES -> GREEN ANCHORED. The judge supplies the judgement, and it checks verdict==exit so it REFUSES A LYING ANCHOR rather than blessing a wrong verdict. ★A CLAIM THAT SOMETHING NEEDS HUMAN AUTHORITY MUST BE EARNED BY TRYING THE TOOL FIRST -- the cheapest experiment was two calls and I declared a blocker without running them. ★COMPOSES TWO RULERS, RE-IMPLEMENTS NEITHER: worklist from knowledge/status/drysweep.log (the census is the single source of truth), judgement from nx_gate_anchor_edit + nx_gate_migrate anchor. This TALLIES. ★ALL FOUR DEFECTS FOUND IN nx_adoptsweep ARE FIXED HERE FROM THE START, not rediscovered: 1. GENERATION SCAN -- drysweep.log is append-only with one block per census, each ended by DRYSWEEP-TOTAL. Reading the whole file sums generations (measured: 605+586=1191 reported as the population). Read between the SECOND-TO-LAST and LAST totals; that also picks up reclassification. 2. EMPTY-WORKLIST REFUSAL -- a sweep that processes nothing must NOT report a clean run. The broken v1 scan printed `partition: 0 of 0 -- SUMS` with no errors. A tooth that passes on the empty set is not a tooth. 3. PER-RUN CANDIDATE PATH -- a fixed /tmp path lets two concurrent sweeps hand each other's candidate to the judge. Suffixed by <skip> so batches are disjoint BY CONSTRUCTION, not by luck. 4. ALREADY-ANCHORED IS A SUCCESS, NOT AN ERROR -- and it is excluded from the rate's denominator. ⚠MUTATES SOURCE: nx_gate_migrate anchor COMMITS on acceptance (.premigrate kept, rule 13) and RESTORES on divergence. <max> is mandatory; measure a batch, read it, then size the next one. nx_anchorsweep <max> [skip] exit: 0 all anchored | 1 any REFUSED/ERROR | 2 usage | 3 NO-CONCLUSION (empty worklist / ruler missing) license_tier: ORIGINAL No hw writes (Rule 26).

dependencies 3 imports · 0 importers

nx_syscalls.nx nx_artifact_root.nx nx_tool_run.nx nx_anchorsweep.nx

imports: nx_syscalls.nxnx_artifact_root.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 an_puts sys_write sys_exit an_atoi 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 ↻ ar_resolve ar_resolve_with ar_exists sys_openat_rd sys_close sys_mmap ↻ ar_read sys_openat_rd ↻ sys_read sys_close ↻ ar_read ↻ an_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

structs

none

consts

36const AN_MAGIC_20000: i64 = 20000
37const AN_MAGIC_4096: i64 = 4096
38const AN_MAGIC_4095: i64 = 4095
40const AN_CENSUS: *u8 = "knowledge/status/drysweep.log"
41const AN_LOG: *u8 = "knowledge/status/anchorsweep.log"
42const AN_SRCCAP: i64 = 4194304
43const AN_OUTCAP: i64 = 65536
44const AN_TIMEOUT: i64 = 120000
45const AN_NAMECAP: i64 = 512

functions

47func an_puts(s: *u8) -> i64 { var n: i64=0; while s[n]!=(0 as u8){n=n+1} sys_write(1,s,n); return 0 }
called by 1: main calls 1: sys_write
48func an_w(fd: i64, s: *u8) -> i64 { var n: i64=0; while s[n]!=(0 as u8){n=n+1} sys_write(fd,s,n); return 0 }
called by 1: main calls 1: sys_write
49func an_n(fd: i64, v: i64) -> i64
called by 1: main calls 2: sys_writesys_mmap
60func an_has(buf: *u8, n: i64, pat: *u8) -> i64
called by 1: main
74func an_lastidx(buf: *u8, n: i64, pat: *u8) -> i64
called by 1: main
89func an_atoi(s: *u8) -> i64
called by 1: main
95func an_cat(dst: *u8, o: i64, s: *u8) -> i64
called by 2: an_srcpathmain
106func an_srcpath(gname: *u8, out: *u8) -> i64
called by 1: main calls 3: sys_mmapan_catar_resolve
119func main(argc: i64, argv: *i64) -> i64