π [fix]: reduce stack use for batched UDP sends #9
All Vouch review confidence checks passed
Residual risk 0.14 = Change Risk (0.35) Γ (1 β Review Confidence (0.60)).
Review depth and reviewer attention state are adequate.
Model 1 Β· Change Risk (XGBoost)
Score: 0.35 Β· 168 lines diff across 2 files
Model 2 Β· Review Depth (DistilBERT)
Depth Score: 0.17 Β· 1 substantive comment(s)
Model 3 Β· Review Timing & Attention
Session adequacy: 100% Β· Reviewer familiarity: 35%
Bedrock Claude 3 Β· Risk Narration
(disconnected)
Groq Risk Narration
AWS Bedrock is currently disconnected. Generate high-confidence PR triage narration on-demand using Groq.
Model 1 Β· Change Risk Attribution
SHAP Weights
Diff Size
diff_size
0.307
Shallow Review Depth
shallow_review_depth
0.289
Real PR Conversation Timeline
1 comments
"Review active on #9"
general
weight: 0.35
heiher
Why
Both UDP send paths reserve a 263-byte SOCKS5 header on the stack for each datagram. They use only the first three bytes because the destination address already has its own
iovec. A batch of 64 datagrams therefore uses over 16 KiB of stack space for address storage it never reads.Changes
mmsghdrarray for UDP segmentation offload (GSO). If the send falls back, rebuild the entries for individual datagrams.Verification and limits
Tested five loopback scenarios on Linux arm64 with an independent SOCKS5 peer. The peer checked addresses, ports, payloads and order for both transports. A syscall trace confirmed that the batch tests exercised both
UDP_SEGMENTand plainsendmmsg.The changed file also compiled with warnings treated as errors on macOS arm64 and for all four Android ABIs. Windows was reviewed by inspection only.
Related
Downstream core PR #7 carries the corresponding change in our fork.
<details><summary>ΠΠ±ΡΡΠΌ ΠΈΠ·ΠΌΠ΅Π½Π΅Π½ΠΈΠΉ: +21 β21 Π² 1 ΡΠ°ΠΉΠ»Π΅</summary>
| ΠΠ°ΡΠ΅Π³ΠΎΡΠΈΡ | Π€Π°ΠΉΠ»ΠΎΠ² | + | β |
|---|---:|---:|---:|
| ΠΡΠΎΠ΄-ΠΊΠΎΠ΄ | 1 | 21 | 21 |
| ΠΡΠΎΠ³ΠΎ | 1 | 21 | 21 |
</details>