code wiki / _hdl_build / nx_builder_compose.nx
nx_builder_compose.nx
buildroot/runtime/_hdl_build/nx_builder_compose.nx
about
nx_builder_compose.nx -- the BUILDER synthesizes code (operator: "build the builder to build this
stuff... it can synthesize and build code; you still skip over the builder"). The Builder AUTHORS a
program by COMPOSING primitives from the team's library to satisfy a SPEC (a target input-type ->
output-type): it SEARCHES for a chain of primitives that type-connects end to end -- Claude does NOT
hand-write the chain, the Builder's search does. This is constrained code synthesis (compose KNOWN
primitives); authoring a genuinely-new primitive is still the LLM-gap (honest). Proven by having the
Builder author the build-cache's core flows. license_tier: ORIGINAL Composes nx_builder_synth + nx_teacher.
dependencies 1 imports · 2 importers
imports: nx_syscalls.nx
imported by: nx_builder_compose_test.nxnx_spec_ingest.nx
structs
| none |
consts
| 12 | const BC_T_PATH: i64 = 1 |
| 13 | const BC_T_BYTES: i64 = 2 |
| 14 | const BC_T_HASH: i64 = 3 |
| 15 | const BC_T_BINARY: i64 = 4 |
| 17 | const BC_P_READ: i64 = 1 // PATH -> BYTES (sys_read_file) |
| 18 | const BC_P_SHA256: i64 = 2 // BYTES -> HASH (sha256) |
| 19 | const BC_P_COMPILE: i64 = 3 // BYTES -> BINARY (the compiler) |
| 20 | const BC_P_NPRIM: i64 = 3 |
functions
| 22 | func bc_in(p: i64) -> i64 { if p == BC_P_READ { return BC_T_PATH } if p == BC_P_SHA256 { return BC_T_BYTES } return BC_T_BYTES } |
| 23 | func bc_out(p: i64) -> i64 { if p == BC_P_READ { return BC_T_BYTES } if p == BC_P_SHA256 { return BC_T_HASH } return BC_T_BINARY } |
| 27 | func bc_compose(target_in: i64, target_out: i64, seq: *i64, maxlen: i64) -> i64 |
| 48 | func bc_valid(seq: *i64, n: i64, target_in: i64, target_out: i64) -> i64 |