Skip to content

Step the moving frames' zstd and widen the still stream's table - #160

Merged
andrewchen5678 merged 2 commits into
mainfrom
lossless-zstd
Nov 5, 2026
Merged

andrewchen5678 merged 2 commits into
mainfrom
lossless-zstd

Conversation

@andrewchen5678

Copy link
Copy Markdown
Contributor

The two planned items of the roadmap's Lossless tiles, and release 0.0.120.

  • The moving frames' zstd, faster. A frame of its own (KIND_PLANAR) now steps 8 bytes past a place the fast strategy found no match at (targetLength under ZSTD_fast), its literals forced to stay Huffman coded (literalCompressionMode, behind the zstd crate's experimental feature, which the bundled libzstd source already carries). The still stream keeps every look.
  • The still stream's table. 2^16 entries and an 8 MiB window, from 2^12 and 1 MiB: the small table forgot a match further back than a few thousand places, so a larger window had taken nothing off. 8 MiB is the most the protocol lets a STILL's frame have, and zDesk's page already holds it to exactly that (STILL_WINDOW_MOST), so neither the protocol nor the page changes. The test reader now holds the window to 8 MiB as the page does.

Measured on lab1, alone, motion-bench --tiles-only --lossless over every sample at every size, two runs each, against 0.0.119:

0.0.119 → now
CPU, all but flood 197 → 170 s (0.87×)
video at 1920x1080 11.6 → 9.9 ms a frame
video at 4K 45.9 → 39.2 ms a frame
bytes, all but flood 15,064 → 15,027 MB
browser 19.6 → 3.6 MB
terminal / uncover / still 0.68× / 0.69× / 0.45×

The still table costs the mixed session 4% more of the processor; moving pictures carry up to 0.4% more bytes. Figures in docs/tiles-performance.md, design in docs/architecture.md; the bench is archived as bench/lossless-zstd-20261105/. wlshare-proto is unchanged, so no proto-v tag.

cargo test, cargo clippy --all-targets -- -D warnings and cargo fmt --check pass.

🤖 Generated with Claude Code

andrewchen5678 and others added 2 commits November 5, 2026 12:27
A frame of its own now steps 8 bytes past a place the fast strategy found
no match at, its literals forced to stay Huffman coded (zstd's
`experimental` parameters): a moving picture's frame is its literals'
entropy coding more than its matches. The still stream keeps every look,
and takes a 65536-entry table with the 8 MiB window the protocol allows:
the 4096-entry one forgot a match further back than a few thousand places,
so a larger window had taken nothing off. The test reader holds a still
stream's window to 8 MiB, as the page does.

On lab1 over every sample, against 0.0.119: 197 -> 170 s of the processor
over all but flood, a video at 1920x1080 11.6 -> 9.9 ms a frame; bytes
15,064 -> 15,027 MB, the browser's 19.6 -> 3.6 MB. Both off the roadmap;
figures in tiles-performance.md, the bench in the artifacts'
bench/lossless-zstd-20261105/.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@andrewchen5678
andrewchen5678 merged commit d6e5286 into main Nov 5, 2026
2 checks passed
@andrewchen5678
andrewchen5678 deleted the lossless-zstd branch November 5, 2026 20:55
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant