nx_probe.nx
buildroot/runtime/nx_probe.nx
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
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
| 122 | struct NxProbeRecord |
consts
| 73 | const NX_MAGIC_65535: i64 = 65535 |
| 74 | const NX_MAGIC_65536: i64 = 65536 |
| 75 | const NX_MAGIC_16383: i64 = 16383 |
| 76 | const NX_MAGIC_16384: i64 = 16384 |
| 77 | const NX_MAGIC_4095: i64 = 4095 |
| 78 | const NX_MAGIC_4096: i64 = 4096 |
| 79 | const NX_MAGIC_1000000000: i64 = 1000000000 |
| 80 | const NX_MAGIC_1000000: i64 = 1000000 |
| 86 | const NX_PROBE_CANARY_PRE: i64 = 0x4E5850524F424500 // "NXPROBE\0" |
| 87 | const NX_PROBE_CANARY_POST: i64 = 0x00454E444E5850 // "\0ENDNXP" |
| 89 | const NX_PROBE_SCHEMA_VERSION: i64 = 1 |
| 92 | const NX_ISA_UNKNOWN: i64 = 0 |
| 93 | const NX_ISA_RV64: i64 = 1 |
| 94 | const NX_ISA_RV32: i64 = 2 |
| 95 | const NX_ISA_X86_64: i64 = 3 |
| 96 | const NX_ISA_AARCH64: i64 = 4 |
| 97 | const NX_ISA_ARMV7A: i64 = 5 |
| 98 | const NX_ISA_WASM32: i64 = 6 |
| 99 | const NX_ISA_N: i64 = 7 |
| 108 | const NX_ENDIAN_UNKNOWN: i64 = 0 |
| 109 | const NX_ENDIAN_LITTLE: i64 = 1 |
| 110 | const NX_ENDIAN_BIG: i64 = 2 |
| 146 | const NX_PROBE_FIELD_NONE: i64 = 0 |
| 147 | const NX_PROBE_FIELD_ISA_FAMILY: i64 = 1 |
| 148 | const NX_PROBE_FIELD_ENDIANNESS: i64 = 2 |
| 149 | const NX_PROBE_FIELD_POINTER_WIDTH: i64 = 3 |
| 150 | const NX_PROBE_FIELD_N: i64 = 4 |
functions
| 101 | func nx_isa_family_is_valid(v: i64) -> i64 called by 1: main |
| 156 | func nx_probe_new() -> *NxProbeRecord |
| 184 | func _probe_endianness() -> i64 |
| 231 | func _probe_pointer_width_bits() -> i64 { return 64 } called by 1: nx_probe_run |
| 235 | func _probe_pointer_width_bits() -> i64 { return 64 } // RV64 default target |
| 250 | func _probe_page_size_bytes() -> i64 |
| 273 | func _probe_mono_clock(out_resolution_ns: *i64) -> i64 |
| 295 | func _probe_write_works() -> i64 |
| 308 | func _probe_mmap_works() -> i64 |
| 323 | func _probe_compiled_isa() -> i64 { return NX_ISA_X86_64 } called by 1: nx_probe_run |
| 327 | func _probe_compiled_isa() -> i64 { return NX_ISA_RV64 } |
| 338 | func nx_probe_run(out: *NxProbeRecord) -> i64 |