13 Commits

Author SHA1 Message Date
Kendall Condon
f50c647977 add deflate compression, simplify decompression
Implements deflate compression from scratch. A history window is kept in
the writer's buffer for matching and a chained hash table is used to
find matches. Tokens are accumulated until a threshold is reached and
then outputted as a block. Flush is used to indicate end of stream.

Additionally, two other deflate writers are provided:
* `Raw` writes only in store blocks (the uncompressed bytes). It
  utilizes data vectors to efficiently send block headers and data.
* `Huffman` only performs Huffman compression on data and no matching.

The above are also able to take advantage of writer semantics since they
do not need to keep a history.

Literal and distance code parameters in `token` have also been reworked.
Their parameters are now derived mathematically, however the more
expensive ones are still obtained through a lookup table (expect on
ReleaseSmall).

Decompression bit reading has been greatly simplified, taking advantage
of the ability to peek on the underlying reader. Additionally, a few
bugs with limit handling have been fixed.
2025-09-30 18:28:47 -07:00
Andrew Kelley
ac4fbb427b std.compress.flate.Decompress: don't compute checksums
These have no business being in-bound; simply provide the expected
values to user code for maximum flexibility.
2025-07-31 22:10:11 -07:00
Andrew Kelley
e73ca2444e std.compress.flate.Decompress: implement peekBitsEnding and writeMatch 2025-07-31 22:10:11 -07:00
Andrew Kelley
824c157e0c std.compress.flate: finish reorganizing 2025-07-31 22:10:11 -07:00
Andrew Kelley
a4f05a4588 delete flate implementation 2025-07-31 22:10:11 -07:00
Andrew Kelley
83513ade35 std.compress: rework flate to new I/O API 2025-07-31 22:10:11 -07:00
Jora Troosh
13070448f5
std: fix typos (#20560) 2024-07-09 14:25:42 -07:00
Igor Anić
f2508abfa6 flate: use 4 bytes lookahead for zlib
That ensures no bytes are left in the BitReader buffer after we reach
end of the stream.
2024-03-04 09:53:01 +01:00
Igor Anić
62ce753814 compress: activate tests in wasm32
They were disabled because insufficient stack size.
That is
[changed](d51aa9748f) now.
2024-02-27 19:19:59 -08:00
Ryan Liptak
16b3d1004e Remove redundant test name prefixes now that test names are fully qualified
Follow up to #19079, which made test names fully qualified.

This fixes tests that now-redundant information in their test names. For example here's a fully qualified test name before the changes in this commit:

"priority_queue.test.std.PriorityQueue: shrinkAndFree"

and the same test's name after the changes in this commit:

"priority_queue.test.shrinkAndFree"
2024-02-26 15:18:31 -08:00
Andrew Kelley
d51aa9748f change default WASI stack size
to match the other operating systems. 16 MiB

closes #18885
2024-02-26 10:33:17 -08:00
Igor Anić
99cb201438 skip failing wasm tests 2024-02-15 00:35:08 +01:00
Igor Anić
fd9db4962c reorganize compress package root folder 2024-02-14 23:34:13 +01:00