code wiki / _hdl_build / nx_research_chipfab.nx

nx_research_chipfab.nx source

↩ module page · 92 lines · 5680 B

1// nx_research_chipfab.nx -- the NISHI RESEARCHER handling the chip-fab arc (operator: "i want you 2// to build our nishi researcher to handle [the sovereign lithography / CPU-fab research]"). The team 3// owns this research, mechanized -- NOT a one-off Claude workflow. It composes nx_researcher_deep's 4// CORROBORATION discipline (a fact is admitted only when >= 2 independent sources confirm it AND it 5// is cataloged in our library) over the chip-fab corpus we ALREADY verified 6// (knowledge/library/electronics-fab-deep-research-2026-06-09.txt -- the first fab deep-research that 7// DID complete before the spend limit). Output = the GROUNDED build-inputs the chip-fab spec needs, 8// plus the open questions to pursue live (nx_browse_text) when egress is up. 9// 10// HONEST: this is the researcher's CORROBORATION + GROUNDING engine over a real verified corpus; 11// LIVE fetch-extend (rc_live_angle below) is wired to nx_browse_text but the sandbox has no egress 12// (the NAS does) -- so live extension is a flagged next rung, the grounding over verified facts is 13// proven here. LAWS: struct-free, integer-only. license_tier: ORIGINAL 14import "nx_researcher_deep.nx" 15import "nx_itoa_lib.nx" // shared MSB-first emitter (zero-alloc) 16import "nx_syscalls.nx" 17 18// the chip-fab corpus: each candidate fact has a source-count (independent confirmations) and a 19// cataloged flag (present in our library). Indices map to rc_fact_name below. 20const RC_NFACTS: i64 = 8 21 22func rc_fact_confirming(i: i64) -> i64 { 23 if i == 0 { return 3 } // sovereign silicon floor = 5-10um DIY litho (Zeloof + HackerFab + Hackaday) 24 if i == 1 { return 2 } // Zeloof Z2: 100-tr NMOS 10um polysilicon gate, garage (primary + press) 25 if i == 2 { return 2 } // HackerFab: 952 tr/chip 94% yield, 5um by Mar2026 (site + arxiv) 26 if i == 3 { return 2 } // open tool stack from projector/ham-radio/Arduino parts (site + arxiv stepper) 27 if i == 4 { return 3 } // fully-printed CPUs infeasible -> litho is the path, not FDM (3 reviews) 28 if i == 5 { return 2 } // hybrid FHE: print interconnect, buy/fab silicon (Nano Conv + Adv Mater) 29 if i == 6 { return 1 } // exact sovereign (non-university) replication BOM in $ -- O4 open question 30 return 1 // consumable supply chain (wafers/photoresist/dopants/gases) -- open 31} 32func rc_fact_cataloged(i: i64) -> i64 { 33 if i <= 5 { return 1 } // facts 0-5 are in our verified library 34 return 0 // 6,7 are open questions, not yet in the library 35} 36func rc_fact_name(i: i64) -> *u8 { 37 if i == 0 { return "sovereign silicon floor = 5-10um node via DIY photolithography (NOT FDM)" as *u8 } 38 if i == 1 { return "Zeloof Z2: 100-transistor NMOS, 10um polysilicon gate, built in a garage (2021)" as *u8 } 39 if i == 2 { return "CMU Hacker Fab: 952 transistors/chip, 94% yield, improved to 5um (Mar 2026)" as *u8 } 40 if i == 3 { return "open tool stack: maskless stepper from projector parts, sputter, Arduino ALD; open BOMs" as *u8 } 41 if i == 4 { return "fully-printed CPUs are infeasible -- lithography is the only small-team path" as *u8 } 42 if i == 5 { return "hybrid FHE: print interconnect/passives, buy or self-fab the silicon dies" as *u8 } 43 if i == 6 { return "OPEN: total sovereign (non-university) replication BOM in dollars" as *u8 } 44 return "OPEN: consumable supply chain -- wafers, photoresist, dopants, process gases" as *u8 } 45 46// is fact i admitted by the researcher's discipline? (>=2 sources AND cataloged) 47func rc_fact_admitted(i: i64) -> i64 { 48 return rd_admit_fact(rc_fact_confirming(i), rc_fact_cataloged(i)) 49} 50 51// count admitted facts over the whole corpus 52func rc_admitted_total() -> i64 { 53 var c: i64 = 0 54 var i: i64 = 0 55 while i < RC_NFACTS { if rc_fact_admitted(i) == 1 { c = c + 1 } i = i + 1 } 56 return c 57} 58 59// is the chip-fab spec grounded enough to build from? (researcher's gate over admitted/total) 60func rc_grounded() -> i64 { 61 return rd_spec_grounded(rc_admitted_total(), RC_NFACTS) 62} 63 64// LIVE EXTENSION HOOK (flagged): when egress is up, this is where the researcher fetches a new 65// angle via nx_browse_text + extracts + corroborates into the corpus. Returns 0 (no-op) in the 66// no-egress sandbox; the angle strings are the pursue-list for the NAS-side run. 67func rc_live_angle(angle_id: i64) -> i64 { 68 // angle 0 = docs.hackerfab.org BOM ; 1 = wafer/resist suppliers ; 2 = maskless stepper repo 69 return 0 70} 71 72func rc_w(s: *u8) -> i64 { var n: i64=0; while s[n]!=(0 as u8){n=n+1} sys_write(1,s,n); return 0 } 73// MIGRATED to the shared emitter (debt 1785563586). The old body mmapped a scratch buffer 74// per call and never freed it. At PAGE granularity that is 4096B leaked PER CALL -- the 75// defect that took 28.5GB of a 36GB host in nx_ts_lumadiff (2MB input, ~3.66M calls). 76// nxi_* is MSB-first, allocates NOTHING, and emits identical bytes including the sign. 77func rc_wn(v: i64) -> i64 { nxi_out(v); return 0 } 78 79// emit the researcher's grounded report (the team's chip-fab research deliverable) 80func rc_report() -> i64 { 81 rc_w("=== NISHI RESEARCHER: chip-fab arc (corroborated >= 2 sources + cataloged) ===\n" as *u8) 82 var i: i64 = 0 83 while i < RC_NFACTS { 84 if rc_fact_admitted(i) == 1 { rc_w(" [ADMITTED x" as *u8); rc_wn(rc_fact_confirming(i)); rc_w("] " as *u8) } 85 if rc_fact_admitted(i) == 0 { rc_w(" [open/pursue ] " as *u8) } 86 rc_w(rc_fact_name(i)); rc_w("\n" as *u8) 87 i = i + 1 88 } 89 rc_w(" admitted=" as *u8); rc_wn(rc_admitted_total()); rc_w("/" as *u8); rc_wn(RC_NFACTS) 90 rc_w(" grounded=" as *u8); rc_wn(rc_grounded()); rc_w(" (1=spec-buildable)\n" as *u8) 91 return 0 92}