]> git.ipfire.org Git - thirdparty/zstd.git/log
thirdparty/zstd.git
3 years ago[CircleCI] Fix short-tests-0 2892/head
Nick Terrell [Wed, 1 Dec 2021 19:49:58 +0000 (11:49 -0800)] 
[CircleCI] Fix short-tests-0

short-tests-0 were silently failing. I think because of the && make clean construction. Switch to ; instead.

Also fix all the test failures that were exposed.

`make all` is failing on CircleCI because it is missing Docker. Move that test
to GitHub actions, and switch the pedantic CircleCI test to `make allmost`.

3 years agoMerge pull request #2886 from terrelln/issue-2865
Nick Terrell [Wed, 1 Dec 2021 18:05:35 +0000 (13:05 -0500)] 
Merge pull request #2886 from terrelln/issue-2865

[test] Test that the exec-stack bit isn't set on libzstd.so

3 years agoMerge pull request #2888 from terrelln/issue-2814
Nick Terrell [Wed, 1 Dec 2021 18:05:09 +0000 (13:05 -0500)] 
Merge pull request #2888 from terrelln/issue-2814

[bmi2] Add lzcnt and bmi target attributes

3 years agoMerge pull request #2889 from terrelln/issue-2811
Nick Terrell [Wed, 1 Dec 2021 18:03:03 +0000 (13:03 -0500)] 
Merge pull request #2889 from terrelln/issue-2811

[contrib][pzstd] Fix build issue with gcc-5

3 years ago[contrib][pzstd] Fix build issue with gcc-5 2889/head
Nick Terrell [Wed, 1 Dec 2021 02:26:11 +0000 (18:26 -0800)] 
[contrib][pzstd] Fix build issue with gcc-5

gcc-5 didn't like the l-value overload for defaulted operator=. There is
no reason it needs to be l-value overloaded, so just remove it.

I'm not sure why the build broke for @mckaygerhard in Issue #2811, since
this code hasn't changed since it was added. But, there is no harm in
fixing it.

Fixes issue #2811.

3 years ago[test] Test that the exec-stack bit isn't set on libzstd.so 2886/head
Nick Terrell [Tue, 30 Nov 2021 20:29:55 +0000 (12:29 -0800)] 
[test] Test that the exec-stack bit isn't set on libzstd.so

Tests that libzstd.so doesn't have the exec-stack bit set using
readelf. If the stack is marked executable systemd will refuse
to link against zstd. We now test that it isn't set on every PR.

Adds a test for PR #2857
Fixes Issue #2865

3 years ago[bmi2] Add lzcnt and bmi target attributes 2888/head
Nick Terrell [Wed, 1 Dec 2021 01:43:28 +0000 (17:43 -0800)] 
[bmi2] Add lzcnt and bmi target attributes

* When dynamic dispatching to bmi2 add lzcnt and bmi to the
  TARGET_ATTRIBUTE.
* Centralize the bmi2 TARGET_ATTRIBUTE definition to
  BMI2_TARGET_ATTRIBUTE so we can change it in the future.
* Only enable bmi2 when both bmi1 & bmi2 are supported. There shouldn't
  be any cases where bmi2 is supported but bmi1 isn't. But, since we are
  using the instruction we should check bmi1 as well.

3 years agoMerge pull request #2877 from jannkoeker/dev
Yann Collet [Wed, 1 Dec 2021 01:39:38 +0000 (17:39 -0800)] 
Merge pull request #2877 from jannkoeker/dev

Add detection when compiling with Clang and Ninja under Windows

3 years agoMerge pull request #2872 from cntrump/fix_umbrella_header_warning_for_spm
Nick Terrell [Tue, 30 Nov 2021 19:10:00 +0000 (14:10 -0500)] 
Merge pull request #2872 from cntrump/fix_umbrella_header_warning_for_spm

Fix SPM warning: umbrella header for module 'libzstd' does not include header 'xxx.h'

3 years agoMerge pull request #2845 from senhuang42/appveyor_msvc2
sen [Tue, 30 Nov 2021 18:12:08 +0000 (13:12 -0500)] 
Merge pull request #2845 from senhuang42/appveyor_msvc2

Move visual studio tests from per-release to per-PR

