code wiki / _hdl_build / nx_relay_loadprobe.nx

nx_relay_loadprobe.nx

buildroot/runtime/_hdl_build/nx_relay_loadprobe.nx

8447 B155 linesdepth 2pulls 3 transitivereach 0 importersview sourcekind tool
docsdependenciesstructsconstsfunctions

about

nx_relay_loadprobe.nx -- SOVEREIGN, on-demand performance probe of the relay's UDP media plane (operator 2026-07-06: "performance to state of the art FIRST"). No third-party tooling (no iperf/netem). Two UDP members join a bench room; A blasts paced media frames, B receives the relay fan-out. BOTH ends share THIS process's monotonic clock -> arrival - embedded_send_us = EXACT one-way A->relay->B latency through the real relay code. Target defaults to 127.0.0.1 (measures RELAY SOFTWARE throughput -- is our CODE the bottleneck, independent of network); argv[1]="lan" targets the NAS 192.168.8.227 for a real-hop run (needs LAN reachability -- WSL NAT may block; the WAN leg is task 25). Per rate tier: latency min/avg/p50/p95/max, jitter, loss, throughput. FAILS LOUD if unreachable. license_tier: ORIGINAL

dependencies 2 imports · 0 importers

nx_syscalls.nx nx_dgram_media.nx nx_relay_loadprobe.nx

imports: nx_syscalls.nxnx_dgram_media.nx

imported by: nobody (leaf or entry point)

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

main lw sys_write sys_socket sys_mmap lp_naddr lp_join sys_mmap ↻ dgm_pack_frame dgm_wr_u32 sys_sendto lp_tmo sys_mmap ↻ sys_setsockopt sys_recvfrom dgm_parse_pkt dgm_rd_u32 lp_tier sys_mmap ↻ dgm_rx_init sys_now_us sys_mmap ↻ sys_clock_gettime_mono dgm_pack_frame ↻ sys_sendto ↻ sys_recvfrom ↻ lp_record dgm_rx_add dgm_parse_pkt ↻ dgm_sender_slot dgm_mask_test dgm_mask_shift dgm_mask_set sys_now_us ↻ lp_rd8 sys_sleep_ms sys_mmap ↻ sys_munmap lp_tmo ↻ lw ↻

structs

none

consts

11const LP_MAGIC_8471: i64 = 8471
12const LP_MAGIC_4096: i64 = 4096
13const LP_MAGIC_2048: i64 = 2048
14const LP_MAGIC_65536: i64 = 65536
15const LP_MAGIC_1000000: i64 = 1000000
16const LP_MAGIC_250000: i64 = 250000
18const LP_MEDIA: i64 = 0x4D
19const LP_FRAME: i64 = 1100
20const LP_MAXN: i64 = 2048

functions

22func lw(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 3: lmslp_tiermain calls 1: sys_write
23func ln(v: i64) -> i64
called by 2: lmslp_tier calls 2: sys_mmapsys_write
27func lms(us: i64) -> i64 { ln(us/1000); lw("." as *u8); let f: i64=(us%1000)/100; ln(f); lw("ms" as *u8); return 0 }
called by 1: lp_tier calls 2: lnlw
28func lp_rd8(b: *u8) -> i64 { // NB: nx_cc x86 blanks .s on IMMEDIATE shifts >31 -> use a VARIABLE-shift loop
called by 1: lp_record
32func lp_naddr(a: *u8, lan: i64) -> i64
called by 1: main
39func lp_tmo(fd: i64, sec: i64, usec: i64) -> i64
43func lp_join(fd: i64, naddr: *u8, id: *u8) -> i64
57func lp_record(rxm: *u8, fout: *u8, info: *i64, buf: *u8, r: i64, N: i64, seen: *u8, lat: *i64, st: *i64) -> i64
called by 1: lp_tier calls 3: dgm_rx_addsys_now_uslp_rd8
72func lp_tier(fda: i64, fdb: i64, naddr: *u8, ida: *u8, rate: i64, secs: i64) -> i64
138func main(argc: i64, argv: *i64) -> i64