]> git.ipfire.org Git - thirdparty/zstd.git/log
thirdparty/zstd.git
4 years agoAdd option to use logical cores for default threads 2710/head
Binh Vo [Wed, 16 Jun 2021 13:38:43 +0000 (09:38 -0400)] 
Add option to use logical cores for default threads

4 years agoMerge pull request #2708 from binhdvo/skippable
binhdvo [Mon, 14 Jun 2021 23:00:31 +0000 (19:00 -0400)] 
Merge pull request #2708 from binhdvo/skippable

Add API for fetching skippable frame content

4 years agoAdd API for fetching skippable frame content 2708/head
Binh Vo [Fri, 11 Jun 2021 16:11:58 +0000 (12:11 -0400)] 
Add API for fetching skippable frame content

4 years agoMerge pull request #2709 from terrelln/bounds-check-fix
Nick Terrell [Mon, 14 Jun 2021 19:33:50 +0000 (12:33 -0700)] 
Merge pull request #2709 from terrelln/bounds-check-fix

[fix] Add missing bounds checks during compression

4 years ago[fix] Add missing bounds checks during compression 2709/head
Nick Terrell [Mon, 14 Jun 2021 18:25:55 +0000 (11:25 -0700)] 
[fix] Add missing bounds checks during compression

* The block splitter missed a bounds check, so when the buffer is too small it
  passes an erroneously large size to `ZSTD_entropyCompressSeqStore()`, which
  can then write the compressed data past the end of the buffer. This is a new
  regression in v1.5.0 when the block splitter is enabled. It is either enabled
  explicitly, or implicitly when using the optimal parser and `ZSTD_compress2()`
  or `ZSTD_compressStream*()`.
* `HUF_writeCTable_wksp()` omits a bounds check when calling
  `HUF_compressWeights()`. If it is called with `dstCapacity == 0` it will pass
  an erroneously large size to `HUF_compressWeights()`, which can then write
  past the end of the buffer. This bug has been present for ages. However, I
  believe that zstd cannot trigger the bug, because it never calls
  `HUF_compress*()` with `dstCapacity == 0` because of [this check][1].

Credit to: Oss-Fuzz

[1]: https://github.com/facebook/zstd/blob/89127e5ee2f3c1e141668fa6d4ee91245f05d132/lib/compress/zstd_compress_literals.c#L100

4 years agoMerge pull request #2705 from binhdvo/bootcamp
binhdvo [Fri, 11 Jun 2021 18:08:23 +0000 (14:08 -0400)] 
Merge pull request #2705 from binhdvo/bootcamp

Add support for negative values in advanced flags

4 years agoAdd support for negative levels in --adapt=min and --adapt=max" 2705/head
Binh Vo [Wed, 9 Jun 2021 20:49:36 +0000 (16:49 -0400)] 
Add support for negative levels in --adapt=min and --adapt=max"

4 years agoMerge pull request #2702 from felixhandte/human_size_output
Felix Handte [Thu, 10 Jun 2021 20:53:43 +0000 (16:53 -0400)] 
Merge pull request #2702 from felixhandte/human_size_output

Format File Sizes Human-Readable in the CLI

4 years agoWhitespace Fixes to Improve Cross-Line Alignment 2702/head
W. Felix Handte [Thu, 10 Jun 2021 17:28:38 +0000 (13:28 -0400)] 
Whitespace Fixes to Improve Cross-Line Alignment

4 years agoUpdate Tests to Reflect New Formatting
W. Felix Handte [Thu, 10 Jun 2021 17:14:18 +0000 (13:14 -0400)] 
Update Tests to Reflect New Formatting

4 years agoConvert Other Size Displays to Use Human-Readable Formatting
W. Felix Handte [Thu, 10 Jun 2021 16:31:42 +0000 (12:31 -0400)] 
Convert Other Size Displays to Use Human-Readable Formatting

4 years agoSwitch to Binary Size Prefixes (e.g., "MB" -> "MiB")
W. Felix Handte [Thu, 10 Jun 2021 16:06:51 +0000 (12:06 -0400)] 
Switch to Binary Size Prefixes (e.g., "MB" -> "MiB")

