4 ms·
Honest question: why would this code clamp the reported round-trip time? By default, min = 0.05 ms and max = 800 ms [1]. if (rtt < config.min_rtt)
by raphman 11mo ago
Honest question: why would this code clamp the reported round-trip time? By default, min = 0.05 ms and max = 800 ms [1].
if (rtt < config.min_rtt)
rtt = config.min_rtt;
else if (rtt > config.max_rtt)
rtt = config.max_rtt;
Wouldn't this hide bugs in the code or network anomalies? Replies from localhost seem to typically arrive in less than 50 µs.
Comments in an earlier version [2] make no sense to me:
/* Use standard timersub for more accurate results */
if (rtt < 0)
rtt = 0;
/* Cap at reasonable maximum to handle outliers */
if (rtt > 1000)
rtt = 1000;
[1] https://github.com/davidesantangelo/fastrace/blob/5b843a197b559d7a01e22bc32325a11870d91d9f/fastrace.c#L365 https://github.com/davidesantangelo/fastrace/blob/5b843a197b...
[2] https://github.com/davidesantangelo/fastrace/commit/79d9274451e26df929a8961a524d56a443e60d06#diff-73819fe3d1f9cf0870908f31828a0c3c2d7ef4d1794cf297aa50404fc9fe70c5R404 https://github.com/davidesantangelo/fastrace/commit/79d92744...
- deleted 11mo ago[deleted]
- roygbiv2 11mo agoBecause it's AI generated.
- 9029 11mo agoIt has now been changed to if (rtt < 0.0) { fprintf(stderr, "Warning: Negative RTT detected (%.3f ms) - clock issue?\n", rtt); rtt = 0.0; } https://github.com/davidesantangelo/fastrace/blob/e8b19407a4bac4f78857c70e44efb38d6d8a8123/fastrace.c#L359-L363 https://github.com/davidesantangelo/fastrace/blob/e8b19407a4...
- anonymous908213 11mo agoAnd the update message has a reference to "50µs localhost responses", indicating the comment calling the code out was directly fed into a prompt: "Fixed Removed artificial RTT clamping that was hiding legitimate network measurements Previously clamped RTT between 0.05ms and 800ms Now reports actual values including sub-50µs localhost responses and >800ms satellite/long-distance links Added sanity check for negative RTT to detect clock issues without corrupting data This fix restores full diagnostic capability for detecting network anomalies like bufferbloat and measuring true round-trip times across all network types." It shouldn't be legal to vibe this hard, honestly. If convicted in court, you should face punishment of, say, XXX hours doing something actually useful to society with your own two hands.
- raphman 11mo agoThanks for pointing this out. If someone reports a bug in my software, I usually acknowledge the reporter in the commit message. Seems like vibe coding also allows one to get rid of this pesky obligation.