code wiki / (root) / nx_commons_store_probe_gate.nx

nx_commons_store_probe_gate.nx source

↩ module page · 47 lines · 1852 B

1// nx_commons_store_probe_gate.nx -- BISECT the hang in nx_commons_ledger_e2e_gate. 2// That gate printed its header and then timed out at 12s, so it blocked inside the store calls and 3// never reached its first post-write print. Guessing which call blocks would be a patch cascade; this 4// prints a marker before and after EACH store call so the blocking one names itself. 5// license_tier: ORIGINAL expect_exit: 0 6import "nx_gate_verdict.nx" 7import "nx_store_seed_lib.nx" 8 9const SP_CAP: i64 = 4096 10 11func main() -> i64 { 12 let ctr: *i64 = gv_ctr() 13 gv_head("nx_commons_store_probe_gate -- which store call blocks?" as *u8) 14 15 let b: *u8 = sts_mm(SP_CAP) 16 b[0] = 49 as u8 17 b[1] = 10 as u8 18 19 gv_puts(" M1 before sts_seed\n" as *u8) 20 let s: i64 = sts_seed("knowledge/store/cmnsP2" as *u8, b, 2) 21 gv_puts(" M2 after sts_seed = " as *u8); gv_num(s); gv_puts("\n" as *u8) 22 23 let row: *u8 = sts_mm(64) 24 row[0] = 50 as u8 25 row[1] = (0 as u8) 26 gv_puts(" M3 before sts_append_row\n" as *u8) 27 let a: i64 = sts_append_row("knowledge/store/cmnsP2" as *u8, row, 1, SP_CAP) 28 gv_puts(" M4 after sts_append_row = " as *u8); gv_num(a); gv_puts("\n" as *u8) 29 30 let back: *u8 = sts_mm(SP_CAP) 31 let flags: *i64 = sts_mm(32) as *i64 32 flags[0] = 0 33 gv_puts(" M5 before sts_load_honest\n" as *u8) 34 let n: i64 = sts_load_honest("knowledge/store/cmnsP2" as *u8, back, SP_CAP, flags) 35 gv_puts(" M6 after sts_load_honest = " as *u8); gv_num(n); gv_puts("\n" as *u8) 36 37 var t1: i64 = 0 38 if s > 0 { t1 = 1 } 39 gv_check("T1 sts_seed returned a positive count" as *u8, t1, ctr) 40 var t2: i64 = 0 41 if n > 0 { t2 = 1 } 42 gv_check("T2 sts_load_honest returned bytes" as *u8, t2, ctr) 43 44 let rc: i64 = gv_verdict("STORE-PROBE" as *u8, ctr, "store round trip reachable" as *u8) 45 sys_exit(rc) 46 return rc 47}