code wiki / _hdl_build / nx_engineer_wire.nx

nx_engineer_wire.nx

buildroot/runtime/_hdl_build/nx_engineer_wire.nx

2298 B41 linesdepth 2pulls 2 transitivereach 3 importersview sourcekind librarytopic engineer
docsdependenciesstructsconstsfunctions

about

nx_engineer_wire.nx -- the ENGINEER's WIRING capability (operator: "if we need wiring we need the engineer to have a wiring capability"). Wiring = swap component X for component Y at a call site, then CERTIFY the wired system before accepting it. A swap is admissible only if it is NON-REGRESSING (every case the old component handled, the new one still handles -- rule 19 contract stability) and ideally IMPROVING (fixes at least one case the old got wrong). A swap that breaks anything is REJECTED, never wired. The Engineer runs both components over a labelled case set and returns the verdict; the Council only admits a safe wiring. RACI: Engineer certifies, Council admits, Builder/Researcher supplied the new component. license_tier: ORIGINAL

dependencies 1 imports · 2 importers

nx_syscalls.nx nx_engineer_wire.nx nx_engineer_wire_sclass.nx nx_engineer_wire_test.nx

imports: nx_syscalls.nx

imported by: nx_engineer_wire_sclass.nxnx_engineer_wire_test.nx

structs

none

consts

12const EW_REGRESS: i64 = 0 // the new component broke a case the old one handled -> REJECT
13const EW_NEUTRAL: i64 = 1 // non-regressing but no improvement -> optional
14const EW_OK: i64 = 2 // non-regressing AND fixes >=1 case -> WIRE IT

functions

17func ew_coverage_ok(old_served: i64, new_served: i64) -> i64 { if new_served >= old_served { return 1 } return 0 }
20func ew_regressions(n: i64, old_correct: *i64, new_correct: *i64) -> i64
27func ew_improvements(n: i64, old_correct: *i64, new_correct: *i64) -> i64
called by 2: ews_marginmain
34func ew_verdict(regressions: i64, improvements: i64) -> i64
called by 1: main
41func ew_safe_to_wire(verdict: i64) -> i64 { if verdict == EW_REGRESS { return 0 } return 1 }
called by 1: main