code wiki / (root) / nx_f6_gate.nx

nx_f6_gate.nx

buildroot/runtime/nx_f6_gate.nx

10512 B290 linesdepth 5pulls 6 transitivereach 0 importersview sourcekind gate/proof
docsdependenciesstructsconstsfunctions

about

f6_gate.nx -- sovereign replacement for bench/f6_gate.sh. Reads the committed golden manifest, invokes nxc2 on each target, SHA-256 hashes the output, compares against the manifest hash. Any mismatch signals one of: (a) intentional change -- rerun with --update (b) non-determinism regression -- fix before shipping (c) toolchain compromise -- Thompson / Vault-7 attack signal Removes the last non-NishiLang language (bash) from the nishi-core build chain. The gate's logic is identical to the bash script's; only the driver changes. Usage: f6_gate -- check against committed manifest f6_gate --update -- overwrite the manifest Environment assumptions (same as f6_gate.sh): - nxc2 executable at ./../nxc2.exe relative to pwd - Manifest at ./f6_manifest.txt - Targets listed in manifest paths (relative to nxc2 dir) Invariants: FG1 Each target compiled under `--target asm --opt` with stdout captured via pipe+dup3. Same invocation as bash gate. Mismatch in options == mismatch against manifest expected. FG2 SHA-256 computed over captured bytes exactly; no trailing whitespace stripped, no normalization. Byte-identical semantics. FG3 Non-zero exit codes from nxc2 (compile errors) cause the target to be skipped (marked "# skip" in manifest) per the bash gate's behaviour. FG4 Output buffer caps: 16 MiB per target's asm. Larger is a configuration issue; we fail loudly rather than truncate.

dependencies 3 imports · 0 importers

nx_syscalls.nx nx_sha256.nx nx_hex_codec.nx nx_f6_gate.nx

imports: nx_syscalls.nxnx_sha256.nxnx_hex_codec.nx

imported by: nobody (leaf or entry point)

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

main sys_mmap sys_read_file sys_openat_rd sys_lseek sys_mmap ↻ sys_read sys_close manifest_path sys_write parse_manifest_line capture_compile sys_mmap ↻ build_argv nxc2_path sys_pipe2 sys_fork sys_dup3 sys_close ↻ sys_execve nxc2_path ↻ sys_exit sys_read ↻ sys_wait4 wait_exit_code sha256_digest sys_mmap ↻ sha256_init sys_mmap ↻ sha256_k sha256_update sha256_compress_ni_blocks blk_set_byte sha256_compress sha256_compress_ni blk_word blk_byte sha256_final blk_set_byte ↻ sha256_compress ↻

structs

none

consts

52const CAPTURE_CAP: i64 = 16777216 // 16 MiB per compilation

functions

54func nxc2_path() -> *u8 { return "../nxc2.exe" }
55func manifest_path() -> *u8 { return "f6_manifest.txt" }
called by 1: main
63func build_argv(argv_slots: *i64, path: *u8) -> i64
called by 1: capture_compile calls 1: nxc2_path
83func capture_compile(path: *u8, out_buf: *u8, out_cap: i64) -> i64
152func parse_manifest_line(buf: *u8, buf_len: i64, pos: i64,
called by 1: main
195func main() -> i64