426 karma · joined Apr 8, 2014 (12y ago) · 86 submissions
[ my public key: https://keybase.io/felix; my proof: https://keybase.io/felix/sigs/mjJ1GvUGKTRmYImkgCu8Z04zn4AetQ7MsGOGRCSMh-A ]
1.
PivCo-Huffman: a novel approach to Huffman decoding(marcinzukowski.github.io ↗)
2 points · by felixhandte · 5mo ago · discuss
comment 1y ago · link · parent
comment 1y ago · link · parent
comment 1y ago · link · parent
comment 1y ago · link · parent
- A white paper: https://arxiv.org/abs/2510.03203
- A blog post: https://engineering.fb.com/2025/10/06/developer-tools/openzl...
- The documentation website: https://openzl.org/
13.
OpenZL: A novel data compression framework(github.com ↗)
33 points · by felixhandte · 1y ago · 4 comments
comment 1y ago · link · parent
Code: https://github.com/facebook/openzl
Documentation: https://openzl.org/
White Paper: https://arxiv.org/abs/2510.03203
comment 1y ago · link · parent
The first stage of Zstd does LZ77 matching, which transforms the input into "sequences", a series of instructions each of which describes some literals and one match. The literals component of the instruction says "the next L bytes of the message are these L bytes". The match component says "the next M bytes of the input are the M bytes N bytes ago".
If you want to construct a match between two strings that differ by one character, rather than saying "the next N bytes are the N bytes M bytes ago except for this one byte here which is X instead", Zstd just breaks it up into two sequences, the first part of the match, and then a single literal byte describing the changed byte, and then the rest of the match, which is described as being at offset 0. The encoding rules for Zstd define offset 0 to mean "the previously used match offset". This isn't as powerful as a Levenshtein edit, but it's a reasonable approximation.
The big advantage of this approach is that it doesn't require much additional machinery on the encoder or decoder, and thus remains very fast. Whereas implementing a whole edit description state machine would (I think) slow down decompression and especially compression enormously.
[0] https://datatracker.ietf.org/doc/html/rfc8878#name-repeat-of...
comment 1y ago · link · parent
Ultimately, Zstd is a byte-oriented compressor that doesn't understand the semantics of the data it compresses. Improvements are certainly possible if you can recognize and separate that framing to recover a contiguous view of the underlying data.
[0] https://github.com/facebook/zstd/blob/v1.5.7/lib/compress/zs...
(I am one of the maintainers of Zstd.)
comment 2y ago · link · parent
I get exactly that green cast and muted color range off of my flatbed scans (Epson v800). This is a really intriguing path to fixing them I hadn't considered.
It seems like the writeup here doesn't specify what you're using for the actual imaging? A flatbed scanner? A camera?
comment 2y ago · link · parent
By far the more common case for image stabilization is one in which the photographer is hand-holding the camera and may not frame the subject until the moment before the exposure begins. The camera movement will likely be several orders of magnitude (~4 to 7) larger than the drift that you want to measure. A low pass filter will tell you nothing at all.
At a certain point we can just start using guide stars [0].
comment 2y ago · link · parent
comment 2y ago · link · parent
Sure, humans act against their own interests all the time. Sometimes we do so for considered reasons, even. But that's because humans are messy and our interests are self-contradictory, incoherent, and have a fairly weak grip on our actions. We are always picking some values to serve and in doing so violating other values.
A strongly and coherently aligned AI would not (could not!) behave that way.
comment 3y ago · link · parent
Whereas Arithmetic encoding is actually practical, extensively used, and a direct analogue to the stick.
comment 3y ago · link · parent
2. The format spec is an RFC [1]. It's frozen. We're not going to pull the rug out from under you somehow (and why would we??).
3. I think we do a pretty good job accepting contributions. But again, if we aren't, you can always fork it.
All in all, we've worked pretty hard to make zstd universal--portable, stable, flexible, robust, etc. I guess I don't really have a point... I guess I hope you reconsider your rejection of zstd? It's pretty cool.
comment 4y ago · link · parent
One correction: the "dictionary" in Zstd is sort of a misnomer. It's (mostly[0]) not a data structure. It's simply a concatenation of substrings that occurred frequently in the samples provided to the trainer. When you compress with a dictionary, that content is used as a prefix against which matches can be made (as if you were doing streaming compression).
This is an important observation because it allows other patterns of dictionary compression. Zstd-trained dictionaries can be used with other LZ77 algorithms (like LZ4) and they will be useful there as well. Or, because dictionaries can be totally unstructured content, you can use one piece of content directly as a dictionary for another. This is useful for example for use cases like you mention, where you store multiple versions of a document. You can compress one version using another as a dictionary, which produces a compressed object which represents the delta.
One other note is that I know of at least one other database that uses dictionary-based Zstd to compress chunks: RocksDB[1].
[0] Zstd-produced dictionaries do actually have a structured header (described here: https://datatracker.ietf.org/doc/html/rfc8878#section-5), but the bulk of the dictionary is unstructured.
[1] https://github.com/facebook/rocksdb/wiki/Dictionary-Compress...
comment 4y ago · link · parent
Amusing video explanation: https://www.youtube.com/watch?v=KnDype-j3hk
29.
Zstandard v1.5.1(github.com ↗)
5 points · by felixhandte · 4y ago · discuss