Suggested by @aqrit, a little more verbose, but hopefully addresses a real
ambiguity.

4 years agoRequire `-vv` to Enable Full Precision
W. Felix Handte [Wed, 9 Jun 2021 20:13:00 +0000 (16:13 -0400)] 
Require `-vv` to Enable Full Precision

4 years agoApply to Other Print Statement as Well
W. Felix Handte [Wed, 9 Jun 2021 20:04:10 +0000 (16:04 -0400)] 
Apply to Other Print Statement as Well

4 years agoFix Whitespace
W. Felix Handte [Wed, 9 Jun 2021 19:28:12 +0000 (15:28 -0400)] 
Fix Whitespace

4 years agoChange Suffix (e.g., "G" -> " GB")
W. Felix Handte [Wed, 9 Jun 2021 19:26:16 +0000 (15:26 -0400)] 
Change Suffix (e.g., "G" -> " GB")

4 years agoIn Verbose Mode, Preserve Full Precision Where Possible
W. Felix Handte [Wed, 9 Jun 2021 19:22:59 +0000 (15:22 -0400)] 
In Verbose Mode, Preserve Full Precision Where Possible

4 years agoFix Integer Constants; Fix Comparison
W. Felix Handte [Wed, 9 Jun 2021 17:27:57 +0000 (13:27 -0400)] 
Fix Integer Constants; Fix Comparison

4 years agoAvoid `snprintf()` in Preparing Human-Readable Sizes; Improve Formatting
W. Felix Handte [Wed, 9 Jun 2021 17:05:44 +0000 (13:05 -0400)] 
Avoid `snprintf()` in Preparing Human-Readable Sizes; Improve Formatting

This produces the following formatting:

   Size    | `zstd` | `ls -lh`
---------- | ------ | --------
1          | 1      | 1
12         | 12     | 12
123        | 123    | 123
1234       | 1.21K  | 1.3K
12345      | 12.1K  | 13K
123456     | 121K   | 121K
1234567    | 1.18M  | 1.2M
12345678   | 11.8M  | 12M
123456789  | 118M   | 118M
1234567890 | 1.15G  | 1.2G
999        | 999    | 999
1000       | 1000   | 1000
1001       | 1001   | 1001
1023       | 1023   | 1023
1024       | 1.000K | 1.0K
1025       | 1.00K  | 1.1K
999999     | 977K   | 977K
1000000    | 977K   | 977K
1000001    | 977K   | 977K
1023999    | 1000K  | 1000K
1024000    | 1000K  | 1000K
1024001    | 1000K  | 1001K
1048575    | 1024K  | 1.0M
1048576    | 1.000M | 1.0M
1048577    | 1.00M  | 1.1M

This was produced with the following invocation:

```
for N in 1 12 123 1234 12345 123456 1234567 12345678 123456789 1234567890 999 1000 1001 1023 1024 1025 999999 1000000 1000001 1023999 1024000 1024001 1048575 1048576 1048577; do
  head -c $N /dev/urandom > r$N
done
./zstd -i1 -b1 -S r1 r12 r123 r1234 r12345 r123456 r1234567 r12345678 r123456789 r1234567890 r999 r1000 r1001 r1023 r1024 r1025 r999999 r1000000 r1000001 r1023999 r1024000 r1024001 r1048575 r1048576 r1048577
```

4 years agoAttempt to fix a failing test with help from @aqrit
Scott Baker [Mon, 7 Jun 2021 20:53:55 +0000 (13:53 -0700)] 
Attempt to fix a failing test with help from @aqrit

4 years agoSome fixes to address things @felixhandte found
Scott Baker [Mon, 7 Jun 2021 16:31:38 +0000 (09:31 -0700)] 
Some fixes to address things @felixhandte found

4 years agoTry enabling the BIG strings now the unsigned long long is in effect
Scott Baker [Sat, 5 Jun 2021 18:12:09 +0000 (11:12 -0700)] 
Try enabling the BIG strings now the unsigned long long is in effect

