code wiki / (root) / nx_tls13_frag_gate.nx

nx_tls13_frag_gate.nx

buildroot/runtime/nx_tls13_frag_gate.nx

7183 B122 linesdepth 7pulls 15 transitivereach 0 importersview sourcekind gate/prooftopic tls13
docsdependenciesstructsconstsfunctions

about

nx_tls13_frag_gate.nx -- THE GATE FOR TLS REQUEST FRAGMENTATION ARITHMETIC, 2026-09-04. SUBJECT: nx_tls13_frag_max / nx_tls13_frag_len / nx_tls13_frag_count, in-process. WHY THIS GATE EXISTS AT ALL. Until today nx_https_req_complete wrote every request as ONE TLS record, so the transport had a hard ~16 KB ceiling that callers wore as hand-picked body constants. MEASURED: a 6,100-byte payload produced an 8,369-byte body and was refused while 5,900 passed, and the sovereign content shipper could not send the 48,402-byte chunks its own server offered -- around forty abandoned transfers had piled up over eleven days while each failure reported only "post failed". Fragmenting fixed it. But that change is in a shared transport every HTTPS client in this estate imports, and it goes live for each of them silently, on their NEXT REBUILD. A change with that blast radius must be testable without a socket. WHY IT GATES PURE ARITHMETIC AND NOT A LIVE SEND, on its sibling nx_https_post_lib_gate precedent: a gate that opens a socket goes RED when someone else network fails, and its RED then indicts this code for another outage. The split was extracted out of the loop precisely so it could be walked exhaustively here as integer arithmetic over one argument. THE LOAD-BEARING TOOTH IS THE PARTITION. Every off-by-one in a chunking loop either DROPS bytes or DUPLICATES them, and both survive a boundary test that only checks counts. Asserting that the fragment lengths SUM BACK TO the request length is the check that cannot be passed by a wrong split. license_tier: ORIGINAL No hw writes (Rule 26). expect_exit: 0

dependencies 3 imports · 0 importers

nx_syscalls.nx nx_gate_verdict.nx nx_tls13_record.nx nx_tls13_frag_gate.nx

imports: nx_syscalls.nxnx_gate_verdict.nxnx_tls13_record.nx

imported by: nobody (leaf or entry point)

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

main gv_ctr sys_mmap nxa_die sys_write sys_exit nxa_lock_take nxa_lock_addr sys_write ↻ nxa_lock_give nxa_lock_addr ↻ nxa_report_overrun sys_write ↻ nxa_dump_printable sys_write ↻ nxa_dump_sizes sys_write ↻ nx_tls13_frag_max gv_check_eq gv_check gv_puts sys_write ↻ gv_puts ↻ gv_num sys_mmap ↻ sys_write ↻ sys_munmap nx_tls13_frag_count nx_tls13_frag_max ↻ fg_walk_sum nx_tls13_frag_len nx_tls13_frag_max ↻ fg_walk_max nx_tls13_frag_len ↻ nx_tls13_frag_len ↻ gv_check ↻ gv_kv gv_puts ↻ gv_num ↻ gv_verdict

structs

none

consts

none

functions

31func fg_walk_sum(req_len: i64, maxsteps: i64) -> i64
called by 1: main calls 1: nx_tls13_frag_len
46func fg_walk_max(req_len: i64, maxsteps: i64) -> i64
called by 1: main calls 1: nx_tls13_frag_len
61func main() -> i64