code wiki / _hdl_build / nx_gatekit_lib.nx

nx_gatekit_lib.nx

buildroot/runtime/_hdl_build/nx_gatekit_lib.nx

38559 B855 linesdepth 2pulls 2 transitivereach 132 importersview sourcekind library
docsdependenciesstructsconstsfunctions

about

nx_gatekit_lib.nx -- build fixtures and DRIVE OTHER ORGANS, entirely through syscalls. WHY THIS UNBLOCKS THE LAST SOVEREIGNTY DEBT ------------------------------------------- Every end-to-end gate for the memory plane was a `sh` script run by WSL from PowerShell: Linux shell + Windows host + third-party runtime on the program path, in an estate whose doctrine is bits-up sovereignty and whose own gates are ELF organs. The blocker was real, not laziness: an in-process gate can test a LIB, but an END-TO-END gate must RUN the organ -- create fixtures, invoke the binary with arguments, inspect exit code and resulting files -- and nothing in the plane could spawn a process. Shell was the only tool that could. nx_syscalls has had fork/execve/wait4 the whole time; the gates simply never used them. ★ THE REASON A THIRD-PARTY RUNTIME PERSISTS IS USUALLY ONE MISSING PRIMITIVE, NOT A REAL DEPENDENCY. The shell dependency also CORRUPTED WORK repeatedly in one session, which is the argument made concrete rather than aesthetic: * a generated .sh written with CRLF made `2>&1` a syntax error in dash; * a PowerShell single-quoted Replace put a LITERAL backtick-n into an organ's source, producing "UNRESOLVED identifier 'n'" -- source and deployed binary silently diverged; * a fixture built with `cp` from another test's OUTPUT measured that test instead of its own. None of those failure modes exist when the fixture is written and the child is spawned by syscall. Sovereign: imports only nx_syscalls. license_tier: ORIGINAL

dependencies 1 imports · 122 importers

nx_syscalls.nx nx_gatekit_lib.nx nx_absa_bench_gate.nx nx_absa_seq_gate.nx nx_actlog_writer_gate.nx nx_aesthetic_canon_gate.nx nx_artifactdrift_gate.nx nx_asset_prov_gate.nx nx_atomic_publish_gate.nx nx_barfresh_gate.nx nx_bck_elide_gate.nx nx_bindings_delivery_gate.nx

diagram shows first 10 each side; +0 more imports, +112 more importers in the complete lists below.

imports: nx_syscalls.nx

