code wiki / _hdl_build / _h2_multistream_interop_gate.nx

_h2_multistream_interop_gate.nx

buildroot/runtime/_hdl_build/_h2_multistream_interop_gate.nx

13072 B275 linesdepth 15pulls 85 transitivereach 0 importersview sourcekind gate/prooftopic h2
docsdependenciesstructsconstsfunctions

about

_h2_multistream_interop_gate.nx -- TUTOR-BOOTSTRAP SCAFFOLD (Claude, B1 rung(6) R4-H2-009), NOT credited as team self-authoring (EoE back-fill owed). THE SOVEREIGN EXTERNAL-INTEROP GATE ORGAN for persistent multi-stream h2. This REPLACES the ad-hoc inline curl orchestration I ran by hand at rung(6) (and the kind of committed .sh harness BL-025 forbids) with a SINGLE self-contained sovereign organ: it stands up OUR persistent multi-stream ALPN-h2 server AND drives an EXTERNAL curl --http2 against it AND emits a machine-checkable verdict -- all in one process tree, no shell, no committed script. Run it and it tells you GREEN/RED; nothing to orchestrate by hand. TOPOLOGY (design B -- self-contained, chosen because the runtime has no sys_unlink/sys_nanosleep so composing the prebuilt daemon ELF would race on a STALE cert.pem; here the PARENT mints a FRESH cert each run and binds BEFORE forking, so there is no stale-key risk and no readiness race): parent: mint fresh Ed25519 SAN=localhost leaf (shared nx_h2_test_leaf) + export PEM /tmp/nx_h2_gate_cert.pem + bind 127.0.0.1:9445 + listen. pipe2 -> fork: child : dup3 pipe-write over stdout, execve /usr/bin/curl --http2 with 4 same-origin URLs (the multiplex/reuse test) + -w num_connects. parent: accept ONE connection -> h2_serve_connection_multi (cap=16) -> served count; drain curl's captured stdout; wait4 curl -> exit. VERDICT GREEN iff: served == 4 (4 streams answered on the ONE accepted conn) AND curl_exit == 0 (every transfer succeeded) AND http200_count == 4 AND newconn_count == 1 (curl opened exactly ONE TCP connection for all 4 transfers = real reuse/multiplex, the discriminating measurement). curl is the LAST-MILE interop ORACLE (nghttp2/OpenSSL) -- unfakeable; OUR side is 100% sovereign. HONEST scope: ONE connection / 4 sequential-or-multiplexed streams (curl decides reuse vs multiplex; both prove persistence). This organ is the REPRODUCIBLE gate; the rung(6) capability itself is R4-H2-008 (already DONE). COMPOSES (each imported once): nx_h2_serve_multi (the persistent driver + transitive framing/tls transport stones), nx_h2_test_leaf (shared cert/PEM), nx_x25519_ephemeral + nx_csprng (per-connection handshake entropy), nx_syscalls (sockets/fork/execve/pipe/wait4/dup3). license_tier: INDEPENDENT_REDERIVE genealogy_id: international-research-sources/ietf/rfc_9113 + rfc_7301 + rfc_8446 lineage_id: nishi_h2_multistream_interop_gate_b1r6

dependencies 5 imports · 0 importers

nx_syscalls.nx nx_h2_serve_multi.nx nx_h2_test_leaf.nx nx_x25519_ephemeral.nx nx_csprng.nx _h2_multistream_interop_gate.n

imports: nx_syscalls.nxnx_h2_serve_multi.nxnx_h2_test_leaf.nxnx_x25519_ephemeral.nxnx_csprng.nx

imported by: nobody (leaf or entry point)

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

main sys_write sys_mmap h2tl_make_cert nx_csprng_fill sys_mmap ↻ nx_csprng_urandom_path sys_openat_rd sys_read sys_close sys_mmap ↻ ed25519_pub_from_priv sys_mmap ↻ ed25519_sha512 sys_mmap ↻ sha512_init sha512_update sha512_blk_set_byte blk_get_i64 blk_set_i64 sha512_compress sys_mmap ↻ blk_get_i64 ↻ sha512_gamma0 sha512_gamma1 sha512_sigma1 sha512_ch sha512_k sha512_sigma0 sha512_maj sha512_final sha512_blk_set_byte ↻ sha512_compress ↻ ge_p3_alloc sys_mmap ↻ fe_alloc nx_scratch nx_scratch_init nx_scratch_oom sys_mmap ↻

structs

none

consts

48const IG_PORT_REAL: i64 = 9445
49const IG_NURLS: i64 = 4

functions

51func ig_addr(out: *u8, port: i64) -> i64
called by 1: main
64func ig_count_sub(buf: *u8, blen: i64, pat: *u8, patlen: i64) -> i64
called by 1: main
79func ig_wn(fd: i64, v: i64) -> i64
called by 2: ig_logmain calls 2: sys_writesys_mmap
88func ig_log(green: i64, served: i64, curl_exit: i64, h200: i64, newconn: i64) -> i64
106func ig_puts(fd: i64, s: *u8) -> i64
called by 1: ig_log_adv calls 1: sys_write
115func ig_log_adv(adv_ok: i64, interop_green: i64) -> i64
129func main() -> i64