code wiki / (root) / nx_probe.nx

nx_probe.nx

buildroot/runtime/nx_probe.nx

16256 B397 linesdepth 2pulls 2 transitivereach 21 importersview sourcekind probetopic probe
docsdependenciesstructsconstsfunctions

about

nx_probe.nx -- on-device capability fingerprint with vendor-claim falsification gate. SA-1 milestone of NISHI_SELF_ASSEMBLY_ROADMAP.md. Every capability reported here was VERIFIED on this device via a micro-smoke at probe time -- the substrate never trusts a vendor claim (CPUID, HWCAP, datasheet) without an empirical witness. Per [[feedback-racing-crew-team-honesty-threat-aware]]: the Alder Lake AVX-512 fuse-off and lying-CSP cases publicly broke CPUID-trust; the racing line refuses that hack. Falsification gate: the caller may pass in a "claim" record asserting capabilities X / Y / Z; the probe runs the on-device smoke for each and increments `falsification_count` whenever a claim disagrees with the witnessed result. Smoke wins on conflict. The disagreement triggers downstream `nx_reselect` per SA-8. V1 capability set (SA-1 honest perf verdict): - canary_pre / canary_post (tamper-detect; per [[feedback-racing-crew-team-honesty-threat-aware]] `nx_canary_value`) - schema_version (bump on any field add) - isa_family (compile-time witness; refined at SA-3 manifest sweep) - endianness (write u32 0x12345678 / read byte 0) - pointer_width (compile-time witness; refined at SA-3) - page_size_bytes (mmap return alignment) - mono_clock_works (sys_clock_gettime_mono returns 0) - mono_clock_resolution_ns (two-sample delta minimum) - mmap_works (sys_mmap returns non-NULL) - write_works (sys_write to fd 1 returns count) - falsification_count + first-mismatch witness Gap list (V1): - no AVX-2 / AVX-512 / RVV / NEON / SVE falsification smoke yet (SA-1.5 -- needs cross-target nx_platform facade from [[NISHI_HARDWARE_AGNOSTIC_ROADMAP]] HA-1+) - no cache-geometry probe (queued for SA-2 nx_calibrate) - no NUMA / huge-page probe (SA-2) - no GPU / DSP / NPU presence probe (SA-1.5)

dependencies 2 imports · 16 importers

nx_syscalls.nx nx_tier.nx nx_probe.nx nx_install_attest_signed_test.nx nx_install_attest_test.nx nx_install_hash_test.nx nx_install_pipeline.nx nx_install_pipeline_test.nx nx_install_plan.nx nx_install_plan_test.nx nx_probe_test.nx nx_select.nx nx_select_joint.nx

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

imports: nx_syscalls.nxnx_tier.nx

imported by: nx_install_attest_signed_test.nxnx_install_attest_test.nxnx_install_hash_test.nxnx_install_pipeline.nxnx_install_pipeline_test.nxnx_install_plan.nxnx_install_plan_test.nxnx_probe_test.nxnx_select.nxnx_select_joint.nxnx_select_joint_chain_test.nxnx_select_joint_test.nxnx_select_test.nxnx_spore_up_lifecycle_test.nxnx_spore_up_network_test.nxnx_spore_up_test.nx

structs

122struct NxProbeRecord

consts

73const NX_MAGIC_65535: i64 = 65535
74const NX_MAGIC_65536: i64 = 65536
75const NX_MAGIC_16383: i64 = 16383
76const NX_MAGIC_16384: i64 = 16384
77const NX_MAGIC_4095: i64 = 4095
78const NX_MAGIC_4096: i64 = 4096
79const NX_MAGIC_1000000000: i64 = 1000000000
80const NX_MAGIC_1000000: i64 = 1000000
86const NX_PROBE_CANARY_PRE: i64 = 0x4E5850524F424500 // "NXPROBE\0"
87const NX_PROBE_CANARY_POST: i64 = 0x00454E444E5850 // "\0ENDNXP"
89const NX_PROBE_SCHEMA_VERSION: i64 = 1
92const NX_ISA_UNKNOWN: i64 = 0
93const NX_ISA_RV64: i64 = 1
94const NX_ISA_RV32: i64 = 2
95const NX_ISA_X86_64: i64 = 3
96const NX_ISA_AARCH64: i64 = 4
97const NX_ISA_ARMV7A: i64 = 5
98const NX_ISA_WASM32: i64 = 6
99const NX_ISA_N: i64 = 7
108const NX_ENDIAN_UNKNOWN: i64 = 0
109const NX_ENDIAN_LITTLE: i64 = 1
110const NX_ENDIAN_BIG: i64 = 2
146const NX_PROBE_FIELD_NONE: i64 = 0
147const NX_PROBE_FIELD_ISA_FAMILY: i64 = 1
148const NX_PROBE_FIELD_ENDIANNESS: i64 = 2
149const NX_PROBE_FIELD_POINTER_WIDTH: i64 = 3
150const NX_PROBE_FIELD_N: i64 = 4

functions

101func nx_isa_family_is_valid(v: i64) -> i64
called by 1: main
156func nx_probe_new() -> *NxProbeRecord
184func _probe_endianness() -> i64
called by 1: nx_probe_run calls 1: sys_mmap
231func _probe_pointer_width_bits() -> i64 { return 64 }
called by 1: nx_probe_run
235func _probe_pointer_width_bits() -> i64 { return 64 } // RV64 default target
250func _probe_page_size_bytes() -> i64
called by 1: nx_probe_run calls 1: sys_mmap
273func _probe_mono_clock(out_resolution_ns: *i64) -> i64
295func _probe_write_works() -> i64
called by 1: nx_probe_run calls 2: sys_mmapsys_write
308func _probe_mmap_works() -> i64
called by 1: nx_probe_run calls 1: sys_mmap
323func _probe_compiled_isa() -> i64 { return NX_ISA_X86_64 }
called by 1: nx_probe_run
327func _probe_compiled_isa() -> i64 { return NX_ISA_RV64 }
338func nx_probe_run(out: *NxProbeRecord) -> i64