code wiki / (root) / nx_autofix_candidate4.nx

nx_autofix_candidate4.nx

buildroot/runtime/nx_autofix_candidate4.nx

2272 B51 linesdepth 2pulls 2 transitivereach 0 importersview sourcekind tooltopic autofix
docsdependenciesstructsconstsfunctions

about

nx_autofix_candidate4.nx -- third self-localizing candidate, one rung HARDER: the seeded bug is SEMANTIC and only PARTIALLY failing. absdiff() returns a-b, which passes absdiff(7,3)=4 and absdiff(5,5)=0 but fails absdiff(3,7) with -4 -- so a fixer that only pattern-matches "function broken -> rewrite from name" has less to go on, and the repair needs order-aware logic. To support this, the output contract adds FNCASE rows for FAILING cases only: FNCASE <fn> <in1> <in2> want <w> got <g> The auto loop feeds those rows verbatim to the local maker = pure machine feedback (no Claude authorship anywhere in the prompt content). FNRES + CGR stay as before. license_tier: ORIGINAL

dependencies 1 imports · 0 importers

nx_syscalls.nx nx_autofix_candidate4.nx

imports: nx_syscalls.nx

imported by: nobody (leaf or entry point)

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

main max2 absdiff fncase cw sys_write cn cw ↻ sys_mmap sys_write ↻ cw ↻ cn ↻

structs

none

consts

none

functions

11func cw(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 3: cnfncasemain calls 1: sys_write
12func cn(v: i64) -> i64
called by 2: fncasemain calls 3: cwsys_mmapsys_write
25func fncase(fn: *u8, a: i64, b: i64, want: i64, got: i64) -> i64
called by 1: main calls 2: cwcn
31func max2(a: i64, b: i64) -> i64 { if a > b { return a } return b }
called by 1: main
32func absdiff(a: i64, b: i64) -> i64 { return a - b }
called by 1: main
34func main() -> i64