nx_netprobe_ladder.nx source
↩ module page · 71 lines · 3874 B
1// nx_netprobe_ladder.nx -- THE DISCRIMINATING EXPERIMENT for the shared TCP liveness probe.
2//
3// THE SITUATION, measured 2026-09-05: nx_gen's dispatch selector and nx_swarm_heal BOTH report the
4// laptop image worker DOWN, while nx_worker_dispatch gets HTTP 200 from GET /v1/models at the SAME
5// address. That looks like two witnesses against one -- it is not. nx_netprobe_lib's own header states
6// both callers were consolidated onto np_probe_up, so the two DOWN verdicts are ONE WITNESS COUNTED
7// TWICE, and they share whatever blind spot it has.
8//
9// WHAT THIS VARIES AND WHAT IT HOLDS FIXED: the address is FIXED, only timeout_ms varies. A flip from
10// DOWN to UP as the bound grows names the timeout as the cause; NO flip refutes the timeout hypothesis
11// and points at the probe's mechanism instead. Running the experiment that can REFUTE the theory,
12// before any fix is written, is the whole point -- a plausible cause confirmed by nothing is how this
13// estate has burned entire sessions.
14//
15// The .193 line is a CONTROL, not a target: nx_swarm_heal calls that endpoint FRESH, so if the ladder
16// reports it DOWN at every bound then the probe is broken for every host and the subject is exonerated.
17// license_tier: ORIGINAL No hw writes (Rule 26).
18import "nx_syscalls.nx"
19import "nx_netprobe_lib.nx"
20
21const NL_PORT: i64 = 7861
22
23func nl_slen(s: *u8) -> i64 { var n: i64 = 0; while s[n] != (0 as u8) { n = n + 1 } return n }
24func nl_puts(s: *u8) -> i64 { sys_write(1, s, nl_slen(s)); return 0 }
25func nl_putn(v: i64) -> i64 {
26 let b: *u8 = sys_mmap(32)
27 var m: i64 = v
28 var k: i64 = 0
29 if m == 0 { b[0] = 48 as u8; sys_write(1, b, 1); return 0 }
30 let t: *u8 = sys_mmap(32)
31 while m > 0 { t[k] = (48 + (m % 10)) as u8; m = m / 10; k = k + 1 }
32 var w: i64 = 0
33 while k > 0 { k = k - 1; b[w] = t[k]; w = w + 1 }
34 sys_write(1, b, w)
35 return 0
36}
37
38func nl_rung(ha: i64, hb: i64, hc: i64, hd: i64, port: i64, tmo: i64) -> i64 {
39 let up: i64 = np_probe_up_to(ha, hb, hc, hd, port, tmo)
40 nl_puts(" addr=" as *u8); nl_putn(ha); nl_puts("." as *u8); nl_putn(hb)
41 nl_puts("." as *u8); nl_putn(hc); nl_puts("." as *u8); nl_putn(hd)
42 nl_puts(":" as *u8); nl_putn(port)
43 nl_puts(" timeout_ms=" as *u8); nl_putn(tmo)
44 if up == 1 { nl_puts(" verdict=UP\n" as *u8) } else { nl_puts(" verdict=DOWN\n" as *u8) }
45 return up
46}
47
48func main(argc: i64, argv: *i64) -> i64 {
49 nl_puts("NX-NETPROBE-LADDER -- address held FIXED, only timeout_ms varies\n" as *u8)
50 nl_puts("SUBJECT 192.168.8.192 (gpu-image, reported DOWN by np_probe_up, HTTP 200 by nx_worker_dispatch)\n" as *u8)
51 let s1: i64 = nl_rung(192, 168, 8, 192, NL_PORT, 500)
52 let s2: i64 = nl_rung(192, 168, 8, 192, NL_PORT, 2000)
53 let s3: i64 = nl_rung(192, 168, 8, 192, NL_PORT, 5000)
54 let s4: i64 = nl_rung(192, 168, 8, 192, NL_PORT, 15000)
55 nl_puts("CONTROL 192.168.8.193 (gpu-found-1, reported FRESH by the same probe -- if this is DOWN at every\n" as *u8)
56 nl_puts(" bound the probe is broken for EVERY host and the subject is exonerated)\n" as *u8)
57 let c1: i64 = nl_rung(192, 168, 8, 193, NL_PORT, 2000)
58 let c2: i64 = nl_rung(192, 168, 8, 193, NL_PORT, 15000)
59 nl_puts("NEG-CONTROL 192.168.8.253 (an address expected to have nothing -- if this reads UP the probe\n" as *u8)
60 nl_puts(" says yes to everything and NO verdict above means anything)\n" as *u8)
61 let n1: i64 = nl_rung(192, 168, 8, 253, NL_PORT, 2000)
62 nl_puts("SUMMARY subject_500=" as *u8); nl_putn(s1)
63 nl_puts(" subject_2000=" as *u8); nl_putn(s2)
64 nl_puts(" subject_5000=" as *u8); nl_putn(s3)
65 nl_puts(" subject_15000=" as *u8); nl_putn(s4)
66 nl_puts(" control_2000=" as *u8); nl_putn(c1)
67 nl_puts(" control_15000=" as *u8); nl_putn(c2)
68 nl_puts(" negcontrol_2000=" as *u8); nl_putn(n1)
69 nl_puts("\n" as *u8)
70 return 0
71}