code wiki / (root) / nx_autofix_candidate2.nx

nx_autofix_candidate2.nx

buildroot/runtime/nx_autofix_candidate2.nx

1996 B47 linesdepth 2pulls 2 transitivereach 0 importersview sourcekind tooltopic autofix
docsdependenciesstructsconstsfunctions

about

nx_autofix_candidate2.nx -- richer "code under repair" for the SELF-LOCALIZING fix loop (nx_autofix_auto). Unlike candidate 1 (one function, aggregate score only), this one grades EACH function and emits per-function FNRES rows -- so the loop can DISCOVER which function is broken instead of being told. SEEDED BUG: sgn() ignores its input (returns 0) -> FNRES sgn 1 3. sgn is deliberately NOT one of the fixer's few-shot examples (min2/abs1) -- a green fix here is the model's own completion, not a template lookup. Output: FNRES <name> <passed> <total> per function, then the aggregate CGR=<total-passed> the existing graders parse. license_tier: ORIGINAL

dependencies 1 imports · 0 importers

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

structs

none

consts

none

functions

10func 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
11func cn(v: i64) -> i64
called by 1: main calls 3: cwsys_mmapsys_write
25func max2(a: i64, b: i64) -> i64 { if a > b { return a } return b }
called by 1: main
26func min2(a: i64, b: i64) -> i64 { if a < b { return a } return b }
called by 1: main
27func sgn(x: i64) -> i64 { return 0 }
called by 1: main
29func main() -> i64
calls 5: max2min2sgncwcn