code wiki / (root) / nx_autofix_candidate3.nx

nx_autofix_candidate3.nx

buildroot/runtime/nx_autofix_candidate3.nx

1890 B45 linesdepth 2pulls 2 transitivereach 0 importersview sourcekind tooltopic autofix
docsdependenciesstructsconstsfunctions

about

nx_autofix_candidate3.nx -- second self-localizing candidate: SAME output contract as candidate2 but the SEEDED BUG is in a DIFFERENT function (dbl() returns x instead of doubling). Running the same nx_autofix_auto organ against candidate2 (bug in sgn) AND this file (bug in dbl) is the tooth that proves localization is DISCOVERED from the per-function FNRES rows, not hardcoded. dbl is also not in the fixer's few-shot examples, and its repair is arithmetic (not if-shaped) -- it probes whether the maker generalizes past the template's pattern. license_tier: ORIGINAL

dependencies 1 imports · 0 importers

nx_syscalls.nx nx_autofix_candidate3.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 sgn dbl cw sys_write cn cw ↻ sys_mmap sys_write ↻

structs

none

consts

none

functions

9func 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 2: cnmain calls 1: sys_write
10func cn(v: i64) -> i64
called by 1: main calls 3: cwsys_mmapsys_write
24func max2(a: i64, b: i64) -> i64 { if a > b { return a } return b }
called by 1: main
25func sgn(x: i64) -> i64 { if x > 0 { return 1 } if x < 0 { return 0 - 1 } return 0 }
called by 1: main
26func dbl(x: i64) -> i64 { return x }
called by 1: main
28func main() -> i64
calls 5: max2sgndblcwcn