imported by: nx_absa_bench_gate.nxnx_absa_seq_gate.nxnx_actlog_writer_gate.nxnx_aesthetic_canon_gate.nxnx_artifactdrift_gate.nxnx_asset_prov_gate.nxnx_atomic_publish_gate.nxnx_barfresh_gate.nxnx_bck_elide_gate.nxnx_bindings_delivery_gate.nxnx_bld_cache_cas_gate.nxnx_board_contract_gate.nxnx_board_idref_gate.nxnx_bodydensity_gate.nxnx_boundedprobe.nxnx_buildmode_gate.nxnx_buildq_gate.nxnx_bundle_ingest_gate.nxnx_bundle_ingest_selected_gate_t144.nxnx_capcensus_gate.nxnx_chargen_param_gate.nxnx_clip_depth_capture_gate.nxnx_clock_reregister_gate.nxnx_closure_gate.nxnx_compare_cite_gate.nxnx_compare_growth_capture_20260910.nxnx_compare_growth_capture_canon_20260910.nxnx_compare_growth_capture_final_20260910.nxnx_compare_growth_final_gate_20260910.nxnx_compare_growth_gate_20260910.nxnx_compare_growth_integration_gate_20260910.nxnx_compare_growth_stable_gate_20260910.nxnx_compare_shared_fit_adopt_capture_20260910.nxnx_compare_shared_fit_capture_20260910.nxnx_compare_shared_fit_final_capture_20260910.nxnx_compare_shared_fit_state_capture_20260910.nxnx_corpus_probe.nxnx_corpus_scan_gate.nxnx_curviness_gate.nxnx_dbg_step_gate.nxnx_deploy_ready_scope_gate.nxnx_depparse_gate.nxnx_dyna_bind_skin_gate.nxnx_eline_gate.nxnx_embfeat_gate.nxnx_emitmap.nxnx_engine_dispatch_gate.nxnx_envelope_audit_gate.nxnx_estate_census_run.nxnx_face_feature_diag_t367.nxnx_face_feature_diag_t368.nxnx_face_feature_gate_t367r4.nxnx_face_feature_gate_t367r5.nxnx_fbx2nxa_gate.nxnx_fence.nxnx_fence_gate.nxnx_firstbyte.nxnx_firstbyte_gate.nxnx_fissure_gate.nxnx_gaps_pass_gate.nxnx_gate_roster_gate.nxnx_gate_roster_run.nxnx_gateadjudicate.nxnx_gatekit_runner_gate.nxnx_gatesubj.nxnx_gdbstub_gate.nxnx_gfx_gates_beat.nxnx_gk_fixture_gate.nxnx_gpt_relocate_gate.nxnx_heavyio_gate.nxnx_inc_compile_gate.nxnx_incumbent_gate.nxnx_jpegmem_gate.nxnx_learnmine_gate.nxnx_lipratio_gate.nxnx_measurement_binding_artifact_gate.nxnx_measurement_binding_capture_gate.nxnx_measurement_binding_gate.nxnx_meshgap_gate.nxnx_meshrig_gate.nxnx_mod_manifest_gate.nxnx_models_page_emit.nxnx_models_page_emit_gate.nxnx_motion_smoke.nxnx_nofloat_q4k_gate.nxnx_nxa_morf_gate.nxnx_nxa_morf_malformed_gate.nxnx_nxa_play_gate.nxnx_nxa_retarget_gate.nxnx_nxa_skin_gate.nxnx_organ_ship_gate.nxnx_postag_gate.nxnx_prop_pass_gate.nxnx_pushback_publish_gate.nxnx_refusal_shape_lib.nxnx_retire_onto_lib.nxnx_seat_meter_beat_gate.nxnx_sevenz_gate.nxnx_sota_bindings_differential_gate.nxnx_sota_source_hash_gate.nx +22 more (shown cap 100 declared)

structs

none

consts

25const GK_MAGIC_65536: i64 = 65536
26const GK_MAGIC_4294967295: i64 = 4294967295
27const GK_MAGIC_4096: i64 = 4096
29const GK_BUF: i64 = 1048576
51const GK_SRC_ROOTS: i64 = 4
128const GK_ROOT_LAPTOP: *u8 = "/mnt/c/Users/elder/nishi-core/nxc2/runtime/"
129const GK_ROOT_NAS: *u8 = "/volume1/homes/elderwesto/nishihost/buildroot/runtime/"
164const GK_OPS_LAPTOP: *u8 = "/mnt/c/Users/elder/nishi-ops/"
165const GK_OPS_NAS: *u8 = "/volume1/homes/elderwesto/nishihost/buildroot/nishi-ops/"

functions

