code wiki / _hdl_build / nx_store_collision_check.nx
nx_store_collision_check.nx
buildroot/runtime/_hdl_build/nx_store_collision_check.nx
about
nx_store_collision_check.nx -- acl lane F745. Scans a TAB-separated store VIEW (export) for
DUPLICATE ids in column <col> = the KEY-COLLISION signature: two independent writers grabbed the
SAME id, so last-writer-wins silently overwrote one (seq71 docs-vs-design-market both id 17; seq40
frontier F-id races; seq96 pmdash elf). Detect-and-refuse, fail-closed. No hardware writes (Rule 26).
nx_store_collision_check dupid <path> <col0based>
exit: 0 CLEAN | 3 COLLISION (>=1 reused id) | 4 ABSENT | 2 usage. stdout carries verdict + first dups.
license_tier: ORIGINAL expect_exit: 0
dependencies 1 imports · 0 importers
imports: nx_syscalls.nx
imported by: nobody (leaf or entry point)
call flow from main pre-order; caps 40 nodes / depth 6 declared; ↻ = already shown
structs
| none |
consts
| 9 | const K_MAGIC_4194304: i64 = 4194304 |
| 10 | const K_MAGIC_1048576: i64 = 1048576 |
| 11 | const K_MAGIC_65536: i64 = 65536 |
functions
| 13 | func sc_w(fd: i64, s: *u8) -> i64 { var n: i64 = 0; while s[n] != (0 as u8) { n = n + 1 } sys_write(fd, s, n); return 0 } |
| 14 | func sc_wn(fd: i64, v: i64) -> i64 { var m: i64 = v; if m < 0 { sc_w(fd, "-" as *u8); m = 0 - m } let t: *u8 = sys_mmap(28); var k: i64 = 0; if m == 0 { t[0] = 48 as u8; k = 1 } while m > 0 { t[k] = (48 + (m % 10)) as u8; m = m / 10; k = k + 1 } let o: *u8 = sys_mmap(28); var i: i64 = 0; while i < k { o[i] = t[k - 1 - i]; i = i + 1 } sys_write(fd, o, k); return 0 } |
| 15 | func sc_read(path: *u8, buf: *u8, cap: i64) -> i64 |
| 24 | func sc_atoi(s: *u8) -> i64 { var v: i64 = 0; var i: i64 = 0; while s[i] != (0 as u8) { let c: i64 = s[i]; if c < 48 { i = i + 1 } else { if c > 57 { i = i + 1 } else { v = v * 10 + (c - 48); i = i + 1 } } } return v } called by 1: main |
| 25 | func sc_eq(ids: *u8, a: i64, b: i64) -> i64 called by 1: main |
| 36 | func main(argc: i64, argv: *i64) -> i64 |