code wiki / (root) / nx_engine_dispatch_gate.nx

nx_engine_dispatch_gate.nx

buildroot/runtime/nx_engine_dispatch_gate.nx

27691 B377 linesdepth 5pulls 7 transitivereach 0 importersview sourcekind gate/prooftopic engine
docsdependenciesstructsconstsfunctions

about

nx_engine_dispatch_gate.nx -- the REFEREE for nx_engine_dispatch (ES3 + ES16 of /compare/engineshift, 2026-09-02). Drives the DEPLOYED dispatcher over fixture tasks and a FIXTURE SEAT the gate serves from its own forked process (one canned /gen reply per fork, pure NishiLang, no model load), and asserts the ladder: the declared judge decides, a C task never reaches the external tier, an unclassed task is REFUSED by name (never defaulted), an unreachable ladder is UNOBSERVABLE never GREEN, nothing below the seat passing is NEEDS-FRONTIER, --dry forks nothing and writes nothing, a failed scoreboard push never changes a verdict, and ES16: a class row resolves clearance, engine order and the token ceiling from data, a C row that lists external is refused at load, a missing row is refused by name, and a class that admits nothing below the seat hands off without touching any engine. Every ledger row is counted against its denominator. nx_engine_dispatch_gate [subject-elf] default _build/nx_engine_dispatch.sov.elf (cwd nxc2) Fixture seats bind 127.0.0.1 on four distinct ports; a busy port is a named PRECONDITION, never a RED. license_tier: ORIGINAL. Writes only under /tmp/nx_engine_dispatch_gate/. No hw writes.

dependencies 4 imports · 0 importers

nx_syscalls.nx nx_gate_verdict.nx nx_gatekit_lib.nx nx_tool_run.nx nx_engine_dispatch_gate.nx

imports: nx_syscalls.nxnx_gate_verdict.nxnx_gatekit_lib.nxnx_tool_run.nx

imported by: nobody (leaf or entry point)

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

main gv_head gv_puts sys_write gv_ctr sys_mmap nxa_die sys_write ↻ sys_exit nxa_lock_take nxa_lock_addr sys_write ↻ nxa_lock_give nxa_lock_addr ↻ nxa_report_overrun sys_write ↻ nxa_dump_printable sys_write ↻ nxa_dump_sizes sys_write ↻ gv_need gv_puts ↻ gk_exists sys_openat_rd sys_close gk_mkdir sys_mkdir gk_rm sys_unlinkat gk_write sys_openat_wr gk_len gk_write_all sys_write ↻ sys_close ↻ sys_mmap ↻ mg_run sys_mmap ↻ gk_len ↻ tr_run_capture_to

structs

none

consts

18const MG_OUT: i64 = 65536
19const MG_I64: i64 = 8
20const MG_ARGV: i64 = 16
21const MG_TIMEOUT_MS: i64 = 30000
22const MG_REQ_CAP: i64 = 65536
23const MG_BODY_CAP: i64 = 4096
24const MG_READY_TRIES: i64 = 100 // readiness and reap are bounded: 100 x 20 ms = 2 s, then the fixture is declared absent
25const MG_READY_STEP_MS: i64 = 20
26const MG_PORT_A: i64 = 18632 // canned "The answer is 42"
27const MG_PORT_B: i64 = 18633 // canned "no idea"
28const MG_PORT_C: i64 = 18634 // canned "The answer is 42" for the tclass tooth (own port so a lingering child cannot alias)
29const MG_PORT_D: i64 = 18635 // canned "no idea" for the SKIPPED-by-flag tooth
30const MG_SO_REUSEADDR_CALL: i64 = 208 // RV64 setsockopt const form (raw 54 collides in the translator) -- as the seat itself
31const MG_LEDGER_ROWS: i64 = 16 // t42 1 + tkat 3 + t42-noext 2 + unreachable 1 + push-failed 1 + tcls 1 + tfront 3 + tnoloc 2 + mute 2
32const MG_ROOT: *u8 = "/tmp/nx_engine_dispatch_gate"
33const MG_STATE: *u8 = "/tmp/nx_engine_dispatch_gate/state"
34const MG_LEDGER: *u8 = "/tmp/nx_engine_dispatch_gate/state/engine_dispatch.jrnl"
35const MG_PROMPT: *u8 = "/tmp/nx_engine_dispatch_gate/prompt.txt"
36const MG_EXPECTED: *u8 = "/tmp/nx_engine_dispatch_gate/expected.txt"
37const MG_CAND_GOOD: *u8 = "/tmp/nx_engine_dispatch_gate/cand_good.txt"
38const MG_CAND_BAD: *u8 = "/tmp/nx_engine_dispatch_gate/cand_bad.txt"
39const MG_T42: *u8 = "/tmp/nx_engine_dispatch_gate/t42.conf"
40const MG_TKAT: *u8 = "/tmp/nx_engine_dispatch_gate/tkat.conf"
41const MG_TMISS: *u8 = "/tmp/nx_engine_dispatch_gate/tmiss.conf"
42const MG_TBAD: *u8 = "/tmp/nx_engine_dispatch_gate/tbad.conf"
43const MG_TNOCLASS: *u8 = "/tmp/nx_engine_dispatch_gate/tnoclass.conf"
44const MG_CLASSES: *u8 = "/tmp/nx_engine_dispatch_gate/classes.conf"
45const MG_TCLS: *u8 = "/tmp/nx_engine_dispatch_gate/tcls.conf"
46const MG_TFRONT: *u8 = "/tmp/nx_engine_dispatch_gate/tfront.conf"
47const MG_TNOLOC: *u8 = "/tmp/nx_engine_dispatch_gate/tnoloc.conf"
48const MG_TBADCLS: *u8 = "/tmp/nx_engine_dispatch_gate/tbadcls.conf"
49const MG_TMISSING: *u8 = "/tmp/nx_engine_dispatch_gate/tmissing.conf"
174const MG_PORT_E: i64 = 18636 // mute: accepts and closes without a body (the NO-REPLY tooth)

functions

51func mg_run(elf: *u8, a1: *u8, a2: *u8, a3: *u8, a4: *u8, a5: *u8, a6: *u8, a7: *u8, a8: *u8, a9: *u8, a10: *u8, a11: *u8, out: *u8, outlen: *i64) -> i64
68func mg_serve_once(port: i64, canned: *u8) -> i64
142func mg_port_ready(port: i64) -> i64
159func mg_fork_seat(port: i64, canned: *u8) -> i64
175func mg_serve_mute(port: i64) -> i64
204func mg_fork_mute(port: i64) -> i64
218func mg_reap(pid: i64) -> i64
233func main(argc: i64, argv: *i64) -> i64