code wiki / _hdl_build / nx_sig2_bp_gate.nx
nx_sig2_bp_gate.nx
buildroot/runtime/_hdl_build/nx_sig2_bp_gate.nx
about
nx_sig2_bp_gate.nx -- ADVERSARIAL gate for nx_sig2_txq (the relay backpressure fix).
Reproduces the EXACT field failure shape the old path had: a receiver that stops reading while the
sender floods video-sized frames. OLD behavior: blocking write -> the whole relay stalls (head-of-line),
or a partial write tears a frame and poisons the stream. REQUIRED behavior, proven here on REAL sockets
with a tiny SO_SNDBUF:
T1 NO-STALL : 300 x 8KB sends to a wedged receiver return in bounded wall time; some accepted,
the rest dropped WHOLE (never blocks, never tears).
T2 INTEGRITY : when the receiver resumes, EVERY accepted frame arrives byte-perfect, in order,
exactly once -- the stream parses cleanly end-to-end (no torn frames possible).
T3 FAIL-STOP : sends after the receiver dies report fatal (conn reap), no crash (SIGPIPE ignored).
T4 FAST PATH : with a live reader, frames go direct (queue stays empty) and all arrive intact.
license_tier: ORIGINAL
dependencies 8 imports · 0 importers
imports: nx_syscalls.nxnx_connect.nxnx_signal.nxnx_websocket_frame.nxnx_websocket_stream.nxnx_poll.nxnx_sig2_txq.nxnx_gate_verdict.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
| none |
functions
| 22 | func gw(s: *u8) -> i64 { var n: i64 = 0; while s[n] != (0 as u8) { n = n + 1 } sys_write(1, s, n); return 0 } |
| 23 | func gn(v: i64) -> i64 |
| 29 | func bp_addr(a: *u8, port: i64) -> i64 |
| 40 | func bp_pair(lfd: i64, port: i64, small: i64, out: *i64) -> i64 |
| 61 | func bp_fill(p: *u8, id: i64, n: i64) -> i64 called by 1: main |
| 68 | func bp_check(p: *u8, n: i64) -> i64 { // returns frame id, or -1 on pattern violation called by 1: main |
| 77 | func main() -> i64 |