code wiki / _hdl_build / nx_geo_clip_gate.nx

nx_geo_clip_gate.nx

buildroot/runtime/_hdl_build/nx_geo_clip_gate.nx

3278 B77 linesdepth 3pulls 4 transitivereach 0 importersview sourcekind gate/prooftopic geo
docsdependenciesstructsconstsfunctions

about

nx_geo_clip_gate.nx -- GATE for GEO-015 polygon intersection (Sutherland-Hodgman). Subject = the 4e6-microdeg square [0,4e6]^2. Three clips prove the three code paths, correctness checked by REUSING GEO-010 geo_area2 on the clipped result (no hard-coded vertex order): overlap : clip by [2e6,6e6]^2 -> overlap square [2e6,4e6]^2, doubled area = 8e12 (4 verts) disjoint : clip by [10e6,12e6]^2 -> no overlap -> 0 verts contains : clip by [-10e6,10e6]^2 -> subject unchanged, doubled area = 3.2e13 Evidence -> knowledge/status/geo_clip.log (GEOCLIPGATE authored=organ ... verdict=GREEN). license_tier: ORIGINAL

dependencies 3 imports · 0 importers

nx_geo_clip.nx nx_geo_area.nx nx_syscalls.nx nx_geo_clip_gate.nx

imports: nx_geo_clip.nxnx_geo_area.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 gc_square gc_set geo_poly_clip sys_mmap ↻ geo_clip_inside geo_intersect_into geo_cabs geo_area2 geo_signed_area2 gc_emit gc_w sys_write gc_wn sys_mmap ↻ sys_write ↻ sys_openat_append sys_close

structs

none

consts

14const GC_LOG: *u8 = "knowledge/status/geo_clip.log"

functions

16func gc_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: gc_emit calls 1: sys_write
17func gc_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: gc_emit calls 2: sys_mmapsys_write
19func gc_set(p: *i64, i: i64, lat: i64, lon: i64) -> i64 { p[i * 2] = lat; p[i * 2 + 1] = lon; return 0 }
called by 1: gc_square
22func gc_square(p: *i64, lo: i64, hi: i64) -> i64
called by 1: main calls 1: gc_set
30func gc_emit(fd: i64, no: i64, ao: i64, nd: i64, ncn: i64, ac: i64, ok: i64) -> i64
called by 1: main calls 2: gc_wgc_wn
40func main() -> i64