code wiki / _hdl_build / nx_boolhunt.nx

nx_boolhunt.nx

buildroot/runtime/_hdl_build/nx_boolhunt.nx

8208 B144 linesdepth 3pulls 5 transitivereach 1 importersview sourcekind library
docsdependenciesstructsconstsfunctions

about

nx_boolhunt.nx -- the team HUNTS its own search space: it enumerates EVERY 3-input boolean function (all 256 truth tables), finds each one's provably-minimal circuit, and races the compiler on each -- discovering, ITSELF, the functions where its exhaustive search beats the compiler's heuristics (and the ones where it's behind, which name the ops it should next author). No human picks the functions; the team sweeps the whole space. The team generates the C for each truth table (sum-of-products) so the compiler can compile it. license_tier: ORIGINAL

dependencies 3 imports · 1 importers

nx_boolsynth.nx nx_gcc_race.nx nx_engineer_crash.nx nx_boolhunt.nx nx_boolhunt_test.nx

imports: nx_boolsynth.nxnx_gcc_race.nxnx_engineer_crash.nx

imported by: nx_boolhunt_test.nx

structs

none

consts

12const K_MAGIC_4096: i64 = 4096
13const K_MAGIC_8192: i64 = 8192

functions

15func bh_emit(buf: *u8, oi: i64, s: *u8) -> i64 { var j: i64 = 0; while s[j] != (0 as u8) { buf[oi] = s[j]; oi = oi + 1; j = j + 1 } return oi }
20func bool_gen_c(tt: i64, path: *u8) -> i64
called by 1: bool_hunt_one calls 2: bh_emitsys_openat_wr
51func bse_rn(buf: *u8, oi: i64, id: i64) -> i64
called by 1: bse_emit_synth calls 1: bh_emit
62func bse_opmn(o: i64) -> *u8
called by 1: bse_emit_synth
68func bse_emit_synth(op: *i64, a: *i64, b: *i64, L: i64, buf: *u8, oi: i64, icnt: *i64) -> i64
112func bse_emit_full(op: *i64, a: *i64, b: *i64, L: i64, buf: *u8, icnt: *i64) -> i64
called by 1: bool_hunt_one calls 2: bh_emitbse_emit_synth
120func bool_hunt_one(tt: i64, gccpath: *u8, res: *i64) -> i64