Repository navigation
net: TCP timestamps (RFC 7323); media, files: TIFF pictures - #118
Merged
Merged
Conversation
- The SYN offers the timestamps option; it is used when the peer's SYN carries it too, and then goes on every segment (12 bytes with its two NOPs, taken off the data a segment carries). - TS.Recent follows the segment that covers the last ACK sent, so an ACK echoes the oldest segment it acknowledges. - The round-trip time is taken from the echo, once per round trip, for retransmitted data as well; without the option the single timed segment and Karn's rule remain. - PAWS: a segment with a timestamp older than the last one accepted is acknowledged and dropped, whatever its sequence number says. Tests (network/net/tests/timestamps.rs): the option through the codec next to every other option and with a wrong length, negotiation with and without a willing peer, the echo, segment sizes, a round-trip sample from a retransmission, and a stale segment inside the window. Against the Linux TCP stack over a TAP device: both SYNs carry the option, 57 to 60 MiB/s up and 54 to 57 MiB/s down without loss; with 2 % of the data segments dropped each way, 4.2 to 9.1 MiB/s up and 3.5 to 28 MiB/s down in four runs (before: 3.9 to 13 up, 22 to 31 down; the spread of these few runs is wide). Co-Authored-By: Claude Fable 5.2 <[email protected]> Claude-Session: https://claude.ai/code/session_01Wky8K1hAgSGYFWjvQ1gDqK
Contributor
Files could not show .tif files. The image decoder now reads the first page of a TIFF 6.0 file: - both byte orders, strips and tiles, chunky and planar samples; - uncompressed, PackBits, LZW, Deflate, CCITT Group 3 and Group 4 (the LZW, inflate and fax decoders are the ones the PDF reader already has); - bilevel and grey of 1, 2, 4, 8 or 16 bits in either polarity, palettes of 1 to 8 bits, RGB and CMYK of 8 or 16 bits, with an alpha sample (associated alpha is un-premultiplied); - the horizontal differencing predictor, the fill order and the eight orientations. BigTIFF, JPEG-compressed strips, YCbCr and L*a*b* pixels and floating-point samples are refused with a message that names them. Sizes from the file are bounded before anything is allocated. Tests compare 23 files with reference decodings (Pillow's where it reads the file the same way; computed from the written pixels for 16 bits, associated alpha and orientation) and feed truncated and bit-flipped files through the decoder. tests/make_tiff_fixtures.py writes them with Pillow and tifffile. Co-Authored-By: Claude Fable 5.2 <[email protected]> Claude-Session: https://claude.ai/code/session_01Wky8K1hAgSGYFWjvQ1gDqK
CodSpeed reported tcp_parse_segment_1460 12.8 % slower with the timestamps option. Callgrind shows why: with two more callers, be32 was no longer inlined, and each call cost about 25 instructions for a four-byte load. A parse took 863 instructions against 779 on main; with be16, be32, put16 and put32 marked #[inline] it takes 788. Co-Authored-By: Claude Fable 5.2 <[email protected]> Claude-Session: https://claude.ai/code/session_01Wky8K1hAgSGYFWjvQ1gDqK
v3nn7
marked this pull request as ready for review
November 12, 2026 10:25
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What does this change?
Two unrelated changes, one commit each.
TCP timestamps (RFC 7323)
The TCP stack sent no timestamps option: the round-trip time came from one timed segment per window (none while retransmitting, by Karn's rule), and nothing protected a long connection against old duplicates.
Tcb::mss).TS.Recentfollows the segment that covers the last ACK sent, so an ACK echoes the oldest segment it acknowledges.TIFF pictures in Files
Files could not show
.tiffiles.osyx-medianow decodes the first page of a TIFF 6.0 file (userspace/media/src/image/tiff.rs), and the built-in viewer and "Open with" taketifandtiff.How was it tested?
TCP:
cargo test --locked -p osyx-net: 74 passed. Five new tests innetwork/net/tests/timestamps.rs: the option through the codec with every other option and with a wrong length, negotiation with and without a willing peer, the echo, segment sizes, a round-trip sample taken from a retransmission, and a stale segment inside the window.10 * 1460bytes as ten segments; with the option a segment carries 1448, so it now sends10 * 1448. The SACK tests strip the option from their SYN because they count whole segments.scripts/net-bench-host.py, 4 MiB each way).tcpdumpshowsTS val/ecron both SYNs and on data segments of 1448 bytes.TIFF:
cargo test --locked -p osyx-media: all suites pass;--test imagehas three new tests.tests/make_tiff_fixtures.pywrites the files with Pillow and tifffile and asserts that Pillow agrees wherever both exist.w * hpixels.TIFF, 8-bit RGB, LZW,..., page 1 of 2) and the messages for JPEG-compressed and BigTIFF files are checked.osyx-desktopbuilds forx86_64-unknown-none;cargo test -p osyx-filekitpasses (20).Limitations or screenshots
TS.Recent..tiffile in QEMU; only the decoder and the build are tested. No screenshot. Only the first page is shown. No thumbnails.osyx-mediaorosyx-filekittests, so the TIFF tests only ran here.maintoo:ipc: ordinary users cannot register services, take the display or read input.Labels
Labels: enhancement, network, desktop
🤖 Generated with Claude Code
https://claude.ai/code/session_01Wky8K1hAgSGYFWjvQ1gDqK