4 years agoTry unsigned long long
Scott Baker [Sat, 5 Jun 2021 18:11:09 +0000 (11:11 -0700)] 
Try unsigned long long

4 years agoUpdate humanSize() to skip the big numbers (it requires 64 bit)
Scott Baker [Sat, 5 Jun 2021 17:30:21 +0000 (10:30 -0700)] 
Update humanSize() to skip the big numbers (it requires 64 bit)

4 years agoUse unsigned long instead to help with some tests
Scott Baker [Sat, 5 Jun 2021 17:06:40 +0000 (10:06 -0700)] 
Use unsigned long instead to help with some tests

4 years agohuman_size() should use size_t
Scott Baker [Sat, 5 Jun 2021 15:45:35 +0000 (08:45 -0700)] 
human_size() should use size_t

4 years agoConvert tabs to spaces
Scott Baker [Sat, 5 Jun 2021 14:41:26 +0000 (07:41 -0700)] 
Convert tabs to spaces

4 years agoUse human_size() on the "multiple files compressed" output also
Scott Baker [Sat, 5 Jun 2021 05:21:00 +0000 (22:21 -0700)] 
Use human_size() on the "multiple files compressed" output also

4 years agoUse human_size() in the benchmark output also
Scott Baker [Sat, 5 Jun 2021 05:09:40 +0000 (22:09 -0700)] 
Use human_size() in the benchmark output also

4 years agoMove the variable declarations to the top
Scott Baker [Sat, 5 Jun 2021 05:03:33 +0000 (22:03 -0700)] 
Move the variable declarations to the top

4 years agoMake the variable types match
Scott Baker [Sat, 5 Jun 2021 05:02:32 +0000 (22:02 -0700)] 
Make the variable types match

4 years agoConvert names to CamelCase
Scott Baker [Sat, 5 Jun 2021 04:44:40 +0000 (21:44 -0700)] 
Convert names to CamelCase

4 years agoPut the human_size() function in util.c
Scott Baker [Sat, 5 Jun 2021 03:28:55 +0000 (20:28 -0700)] 
Put the human_size() function in util.c

4 years agoMake the CLI output the file sizes in human readable format
Scott Baker [Sat, 5 Jun 2021 03:25:31 +0000 (20:25 -0700)] 
Make the CLI output the file sizes in human readable format

4 years agoMerge pull request #2697 from senhuang42/entropy_repeat_fix
sen [Thu, 10 Jun 2021 13:39:17 +0000 (16:39 +0300)] 
Merge pull request #2697 from senhuang42/entropy_repeat_fix

[bug] Fix entropy repeat mode bug

4 years agoMerge pull request #2704 from facebook/revert-2703-bootcamp
Yann Collet [Wed, 9 Jun 2021 20:03:28 +0000 (13:03 -0700)] 
Merge pull request #2704 from facebook/revert-2703-bootcamp

Revert "Add support for --long-param flag, fix #2104"

4 years agoRevert "Add support for --long-param flag, fix #2104" 2704/head
binhdvo [Wed, 9 Jun 2021 19:35:43 +0000 (15:35 -0400)] 
Revert "Add support for --long-param flag, fix #2104"

4 years agoMerge pull request #2703 from binhdvo/bootcamp
binhdvo [Wed, 9 Jun 2021 19:03:38 +0000 (15:03 -0400)] 
Merge pull request #2703 from binhdvo/bootcamp

Add support for --long-param flag, fix #2104

4 years agoAdd support for --long-param flag 2703/head
Binh Vo [Wed, 9 Jun 2021 18:00:29 +0000 (14:00 -0400)] 
Add support for --long-param flag

4 years agoMerge pull request #2698 from binhdvo/bootcamp
Yann Collet [Wed, 9 Jun 2021 16:56:01 +0000 (09:56 -0700)] 
Merge pull request #2698 from binhdvo/bootcamp

Fix --progress flag to properly control progress display and default …

