nx_index_migrate_gate.nx
buildroot/runtime/nx_index_migrate_gate.nx
about
nx_index_migrate_gate.nx -- THE MIGRATION-PROOF gate (operator headline: "migratable to bigger + more sophisticated
hardware"). Proves the sovereign inverted index is a PORTABLE BYTE ARTIFACT: build on "hw-A", save, COPY the file to
a different path (= migrate to a different host/disk/hardware), LOAD from the copy, re-query -> BYTE-IDENTICAL. Plus
pin the format endian/word-size (i64 LE MAGIC round-trips) so it ports to different/more-sophisticated ISAs incl.
our own sovereign silicon. WHY it works: vocab slots store OFFSETS not pointers -> load needs ZERO relocation; no
JVM/OS lock-in. Format is byte-compatible with nx_search_inverted_persist (NXINV magic); serializer inlined here to
keep a single clean syscalls lineage (the _hdl_build persist cross-import trips the compiler on this graph -- a known
large-graph double-import limitation, filed). license_tier: ORIGINAL
dependencies 1 imports · 0 importers
imports: nx_search_inverted.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
| 11 | const MIG_MAGIC: i64 = 336659591510 // "NXINV" -- byte-identical to nx_search_inverted_persist |
functions
| 13 | func gw(s: *u8) -> i64 { var n: i64=0; while s[n]!=(0 as u8){n=n+1} sys_write(1,s,n); return 0 } called by 1: main |
| 14 | func gn(v: i64) -> i64 { if v==0 { sys_write(1,"0" as *u8,1); return 0 } var m: i64=v; if m<0 { sys_write(1,"-" as *u8,1); m=0-m } let t: *u8=sys_mmap(28); var k: i64=0; while m>0 { t[k]=48+(m%10); m=m/10; k=k+1 } while k>0 { k=k-1; sys_write(1,(((t as i64)+k) as *u8),1) } return 0 } called by 1: main |
| 15 | func mig_slen(s: *u8) -> i64 { var n: i64=0; while s[n]!=(0 as u8){n=n+1} return n } |
| 16 | func mig_wall(fd: i64, buf: *u8, n: i64) -> i64 { var off: i64=0; while off<n { let w: i64=sys_write(fd, ((buf as i64)+off) as *u8, n-off); if w<=0 { return 0-1 } off=off+w } return off } |
| 19 | func mig_save(idx: *NxInvIndex, path: *u8) -> i64 |
| 29 | func mig_load(path: *u8) -> *NxInvIndex |
| 44 | func mig_copy(src: *u8, dst: *u8) -> i64 |
| 53 | func mig_query(idx: *NxInvIndex, term: *u8, out_ids: *i64) -> i64 |
| 67 | func mig_ids_eq(a: *i64, an: i64, b: *i64, bn: i64) -> i64 { if an!=bn { return 0 } var i: i64=0; while i<an { if a[i]!=b[i] { return 0 } i=i+1 } return 1 } called by 1: main |
| 69 | func main() -> i64 |