]>
git.ipfire.org Git - thirdparty/zstd.git/log
supperPants [Wed, 1 Dec 2021 14:41:24 +0000 (22:41 +0800)]
Merge https://github.com/facebook/zstd into dev
supperPants [Wed, 1 Dec 2021 14:36:21 +0000 (22:36 +0800)]
Fix typos.
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
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'
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
senhuang42 [Mon, 29 Nov 2021 18:09:56 +0000 (13:09 -0500)]
Add GH Actions windows runtime test
binhdvo [Mon, 29 Nov 2021 19:11:39 +0000 (14:11 -0500)]
Fix build for cygwin/bsd (#2882)
binhdvo [Mon, 29 Nov 2021 19:10:43 +0000 (14:10 -0500)]
Clarify documentation for -c (#2883)
senhuang42 [Wed, 3 Nov 2021 13:48:34 +0000 (16:48 +0300)]
msvc tests to dev
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
Lvv.me [Tue, 23 Nov 2021 23:48:40 +0000 (07:48 +0800)]
Remove zstd-umbrella.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'
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
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.
Yann Collet [Wed, 17 Nov 2021 21:04:30 +0000 (13:04 -0800)]
Merge pull request #2856 from rex4539/typos
Fix typos
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
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
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 |
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
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
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.
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
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.
Lvv.me [Mon, 15 Nov 2021 05:23:50 +0000 (13:23 +0800)]
Using `module.modulemap` replace symbol link for public header
Lvv.me [Sun, 14 Nov 2021 09:29:33 +0000 (17:29 +0800)]
Support Swift Package Manager
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.
Dimitris Apostolou [Sat, 13 Nov 2021 08:04:04 +0000 (10:04 +0200)]
Fix typos
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
Kevin Svetlitski [Fri, 12 Nov 2021 22:10:21 +0000 (14:10 -0800)]
Integrate verbose mode tests into playTests.sh
Kevin Svetlitski [Thu, 11 Nov 2021 22:37:02 +0000 (14:37 -0800)]
Suppress spurious unused parameter warning
Kevin Svetlitski [Thu, 11 Nov 2021 21:17:30 +0000 (13:17 -0800)]
Ensure formatting directives for displaying size_t are portable
Kevin Svetlitski [Thu, 11 Nov 2021 20:14:56 +0000 (12:14 -0800)]
Ensure print*CParams functions are only defined when used
Kevin Svetlitski [Thu, 11 Nov 2021 19:57:55 +0000 (11:57 -0800)]
Add test case for detailed compression parameter verbose output
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()
Kevin Svetlitski [Thu, 11 Nov 2021 01:25:27 +0000 (17:25 -0800)]
Fix const-ness of FIO_displayCompressionParameters
Kevin Svetlitski [Fri, 5 Nov 2021 19:48:13 +0000 (12:48 -0700)]
Display --zstd= subparameters in command-line ready form in verbose mode
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
binhdvo [Tue, 9 Nov 2021 20:15:35 +0000 (15:15 -0500)]
Fix fullbench CI failure (#2851)
W. Felix Handte [Tue, 9 Nov 2021 17:15:18 +0000 (12:15 -0500)]
Rewrite Fix to Still Auto-Vectorize
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`.
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
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/
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
Kevin Svetlitski [Fri, 5 Nov 2021 19:01:20 +0000 (12:01 -0700)]
Display command line parameters with concrete values in verbose mode
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
Kevin Svetlitski [Mon, 1 Nov 2021 20:31:03 +0000 (13:31 -0700)]
Report memory required to decompress while compressing in verbose mode
senhuang42 [Wed, 3 Nov 2021 14:06:21 +0000 (17:06 +0300)]
Void out unused functions
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.
binhdvo [Tue, 2 Nov 2021 17:17:55 +0000 (13:17 -0400)]
Move mingw tests from appveyor to github actions (#2838)
binhdvo [Fri, 29 Oct 2021 14:29:50 +0000 (10:29 -0400)]
Fix oss fuzz test error (#2837)
Yann Collet [Wed, 27 Oct 2021 06:23:30 +0000 (23:23 -0700)]
minor improvements to benchmark display
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
Yann Collet [Tue, 26 Oct 2021 15:38:17 +0000 (08:38 -0700)]
fix minor cast warning
Yann Collet [Tue, 26 Oct 2021 15:21:31 +0000 (08:21 -0700)]
added minimum for decoder buffer
also : introduced macro BOUNDED()
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
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
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.
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.
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>
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.
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.
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
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.
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
Martin Liska [Fri, 15 Oct 2021 15:55:08 +0000 (17:55 +0200)]
Support thread pool section in HTML documentation.
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
W. Felix Handte [Mon, 11 Oct 2021 19:57:29 +0000 (15:57 -0400)]
Convert Outer Control Structure to Loop
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.
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.
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
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
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
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
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/
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/
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/
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/
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
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.
W. Felix Handte [Thu, 9 Sep 2021 21:17:46 +0000 (17:17 -0400)]
Update results.csv
W. Felix Handte [Thu, 9 Sep 2021 21:01:31 +0000 (17:01 -0400)]
Simplify DMS Implementation by Removing noDict Support
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
W. Felix Handte [Thu, 9 Sep 2021 20:39:29 +0000 (16:39 -0400)]
Nit: Rename Function
W. Felix Handte [Wed, 8 Sep 2021 20:47:26 +0000 (16:47 -0400)]
Nit: Unnest Blocks that Don't Declare Anything
W. Felix Handte [Wed, 8 Sep 2021 20:41:43 +0000 (16:41 -0400)]
Search One Last Position
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`).
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!
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.
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.
W. Felix Handte [Thu, 2 Sep 2021 16:15:58 +0000 (12:15 -0400)]
Pull Match Found Stuff Out of the Loop
W. Felix Handte [Thu, 2 Sep 2021 16:03:49 +0000 (12:03 -0400)]
Extract Working Variables
W. Felix Handte [Wed, 1 Sep 2021 21:50:53 +0000 (17:50 -0400)]
Track Step Rather than Recalculating (+0.5% Speed)
W. Felix Handte [Wed, 1 Sep 2021 21:26:19 +0000 (17:26 -0400)]
Extract Single-Segment Variant of ZSTD_dfast
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
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
Nick Terrell [Wed, 29 Sep 2021 16:48:47 +0000 (09:48 -0700)]
Merge pull request #2803 from terrelln/linux-kernel-ci
[contrib][linux-kernel] Add standard warnings and -Werror to CI
Nick Terrell [Wed, 29 Sep 2021 16:48:17 +0000 (09:48 -0700)]
Merge pull request #2802 from solbjorn/fix-kernel-wundef
[contrib][linux] Fix -Wundef inside Linux kernel tree
Nick Terrell [Wed, 29 Sep 2021 16:47:17 +0000 (09:47 -0700)]
Merge pull request #2810 from 3nids/patch-1
add missing BUNDLE DESTINATION
sen [Wed, 29 Sep 2021 16:44:07 +0000 (12:44 -0400)]
Merge pull request #2755 from senhuang42/skip_long_matches_lazy
Skip most long matches in lazy hash table update
Denis Rouzaud [Wed, 29 Sep 2021 05:09:08 +0000 (07:09 +0200)]
add missing BUNDLE DESTINATION
fixes build on iOS