code wiki / _hdl_build / nx_builder_compose.nx

nx_builder_compose.nx

buildroot/runtime/_hdl_build/nx_builder_compose.nx

2974 B55 linesdepth 2pulls 2 transitivereach 3 importersview sourcekind librarytopic builder
docsdependenciesstructsconstsfunctions

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

nx_syscalls.nx nx_builder_compose.nx nx_builder_compose_test.nx nx_spec_ingest.nx

imports: nx_syscalls.nx

imported by: nx_builder_compose_test.nxnx_spec_ingest.nx

structs

none

consts

12const BC_T_PATH: i64 = 1
13const BC_T_BYTES: i64 = 2
14const BC_T_HASH: i64 = 3
15const BC_T_BINARY: i64 = 4
17const BC_P_READ: i64 = 1 // PATH -> BYTES (sys_read_file)
18const BC_P_SHA256: i64 = 2 // BYTES -> HASH (sha256)
19const BC_P_COMPILE: i64 = 3 // BYTES -> BINARY (the compiler)
20const BC_P_NPRIM: i64 = 3

functions

22func 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 }
called by 2: bc_composebc_valid
23func 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 }
called by 2: bc_composebc_valid
27func bc_compose(target_in: i64, target_out: i64, seq: *i64, maxlen: i64) -> i64
called by 2: mainsi_buildable calls 2: bc_inbc_out
48func bc_valid(seq: *i64, n: i64, target_in: i64, target_out: i64) -> i64
called by 1: main calls 2: bc_inbc_out