code wiki / _hdl_build / nx_geo_s2_gate.nx

nx_geo_s2_gate.nx

buildroot/runtime/_hdl_build/nx_geo_s2_gate.nx

3730 B92 linesdepth 3pulls 3 transitivereach 0 importersview sourcekind gate/prooftopic geo
docsdependenciesstructsconstsfunctions

about

nx_geo_s2_gate.nx -- GATE for GEO-005 Hilbert (S2-class) cell index, on an 8x8 grid (k=3, 64 cells). Proves correctness AND the measured locality exceed over geohash's Z-order: bijection : Hilbert xy2d hits all 64 distinct indices [0,63] exactly once roundtrip : d2xy(xy2d(x,y)) == (x,y) for all cells continuity : max Manhattan step between CONSECUTIVE Hilbert indices == 1 (the defining property) exceed : Z-order's max consecutive step == 8 (= grid width N) -- it TEARS; Hilbert (1) wins Evidence -> knowledge/status/geo_s2.log (GEOS2GATE authored=organ ... verdict=GREEN). license_tier: ORIGINAL

dependencies 2 imports · 0 importers

nx_geo_s2.nx nx_syscalls.nx nx_geo_s2_gate.nx

imports: nx_geo_s2.nxnx_syscalls.nx

imported by: nobody (leaf or entry point)

call flow from main pre-order; caps 40 nodes / depth 6 declared; ↻ = already shown

main sys_mmap geo_hilbert_xy2d geo_s2_pow2 geo_zorder_xy2d geo_hilbert_d2xy geo_s2_pow2 ↻ g2_abs g2_emit g2_w sys_write g2_wn sys_mmap ↻ sys_write ↻ sys_openat_append sys_close

structs

none

consts

13const GS2_LOG: *u8 = "knowledge/status/geo_s2.log"

functions

15func g2_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 }
called by 1: g2_emit calls 1: sys_write
16func g2_wn(fd: i64, v: i64) -> i64 { let bb: *u8 = sys_mmap(28); var m: i64=v; if m<0 {m=0-m; sys_write(fd,"-" as *u8,1)}; let t: *u8 = sys_mmap(28); var k: i64=0; if m==0 {t[0]=48;k=1}; while m>0 {t[k]=(48+(m%10)) as u8; m=m/10; k=k+1}; var i: i64=0; while i<k {bb[i]=t[k-1-i]; i=i+1}; sys_write(fd, bb, k); return 0 }
called by 1: g2_emit calls 2: sys_mmapsys_write
17func g2_abs(x: i64) -> i64 { if x < 0 { return 0 - x } return x }
called by 1: main
19func g2_emit(fd: i64, cnt: i64, rt: i64, hmax: i64, zmax: i64, ok: i64) -> i64
called by 1: main calls 2: g2_wg2_wn
28func main() -> i64