52func gk_src_root(i: i64) -> *u8
called by 1: gk_srcpath
58func gk_srcpath(target: *u8, out: *u8) -> i64
called by 1: main calls 3: gk_catgk_src_rootgk_exists
78func gk_len(s: *u8) -> i64 { var n: i64 = 0; while s[n] != (0 as u8) { n = n + 1 } return n }
86func gk_eol(b: *u8, from: i64, n: i64) -> i64
143func gk_corpus_root(out: *u8) -> i64
167func gk_ops_dir(out: *u8) -> i64
179func gk_ops_path(out: *u8, name: *u8) -> i64
called by 3: mainmainmain calls 3: gk_ops_dirgk_lengk_cat
188func gk_corpus_hdl(out: *u8) -> i64
196func gk_isnx(name: *u8) -> i64
called by 2: maingk_dircount calls 1: gk_len
214func gk_ext_is(name: *u8, ext: *u8) -> i64
called by 2: maingk_dirscan_ext calls 1: gk_len
230func gk_dirscan_ext(dir: *u8, shadowdir: *u8, names: *u8, stride: i64, cap: i64, n0: i64, ext: *u8) -> i64
285func gk_dirscan(dir: *u8, shadowdir: *u8, names: *u8, stride: i64, cap: i64, n0: i64) -> i64
301func gk_dircount(dir: *u8, shadowdir: *u8, maxlen: *i64) -> i64
338func gk_corpus_count(maxlen: *i64) -> i64
354func gk_corpus_scan(names: *u8, stride: i64, cap: i64) -> i64
365func gk_streq(a: *u8, b: *u8) -> i64
377func gk_has(hay: *u8, ned: *u8) -> i64
called by 20: bd_manifestmainmainmainmainmain+14 calls 1: gk_len
395func gk_cat(buf: *u8, off: i64, s: *u8) -> i64
402func gk_catn(buf: *u8, off: i64, v: i64) -> i64
415func gk_write_all(fd: i64, buf: *u8, n: i64) -> i64
427func gk_say(buf: *u8, n: i64) -> i64 { return gk_write_all(1, buf, n) }
called by 18: mainmainmainecr_rowmainmain+12 calls 1: gk_write_all
429func gk_join(dst: *u8, dir: *u8, name: *u8) -> i64
442func gk_mkdir(path: *u8) -> i64 { return sys_mkdir(path, 493) } // 0755
called by 42: mainmainmainmainmainmain+36 calls 1: sys_mkdir
465func gk_fixture_dir(gate: *u8, out: *u8) -> i64
475func gk_write(path: *u8, text: *u8) -> i64
489func gk_read(path: *u8, buf: *u8, cap: i64) -> i64
505func gk_size(path: *u8) -> i64
513func gk_exists(path: *u8) -> i64
520func gk_rm(path: *u8) -> i64 { return sys_unlinkat(path) }
528func gk_contains(path: *u8, needle: *u8) -> i64
548func gk_count(path: *u8, needle: *u8) -> i64
called by 3: mainmainmain calls 3: sys_mmapgk_readgk_len
579func gk_wait_code(status: i64) -> i64
588func gk_run(elf: *u8, a1: *u8, a2: *u8, a3: *u8, a4: *u8) -> i64
629func gk_run_capture_in(elf: *u8, a1: *u8, a2: *u8, a3: *u8, a4: *u8, infile: *u8, outbuf: *u8, cap: i64, outlen: *i64) -> i64
called by 2: tgg_runtgg_run2 calls 1: gk_run_cap2
633func gk_run_capture(elf: *u8, a1: *u8, a2: *u8, a3: *u8, a4: *u8, outbuf: *u8, cap: i64, outlen: *i64) -> i64
called by 37: mainmainbd_runmainmainmain+31 calls 1: gk_run_cap2
641func gk_run_capture_ms(elf: *u8, a1: *u8, a2: *u8, a3: *u8, a4: *u8, ms: i64, outbuf: *u8, cap: i64, outlen: *i64) -> i64
647func gk_run_cap2(elf: *u8, a1: *u8, a2: *u8, a3: *u8, a4: *u8, infile: *u8, outbuf: *u8, cap: i64, outlen: *i64) -> i64
651func gk_run_cap3(elf: *u8, a1: *u8, a2: *u8, a3: *u8, a4: *u8, infile: *u8, ms: i64, outbuf: *u8, cap: i64, outlen: *i64) -> i64
760func gk_out_has(buf: *u8, n: i64, needle: *u8) -> i64
778func gk_out_pos(buf: *u8, n: i64, needle: *u8) -> i64
798func gk_ok(r: *i64, cond: i64, label: *u8) -> i64
814func gk_eq(r: *i64, got: i64, want: i64, label: *u8) -> i64
837func gk_head(label: *u8) -> i64
845func gk_result(r: *i64) -> i64