nx_sendcheck_gate.nx
buildroot/runtime/nx_sendcheck_gate.nx
about
nx_sendcheck_gate.nx -- LN6 (lang.plan): DATA-RACE TYPING AT THE THREAD-POOL BOUNDARY. End-to-end over the
PROMOTED compiler: four fixtures are assembled at runtime in /tmp/<gate>/ (never a file a source census
could mistake for an organ), the compiler is forked on each with stderr captured, and the teeth read the
captured bytes. Each fixture declares its own nx_pool_submit stub (the check is keyed on the callee NAME,
so the real pool and its threads are not needed):
fx_unmarked `struct Job { .. }` handed as `j as i64` under --sendcheck -> MUST be refused, naming Job,
with where (caret), why and fix (the teaching voice)
fx_marked `struct Job send { .. }` the same call under --sendcheck -> MUST compile (the marker works)
fx_int a plain integer ctx under --sendcheck -> MUST compile (declared abstention)
fx_default fx_unmarked WITHOUT the flag -> MUST compile (default unchanged)
The refusal is the LN6 contract; the three controls keep the gate from passing on a compiler that
refuses everything, on one that ignores the marker, or on one that changed the default. Byte-identity
of default builds is nx_cc_equiv_gate's job (10 rows + self-host), deliberately not duplicated here.
nx_sendcheck_gate -- verdict in the exit code (gv_verdict)
license_tier: ORIGINAL layer: lang module: nishi-core.lang.sendcheck_gate
dependencies 2 imports · 0 importers
imports: nx_syscalls.nxnx_gate_verdict.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
| 19 | const SG_DIR: *u8 = "/tmp/nx_sendcheck_gate\x00" as *u8 |
| 20 | const SG_UNMARKED: *u8 = "/tmp/nx_sendcheck_gate/fx_unmarked.nx\x00" as *u8 |
| 21 | const SG_MARKED: *u8 = "/tmp/nx_sendcheck_gate/fx_marked.nx\x00" as *u8 |
| 22 | const SG_INT: *u8 = "/tmp/nx_sendcheck_gate/fx_int.nx\x00" as *u8 |
| 23 | const SG_ERR_U: *u8 = "/tmp/nx_sendcheck_gate/fx_unmarked.err\x00" as *u8 |
| 24 | const SG_ERR_M: *u8 = "/tmp/nx_sendcheck_gate/fx_marked.err\x00" as *u8 |
| 25 | const SG_ERR_I: *u8 = "/tmp/nx_sendcheck_gate/fx_int.err\x00" as *u8 |
| 26 | const SG_ERR_D: *u8 = "/tmp/nx_sendcheck_gate/fx_default.err\x00" as *u8 |
| 27 | const SG_DEVNULL: *u8 = "/dev/null\x00" as *u8 |
| 28 | const SG_FLAG: *u8 = "--sendcheck\x00" as *u8 |
| 29 | const SG_CC_NAS: *u8 = "buildroot/_offc/nx_cc_sovereign.elf\x00" as *u8 // NAS gate CWD = nishihost root |
| 30 | const SG_CC_LAP: *u8 = "_offc/nx_cc_sovereign.elf\x00" as *u8 // laptop CWD = nxc2 root |
| 31 | const SG_CAP: i64 = 65536 |
| 32 | const SG_MODE: i64 = 420 |
functions
| 34 | func sg_slen(s: *u8) -> i64 { var n: i64 = 0; while s[n] != (0 as u8) { n = n + 1 } return n } |
| 35 | func sg_w(s: *u8) -> i64 { sys_write(1, s, sg_slen(s)); return 0 } |
| 36 | func sg_find(b: *u8, n: i64, pat: *u8) -> i64 |
| 48 | func sg_write_file(path: *u8, body: *u8) -> i64 |
| 57 | func sg_compile(cc: *u8, flag: *u8, src: *u8, errpath: *u8) -> i64 |
| 79 | func sg_read(path: *u8, buf: *u8, cap: i64) -> i64 |
| 90 | func sg_pick_cc() -> *u8 |
| 96 | func main() -> i64 |