https://gitlab.synchro.net/main/sbbs/-/commit/66bb670505aab3bba9c0f84c
Added Files:
src/bench/zmodem/fixC-buffered-producer.patch
Modified Files:
src/bench/zmodem/README.md
Log Message:
bench/zmodem: the buffered-producer fix, and the one case it still breaks
Implements the shipping-shape fix that the queue-depth diagnosis pointed
at, measures it against every mode the bench can exercise, and parks it
as a patch rather than applying it, because windowed mode regresses.
The change to sexyz.c is: a buffered send_byte that accumulates into a
4 KB txbuf and treats a failed flush as transient (remainder stays
buffered, no latch, no dropped bytes), a tx_flush() at the top of
recv_buffer() so the protocol never waits on the back-channel with untransmitted output pending, a flush() callback that actually reaches
the ring instead of being a no-op on the socket path, and SO_SNDBUF
bounded to OutbufSize so the bytes queued ahead of the protocol stay
capped -- that last part being what turns the error gate from 0/3 into
3/3, and it is applied before the [sockopts] ini section so a sysop can
still override it for a high bandwidth-delay link.
Measured: 11.5 -> 115.8 MB/s on a clean 256 MB send, with sender CPU
falling from 44 seconds to 1.0; error gate 3/3 at +32 to +38% wire
overhead against the shipped sender's +4.2%; the receive path unchanged
at 111 MB/s; and 8 MB over a 25 ms link actually faster than the shipped sender, 1.01 against 0.73 MB/s, so bounding the send buffer does not cost anything on a slower link.
The blocker is -w. Windowed sends fall from 4.74 MB/s to a crawl, one
roughly one-second stall per window, logging "Transmit-Window
management: 32768 >= 32768" followed by a receive timeout each time.
zmodem.c's window-full path does continue back to the back-channel wait
without a zmodem_flush(), which a per-byte producer never noticed
because everything was already in the ring. A buffered producer notices.
Since -w is supported, is what the 2 GB fix was validated with, and is
exactly the option a lossy link wants, the fix does not ship until that
is resolved.
sexyz.c is therefore unchanged; the work is saved as fixC-buffered-producer.patch alongside fixA/fixB and described in the
README. Refs #1195.
Co-Authored-By: Claude Opus 4.8 (1M context) <
noreply@anthropic.com>
---
þ Synchronet þ Vertrauen þ Home of Synchronet þ [vert/cvs/bbs].synchro.net