code wiki / _hdl_build / nx_anchorsweep.nx
nx_anchorsweep.nx
buildroot/runtime/_hdl_build/nx_anchorsweep.nx
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
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
structs
| none |
consts
| 36 | const AN_MAGIC_20000: i64 = 20000 |
| 37 | const AN_MAGIC_4096: i64 = 4096 |
| 38 | const AN_MAGIC_4095: i64 = 4095 |
| 40 | const AN_CENSUS: *u8 = "knowledge/status/drysweep.log" |
| 41 | const AN_LOG: *u8 = "knowledge/status/anchorsweep.log" |
| 42 | const AN_SRCCAP: i64 = 4194304 |
| 43 | const AN_OUTCAP: i64 = 65536 |
| 44 | const AN_TIMEOUT: i64 = 120000 |
| 45 | const AN_NAMECAP: i64 = 512 |
functions
| 47 | func 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 } |
| 48 | func 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 } |
| 49 | func an_n(fd: i64, v: i64) -> i64 |
| 60 | func an_has(buf: *u8, n: i64, pat: *u8) -> i64 called by 1: main |
| 74 | func an_lastidx(buf: *u8, n: i64, pat: *u8) -> i64 called by 1: main |
| 89 | func an_atoi(s: *u8) -> i64 called by 1: main |
| 95 | func an_cat(dst: *u8, o: i64, s: *u8) -> i64 |
| 106 | func an_srcpath(gname: *u8, out: *u8) -> i64 |
| 119 | func main(argc: i64, argv: *i64) -> i64 |