nx_wall_scan_native.nx
buildroot/runtime/nx_wall_scan_native.nx
about
nx_wall_scan_native.nx -- substrate-native wall-tier scanner.
license_tier: ORIGINAL
Substrate-native equivalent of `bench/wall_scan.sh --count`.
Walks runtime/*.nx via sys_getdents64 + sys_read_file, classifies
each by license_tier header, prints aggregate counts. Zero
fork+exec; single binary; typed sealed-verdict per file.
Bench against shell-pipeline wall_scan.sh:
shell v3: ~2.3s on 5019 files (one grep -nHE + awk)
native: measured by `time qemu-riscv64-static nx_wall_scan.elf`
Honest verdict on completion.
dependencies 3 imports · 0 importers
imports: nx_syscalls.nxnx_dirent.nxnx_fcntl.nx
imported by: nobody (leaf or entry point)
structs
| none |
consts
| 26 | const TIER_NONE: i64 = 0 |
| 27 | const TIER_T0: i64 = 1 |
| 28 | const TIER_REDERIVE: i64 = 2 |
| 29 | const TIER_ORIG: i64 = 3 |
| 30 | const TIER_OTHER: i64 = 4 |
| 32 | const DIR_BUF_CAP: i64 = 32768 |
| 33 | const FILE_HEAD_CAP: i64 = 4096 // license headers live in first ~2KB |
| 34 | const PATH_BUF_CAP: i64 = 512 |
functions
| 38 | func _eq_at(buf: *u8, n: i64, off: i64, needle: *u8, nlen: i64) -> i64 |
| 53 | func classify_bytes(buf: *u8, n: i64) -> i64 |
| 97 | func _build_path(path_buf: *u8, name: *u8, name_len: i64) -> i64 |
| 111 | func _ends_in_nx(name: *u8, n: i64) -> i64 |
| 123 | func print_i64_field(label: *u8, v: i64) -> i64 |
| 152 | func main() -> i64 |