]> git.ipfire.org Git - thirdparty/zstd.git/log
thirdparty/zstd.git
2 years agoZstd 1.5.0 Release v1.5.0
sen [Fri, 14 May 2021 14:59:34 +0000 (10:59 -0400)] 
Zstd 1.5.0 Release

Zstd 1.5.0 Release

2 years agoRemove deprecate flag for vcx (#2647) 2636/head
sen [Thu, 13 May 2021 23:33:48 +0000 (19:33 -0400)] 
Remove deprecate flag for vcx (#2647)

2 years agoAdd source level deprecation warning disabling to certain tests/utils (#2645)
sen [Thu, 13 May 2021 18:41:21 +0000 (14:41 -0400)] 
Add source level deprecation warning disabling to certain tests/utils (#2645)

2 years agoMerge pull request #2644 from facebook/mesonFix
Yann Collet [Thu, 13 May 2021 17:19:49 +0000 (10:19 -0700)] 
Merge pull request #2644 from facebook/mesonFix

Fixed meson test on travisCI

2 years agoupdated meson test 2644/head
Yann Collet [Thu, 13 May 2021 16:34:28 +0000 (09:34 -0700)] 
updated meson test

hopefully, bionic will have a more recent version of python
required to install meson.

2 years agoMerge pull request #2643 from facebook/workers32
Yann Collet [Wed, 12 May 2021 21:18:31 +0000 (14:18 -0700)] 
Merge pull request #2643 from facebook/workers32

reduce ZSTDMT_NBWORKERS_MAX in 32-bit mode

2 years agoUpdate CHANGELOG to include patch from fix (#2642)
sen [Wed, 12 May 2021 20:46:05 +0000 (16:46 -0400)] 
Update CHANGELOG to include patch from fix (#2642)

2 years agoMerge branch 'dev' of github.com:facebook/zstd into dev 2643/head
Yann Collet [Wed, 12 May 2021 20:12:30 +0000 (13:12 -0700)] 
Merge branch 'dev' of github.com:facebook/zstd into dev

2 years agofileio: clamp value of windowLog in patch-mode (#2637)
Olivier Perret [Wed, 12 May 2021 20:11:15 +0000 (22:11 +0200)] 
fileio: clamp value of windowLog in patch-mode (#2637)

With small enough input files, the inferred value of fileWindowLog could
be smaller than ZSTD_WINDOWLOG_MIN.

This can be reproduced like so:
$ echo abc > small
$ echo abcdef > small2
$ zstd --patch-from small small2 -o patch
previously, this would fail with the error "zstd: error 11 : Parameter is out of bound"

2 years agoreduce Max nb Workers to 64 in 32-bit mode
Yann Collet [Wed, 12 May 2021 20:10:25 +0000 (13:10 -0700)] 
reduce Max nb Workers to 64 in 32-bit mode

and restored limit to 256 when in 64-bit mode
(it was reduced to 200 to give more room for 32-bit).

This should fix test instability issues
using lot of threads in 32-bit environments.

2 years agoRemove const data members in threadpooltest payload (#2639) (#2640)
sen [Wed, 12 May 2021 20:09:48 +0000 (16:09 -0400)] 
Remove const data members in threadpooltest payload (#2639) (#2640)

2 years agoRemove const data members in threadpooltest payload (#2639)
sen [Wed, 12 May 2021 16:56:57 +0000 (12:56 -0400)] 
Remove const data members in threadpooltest payload (#2639)

2 years agoAdd mt lib build to CL, shuffle around bugs section (#2638)
sen [Wed, 12 May 2021 15:31:31 +0000 (11:31 -0400)] 
Add mt lib build to CL, shuffle around bugs section (#2638)

2 years agoupdated generated man pages for v1.5.0 (#2635)
Yann Collet [Tue, 11 May 2021 22:17:31 +0000 (15:17 -0700)] 
updated generated man pages for v1.5.0 (#2635)

2 years agoBump version to 1.5.0, rebuild documentation (#2634)
sen [Tue, 11 May 2021 20:32:09 +0000 (16:32 -0400)] 
Bump version to 1.5.0, rebuild documentation (#2634)

2 years agoMerge pull request #2633 from bmwiedemann/issue2632
Yann Collet [Tue, 11 May 2021 18:17:52 +0000 (11:17 -0700)] 
Merge pull request #2633 from bmwiedemann/issue2632

Avoid SIGBUS on armv6

2 years agoAvoid SIGBUS on armv6 2633/head
Bernhard M. Wiedemann [Tue, 11 May 2021 15:46:55 +0000 (17:46 +0200)] 
Avoid SIGBUS on armv6

When running armv6 userspace on armv8 hardware with a 64 bit Linux kernel,
the mode 2 caused SIGBUS (unaligned memory access).
Running all our arm builds in the build farm
only on armv8 simplifies administration a lot.

Depending on compiler and environment, this change might slow down
memory accesses (did not benchmark it). The original analysis is 6 years old.

Fixes #2632

2 years agoMerge pull request #2630 from facebook/gcc9
Yann Collet [Mon, 10 May 2021 17:54:16 +0000 (10:54 -0700)] 
Merge pull request #2630 from facebook/gcc9

improved gcc-9 and gcc-10 decoding speed

2 years agoMerge pull request #2628 from skitt/libzstd-nomt-flags
Yann Collet [Sat, 8 May 2021 07:21:59 +0000 (00:21 -0700)] 
Merge pull request #2628 from skitt/libzstd-nomt-flags

Apply flags to libzstd-nomt in libzstd style

2 years agoimproved gcc-9 and gcc-10 decoding speed 2630/head
Yann Collet [Sat, 8 May 2021 06:58:13 +0000 (23:58 -0700)] 
improved gcc-9 and gcc-10 decoding speed

the new alignment setting is better for gcc-9 and gcc-10
by about ~+5%.

Unfortunately, it's worse for essentially all other compilers.

Make the new alignment setting conditional to gcc-9+.

2 years agoMerge pull request #2547 from facebook/d_prefetch_refactor
Yann Collet [Fri, 7 May 2021 23:28:00 +0000 (16:28 -0700)] 
Merge pull request #2547 from facebook/d_prefetch_refactor

Refactor prefetching for the decoding loop

2 years agoupdate decoder hot loop alignment 2547/head
Yann Collet [Fri, 7 May 2021 22:18:16 +0000 (15:18 -0700)] 
update decoder hot loop alignment

This seems to bring an additional ~+1.2% decompression speed
on average across 10 compilers x 6 scenarios.

2 years agoMerge branch 'd_prefetch_refactor' of github.com:facebook/zstd into d_prefetch_refactor
Yann Collet [Fri, 7 May 2021 18:30:44 +0000 (11:30 -0700)] 
Merge branch 'd_prefetch_refactor' of github.com:facebook/zstd into d_prefetch_refactor

2 years agoimprove decompression speed of long variant by ~+5%
Yann Collet [Fri, 7 May 2021 18:26:14 +0000 (11:26 -0700)] 
improve decompression speed of long variant by ~+5%

changed strategy,
now unconditionally prefetch the first 2 cache lines,
instead of cache lines corresponding to the first and last bytes of the match.

This better corresponds to cpu expectation,
which should auto-prefetch following cachelines on detecting the sequential nature of the read.

This is globally positive, by +5%,
though exact gains depend on compiler (from -2% to +15%).
The only negative counter-example is gcc-9.

2 years agoAdd PHONY targets to makefiles (#2629)
sen [Fri, 7 May 2021 18:03:19 +0000 (14:03 -0400)] 
Add PHONY targets to makefiles (#2629)

2 years agoMerge pull request #2627 from terrelln/timeout-fix
Nick Terrell [Fri, 7 May 2021 17:55:26 +0000 (10:55 -0700)] 
Merge pull request #2627 from terrelln/timeout-fix

[lib] Fix fuzzer timeouts by backing off overflow correction

2 years agoAssert no divison by 0, correct superblocks 0 sequences case (#2592)
sen [Fri, 7 May 2021 17:26:56 +0000 (13:26 -0400)] 
Assert no divison by 0, correct superblocks 0 sequences case (#2592)

2 years agoMerge branch 'dev' into d_prefetch_refactor
Yann Collet [Fri, 7 May 2021 16:32:53 +0000 (09:32 -0700)] 
Merge branch 'dev' into d_prefetch_refactor

2 years agoMerge pull request #2623 from facebook/fasterCygwin
Yann Collet [Fri, 7 May 2021 16:18:06 +0000 (09:18 -0700)] 
Merge pull request #2623 from facebook/fasterCygwin

attempt to make Appveyor's Cygwin test faster

2 years agoAdd threadPool unit tests to fuzzer.c (#2604)
sen [Fri, 7 May 2021 15:13:44 +0000 (11:13 -0400)] 
Add threadPool unit tests to fuzzer.c (#2604)

2 years ago[1.5.0] Enable multithreading in lib build by default (#2584)
sen [Fri, 7 May 2021 15:13:30 +0000 (11:13 -0400)] 
[1.5.0] Enable multithreading in lib build by default (#2584)

* Update lib Makefile to have new targets

* Update lib/README.md for mt

2 years agoApply flags to libzstd-nomt in libzstd style 2628/head
Stephen Kitt [Fri, 7 May 2021 11:22:53 +0000 (13:22 +0200)] 
Apply flags to libzstd-nomt in libzstd style

... for consistency (this doesn't actually change the build flags used
in practice, currently).

Signed-off-by: Stephen Kitt <steve@sk2.org>
2 years ago[lib] Fix fuzzer timeouts by backing off overflow correction 2627/head
Nick Terrell [Fri, 7 May 2021 04:56:51 +0000 (21:56 -0700)] 
[lib] Fix fuzzer timeouts by backing off overflow correction

Linearly back off the frequency of overflow correction based on the
number of times the `ZSTD_window_t` has been overflow corrected. This
will still allow the fuzzer to quickly find overflow correction bugs,
while also keeping good speed for larger inputs.

Additionally, the `nbOverflowCorrections` variable can be useful for
debugging coredumps, since we can inspect the `ZSTD_CCtx` to see if
overflow correction has happened yet.

I've verified this fixes the timeouts in OSS-Fuzz (176 seconds -> 6
seconds). I've also verified that fuzzers and `fuzzer` and `zstreamtest`
still catch the row-hash overflow correction bug.

2 years agodo not install g++ 2623/head
Yann Collet [Fri, 7 May 2021 04:53:30 +0000 (21:53 -0700)] 
do not install g++

2 years agoMerge branch 'dev' into d_prefetch_refactor
Yann Collet [Fri, 7 May 2021 02:49:26 +0000 (19:49 -0700)] 
Merge branch 'dev' into d_prefetch_refactor

2 years agoMerge pull request #2626 from facebook/codingStyle1
Yann Collet [Fri, 7 May 2021 02:46:05 +0000 (19:46 -0700)] 
Merge pull request #2626 from facebook/codingStyle1

added a paragraph on coding style

2 years agoMerge pull request #2625 from terrelln/ubsan-failure
Nick Terrell [Fri, 7 May 2021 02:22:25 +0000 (19:22 -0700)] 
Merge pull request #2625 from terrelln/ubsan-failure

[lib] Fix UBSAN warning in ZSTD_decompressSequences()

2 years agoadded a paragraph on coding style 2626/head
Yann Collet [Fri, 7 May 2021 01:28:24 +0000 (18:28 -0700)] 
added a paragraph on coding style

2 years agoswitch to clang
Yann Collet [Thu, 6 May 2021 23:07:44 +0000 (16:07 -0700)] 
switch to clang

2 years agoMerge branch 'dev' into fasterCygwin
Yann Collet [Thu, 6 May 2021 23:06:00 +0000 (16:06 -0700)] 
Merge branch 'dev' into fasterCygwin

2 years ago[lib] Fix UBSAN warning in ZSTD_decompressSequences() 2625/head
Nick Terrell [Thu, 6 May 2021 22:30:23 +0000 (15:30 -0700)] 
[lib] Fix UBSAN warning in ZSTD_decompressSequences()

2 years ago[1.5.0] Deprecate some functions (#2582)
sen [Thu, 6 May 2021 21:59:32 +0000 (17:59 -0400)] 
[1.5.0] Deprecate some functions (#2582)

* Add deprecated macro to zstd.h, mark certain functions as deprecated

* Remove ZSTD_compress.c dependencies on deprecated functions

2 years agoMerge pull request #2600 from nickhutchinson/clang-cl
Nick Terrell [Thu, 6 May 2021 19:43:15 +0000 (12:43 -0700)] 
Merge pull request #2600 from nickhutchinson/clang-cl

Fix for excessive compiler warnings when building with clang-cl

2 years agoMerge pull request #2622 from terrelln/zdict-api
Nick Terrell [Thu, 6 May 2021 19:42:56 +0000 (12:42 -0700)] 
Merge pull request #2622 from terrelln/zdict-api

[zdict] Add a FAQ to the top of zdict.h

2 years ago[zdict] Add a FAQ to the top of zdict.h 2622/head
Nick Terrell [Thu, 6 May 2021 02:44:24 +0000 (19:44 -0700)] 
[zdict] Add a FAQ to the top of zdict.h

The FAQ covers the questions asked in Issue #2566. It first covers why
you would want to use a dictionary, then what a dictionary is, and
finally it tells you how to train a dictionary, and clarifies some of
the parameters.

There is definitely more that could be said about some of the advanced
trainers, but this should be a good start.

2 years agoAdd --progress flag (#2595)
sen [Thu, 6 May 2021 18:50:28 +0000 (14:50 -0400)] 
Add --progress flag (#2595)

2 years agoMerge pull request #2620 from facebook/winFilelist
Yann Collet [Thu, 6 May 2021 18:35:16 +0000 (11:35 -0700)] 
Merge pull request #2620 from facebook/winFilelist

fix --filelist compatibility with Windows cr+lf line ending

2 years agoMerge pull request #2618 from felixhandte/single-file-build-mv
Felix Handte [Thu, 6 May 2021 18:09:42 +0000 (14:09 -0400)] 
Merge pull request #2618 from felixhandte/single-file-build-mv

Move Single-File Build Script from `contrib/` to `build/`

2 years agoMerge pull request #2616 from terrelln/deterministic-dict
Nick Terrell [Thu, 6 May 2021 18:09:22 +0000 (11:09 -0700)] 
Merge pull request #2616 from terrelln/deterministic-dict

[lib] Add ZSTD_c_deterministicRefPrefix

2 years agoCMake: fix excessive build warnings when building with clang-cl 2600/head
Nick Hutchinson [Sun, 2 May 2021 13:46:12 +0000 (14:46 +0100)] 
CMake: fix excessive build warnings when building with clang-cl

2 years agoMerge pull request #2621 from terrelln/regression-test
Nick Terrell [Thu, 6 May 2021 17:32:07 +0000 (10:32 -0700)] 
Merge pull request #2621 from terrelln/regression-test

[test][regression] Update results.csv

2 years agoattempt to make Appveyor's Cygwin test faster
Yann Collet [Thu, 6 May 2021 03:43:04 +0000 (20:43 -0700)] 
attempt to make Appveyor's Cygwin test faster

Cygwin is the longest Appveyor test
Appveyor is typically the CI which finish last

2 years agoAdd seekable roundtrip fuzzer (#2617)
sen [Thu, 6 May 2021 14:08:21 +0000 (10:08 -0400)] 
Add seekable roundtrip fuzzer (#2617)

2 years agoMerge pull request #2619 from facebook/winbench
Yann Collet [Thu, 6 May 2021 03:34:31 +0000 (20:34 -0700)] 
Merge pull request #2619 from facebook/winbench

improved benchmark experience on Windows

2 years agoMerge pull request #2615 from terrelln/stack-space
Nick Terrell [Thu, 6 May 2021 02:43:39 +0000 (19:43 -0700)] 
Merge pull request #2615 from terrelln/stack-space

[lib] Move some ZSTD_CCtx_params off the stack

2 years ago[test][regression] Update results.csv 2621/head
Nick Terrell [Thu, 6 May 2021 02:00:36 +0000 (19:00 -0700)] 
[test][regression] Update results.csv

The LDM change in PR #2602 changed the algorithm slightly.
The compressed size is generally positive, and when it is worse,
it is only a few bytes.

2 years ago[lib] Add ZSTD_c_deterministicRefPrefix 2616/head
Nick Terrell [Wed, 5 May 2021 19:18:47 +0000 (12:18 -0700)] 
[lib] Add ZSTD_c_deterministicRefPrefix

This flag forces zstd to always load the prefix in ext-dict mode, even
if it happens to be contiguous, to force determinism. It also applies to
dictionaries that are re-processed.

A determinism test case is also added, which fails without
`ZSTD_c_deterministicRefPrefix` and passes with it set.

Question: Should this be the default behavior? It isn't in this PR.

2 years agofix --filelist compatibility with Windows cr+lf line ending 2620/head
Yann Collet [Thu, 6 May 2021 01:01:55 +0000 (18:01 -0700)] 
fix --filelist compatibility with Windows cr+lf line ending

2 years agoMerge pull request #2614 from facebook/dlong8
Yann Collet [Wed, 5 May 2021 23:55:40 +0000 (16:55 -0700)] 
Merge pull request #2614 from facebook/dlong8

faster speed for decompressSequencesLong

2 years agoimproved benchmark experience on Windows 2619/head
Yann Collet [Wed, 5 May 2021 23:52:21 +0000 (16:52 -0700)] 
improved benchmark experience on Windows

benchmark results are not progressively displayed on Windows terminal.
For long benchmark sessions, nothing is displayed,
until the end, where everything is flushed.

Force display to be flushed after each update.
Updates happen roughtly every second, or even less,
so it's not a substantial workload.

2 years agoRewrite References to Location 2618/head
W. Felix Handte [Wed, 5 May 2021 22:03:48 +0000 (18:03 -0400)] 
Rewrite References to Location

2 years agoMerge pull request #2525 from felixhandte/fix-file-permissions-again
Felix Handte [Wed, 5 May 2021 21:59:13 +0000 (17:59 -0400)] 
Merge pull request #2525 from felixhandte/fix-file-permissions-again

Improve Setting Permissions of Created Files

2 years ago[tests] Set `DEBUGLEVEL=2` by default 2615/head
Nick Terrell [Wed, 5 May 2021 20:25:28 +0000 (13:25 -0700)] 
[tests] Set `DEBUGLEVEL=2` by default

This allows us to quickly check for compile errors in debug log
messages, which are compiled out when `DEBUGLEVEL < 2`.

2 years ago[lib] Move some ZSTD_CCtx_params off the stack
Nick Terrell [Wed, 5 May 2021 19:41:13 +0000 (12:41 -0700)] 
[lib] Move some ZSTD_CCtx_params off the stack

* Take `params` by const reference in `ZSTD_resetCCtx_internal()`.
* Add `simpleApiParams` to the CCtx and use them in the simple API
  functions, instead of creating those parameters on the stack.

I think this is a good direction to move in, because we shouldn't need
to worry about adding parameters to `ZSTD_CCtx_params`, since it should
always be on the heap (unless they become absoultely gigantic).

Some `ZSTD_CCtx_params` are still on the stack in the CDict functions,
but I've left them for now, because it was a little more complex, and we
don't use those functions in stack-constrained currently.

2 years agoMove Single-File Build Script from `contrib/` to `build/`
W. Felix Handte [Wed, 5 May 2021 20:07:51 +0000 (16:07 -0400)] 
Move Single-File Build Script from `contrib/` to `build/`

2 years agoAttempt to Fix Windows Build Error 2525/head
W. Felix Handte [Wed, 5 May 2021 17:13:56 +0000 (13:13 -0400)] 
Attempt to Fix Windows Build Error

2 years agoAlso Pass Mode Bits in on Windows
W. Felix Handte [Tue, 6 Apr 2021 15:29:28 +0000 (11:29 -0400)] 
Also Pass Mode Bits in on Windows

I think in some unix emulation environments on Windows, (cygwin?) mode bits
are somehow respected. So we might as well pass them in. Can't hurt.

2 years ago`rm -f` in playTests.sh
W. Felix Handte [Tue, 6 Apr 2021 15:27:27 +0000 (11:27 -0400)] 
`rm -f` in playTests.sh

2 years agoFix Build for Windows
W. Felix Handte [Tue, 9 Mar 2021 06:24:11 +0000 (01:24 -0500)] 
Fix Build for Windows

2 years agoAttempt to Fix `stat` Format for BSDs
W. Felix Handte [Mon, 8 Mar 2021 23:03:55 +0000 (18:03 -0500)] 
Attempt to Fix `stat` Format for BSDs

2 years agoDon't Block Removing File on Being Able to Read It
W. Felix Handte [Mon, 8 Mar 2021 22:49:20 +0000 (17:49 -0500)] 
Don't Block Removing File on Being Able to Read It

`open()`'s mode bits are only applied to files that are created by the call.
If the output file already exists, but is not readable, the `fopen()` would
fail, preventing us from removing it, which would mean that the file would
not end up with the correct permission bits.

It's not clear to me why the `fopen()` is there at all. `UTIL_isRegularFile()`
should be sufficient, AFAICT.

2 years agoCreate Files with Desired Permissions; Avoid chmod(); Remove UTIL_chmod()
W. Felix Handte [Mon, 8 Mar 2021 22:39:14 +0000 (17:39 -0500)] 
Create Files with Desired Permissions; Avoid chmod(); Remove UTIL_chmod()

2 years agoAdd Tests Checking File Permissions of Created Files
W. Felix Handte [Fri, 5 Mar 2021 23:04:45 +0000 (18:04 -0500)] 
Add Tests Checking File Permissions of Created Files

2 years agoMerge pull request #2613 from felixhandte/allow-block-device
Felix Handte [Wed, 5 May 2021 17:06:32 +0000 (13:06 -0400)] 
Merge pull request #2613 from felixhandte/allow-block-device

Allow Reading from Block Devices with `--force`

2 years agodeeper prefetching pipeline for decompressSequencesLong 2614/head
Yann Collet [Wed, 5 May 2021 17:04:03 +0000 (10:04 -0700)] 
deeper prefetching pipeline for decompressSequencesLong

pipeline increased from 4 to 8 slots.
This change substantially improves decompression speed when there are long distance offsets.
example with enwik9 compressed at level 22 :
gcc-9 : 947 -> 1039 MB/s
clang-10: 884 -> 946 MB/s

I also checked the "cold dictionary" scenario,
and found a smaller benefit, around ~2%
(measurements are more noisy for this scenario).

2 years agoMerge branch 'dev' into d_prefetch_refactor
Yann Collet [Wed, 5 May 2021 16:13:38 +0000 (09:13 -0700)] 
Merge branch 'dev' into d_prefetch_refactor

2 years agoupdated documentation regarding minimum job size
Yann Collet [Wed, 5 May 2021 16:03:11 +0000 (09:03 -0700)] 
updated documentation regarding minimum job size

2 years agoseekable decompression fixes (#2594)
Azat Khuzhin [Wed, 5 May 2021 14:05:41 +0000 (17:05 +0300)] 
seekable decompression fixes (#2594)

* seekable_format: fix from-file reading (not in-memory)

It tries to check the buffer boundary, but there is no buffer for
from-file reading.

* seekable_decompression: break when ZSTD_seekable_decompress() returns zero

* seekable_decompression_mem: break when ZSTD_seekable_decompress() returns zero

* seekable_format: cap the offset+len up to the last dOffset

This will allow to read the whole file w/o gotting corruption error if
the offset is more then the data left in file, i.e.:

    $ ./seekable_compression seekable_compression.c 8192 | head
    $ zstd -cdq seekable_compression.c.zst | wc -c
    4737

Before this patch:

    $ ./seekable_decompression seekable_compression.c.zst 0 10000000 | wc -c
    ZSTD_seekable_decompress() error : Corrupted block detected
    0

After:

    $ ./seekable_decompression seekable_compression.c.zst 0 10000000 | wc -c
    4737

2 years agoMerge pull request #2611 from facebook/smallerJobs
Yann Collet [Wed, 5 May 2021 07:03:29 +0000 (00:03 -0700)] 
Merge pull request #2611 from facebook/smallerJobs

allow jobSize to be as low as 512 KB

2 years agoMerge pull request #2602 from terrelln/ldm-opt
Nick Terrell [Wed, 5 May 2021 06:13:09 +0000 (23:13 -0700)] 
Merge pull request #2602 from terrelln/ldm-opt

[LDM] Speed optimization on repetitive data

2 years agoMerge pull request #2610 from senhuang42/lazy_underflow_fix
Nick Terrell [Wed, 5 May 2021 06:10:23 +0000 (23:10 -0700)] 
Merge pull request #2610 from senhuang42/lazy_underflow_fix

Fix bad integer wraparound in repcode index for fast, dfast, lazy

2 years agoMerge pull request #2607 from terrelln/deterministic-dict
Nick Terrell [Wed, 5 May 2021 05:48:48 +0000 (22:48 -0700)] 
Merge pull request #2607 from terrelln/deterministic-dict

[lib] Always load the dictionary in one go

2 years ago[test] Add large dict/data --patch-from test 2607/head
Nick Terrell [Wed, 5 May 2021 00:09:32 +0000 (17:09 -0700)] 
[test] Add large dict/data --patch-from test

Dictionary size must be > `ZSTD_CHUNKSIZE_MAX`.

2 years agoFix incorrect usages of repIndex across all strategies 2610/head
Sen Huang [Tue, 4 May 2021 16:50:44 +0000 (09:50 -0700)] 
Fix incorrect usages of repIndex across all strategies

2 years ago[lib] Always load the dictionary in one go
Nick Terrell [Tue, 4 May 2021 05:33:22 +0000 (22:33 -0700)] 
[lib] Always load the dictionary in one go

Dictionaries larger than `ZSTD_CHUNKSIZE_MAX` used to have to be loaded
in multiple segments. Instead, when we detect large dictionaries, ensure
that we reset the context's indicies. Then, for dictionaries larger than
`ZSTD_CURRENT_MAX - 1`, only load the suffix of the dictionary. Finally,
enable DDS for large dictionaries, since we no longer load in multiple
segments.

This simplifes the dictionary loading code, and reduces opportunities
for non-determinism to slip in.

2 years agofix rsyncable mode 2611/head
Yann Collet [Tue, 4 May 2021 22:59:27 +0000 (15:59 -0700)] 
fix rsyncable mode

2 years agoAdd Test Case (Behind Flag); Run in GitHub Action 2613/head
W. Felix Handte [Tue, 4 May 2021 21:26:05 +0000 (17:26 -0400)] 
Add Test Case (Behind Flag); Run in GitHub Action

2 years agoMerge pull request #2612 from terrelln/minor-fix
Nick Terrell [Tue, 4 May 2021 22:02:00 +0000 (15:02 -0700)] 
Merge pull request #2612 from terrelln/minor-fix

[easy] Rewrite rowHashLog computation

2 years agoAllow Reading from Block Devices with `--force`
W. Felix Handte [Tue, 4 May 2021 20:24:46 +0000 (16:24 -0400)] 
Allow Reading from Block Devices with `--force`

2 years agoMerge pull request #2608 from facebook/docMinVer
Yann Collet [Tue, 4 May 2021 19:10:52 +0000 (12:10 -0700)] 
Merge pull request #2608 from facebook/docMinVer

Documented minimum version numbers

2 years ago[easy] Rewrite rowHashLog computation 2612/head
Nick Terrell [Tue, 4 May 2021 18:43:20 +0000 (11:43 -0700)] 
[easy] Rewrite rowHashLog computation

`ZSTD_highbit32(1u << x) == x` when it isn't undefined behavior.

2 years agoMerge pull request #2597 from terrelln/public-headers
Nick Terrell [Tue, 4 May 2021 18:28:41 +0000 (11:28 -0700)] 
Merge pull request #2597 from terrelln/public-headers

[1.5.0] Move `zstd_errors.h` and `zdict.h` to `lib/` root

2 years agoMerge pull request #2609 from felixhandte/md5sum-darwin
Felix Handte [Tue, 4 May 2021 18:22:54 +0000 (14:22 -0400)] 
Merge pull request #2609 from felixhandte/md5sum-darwin

Detect Presence of `md5` on Darwin

2 years agoallow jobSize to be as low as 512 KB
Yann Collet [Tue, 4 May 2021 17:54:34 +0000 (10:54 -0700)] 
allow jobSize to be as low as 512 KB

previous lower limit was 1 MB.

Note : by default, the lowest job size is 2 MB, achieved at level 1.
Even lower job sizes can be achieved by manipulating this value directly,
or manually modifying window sizes to lower amounts.

Updated unit test to ensure that this new limit works fine
(test would fail with previous 1 MB limit).

2 years ago[LDM] Speed optimization on repetitive data 2602/head
Nick Terrell [Mon, 3 May 2021 21:32:15 +0000 (14:32 -0700)] 
[LDM] Speed optimization on repetitive data

LDM does especially poorly on repetitive data when that data's hash happens
to have `(hash & stopMask) == 0`. Either because the `stopMask == 0` or
random chance. Optimize this case by skipping over repetitive patterns.
The detection is very simplistic, but should catch most of the offending
cases.

```
head -c 1G /dev/zero | perf stat -- ./zstd -1 -o /dev/null -v --zstd=ldmHashRateLog=1 --long
      21.187881087 seconds time elapsed

head -c 1G /dev/zero | perf stat -- ./zstd -1 -o /dev/null -v --zstd=ldmHashRateLog=1 --long
       1.149707921 seconds time elapsed

```

2 years agoDetect Presence of `md5` on Darwin 2609/head
W. Felix Handte [Tue, 4 May 2021 16:30:39 +0000 (12:30 -0400)] 
Detect Presence of `md5` on Darwin

This fixes #2568.

2 years agoDocumented minimum version numbers 2608/head
Yann Collet [Tue, 4 May 2021 16:05:22 +0000 (09:05 -0700)] 
Documented minimum version numbers

Any stable API entry point introduced after v1.0
should be documented with its minimum version number.

Since PR fixes this requirement
updating mostly new entry points since v1.4.0
and newly introduced ones for future v1.5.0.

2 years agoMerge pull request #2606 from terrelln/test-memory
Nick Terrell [Tue, 4 May 2021 04:16:28 +0000 (21:16 -0700)] 
Merge pull request #2606 from terrelln/test-memory

[tests] Reduce memory usage of MT CLI tests

3 years agoMerge pull request #2603 from terrelln/reduce-indices-fuzzer
Nick Terrell [Tue, 4 May 2021 02:24:55 +0000 (19:24 -0700)] 
Merge pull request #2603 from terrelln/reduce-indices-fuzzer

Bug fix & run overflow correction much more frequently in tests

3 years ago[tests] Reduce memory usage of MT CLI tests 2606/head
Nick Terrell [Mon, 3 May 2021 23:29:11 +0000 (16:29 -0700)] 
[tests] Reduce memory usage of MT CLI tests

Switch from `-T0` to the default `-T1` which significantly reduces
memory usage for level 19 when there are many cores. This fixes
32-bit issues of running out of address space.

Fixes #2603.