code wiki / (root) / nx_shard_query_gate.nx

nx_shard_query_gate.nx

buildroot/runtime/nx_shard_query_gate.nx

4138 B62 linesdepth 3pulls 4 transitivereach 0 importersview sourcekind gate/prooftopic shard
docsdependenciesstructsconstsfunctions

about

nx_shard_query_gate.nx -- proves sharded scatter-gather top-k == single whole-corpus top-k (EXACT), incl. when the winners span DIFFERENT shards. license_tier: ORIGINAL

dependencies 2 imports · 0 importers

nx_shard_query.nx nx_gate.nx nx_shard_query_gate.nx

imports: nx_shard_query.nxnx_gate.nx

imported by: nobody (leaf or entry point)

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

main gw sys_write sq_topk sys_mmap sq_insert sq_scatter_gather sys_mmap ↻ sq_topk ↻ sq_eq gn sys_write ↻ sys_mmap ↻ sq_asc sys_openat_append gwf

structs

none

consts

none

functions

6func gwf(fd: i64, s: *u8) -> i64 { var n: i64=0; while s[n]!=(0 as u8){n=n+1} if fd>=0 { sys_write(fd,s,n) } return 0 }
called by 1: main
7func sq_asc(a: *i64, n: i64) -> i64 { var i: i64=0; while i<n { var j: i64=0; while j<n-1 { if a[j]>a[j+1] { let t: i64=a[j]; a[j]=a[j+1]; a[j+1]=t } j=j+1 } i=i+1 } return 0 }
called by 1: main
8func sq_eq(a: *i64, b: *i64, n: i64) -> i64 { var i: i64=0; while i<n { if a[i]!=b[i] { return 0 } i=i+1 } return 1 }
called by 1: main
10func main() -> i64