4 years agoMerge pull request #2678 from senhuang42/big_endian_no_intrinsics_fuzztest
sen [Wed, 9 Jun 2021 15:46:52 +0000 (18:46 +0300)] 
Merge pull request #2678 from senhuang42/big_endian_no_intrinsics_fuzztest

Fuzzer test with no intrinsics on S390x (big endian)

4 years agoMerge pull request #2700 from gauthamkrishna9991/update_readme_travis_link
sen [Wed, 9 Jun 2021 07:41:35 +0000 (10:41 +0300)] 
Merge pull request #2700 from gauthamkrishna9991/update_readme_travis_link

Update README for Travis CI Badge

4 years agoUpdate README for Travis CI Badge 2700/head
Goutham Krishna [Wed, 9 Jun 2021 07:08:22 +0000 (12:38 +0530)] 
Update README for Travis CI Badge

### Updating Badge link to the newTravis CI link.
- Update badge root to `api.travis-ci.com` (new)
  from `travis-ci.org` (old), which was migrated.

4 years agoFlatten ZSTD_row_getMatchMask (#2681)
aqrit [Wed, 9 Jun 2021 05:50:25 +0000 (01:50 -0400)] 
Flatten ZSTD_row_getMatchMask (#2681)

* Flatten ZSTD_row_getMatchMask

* Remove the SIMD abstraction layer.
* Add big endian support.
* Align `hashTags` within `tagRow` to a 16-byte boundary.
* Switch SSE2 to use aligned reads.
* Optimize scalar path using SWAR.
* Optimize neon path for `n == 32`
* Work around minor clang issue for NEON (https://bugs.llvm.org/show_bug.cgi?id=49577)

* replace memcpy with MEM_readST

* silence alignment warnings

* fix neon casts

* Update zstd_lazy.c

* unify simd preprocessor detection (#3)

* remove duplicate asserts

* tweak rotates

* improve endian detection

* add cast

there is a fun little catch-22 with gcc: result from pmovmskb has to be cast to uint32_t to avoid a zero-extension
but must be uint16_t to get gcc to generate a rotate instruction..

* more casts

* fix casts

better work-around for the (bogus) warning: unary minus on unsigned

4 years agoFix --progress flag to properly control progress display and default progress display... 2698/head
Binh Vo [Mon, 7 Jun 2021 15:50:22 +0000 (11:50 -0400)] 
Fix --progress flag to properly control progress display and default progress display on when using -v

4 years agoMerge pull request #2654 from wolfpld/dev
Felix Handte [Mon, 7 Jun 2021 17:04:19 +0000 (13:04 -0400)] 
Merge pull request #2654 from wolfpld/dev

Initialize "potentially uninitialized" pointers.

4 years agoMerge pull request #2691 from senhuang42/per_pr_regressiontest
sen [Mon, 7 Jun 2021 09:44:31 +0000 (12:44 +0300)] 
Merge pull request #2691 from senhuang42/per_pr_regressiontest

Make regression test run on every PR

4 years agoAdd no intrinsics fuzztest, rowhash compression size test, and S390X to travis 2678/head
Sen Huang [Mon, 7 Jun 2021 07:44:23 +0000 (00:44 -0700)] 
Add no intrinsics fuzztest, rowhash compression size test, and S390X to travis

4 years agoMake regression test run on every PR 2691/head
senhuang42 [Tue, 1 Jun 2021 02:59:01 +0000 (05:59 +0300)] 
Make regression test run on every PR

4 years agoFix entropy repeat mode bug 2697/head
Sen Huang [Mon, 7 Jun 2021 07:32:03 +0000 (00:32 -0700)] 
Fix entropy repeat mode bug

4 years agoMerge pull request #2693 from binhdvo/bootcamp
Yann Collet [Thu, 3 Jun 2021 19:41:23 +0000 (12:41 -0700)] 
Merge pull request #2693 from binhdvo/bootcamp

Add documentation for --patch-from

4 years agoAdd documentation for --patch-from 2693/head
Binh Vo [Thu, 3 Jun 2021 15:12:27 +0000 (11:12 -0400)] 
Add documentation for --patch-from

4 years agoMerge pull request #2684 from senhuang42/old_api_ldm_blocksplit
sen [Thu, 3 Jun 2021 07:10:27 +0000 (10:10 +0300)] 
Merge pull request #2684 from senhuang42/old_api_ldm_blocksplit

Add ldm and block splitter auto-enable to old api

4 years agoMerge pull request #2686 from senhuang42/arm64fuzztest
sen [Thu, 27 May 2021 17:50:26 +0000 (13:50 -0400)] 
Merge pull request #2686 from senhuang42/arm64fuzztest

Add arm64 fuzz test to travis

4 years agoAdd arm64 fuzz test to travis 2686/head
senhuang42 [Wed, 26 May 2021 18:51:04 +0000 (14:51 -0400)] 
Add arm64 fuzz test to travis

4 years agoMerge pull request #2682 from senhuang42/armbuild_fixtest
sen [Wed, 26 May 2021 18:14:43 +0000 (14:14 -0400)] 
Merge pull request #2682 from senhuang42/armbuild_fixtest

Make GH Actions CI tests run apt-get update before apt-get install

4 years agoUpdate apt-get prior to tests that install packages 2682/head
senhuang42 [Wed, 26 May 2021 17:38:36 +0000 (13:38 -0400)] 
Update apt-get prior to tests that install packages

4 years agoMerge pull request #2675 from senhuang42/ci_overhaul
sen [Wed, 26 May 2021 17:35:53 +0000 (13:35 -0400)] 
Merge pull request #2675 from senhuang42/ci_overhaul

[CI][1/2] Re-do the github actions workflows, migrate various travis and appveyor tests.

4 years agoAdd ldm and block splitter auto-enable to old api 2684/head
senhuang42 [Mon, 24 May 2021 16:57:56 +0000 (12:57 -0400)] 
Add ldm and block splitter auto-enable to old api

4 years agoMigrate travis CI tests 2675/head
senhuang42 [Tue, 18 May 2021 15:54:19 +0000 (11:54 -0400)] 
Migrate travis CI tests

4 years agoMerge pull request #2673 from terrelln/regression
Nick Terrell [Wed, 19 May 2021 17:19:09 +0000 (10:19 -0700)] 
Merge pull request #2673 from terrelln/regression

[test][regression] Update results.csv

4 years agoMerge pull request #2674 from terrelln/trace-aix
Nick Terrell [Wed, 19 May 2021 17:18:58 +0000 (10:18 -0700)] 
Merge pull request #2674 from terrelln/trace-aix

[trace] Refine the ZSTD_HAVE_WEAK_SYMBOLS detection

4 years ago[trace] Refine the ZSTD_HAVE_WEAK_SYMBOLS detection 2674/head
Nick Terrell [Wed, 19 May 2021 03:22:36 +0000 (20:22 -0700)] 
[trace] Refine the ZSTD_HAVE_WEAK_SYMBOLS detection

* Only enable for ELF on x86-64 or i386.
* Also explicitly disable for AIX.

Fixes #2658.

4 years ago[test][regression] Update results.csv 2673/head
Nick Terrell [Wed, 19 May 2021 02:46:37 +0000 (19:46 -0700)] 
[test][regression] Update results.csv

Changing the repcode search slightly, and changing when zstd is in
ext-dict vs. prefix mode in edge cases, slightly changes the compressed
results.

4 years agoMerge pull request #2667 from senhuang42/arm_tests_ci
sen [Mon, 17 May 2021 18:29:20 +0000 (14:29 -0400)] 
Merge pull request #2667 from senhuang42/arm_tests_ci

[CI] Add ARM tests back into CI

4 years agoMerge pull request #2668 from senhuang42/update_ci_platforms
sen [Mon, 17 May 2021 18:29:04 +0000 (14:29 -0400)] 
Merge pull request #2668 from senhuang42/update_ci_platforms

[CI] Fix zlib-wrapper test

4 years agoMerge pull request #2649 from felixhandte/circleci-release-job-fix
Yann Collet [Mon, 17 May 2021 18:22:56 +0000 (11:22 -0700)] 
Merge pull request #2649 from felixhandte/circleci-release-job-fix

Fix CircleCI Config to Fully Remove `publish-github-release` Job

4 years agoMerge pull request #2653 from TrianglesPCT/dev
Yann Collet [Mon, 17 May 2021 18:20:50 +0000 (11:20 -0700)] 
Merge pull request #2653 from TrianglesPCT/dev

Enable SSE2 compression path to work on MSVC

4 years agoMerge pull request #2660 from facebook/diaz
Yann Collet [Mon, 17 May 2021 17:15:55 +0000 (10:15 -0700)] 
Merge pull request #2660 from facebook/diaz

improve tar compatibility

4 years ago[ci] Add ARM tests back into CI 2667/head
senhuang42 [Mon, 17 May 2021 16:54:34 +0000 (12:54 -0400)] 
[ci] Add ARM tests back into CI

4 years ago[ci] Use *-latest for platforms to test on 2668/head
senhuang42 [Mon, 17 May 2021 17:04:55 +0000 (13:04 -0400)] 
[ci] Use *-latest for platforms to test on

4 years agoMerge pull request #2657 from dnelson-1901/dev-typofix
Yann Collet [Mon, 17 May 2021 04:49:21 +0000 (21:49 -0700)] 
Merge pull request #2657 from dnelson-1901/dev-typofix

ZSTD_VecMask_next: fix incorrect variable name in fallback code path

4 years agoimprove tar compatibility 2660/head
Yann Collet [Sun, 16 May 2021 06:09:42 +0000 (23:09 -0700)] 
improve tar compatibility

This patch is supposed to improve compatibility with less featured tar variants
"when the tar program used does not support historical options (without hyphen) nor the '-z' option."

Patch proposed by Antonio Diaz Diaz

4 years agominor mention of RFC8878
Yann Collet [Sun, 16 May 2021 06:04:46 +0000 (23:04 -0700)] 
minor mention of RFC8878

more recent update

4 years agoZSTD_VecMask_next: fix incorrect variable name in fallback code path 2657/head
Dan Nelson [Sat, 15 May 2021 15:20:37 +0000 (10:20 -0500)] 
ZSTD_VecMask_next: fix incorrect variable name in fallback code path

4 years agoUpdate zstd_lazy.c 2653/head
TrianglesPCT [Sat, 15 May 2021 01:23:13 +0000 (19:23 -0600)] 
Update zstd_lazy.c

It put the changes back when I tried to make a separate pull request, i don't understand githubs interface at all.

4 years agoAdd files via upload
TrianglesPCT [Sat, 15 May 2021 01:18:12 +0000 (19:18 -0600)] 
Add files via upload

AVX2

4 years agoUpdate zstd_lazy.c
TrianglesPCT [Sat, 15 May 2021 01:11:28 +0000 (19:11 -0600)] 
Update zstd_lazy.c

add space

4 years agoUpdate zstd_lazy.c
TrianglesPCT [Sat, 15 May 2021 01:10:24 +0000 (19:10 -0600)] 
Update zstd_lazy.c

Remove the AVX2 part

4 years agoUpdate zstd_lazy.c
TrianglesPCT [Sat, 15 May 2021 01:02:34 +0000 (19:02 -0600)] 
Update zstd_lazy.c

Switch to other comment style

4 years agoMerge pull request #2648 from terrelln/determinism-fuzzer
Nick Terrell [Sat, 15 May 2021 00:19:41 +0000 (17:19 -0700)] 
Merge pull request #2648 from terrelln/determinism-fuzzer

Add determinism fuzzers and fix rare determinism bugs

4 years agoUpdate zstd_lazy.c
TrianglesPCT [Fri, 14 May 2021 23:03:30 +0000 (17:03 -0600)] 
Update zstd_lazy.c

switch to unaligned load as I don't know if buffer will always be aligned to 32 bytes, and compilers aside from MSVC might actually use aligned loads

4 years agoUpdate zstd_lazy.c
TrianglesPCT [Fri, 14 May 2021 22:53:19 +0000 (16:53 -0600)] 
Update zstd_lazy.c

4 years agoUpdate zstd_lazy.c
TrianglesPCT [Fri, 14 May 2021 22:47:24 +0000 (16:47 -0600)] 
Update zstd_lazy.c

use 8bit

4 years agoInitialize "potentially uninitialized" pointers. 2654/head
Bartosz Taudul [Fri, 14 May 2021 22:40:49 +0000 (00:40 +0200)] 
Initialize "potentially uninitialized" pointers.

4 years agoAdd files via upload
TrianglesPCT [Fri, 14 May 2021 22:40:32 +0000 (16:40 -0600)] 
Add files via upload

4 years agoAdd files via upload
TrianglesPCT [Fri, 14 May 2021 22:33:07 +0000 (16:33 -0600)] 
Add files via upload

msvc

4 years agoAdd files via upload
TrianglesPCT [Fri, 14 May 2021 22:32:04 +0000 (16:32 -0600)] 
Add files via upload

msvc suport
avx2 path

4 years agoFix CircleCI Config to Fully Remove `publish-github-release` Job 2649/head
W. Felix Handte [Fri, 14 May 2021 15:59:50 +0000 (11:59 -0400)] 
Fix CircleCI Config to Fully Remove `publish-github-release` Job

4 years ago[fuzz] Add determinism fuzzing to simple & dictionary round trip 2648/head
Nick Terrell [Thu, 13 May 2021 23:16:47 +0000 (16:16 -0700)] 
[fuzz] Add determinism fuzzing to simple & dictionary round trip

Compress the input twice in the `simple_round_trip` and
`dictionary_round_trip` fuzzers with exactly the same parameters, but
reusing the context. Then ensure that the compressed output is
identical.

4 years ago[lib] Fix dictionary invalidation logic
Nick Terrell [Thu, 13 May 2021 23:13:29 +0000 (16:13 -0700)] 
[lib] Fix dictionary invalidation logic

Call `ZSTD_enforceMaxDist()` before each block with the beginning of the
block. This ensures that `lowLimit` is updated to `dictLimit` whenever
the ext-dict is out of range, so we can use prefix mode for speed.

This can cause non-determinism because prefix mode and ext-dict mode
match finders can return different results. It can also hurt speed
because ext-dict match finders are slower.

The scenario is:
1. Compress large data with a dictionary.
2. The dictionary goes out of bounds, so we invalidate it.
3. However, we still have `lowLimit < dictLimit`, since it is
   never updated.
4. We will call the ext-dict match finder instead of the prefix one.

4 years ago[lib] Fix off-by-one error in repcode checks
Nick Terrell [Thu, 13 May 2021 22:51:15 +0000 (15:51 -0700)] 
[lib] Fix off-by-one error in repcode checks

The repcode checks disallowed repcodes that are equal to `windowLow`.
This is slightly inefficient, but isn't a problem on its own. Together
with the next commit, it cause non-determinism.

4 years ago[lib] Fix determinism bug in the optimal parser
Nick Terrell [Thu, 13 May 2021 22:44:12 +0000 (15:44 -0700)] 
[lib] Fix determinism bug in the optimal parser

`ZSTD_insertBt1()` has a speed optimization that skips the prefix of
very long matches.

https://github.com/facebook/zstd/blob/40def70387f99b239f3f566ba399275a8fd44cde/lib/compress/zstd_opt.c#L476

This optimization is based off the length longest match found. However,
when indices are reset, we only ensure that we can reference the whole
window starting from `ip`. If the previous block ended with a long match
then `nextToUpdate` could be much less than `ip`. It might be far enough
back that `nextToUpdate < maxDist`, so it doesn't have a full window of
data to reference. This can cause non-determinism bugs, because we may
find a match that is beyond `ip - maxDist`, and may sometimes be
un-referencable, and that match triggers the speed optimization.

The fix is to base the `windowLow` off of the `target` of
`ZSTD_updateTree_internal()`, because anything below that value will be
obsolete by the time `ZSTD_updateTree_internal()` completes.

4 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)

4 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)

4 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

4 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.

4 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

4 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)

4 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