3 years agoAdd GH Actions windows runtime test 2845/head
senhuang42 [Mon, 29 Nov 2021 18:09:56 +0000 (13:09 -0500)] 
Add GH Actions windows runtime test

3 years agoFix build for cygwin/bsd (#2882)
binhdvo [Mon, 29 Nov 2021 19:11:39 +0000 (14:11 -0500)] 
Fix build for cygwin/bsd (#2882)

3 years agoClarify documentation for -c (#2883)
binhdvo [Mon, 29 Nov 2021 19:10:43 +0000 (14:10 -0500)] 
Clarify documentation for -c (#2883)

3 years agomsvc tests to dev
senhuang42 [Wed, 3 Nov 2021 13:48:34 +0000 (16:48 +0300)] 
msvc tests to dev

3 years agoUpdate CMakeLists.txt 2877/head
Jann Köker [Wed, 24 Nov 2021 10:35:36 +0000 (11:35 +0100)] 
Update CMakeLists.txt

 Prevents multiple rules error when building with ninja and clang under windows

3 years agoRemove zstd-umbrella.h 2872/head
Lvv.me [Tue, 23 Nov 2021 23:48:40 +0000 (07:48 +0800)] 
Remove zstd-umbrella.h

3 years agoFix SPM warning: umbrella header for module 'libzstd' does not include header 'xxx.h'
Lvv.me [Sun, 21 Nov 2021 13:57:55 +0000 (21:57 +0800)] 
Fix SPM warning: umbrella header for module 'libzstd' does not include header 'xxx.h'

3 years agoMerge pull request #2869 from felixhandte/oss-fuzz-fix-41005
Felix Handte [Thu, 18 Nov 2021 15:11:48 +0000 (10:11 -0500)] 
Merge pull request #2869 from felixhandte/oss-fuzz-fix-41005

Determinism: Avoid Mapping Window into Reserved Indices during Reduction

3 years agoDeterminism: Avoid Mapping Window into Reserved Indices during Reduction 2869/head
W. Felix Handte [Wed, 17 Nov 2021 23:09:18 +0000 (18:09 -0500)] 
Determinism: Avoid Mapping Window into Reserved Indices during Reduction

PR #2850 attempted to fix a determinism bug that was uncovered by OSS-Fuzz. It
succeeded in addressing that source of non-determinism, but introduced a new
one: it was possible, when index reduction occurred, to map indices in the
window to the reserved value, which would cause them to be zeroed, potentially
altering parsing of the input.

This PR addresses this issue. It makes sure that the bottom of the window is
always `>= ZSTD_WINDOW_START_INDEX`.

I'm not sure if this makes #2850 redundant. I think it's probably still
valuable to have that protection as well.

Credit to OSS-Fuzz for discovering this issue.

3 years agoMerge pull request #2856 from rex4539/typos
Yann Collet [Wed, 17 Nov 2021 21:04:30 +0000 (13:04 -0800)] 
Merge pull request #2856 from rex4539/typos

Fix typos

3 years agoMerge pull request #2858 from cntrump/support_swift_package_manager
Yann Collet [Wed, 17 Nov 2021 04:50:07 +0000 (20:50 -0800)] 
Merge pull request #2858 from cntrump/support_swift_package_manager

Support Swift Package Manager

3 years agoMerge pull request #2866 from terrelln/linux-O2
Nick Terrell [Wed, 17 Nov 2021 01:23:23 +0000 (17:23 -0800)] 
Merge pull request #2866 from terrelln/linux-O2

[linux-kernel] Don't add -O3 to CFLAGS

3 years ago[linux-kernel] Don't add -O3 to CFLAGS 2866/head
Nick Terrell [Tue, 16 Nov 2021 22:25:18 +0000 (14:25 -0800)] 
[linux-kernel] Don't add -O3 to CFLAGS

It is no longer necessary to get good performance, there is only a small
speed difference between -O2 and -O3, so just stick to the default of
-O2. I've measured neutral compression speed and a ~3% decompression
speed loss in userspace with clang & gcc. I've also measured neutral
compression speed and a ~1% decompression speed loss in the kernel
benchmarks.

This also fixes the stack space usage on parisc. The compiler was buggy
for -O3 and used ~3KB of stack space for several functions. With -O2 the
problem is completely resolved, and stack space is back to a few hundred
bytes.

Additionally, we get a large code size win on gcc:

| Compiler | Before (Bytes) | After (Bytes) | Delta (Bytes) |
|----------|----------------|---------------|---------------|
| gcc-11   |         952754 |        738954 |       -213800 |
| clang-12 |         976290 |        938826 |        -37464 |

3 years agoMerge pull request #2857 from ko-zu/noexecstack
Nick Terrell [Tue, 16 Nov 2021 22:37:56 +0000 (14:37 -0800)] 
Merge pull request #2857 from ko-zu/noexecstack

Remove executable flag from GNU_STACK segment

3 years agoMerge pull request #2864 from terrelln/linux-opt
Nick Terrell [Tue, 16 Nov 2021 22:13:39 +0000 (14:13 -0800)] 
Merge pull request #2864 from terrelln/linux-opt

[linux-kernel] Don't inline function in zstd_opt.c

3 years ago[linux-kernel] Don't inline function in zstd_opt.c 2864/head
Nick Terrell [Tue, 16 Nov 2021 00:57:00 +0000 (16:57 -0800)] 
[linux-kernel] Don't inline function in zstd_opt.c

The optimal parser is unlikely to be used in the linux kernel in
practice. There is no reason these functions should be force inlined,
since we aren't gaining anything, and are losing build size.

| Compiler | Before (Bytes) | After (Bytes) | Delta (Bytes) |
|----------|----------------|---------------|---------------|
| gcc-11   |        1142090 |        952754 |       -189336 |
| clang-12 |        1228402 |        976290 |       -252112 |

This is a temporary solution pending the resolution of PR #2862 in the
`dev` branch.

3 years agoMerge pull request #2863 from terrelln/fast-dfast-size
Nick Terrell [Tue, 16 Nov 2021 04:15:22 +0000 (20:15 -0800)] 
Merge pull request #2863 from terrelln/fast-dfast-size

Reduce function size in fast & dfast

3 years agoReduce function size in fast & dfast 2863/head
Nick Terrell [Tue, 16 Nov 2021 01:25:24 +0000 (17:25 -0800)] 
Reduce function size in fast & dfast

Take the same approach as in PR #2828 [0] to remove functions that force
inline many function bodies and `switch`. Instead, create one function per
"template" combination, and then switch between these functions. This
allows the compiler to break the large function into many small
functions, which generally helps codegen.

Also, in the `extDict` modes when there is no ext-dict, call the top
level function instead of the force inlined one, to save on code size.

I'm specifically doing this because gcc on the parisc architecture doesn't
handle the large function body well, and ends up using a lot of excess
stack space. Outlining these functions fixes it.

3 years agoUsing `module.modulemap` replace symbol link for public header 2858/head
Lvv.me [Mon, 15 Nov 2021 05:23:50 +0000 (13:23 +0800)] 
Using `module.modulemap` replace symbol link for public header

3 years agoSupport Swift Package Manager
Lvv.me [Sun, 14 Nov 2021 09:29:33 +0000 (17:29 +0800)] 
Support Swift Package Manager

3 years agoRemove executable flag from GNU_STACK section 2857/head
ko-zu [Sat, 13 Nov 2021 13:48:33 +0000 (22:48 +0900)] 
Remove executable flag from GNU_STACK section

Putting stack marking into every assembly files is required to indicate
that the stack does not need to be executable.
Executable flag on stack conflicts with some security measures, Systemd
MemoryDenyWriteExecute=yes for example.

3 years agoFix typos 2856/head
Dimitris Apostolou [Sat, 13 Nov 2021 08:04:04 +0000 (10:04 +0200)] 
Fix typos

3 years agoMerge pull request #2847 from Svetlitski-FB/improve-verbose-output-2
Yann Collet [Sat, 13 Nov 2021 02:51:18 +0000 (18:51 -0800)] 
Merge pull request #2847 from Svetlitski-FB/improve-verbose-output-2

Display command line parameters with concrete values in verbose mode

3 years agoIntegrate verbose mode tests into playTests.sh 2847/head
Kevin Svetlitski [Fri, 12 Nov 2021 22:10:21 +0000 (14:10 -0800)] 
Integrate verbose mode tests into playTests.sh

3 years agoSuppress spurious unused parameter warning
Kevin Svetlitski [Thu, 11 Nov 2021 22:37:02 +0000 (14:37 -0800)] 
Suppress spurious unused parameter warning

3 years agoEnsure formatting directives for displaying size_t are portable
Kevin Svetlitski [Thu, 11 Nov 2021 21:17:30 +0000 (13:17 -0800)] 
Ensure formatting directives for displaying size_t are portable

3 years agoEnsure print*CParams functions are only defined when used
Kevin Svetlitski [Thu, 11 Nov 2021 20:14:56 +0000 (12:14 -0800)] 
Ensure print*CParams functions are only defined when used

3 years agoAdd test case for detailed compression parameter verbose output
Kevin Svetlitski [Thu, 11 Nov 2021 19:57:55 +0000 (11:57 -0800)] 
Add test case for detailed compression parameter verbose output

3 years agoMerge pull request #2836 from animalize/copy16
Yann Collet [Thu, 11 Nov 2021 15:53:08 +0000 (07:53 -0800)] 
Merge pull request #2836 from animalize/copy16

ZSTD_copy16() uses ZSTD_memcpy()

3 years agoFix const-ness of FIO_displayCompressionParameters
Kevin Svetlitski [Thu, 11 Nov 2021 01:25:27 +0000 (17:25 -0800)] 
Fix const-ness of FIO_displayCompressionParameters

3 years agoDisplay --zstd= subparameters in command-line ready form in verbose mode
Kevin Svetlitski [Fri, 5 Nov 2021 19:48:13 +0000 (12:48 -0700)] 
Display --zstd= subparameters in command-line ready form in verbose mode

3 years agoMerge pull request #2850 from felixhandte/oss-fuzz-fix-40829-for-real-this-time
Felix Handte [Wed, 10 Nov 2021 17:00:43 +0000 (12:00 -0500)] 
Merge pull request #2850 from felixhandte/oss-fuzz-fix-40829-for-real-this-time

Fix Determinism Bug: Avoid Reducing Indices to Reserved Values

3 years agoFix fullbench CI failure (#2851)
binhdvo [Tue, 9 Nov 2021 20:15:35 +0000 (15:15 -0500)] 
Fix fullbench CI failure (#2851)

3 years agoRewrite Fix to Still Auto-Vectorize 2850/head
W. Felix Handte [Tue, 9 Nov 2021 17:15:18 +0000 (12:15 -0500)] 
Rewrite Fix to Still Auto-Vectorize

3 years agoAvoid Reducing Indices to Reserved Values
W. Felix Handte [Tue, 9 Nov 2021 01:03:52 +0000 (20:03 -0500)] 
Avoid Reducing Indices to Reserved Values

Previously, if an index was equal to `reducerValue + 1`, it would get remapped
during index reduction to 1 i.e. `ZSTD_DUBT_UNSORTED_MARK`. This can affect the
parsing of the input slightly, by causing tree nodes to be nullified when they
otherwise wouldn't be. This hardly matters from a correctness or efficiency
perspective, but it does impact determinism.

So this commit changes index reduction to avoid mapping indices to collide with
`ZSTD_DUBT_UNSORTED_MARK`.

3 years agoMerge pull request #2849 from terrelln/linux-kernel-backport
Nick Terrell [Fri, 5 Nov 2021 22:02:37 +0000 (15:02 -0700)] 
Merge pull request #2849 from terrelln/linux-kernel-backport

Backport zstd patch from LKML

3 years agoBackport zstd patch from LKML 2849/head
Nick Terrell [Fri, 5 Nov 2021 21:09:49 +0000 (14:09 -0700)] 
Backport zstd patch from LKML

Credit to Nathan Chancellor for the bug fix and Nick Desaulniers for the
bug report.

Link: https://github.com/ClangBuiltLinux/linux/issues/1486
Link: https://lore.kernel.org/all/20211021202353.2356400-1-nathan@kernel.org/
3 years agoMerge pull request #2846 from senhuang42/fix_appveyor
sen [Fri, 5 Nov 2021 20:24:25 +0000 (23:24 +0300)] 
Merge pull request #2846 from senhuang42/fix_appveyor

Use unused functions to appease Visual Studio

3 years agoDisplay command line parameters with concrete values in verbose mode
Kevin Svetlitski [Fri, 5 Nov 2021 19:01:20 +0000 (12:01 -0700)] 
Display command line parameters with concrete values in verbose mode

3 years agoMerge pull request #2839 from Svetlitski-FB/improve-verbose-output
Yann Collet [Fri, 5 Nov 2021 01:26:42 +0000 (18:26 -0700)] 
Merge pull request #2839 from Svetlitski-FB/improve-verbose-output

Improvements to verbose mode output - decompression memory usage

3 years agoReport memory required to decompress while compressing in verbose mode 2839/head
Kevin Svetlitski [Mon, 1 Nov 2021 20:31:03 +0000 (13:31 -0700)] 
Report memory required to decompress while compressing in verbose mode

3 years agoVoid out unused functions 2846/head
senhuang42 [Wed, 3 Nov 2021 14:06:21 +0000 (17:06 +0300)] 
Void out unused functions

3 years agoZSTD_copy16() uses SSE2 instructions 2836/head
Ma Lin [Thu, 28 Oct 2021 10:53:12 +0000 (18:53 +0800)] 
ZSTD_copy16() uses SSE2 instructions

This accelerates the decompression speed of MSVC build.

3 years agoMove mingw tests from appveyor to github actions (#2838)
binhdvo [Tue, 2 Nov 2021 17:17:55 +0000 (13:17 -0400)] 
Move mingw tests from appveyor to github actions (#2838)

3 years agoFix oss fuzz test error (#2837)
binhdvo [Fri, 29 Oct 2021 14:29:50 +0000 (10:29 -0400)] 
Fix oss fuzz test error (#2837)

3 years agominor improvements to benchmark display
Yann Collet [Wed, 27 Oct 2021 06:23:30 +0000 (23:23 -0700)] 
minor improvements to benchmark display

3 years agoMerge pull request #2829 from facebook/ZSTD_DECODER_INTERNAL_BUFFER
Yann Collet [Tue, 26 Oct 2021 17:48:16 +0000 (10:48 -0700)] 
Merge pull request #2829 from facebook/ZSTD_DECODER_INTERNAL_BUFFER

minor : change build macro to ZSTD_DECODER_INTERNAL_BUFFER

3 years agofix minor cast warning 2829/head
Yann Collet [Tue, 26 Oct 2021 15:38:17 +0000 (08:38 -0700)] 
fix minor cast warning

3 years agoadded minimum for decoder buffer
Yann Collet [Tue, 26 Oct 2021 15:21:31 +0000 (08:21 -0700)] 
added minimum for decoder buffer

also : introduced macro BOUNDED()

3 years agoMerge pull request #2830 from facebook/clevels
Yann Collet [Mon, 25 Oct 2021 20:35:54 +0000 (13:35 -0700)] 
Merge pull request #2830 from facebook/clevels

separate compression level tables into their own file

3 years agoMerge pull request #2828 from terrelln/lazy-compile
Nick Terrell [Mon, 25 Oct 2021 17:22:23 +0000 (10:22 -0700)] 
Merge pull request #2828 from terrelln/lazy-compile

[lazy] Speed up compilation times

3 years agoseparate compression level tables into their own files 2830/head
Yann Collet [Mon, 25 Oct 2021 15:49:54 +0000 (08:49 -0700)] 
separate compression level tables into their own files

that's clearer than finding the tables somewhere in the middle of `compress.c`.

Also, down the line, it may potentially allows zstd to feature adjusted tables depending on target cpu.

3 years agobuild macro ZSTD_DECODER_INTERNAL_BUFFER
Yann Collet [Mon, 25 Oct 2021 15:09:04 +0000 (08:09 -0700)] 
build macro ZSTD_DECODER_INTERNAL_BUFFER

just to make the topic more accessible for potential users.

3 years agoReduce size of dctx by reutilizing dst buffer (#2751)
binhdvo [Mon, 25 Oct 2021 14:38:01 +0000 (10:38 -0400)] 
Reduce size of dctx by reutilizing dst buffer (#2751)

* Reduce size of dctx by reutilizing dst buffer

Co-authored-by: Binh Vo <binhvo@fb.com>
3 years agoMerge pull request #2822 from marxin/fix-zstd-thread-pool-documentation
Yann Collet [Fri, 22 Oct 2021 23:46:08 +0000 (16:46 -0700)] 
Merge pull request #2822 from marxin/fix-zstd-thread-pool-documentation

Support thread pool section in HTML documentation.

3 years ago[lazy] Speed up compilation times 2828/head
Nick Terrell [Thu, 21 Oct 2021 19:52:26 +0000 (12:52 -0700)] 
[lazy] Speed up compilation times

Speed up compilation times by moving each specialized search function
into its own function. This is faster because compilers can handle many
smaller functions much faster than one gigantic function. The previous
approach generated one giant function with `switch` statements and
inlining to select the implementation.

| Compiler | Flags                               | Dev Time (s) | PR Time (s) | Delta |
|----------|-------------------------------------|--------------|-------------|-------|
| gcc      | -O3                                 |         16.5 |         5.6 |  -66% |
| gcc      | -O3 -g -fsanitize=address,undefined |        158.9 |        38.2 |  -75% |
| clang    | -O3                                 |         36.5 |         5.5 |  -85% |
| clang    | -O3 -g -fsanitize=address,undefined |         27.8 |        17.5 |  -37% |

This also reduces the binary size because the search functions are no
longer inlined into the main body.

| Compiler | Dev libzstd.a Size (B) | PR libzstd.a Size (B) | Delta |
|----------|------------------------|-----------------------|-------|
| gcc      |                1563868 |               1308844 |  -16% |
| clang    |                1924372 |               1376020 |  -28% |

Finally, the performance is not impacted significantly by this change,
in fact we generally see a small speed boost.

| Compiler | Level | Dev Speed (MB/s) | PR Speed (MB/s) | Delta |
|----------|-------|------------------|-----------------|-------|
| gcc      |     5 |            110.6 |           110.0 | -0.5% |
| gcc      |     7 |             70.4 |            72.2 | +2.5% |
| gcc      |     9 |             53.2 |            53.5 | +0.5% |
| gcc      |    13 |             12.7 |            12.9 | +1.5% |
| clang    |     5 |            113.9 |           110.4 | -3.0% |
| clang    |     7 |             67.7 |            70.6 | +4.2% |
| clang    |     9 |             51.9 |            52.2 | +0.5% |
| clang    |    13 |             12.4 |            13.3 | +7.2% |

The compression strategy is unmodified in this PR, so the compressed size
should be exactly the same. I may have a follow up PR to slightly improve
the compression ratio, if it doesn't cost too much speed.

3 years agoMerge pull request #2825 from terrelln/huf-asm-comments
Nick Terrell [Thu, 21 Oct 2021 01:06:37 +0000 (18:06 -0700)] 
Merge pull request #2825 from terrelln/huf-asm-comments

[asm] Switch to C style comments

3 years ago[asm] Switch to C style comments 2825/head
Nick Terrell [Wed, 20 Oct 2021 18:37:05 +0000 (11:37 -0700)] 
[asm] Switch to C style comments

Switch to C style comments for increased portability, and consistency.

3 years agoMerge pull request #2800 from animalize/fix_c89
Yann Collet [Mon, 18 Oct 2021 21:32:04 +0000 (14:32 -0700)] 
Merge pull request #2800 from animalize/fix_c89

Fix a C89 error in msvc

3 years agoSupport thread pool section in HTML documentation. 2822/head
Martin Liska [Fri, 15 Oct 2021 15:55:08 +0000 (17:55 +0200)] 
Support thread pool section in HTML documentation.

3 years agoMerge pull request #2774 from felixhandte/zstd-dfast-pipelined-single
Felix Handte [Wed, 13 Oct 2021 20:38:43 +0000 (16:38 -0400)] 
Merge pull request #2774 from felixhandte/zstd-dfast-pipelined-single

Pipelined Implementation of ZSTD_dfast

3 years agoConvert Outer Control Structure to Loop 2774/head
W. Felix Handte [Mon, 11 Oct 2021 19:57:29 +0000 (15:57 -0400)] 
Convert Outer Control Structure to Loop

3 years agoMerge pull request #2813 from marxin/streaming-compress-enhance
sen [Tue, 12 Oct 2021 17:05:54 +0000 (13:05 -0400)] 
Merge pull request #2813 from marxin/streaming-compress-enhance

Enhance streaming_compression examples.

3 years agoEnhance streaming_compression examples. 2813/head
Martin Liska [Mon, 4 Oct 2021 06:23:57 +0000 (08:23 +0200)] 
Enhance streaming_compression examples.

Add level argument to the first test and be more verbose about
used compression level and number of threads.

3 years agoMerge pull request #2820 from terrelln/nb-compares
Nick Terrell [Mon, 11 Oct 2021 16:59:57 +0000 (09:59 -0700)] 
Merge pull request #2820 from terrelln/nb-compares

[binary-tree] Fix underflow of nbCompares

3 years agoMerge pull request #2819 from terrelln/ldm-hash-rate-log
Nick Terrell [Fri, 8 Oct 2021 21:58:29 +0000 (14:58 -0700)] 
Merge pull request #2819 from terrelln/ldm-hash-rate-log

[ldm] Fix ZSTD_c_ldmHashRateLog bounds check

3 years agoMerge pull request #2818 from terrelln/indentation-fix
Nick Terrell [Fri, 8 Oct 2021 21:57:52 +0000 (14:57 -0700)] 
Merge pull request #2818 from terrelln/indentation-fix

[nit] Fix buggy indentation

3 years agoMerge pull request #2817 from terrelln/multiple-ddict-fix
Nick Terrell [Fri, 8 Oct 2021 21:57:29 +0000 (14:57 -0700)] 
Merge pull request #2817 from terrelln/multiple-ddict-fix

[multiple-ddicts] Fix NULL checks

3 years ago[binary-tree] Fix underflow of nbCompares 2820/head
Nick Terrell [Fri, 8 Oct 2021 18:45:30 +0000 (11:45 -0700)] 
[binary-tree] Fix underflow of nbCompares

Fix underflow of `nbCompares` by switching to an `int` and comparing
`nbCompares > 0`. This is a minimal fix, because I don't want to change
the logic. These loops seem to be doing `nbCompares + 1` comparisons.

The bug was reported by Dan Carpenter and found by Smatch static
checker.

https://lore.kernel.org/all/20211008063704.GA5370@kili/

3 years ago[multiple-ddicts] Fix NULL checks 2817/head
Nick Terrell [Fri, 8 Oct 2021 18:05:58 +0000 (11:05 -0700)] 
[multiple-ddicts] Fix NULL checks

The bug was reported by Dan Carpenter and found by Smatch static
checker.

https://lore.kernel.org/all/20211008063704.GA5370@kili/

3 years ago[ldm] Fix ZSTD_c_ldmHashRateLog bounds check 2819/head
Nick Terrell [Fri, 8 Oct 2021 18:17:40 +0000 (11:17 -0700)] 
[ldm] Fix ZSTD_c_ldmHashRateLog bounds check

There is no minimum value check, so the parameter could be negative.
Switch to the standard pattern of using `BOUNDCHECK()`.

The bug was reported by Dan Carpenter and found by Smatch static
checker.

https://lore.kernel.org/all/20211008063704.GA5370@kili/

3 years ago[nit] Fix buggy indentation 2818/head
Nick Terrell [Fri, 8 Oct 2021 18:13:11 +0000 (11:13 -0700)] 
[nit] Fix buggy indentation

The bug was reported by Dan Carpenter and found by Smatch static
checker.

https://lore.kernel.org/all/20211008063704.GA5370@kili/

3 years agoStyle: Add Comments to Variables and Move a Couple into the Loop
W. Felix Handte [Tue, 5 Oct 2021 18:53:45 +0000 (14:53 -0400)] 
Style: Add Comments to Variables and Move a Couple into the Loop

3 years agoFix Flaky Test
W. Felix Handte [Mon, 13 Sep 2021 20:35:58 +0000 (16:35 -0400)] 
Fix Flaky Test

This test depended on `_extDict` and `_noDict` compressing identically, which
is not a guarantee we make, AFAIK.

3 years agoUpdate results.csv
W. Felix Handte [Thu, 9 Sep 2021 21:17:46 +0000 (17:17 -0400)] 
Update results.csv

3 years agoSimplify DMS Implementation by Removing noDict Support
W. Felix Handte [Thu, 9 Sep 2021 21:01:31 +0000 (17:01 -0400)] 
Simplify DMS Implementation by Removing noDict Support

3 years agoFall Back in _extDict to New _noDict Rather than Old Merged Impl
W. Felix Handte [Thu, 9 Sep 2021 20:42:13 +0000 (16:42 -0400)] 
Fall Back in _extDict to New _noDict Rather than Old Merged Impl

3 years agoNit: Rename Function
W. Felix Handte [Thu, 9 Sep 2021 20:39:29 +0000 (16:39 -0400)] 
Nit: Rename Function

3 years agoNit: Unnest Blocks that Don't Declare Anything
W. Felix Handte [Wed, 8 Sep 2021 20:47:26 +0000 (16:47 -0400)] 
Nit: Unnest Blocks that Don't Declare Anything

3 years agoSearch One Last Position
W. Felix Handte [Wed, 8 Sep 2021 20:41:43 +0000 (16:41 -0400)] 
Search One Last Position

3 years agoAdvance Long Index Lookup (+0.5% Speed)
W. Felix Handte [Wed, 8 Sep 2021 20:15:01 +0000 (16:15 -0400)] 
Advance Long Index Lookup (+0.5% Speed)

This lookup can be advanced to before the short match check because either way
we will use it (in the next loop iter or in `_search_next_long`).

3 years agoWrite Back Advanced Hash in Long Matches as Well (+Ratio)
W. Felix Handte [Wed, 8 Sep 2021 16:45:42 +0000 (12:45 -0400)] 
Write Back Advanced Hash in Long Matches as Well (+Ratio)

Since we're now hashing the position ahead even if we find a long match and
don't search that next position, we can write it back into the hashtable even
in long matches. This seems to cost us no speed, and improves compression
ratio slightly!

3 years agoUse Look-Ahead Hash for Next Long Check after Short Match (+0.5% Speed)
W. Felix Handte [Wed, 8 Sep 2021 16:41:15 +0000 (12:41 -0400)] 
Use Look-Ahead Hash for Next Long Check after Short Match (+0.5% Speed)

This costs a little ratio, unfortunately.

3 years agoHash Long One Position Ahead (+2.5% Speed)
W. Felix Handte [Thu, 2 Sep 2021 16:25:08 +0000 (12:25 -0400)] 
Hash Long One Position Ahead (+2.5% Speed)

Aside from maybe a latency win in the loop, this means that when we find a
short match, we've already done the hash we need to check the next long match.

3 years agoPull Match Found Stuff Out of the Loop
W. Felix Handte [Thu, 2 Sep 2021 16:15:58 +0000 (12:15 -0400)] 
Pull Match Found Stuff Out of the Loop

3 years agoExtract Working Variables
W. Felix Handte [Thu, 2 Sep 2021 16:03:49 +0000 (12:03 -0400)] 
Extract Working Variables

3 years agoTrack Step Rather than Recalculating (+0.5% Speed)
W. Felix Handte [Wed, 1 Sep 2021 21:50:53 +0000 (17:50 -0400)] 
Track Step Rather than Recalculating (+0.5% Speed)

3 years agoExtract Single-Segment Variant of ZSTD_dfast
W. Felix Handte [Wed, 1 Sep 2021 21:26:19 +0000 (17:26 -0400)] 
Extract Single-Segment Variant of ZSTD_dfast

3 years agoLimit train samples (#2809)
stanjo74 [Tue, 5 Oct 2021 00:47:52 +0000 (17:47 -0700)] 
Limit train samples (#2809)

* Limit training samples size to 2GB

* simplified DISPLAYLEVEL() macro to use global vqriable instead of local.

* refactored training samples loading

* fixed compiler warning

* addressed comments from the pull request

* addressed @terrelln comments

* missed some fixes

* fixed type mismatch

* Fixed bug passing estimated number of samples rather insted of the loaded number of samples.
Changed unit conversion not to use bit-shifts.

* fixed a declaration after code

* fixed type conversion compile errors

* fixed more type castting

* fixed more type mismatching

* changed sizes type to size_t

* move type casting

* more type cast fixes

3 years agoMerge pull request #2747 from Helflym/dev
Yann Collet [Fri, 1 Oct 2021 15:13:39 +0000 (08:13 -0700)] 
Merge pull request #2747 from Helflym/dev

Add AIX support in Makefile