code wiki / _hdl_build / nx_write.nx

nx_write.nx

buildroot/runtime/_hdl_build/nx_write.nx

22055 B488 linesdepth 5pulls 12 transitivereach 0 importersview sourcekind tool
docsdependenciesstructsconstsfunctions

about

nx_write.nx -- W-BB-1: THE WRITE LANE'S BACKBONE. The organ that actually WRITES. u2605u2605u2605u2605u2605u2605THE GAP THIS CLOSES, AND IT IS EMBARRASSING IN THE RIGHT WAY. The write lane had a ruler (nx_writebench, 625 permil), a panel-reliability bound, a real-person gate, a greeting-structure grader, a campaign continuity checker and a per-turn dialogue meter -- and NO GENERATOR. `nx_writer_run` is 9 functions that emit scaffolding and contain no inference call whatsoever: no engine, no model, no HTTP. Meanwhile the local engine answers /v1/chat/completions in ~1.4s and has all along; the gen lane has been using it for images and chat for weeks. u21d2 WE HAD BUILT GRADERS FOR A THING THAT COULD NOT PRODUCE. u2605u2605u2605u2605u2605u2605A LANE WITH RULERS AND NO PRODUCER MEASURES NOTHING -- COVERAGE ON AN EMPTY LANE IS A NUMBER ABOUT THE RULER, NOT ABOUT A CAPABILITY. WHAT THIS IS: prompt -> real prose, on the local engine, for every mode in the registry -- the writing equivalent of what nx_gen is for images. u2605THE SEAM IS ENFORCED BY CONSTRUCTION, NOT BY POLICY TEXT. write_modes.tsv declares per mode a REGISTER (sfw|mixed|explicit) and a LANE (tutor|local). An `explicit` mode may only run on the `local` lane -- it never leaves this machine. That is a routing fact checked here before a single byte is sent, so it cannot be forgotten by a caller or argued away by a prompt. u2605ENDPOINT FROM THE SWARM SSOT, never a literal: se_addr("gpu-image") -- the same single source the gen daemon resolves per request, so a DHCP move heals both lanes at once (the 6-hardcoded-sites outage is not repeated here). nx_write <mode> <prompt...> -- generate; prose to stdout nx_write modes -- list the registry license_tier: ORIGINAL expect_exit: 0 module: nishi-core.write.backbone

dependencies 6 imports · 0 importers

nx_syscalls.nx nx_estate_path.nx nx_connect.nx nx_swarm_endpoint_lib.nx nx_store_seed_lib.nx nx_lane_conf.nx nx_write.nx

imports: nx_syscalls.nxnx_estate_path.nxnx_connect.nxnx_swarm_endpoint_lib.nxnx_store_seed_lib.nxnx_lane_conf.nx

imported by: nobody (leaf or entry point)

call flow from main pre-order; caps 40 nodes / depth 6 declared; ↻ = already shown

main ep_anchor sys_openat_rd sys_close sys_chdir sys_mmap ww sys_write w_streq w_list_modes sys_mmap ↻ sts_load ss_open_cached ssc_init sys_mmap ↻ ssc_sig_of ss_cat sys_fstatat ssc_streq ss_open ss_open2 sys_mmap ↻ ss_manifest_dyn ss_cat ↻ ss_loadfile ss_load_aux2 ssl_total_keys ssl_pow2 ssl_build ss_r32 ssl_lookup ss_manifest_free sys_munmap ssc_retire_handle sts_mm sys_mmap ↻ sts_werr sys_write ↻ sys_exit ss_hget

structs

none

consts

35const W_MAGIC_4096: i64 = 4096
40const W_PLANE: *u8 = "knowledge/store/writemode-"
42const W_BUF: i64 = 1048576
43const W_REQ: i64 = 262144
46const W_TMO_SEC: i64 = 300
47const W_MAXTOK: i64 = 1200
48const W_LEN_MIN: i64 = 200
49const W_LEN_MAX: i64 = 8000

functions

51func ww(s: *u8) -> i64 { var n: i64 = 0; while s[n] != (0 as u8) { n = n + 1 } sys_write(1, s, n); return 0 }
52func we(s: *u8) -> i64 { var n: i64 = 0; while s[n] != (0 as u8) { n = n + 1 } sys_write(2, s, n); return 0 }
called by 3: w_list_modesw_migratemain calls 1: sys_write
53func w_len(s: *u8) -> i64 { var n: i64 = 0; while s[n] != (0 as u8) { n = n + 1 } return n }
called by 1: w_extract
54func w_cat(d: *u8, o: i64, s: *u8) -> i64 { var i: i64 = 0; var a: i64 = o; while s[i] != (0 as u8) { d[a] = s[i]; a = a + 1; i = i + 1 } return a }
called by 2: w_system_formain
55func w_catn(d: *u8, o: i64, v: i64) -> i64
called by 2: w_migratemain calls 1: sys_mmap
65func w_jesc(d: *u8, o: i64, s: *u8) -> i64
called by 1: main
77func w_slurp(path: *u8, buf: *u8, cap: i64) -> i64
88func w_streq(a: *u8, b: *u8) -> i64
95func w_field(buf: *u8, s: i64, e: i64, idx: i64, out: *u8, cap: i64) -> i64
called by 1: w_mode_lookup
118func w_atoi(s: *u8, pi: *i64) -> i64
called by 1: main
133func w_mode_lookup(mode: *u8, reg: *u8, lane: *u8, structure: *u8, mtok: *u8, arc: *u8) -> i64
called by 1: main calls 4: sys_mmapsts_loadw_fieldw_streq
164func w_list_modes() -> i64
called by 1: main calls 5: sys_mmapsts_loadwewwsys_write
174func w_migrate() -> i64
called by 1: main calls 7: sys_mmapw_slurpwests_seedwww_catn+1
213func w_system_for(structure: *u8, arc: *u8, out: *u8) -> i64
called by 1: main calls 2: w_catw_streq
238func w_engine_call(a: i64, b: i64, c: i64, d: i64, port: i64, req: *u8, reqlen: i64, resp: *u8, cap: i64) -> i64
261func w_probe(a: i64, b: i64, c: i64, d: i64, port: i64) -> i64
277func w_extract(resp: *u8, n: i64) -> i64
called by 1: main calls 4: w_lensys_mmapsys_writeww
313func w_parse_addr(s: *u8, w: *i64) -> i64
called by 1: main
332func main(argc: i64, argv: *i64) -> i64