code wiki / _hdl_build / nx_connect_datalight.nx
nx_connect_datalight.nx
buildroot/runtime/_hdl_build/nx_connect_datalight.nx
about
nx_connect_datalight.nx -- CONNECT worldwide LOW-BANDWIDTH reach (the last LDS-census MU cell):
the data-light wire discipline, MEASURED at the architecture level (integer byte accounting inside
the gate; the WhatsApp-MQTT class is the named yardstick -- no live-network H2H is claimed, so the
cell flips PRESENT, never PARITY/EXCEEDS).
BY CONSTRUCTION properties, each with a measured tooth:
- COMPACT ENVELOPE: a text message rides a fixed 34-byte binary header + payload (no per-field
text labels). NEG-CONTROL: the verbose labeled envelope (JSON-class) measures >3x our bytes on
the same payload.
- DELTA SYNC: a client syncs with a since-cursor and receives ONLY newer messages; an up-to-date
client pays ~0 payload bytes. NEG-CONTROL: the chatty full-poll model refetches the whole tail
every poll -- measured O(N x polls) vs our O(new).
- ONE-ROUND-TRIP CATCH-UP: a 100-message backlog drains in a single batched response.
- TEXT-FIRST MEDIA: a media message ships an 8-byte content-address REFERENCE inline (the blob
fetch is lazy + optional; composes nx_connect_media's content addressing).
100% sovereign, deterministic. 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
| 17 | const DL_MAGIC_50000: i64 = 50000 |
| 18 | const DL_MAGIC_2000000: i64 = 2000000 |
| 19 | const DL_MAGIC_1000000: i64 = 1000000 |
| 21 | const DL_HDR: i64 = 34 |
| 22 | const DL_MAXM: i64 = 256 |
functions
| 24 | func sw(s: *u8) -> i64 { var n: i64=0; while s[n]!=(0 as u8){n=n+1} sys_write(1,s,n); return 0 } |
| 25 | func sn(v: i64) -> i64 { let bb: *u8=sys_mmap(28); var m: i64=v; if m<0{m=0-m;sys_write(1,"-" as *u8,1)} 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} var i: i64=0; while i<k{bb[i]=t[k-1-i];i=i+1} sys_write(1,bb,k); return 0 } |
| 26 | func tcheck(pass: i64, label: *u8, fails: *i64) -> i64 |
| 31 | func dl_slen(s: *u8) -> i64 { var n: i64=0; while s[n]!=(0 as u8){n=n+1} return n } called by 1: dl_verbose_bytes |
| 34 | func dl_envelope_bytes(payload_len: i64) -> i64 { return DL_HDR + payload_len } |
| 38 | func dl_verbose_bytes(payload_len: i64) -> i64 |
| 45 | func dl_sync(ids: *i64, lens: *i64, nmsg: i64, cursor: i64, out_bytes: *i64) -> i64 |
| 61 | func dl_fullpoll(ids: *i64, lens: *i64, nmsg: i64, window: i64, out_bytes: *i64) -> i64 |
| 74 | func main() -> i64 |