code wiki / _hdl_build / nx_evo_synth_gate.nx
nx_evo_synth_gate.nx
buildroot/runtime/_hdl_build/nx_evo_synth_gate.nx
about
nx_evo_synth_gate.nx -- the operator's question: "cant it just use a search engine for enrichment in a loop
over an LLM -- test, discard if worthless, keep if functional, evolve like an animal in an environment? or are
there pieces the LLM adds, or only on edge cases?" This gate DECOMPOSES the LLM's proposer role and shows,
MEASURED, which pieces the evolve-test-select loop already covers WITHOUT an LLM, and the ONE piece it doesn't.
The LLM-as-proposer = (a) a PRIOR over plausible candidates + (b) COMPOSITION (turn parents into a NEW valid
candidate) + (c) TRANSLATION of unstructured knowledge into a NEW primitive (grammar expansion). The honest map:
(a) PRIOR -> a SEARCH ENGINE provides it (retrieve human knowledge -> narrow the space). T4.
(b) COMPOSITION -> a GRAMMAR + mechanical MUTATION makes new VALID candidates. T1-T3, no LLM.
TEST/SELECT -> a deterministic evaluator (FunSearch already does this WITHOUT the LLM).
(c) TRANSLATION -> turning retrieved knowledge into a NEW grammar primitive = the piece evolution CANNOT do
(mutation explores WITHIN the grammar; it cannot INVENT a construct outside it). T5 proves it.
FOUND THE HARD WAY: naive greedy single-gene evolution got STUCK in a local optimum; escaping it needed multi-gene
mutation + random restart (iterated local search) = classical EA mechanics, NOT an LLM.
T1 EVOLVE-TEST-SELECT solves a target with NO LLM, NO exhaustive enumeration (mutation + environment selection).
T2 MEASURED: evolution finds it in FAR fewer evaluations than blind random search (selection/environment works).
T3 the evolved program GENERALIZES on held-out (it's a real solution, not memorized).
T4 ENRICHMENT: a RETRIEVED prior that NARROWS the space (search-engine proxy) makes evolution far cheaper.
T5 THE ONE LLM PIECE: an OUT-OF-GRAMMAR target (x^4 vs a cubic-only construct) is UNREACHABLE -> grammar EXPANSION.
expect_exit: 0 license_tier: ORIGINAL
dependencies 2 imports · 0 importers
imports: nx_ncf_synth.nxnx_syscalls.nx
imported by: nobody (leaf or entry point)
call flow from main pre-order; caps 40 nodes / depth 6 declared; ↻ = already shown
structs
| none |
consts
| none |
functions
| 24 | func lcg_next(st: *i64) -> i64 { st[0]=((1103515245*st[0])+12345)&2147483647; return st[0] } |
| 25 | func rand_gene(st: *i64, lo: i64, hi: i64) -> i64 { return lo+(lcg_next(st)%((hi-lo)+1)) } |
| 29 | func g_error(g: *i64, xs: *i64, ys: *i64, n: i64) -> i64 |
| 37 | func evolve(xs: *i64, ys: *i64, n: i64, seed: i64, lo: i64, hi: i64, evalbox: *i64, best: *i64) -> i64 |
| 66 | func random_search(xs: *i64, ys: *i64, n: i64, seed: i64, lo: i64, hi: i64, budget: i64, evalbox: *i64) -> i64 |
| 79 | func main() -> i64 |