]> git.ipfire.org Git - thirdparty/zstd.git/log
thirdparty/zstd.git
3 years agoNits 3177/head
Elliot Gorokhovsky [Thu, 23 Jun 2022 20:58:03 +0000 (16:58 -0400)] 
Nits

3 years agoAdd tests
Elliot Gorokhovsky [Wed, 22 Jun 2022 21:05:23 +0000 (17:05 -0400)] 
Add tests

3 years agoadd prefetchCDictTables to largeNbDicts
Elliot Gorokhovsky [Wed, 22 Jun 2022 15:59:28 +0000 (08:59 -0700)] 
add prefetchCDictTables to largeNbDicts

3 years agoAdd docs
Elliot Gorokhovsky [Tue, 21 Jun 2022 22:06:48 +0000 (18:06 -0400)] 
Add docs

3 years agoAdd prefetchCDictTables CCtxParam
Elliot Gorokhovsky [Tue, 21 Jun 2022 15:59:27 +0000 (11:59 -0400)] 
Add prefetchCDictTables CCtxParam

3 years agoMerge pull request #3175 from facebook/fix3169
Yann Collet [Wed, 22 Jun 2022 18:21:09 +0000 (11:21 -0700)] 
Merge pull request #3175 from facebook/fix3169

Streaming decompression can detect incorrect header ID sooner

3 years agoStreaming decompression can detect incorrect header ID sooner 3175/head
Yann Collet [Wed, 22 Jun 2022 01:14:11 +0000 (18:14 -0700)] 
Streaming decompression can detect incorrect header ID sooner

Streaming decompression used to wait for a minimum of 5 bytes before attempting decoding.
This meant that, in the case that only a few bytes (<5) were provided,
and assuming these bytes are incorrect,
there would be no error reported.
The streaming API would simply request more data, waiting for at least 5 bytes.

This PR makes it possible to detect incorrect Frame IDs as soon as the first byte is provided.

Fix #3169

3 years ago"Short cache" optimization for level 1-4 DMS (+5-30% compression speed) (#3152)
Elliot Gorokhovsky [Tue, 21 Jun 2022 21:27:19 +0000 (14:27 -0700)] 
"Short cache" optimization for level 1-4 DMS (+5-30% compression speed) (#3152)

* first attempt at fast DMS short cache

* significant wins for some scenarios

* fix all clang regressions

* nits

* fix 1.5% gcc11 regression on hot 110Kdict scenario

* fix CI

* nit

* Add tags to doublefast hash table

* use tags in doublefast DMS

* Fix CI

* Clean up some hardcoded logic / constants

* Switch forCCtx to an enum

* nit

* add short cache to ip+1 long search

* Move tag size into hashLog

* Minor nits

* Truncate dictionaries greater than 16MB in short cache mode

* Helper function for tag comparison

* Cap short cache hashLog at 24 to prevent overflow

* size_t dictTagsMatch -> int dictTagsMatch

* nit

* Clean up and comment dictionary truncation

* Move ZSTD_tableFillPurpose_e next to ZSTD_dictTableLoadMethod_e

* Comment and expand helper functions

* Asserts and documentation

* nit

3 years agoMerge pull request #3170 from facebook/mesongnu99
Yann Collet [Tue, 21 Jun 2022 17:17:36 +0000 (10:17 -0700)] 
Merge pull request #3170 from facebook/mesongnu99

removed gnu99 statement from meson recipe

3 years agoremoved gnu99 statement from meson recipe 3170/head
Yann Collet [Mon, 20 Jun 2022 22:02:41 +0000 (15:02 -0700)] 
removed gnu99 statement from meson recipe

3 years agoMerge pull request #3167 from facebook/cmake_std
Yann Collet [Sun, 19 Jun 2022 23:49:21 +0000 (16:49 -0700)] 
Merge pull request #3167 from facebook/cmake_std

remove explicit standard setting from cmake script

3 years agoremoved explicit compilation standard from cmake script 3167/head
Yann Collet [Sun, 19 Jun 2022 21:52:32 +0000 (14:52 -0700)] 
removed explicit compilation standard from cmake script

it's not expected to be useful
and can actually lead to subtle side effects
such as #3163.

3 years agoMerge pull request #3166 from facebook/warning_clockt
Yann Collet [Sun, 19 Jun 2022 21:45:49 +0000 (14:45 -0700)] 
Merge pull request #3166 from facebook/warning_clockt

display a warning message when using C90 clock_t

3 years agodisplay a warning message when using C90 clock_t for MT speed measurements. 3166/head
Yann Collet [Sun, 19 Jun 2022 18:38:06 +0000 (11:38 -0700)] 
display a warning message when using C90 clock_t for MT speed measurements.

3 years agoupdated documentation regarding build systems
Yann Collet [Sun, 19 Jun 2022 18:12:16 +0000 (11:12 -0700)] 
updated documentation regarding build systems

3 years agoMerge pull request #3161 from embg/largeNbDictsImprovements
Elliot Gorokhovsky [Wed, 15 Jun 2022 14:39:50 +0000 (07:39 -0700)] 
Merge pull request #3161 from embg/largeNbDictsImprovements

[contrib] largeNbDicts bugfix + improvements

3 years agofix typo 3161/head
Elliot Gorokhovsky [Tue, 14 Jun 2022 23:18:49 +0000 (19:18 -0400)] 
fix typo

Co-authored-by: Nick Terrell <nickrterrell@gmail.com>
3 years agoFix FILE handle leak
Elliot Gorokhovsky [Tue, 14 Jun 2022 21:57:54 +0000 (14:57 -0700)] 
Fix FILE handle leak

3 years agoSupport advanced API so forceCopy/forceAttach works properly
Elliot Gorokhovsky [Tue, 14 Jun 2022 21:52:51 +0000 (14:52 -0700)] 
Support advanced API so forceCopy/forceAttach works properly

3 years agolargeNbDicts bugfix + improvements
Elliot Gorokhovsky [Tue, 14 Jun 2022 00:23:33 +0000 (17:23 -0700)] 
largeNbDicts bugfix + improvements

3 years agoMerge pull request #3160 from danlark1/patch-1
Elliot Gorokhovsky [Mon, 13 Jun 2022 18:01:43 +0000 (14:01 -0400)] 
Merge pull request #3160 from danlark1/patch-1

Fix big endian ARM NEON path

3 years agoFix big endian ARM NEON path 3160/head
Daniel Kutenin [Mon, 13 Jun 2022 08:16:24 +0000 (09:16 +0100)] 
Fix big endian ARM NEON path

It is not using the NEON acceleration but the bit grouping was applied

3 years agoMerge pull request #3141 from JunHe77/seqDec
Nick Terrell [Thu, 9 Jun 2022 20:40:51 +0000 (13:40 -0700)] 
Merge pull request #3141 from JunHe77/seqDec

dec: adjust seqSymbol load on aarch64

3 years agoMerge pull request #3145 from JunHe77/wildcopy
Nick Terrell [Thu, 9 Jun 2022 20:38:30 +0000 (13:38 -0700)] 
Merge pull request #3145 from JunHe77/wildcopy

common: apply two stage copy to aarch64

3 years agoMerge pull request #3157 from embg/huge_dict_bugfix
Elliot Gorokhovsky [Thu, 9 Jun 2022 19:35:29 +0000 (15:35 -0400)] 
Merge pull request #3157 from embg/huge_dict_bugfix

Bugfix for huge dictionaries

3 years agoBugfix for huge dictionaries 3157/head
Elliot Gorokhovsky [Thu, 9 Jun 2022 15:39:30 +0000 (11:39 -0400)] 
Bugfix for huge dictionaries

3 years agoupdated --single-thread man
Yann Collet [Wed, 8 Jun 2022 00:44:20 +0000 (17:44 -0700)] 
updated --single-thread man

3 years agoMerge pull request #3154 from terrelln/rsyncable-speed-fix
Nick Terrell [Mon, 6 Jun 2022 23:07:20 +0000 (16:07 -0700)] 
Merge pull request #3154 from terrelln/rsyncable-speed-fix

Remove expensive assert in --rsyncable hot loop

3 years agoRemove expensive assert in --rsyncable hot loop 3154/head
Nick Terrell [Mon, 6 Jun 2022 18:56:13 +0000 (11:56 -0700)] 
Remove expensive assert in --rsyncable hot loop

This assert slows the loop down by 10x. We can get similar
coverage by asserting at the beginning & end of the loop.

We need this fix because Debian compiles zstd with asserts
enabled. Separately, we should ask them why, and if they would
consider disabling asserts in their builds. Since we don't
optimize for assert enabled builds.

Fixes Issue #3150.

3 years agoMerge pull request #3147 from animalize/dev
Nick Terrell [Thu, 2 Jun 2022 17:04:55 +0000 (10:04 -0700)] 
Merge pull request #3147 from animalize/dev

fix leaking thread handles on Windows

3 years agoMerge pull request #3148 from ihsinme/patch-1
Yann Collet [Thu, 2 Jun 2022 16:58:45 +0000 (09:58 -0700)] 
Merge pull request #3148 from ihsinme/patch-1

simple fix

3 years agodec: adjust seqSymbol load on aarch64 3141/head
Jun He [Mon, 23 May 2022 06:25:10 +0000 (14:25 +0800)] 
dec: adjust seqSymbol load on aarch64

ZSTD_seqSymbol is a structure with total of 64 bits
wide. So it can be loaded in one operation and
extract its fields by simply shifting or extracting
on aarch64.
GCC doesn't recognize this and generates more
unnecessary ldr/ldrb/ldrh operations that cause
performance drop.
With this change it is observed 2~4% uplift of
silesia and 2.5~6% of cantrbry @L8 on Arm N1.

Signed-off-by: Jun He <jun.he@arm.com>
Change-Id: I7748909204cf78a17eb9d4f2333692d53239daa8

3 years agoUpdate zstd_compress.c 3148/head
ihsinme [Mon, 30 May 2022 11:08:19 +0000 (14:08 +0300)] 
Update zstd_compress.c

3 years agofix leaking thread handles on Windows 3147/head
Ma Lin [Mon, 30 May 2022 00:18:54 +0000 (08:18 +0800)] 
fix leaking thread handles on Windows

On Windows, thread handle should be closed explicitly.

Co-authored-by: luben karavelov <luben@users.noreply.github.com>
3 years agocommon: apply two stage copy to aarch64 3145/head
Jun He [Wed, 25 May 2022 14:26:41 +0000 (22:26 +0800)] 
common: apply two stage copy to aarch64

On aarch64 ZSTD_wildcopy uses a simple loop to do
16B based memory copy. There is existing optimized
two stage copy that can achieve better performance.
By applying this to aarch64 it is also observed ~1%
uplift in silesia corpus.

Signed-off-by: Jun He <jun.he@arm.com>
Change-Id: Ic1253308e7a8a7df2d08963ba544e086c81ce8be

3 years agoMerge pull request #3143 from facebook/fixdoc_3142
Yann Collet [Tue, 24 May 2022 17:19:14 +0000 (10:19 -0700)] 
Merge pull request #3143 from facebook/fixdoc_3142

fix small error in format documentation example

3 years agoMerge pull request #3139 from danlark1/dev
Nick Terrell [Tue, 24 May 2022 15:10:26 +0000 (11:10 -0400)] 
Merge pull request #3139 from danlark1/dev

[lazy] Optimize ZSTD_row_getMatchMask for levels 8-10 for ARM

3 years agofix small error in format documentation example 3143/head
Yann Collet [Tue, 24 May 2022 11:47:49 +0000 (04:47 -0700)] 
fix small error in format documentation example

reported by @dkcasset
fix #3142

3 years agoAgain unused error warning. Fixed 3139/head
Danila Kutenin [Mon, 23 May 2022 14:51:47 +0000 (14:51 +0000)] 
Again unused error warning. Fixed

3 years agoMove NEON version to a separate function and fix indentation
Danila Kutenin [Mon, 23 May 2022 14:49:35 +0000 (14:49 +0000)] 
Move NEON version to a separate function and fix indentation

3 years agoDisable unused variable warning
Danila Kutenin [Sun, 22 May 2022 10:50:33 +0000 (10:50 +0000)] 
Disable unused variable warning

3 years ago[lazy] Optimize ZSTD_row_getMatchMask for level 8-10
Danila Kutenin [Sun, 22 May 2022 10:34:33 +0000 (10:34 +0000)] 
[lazy] Optimize ZSTD_row_getMatchMask for level 8-10

We found that movemask is not used properly or consumes too much CPU.
This effort helps to optimize the movemask emulation on ARM.

For level 8-9 we saw 3-5% improvements. For level 10 we say 1.5%
improvement.

The key idea is not to use pure movemasks but to have groups of bits.
For rowEntries == 16, 32 we are going to have groups of size 4 and 2
respectively. It means that each bit will be duplicated within the group

Then we do AND to have only one bit set in the group so that iteration
with lowering bit `a &= (a - 1)` works as well.

Also, aarch64 does not have rotate instructions for 16 bit, only for 32
and 64, that's why we see more improvements for level 8-9.

vshrn_n_u16 instruction is used to achieve that: vshrn_n_u16 shifts by
4 every u16 and narrows to 8 lower bits. See the picture below. It's
also used in
[Folly](https://github.com/facebook/folly/blob/c5702590080aa5d0e8d666d91861d64634065132/folly/container/detail/F14Table.h#L446).
It also uses 2 cycles according to Neoverse-N{1,2} guidelines.

64 bit movemask is already well optimized. We have ongoing experiments
but were not able to validate other implementations work reliably faster.

3 years agoMerge pull request #3135 from averred/dev
Yann Collet [Fri, 20 May 2022 17:05:16 +0000 (10:05 -0700)] 
Merge pull request #3135 from averred/dev

Typo in man

3 years agoTypo in man 3135/head
Talha Khan [Fri, 20 May 2022 08:53:48 +0000 (16:53 +0800)] 
Typo in man

3 years agoMerge pull request #3127 from embg/repcode_history
Elliot Gorokhovsky [Thu, 12 May 2022 17:50:15 +0000 (13:50 -0400)] 
Merge pull request #3127 from embg/repcode_history

Correct and clarify repcode offset history logic

3 years agoNits 3127/head
Elliot Gorokhovsky [Thu, 12 May 2022 16:53:15 +0000 (12:53 -0400)] 
Nits

3 years agoMerge pull request #3129 from felixhandte/zstd-fast-nodict-unconditional-ip1-table...
Felix Handte [Wed, 11 May 2022 21:04:02 +0000 (17:04 -0400)] 
Merge pull request #3129 from felixhandte/zstd-fast-nodict-unconditional-ip1-table-write

ZSTD_fast_noDict: Avoid Safety Check When Writing `ip1` into Table

3 years agoUpdate results.csv 3129/head
W. Felix Handte [Wed, 11 May 2022 17:27:35 +0000 (10:27 -0700)] 
Update results.csv

3 years agoFix Comments Slightly
W. Felix Handte [Wed, 11 May 2022 16:38:20 +0000 (12:38 -0400)] 
Fix Comments Slightly

3 years agoHoist Hash Table Writes Up into Each Match Found Block
W. Felix Handte [Wed, 11 May 2022 15:27:34 +0000 (11:27 -0400)] 
Hoist Hash Table Writes Up into Each Match Found Block

Refactoring this way avoids the bad write in the case that `step > 4`, and
is a bit more straightforward. It also seems to perform better!

3 years agoZSTD_fast_noDict: Minimize Checks When Writing Hash Table for ip1
W. Felix Handte [Tue, 10 May 2022 21:29:39 +0000 (14:29 -0700)] 
ZSTD_fast_noDict: Minimize Checks When Writing Hash Table for ip1

This commit avoids checking whether a hashtable write is safe in two of the
three match-found paths in `ZSTD_compressBlock_fast_noDict_generic`. This pro-
duces a ~0.5% speed-up in compression.

A comment in the code describes why we can skip this check in the other two
paths (the repcode check and the first match check in the unrolled loop).

A downside is that in the new position where we make this check, we have not
yet computed `mLength`. We therefore have to avoid writing *possibly* dangerous
positions, rather than the old check which only avoids writing *actually*
dangerous positions. This leads to a miniscule loss in ratio (remember that
this scenario can only been triggered in very negative levels or under incomp-
ressibility acceleration).

3 years agoNits
Elliot Gorokhovsky [Mon, 9 May 2022 22:26:10 +0000 (18:26 -0400)] 
Nits

3 years agoCorrect and clarify repcode offset history logic
Elliot Gorokhovsky [Mon, 9 May 2022 21:17:11 +0000 (17:17 -0400)] 
Correct and clarify repcode offset history logic

3 years agoMerge pull request #3126 from embg/fix_freebsd_ci
Elliot Gorokhovsky [Mon, 9 May 2022 23:48:13 +0000 (19:48 -0400)] 
Merge pull request #3126 from embg/fix_freebsd_ci

Unbreak FreeBSD CI

3 years agoUnbreak FreeBSD CI 3126/head
Elliot Gorokhovsky [Mon, 9 May 2022 22:28:03 +0000 (18:28 -0400)] 
Unbreak FreeBSD CI

3 years agoMerge pull request #3114 from embg/fast_extdict_pipeline2
Elliot Gorokhovsky [Thu, 5 May 2022 19:06:47 +0000 (15:06 -0400)] 
Merge pull request #3114 from embg/fast_extdict_pipeline2

Software pipeline for ZSTD_compressBlock_fast_extDict

3 years agoUpdate results.csv 3114/head
Elliot Gorokhovsky [Wed, 4 May 2022 20:05:37 +0000 (16:05 -0400)] 
Update results.csv

3 years agoMerge pull request #3122 from eli-schwartz/betterlinkage
Yann Collet [Mon, 2 May 2022 17:56:37 +0000 (10:56 -0700)] 
Merge pull request #3122 from eli-schwartz/betterlinkage

meson: for internal linkage, link to both libzstd and a static copy of it

3 years agomeson: for internal linkage, link to both libzstd and a static copy of it 3122/head
Eli Schwartz [Thu, 28 Apr 2022 22:22:55 +0000 (18:22 -0400)] 
meson: for internal linkage, link to both libzstd and a static copy of it

Partial, Meson-only implementation of #2976 for non-MSVC builds.

Due to the prevalence of private symbol reuse, linking to a shared
library is simply utterly unreliable, but we still want to defer to the
shared library for installable applications. By linking to both, we can
share symbols where possible, and statically link where needed.

This means we no longer need to manually track every file that needs to
be extracted and reused.

The flip side is that MSVC completely does not support this, so for MSVC
builds we just link to a full static copy even where
-Ddefault_library=shared.

As a side benefit, by using library inclusion rather than including
extra explicit object files, the zstd program shrinks in size slightly
(~4kb).

3 years agomeson: avoid rebuilding some libzstd sources in the programs
Eli Schwartz [Tue, 10 Aug 2021 02:53:15 +0000 (22:53 -0400)] 
meson: avoid rebuilding some libzstd sources in the programs

These need to be explicitly included as we use their private symbols,
but we don't need to recompile them when we can reuse the existing
objects.

Minus 7 compile steps.

3 years agomeson: avoid rebuilding some libzstd files in the test programs
Eli Schwartz [Tue, 10 Aug 2021 03:19:52 +0000 (23:19 -0400)] 
meson: avoid rebuilding some libzstd files in the test programs

The poolTests program already linked to libzstd, and later to
libtestcommon with included libzstd objects. So this was redundant.

Minus 4 compile steps.

3 years agoRemove hasStep variant (not enough wins to justify the code size increase)
Elliot Gorokhovsky [Thu, 28 Apr 2022 22:05:39 +0000 (18:05 -0400)] 
Remove hasStep variant (not enough wins to justify the code size increase)

3 years agoFinal nit
Elliot Gorokhovsky [Thu, 28 Apr 2022 18:49:45 +0000 (14:49 -0400)] 
Final nit

3 years agoRevert "Hardcode repcode safety check, fix cosmetic nits"
Elliot Gorokhovsky [Wed, 27 Apr 2022 22:16:21 +0000 (18:16 -0400)] 
Revert "Hardcode repcode safety check, fix cosmetic nits"

This reverts commit 518cb83833074d304dfcaa93cfc16039ea4683c8.

3 years agoHardcode repcode safety check, fix cosmetic nits
Elliot Gorokhovsky [Tue, 26 Apr 2022 21:54:25 +0000 (17:54 -0400)] 
Hardcode repcode safety check, fix cosmetic nits

3 years agoMerge pull request #3117 from cuishuang/dev
Yann Collet [Tue, 26 Apr 2022 17:02:04 +0000 (10:02 -0700)] 
Merge pull request #3117 from cuishuang/dev

fix some typos

3 years agofix some typos 3117/head
cuishuang [Tue, 26 Apr 2022 09:40:23 +0000 (17:40 +0800)] 
fix some typos

Signed-off-by: cuishuang <imcusg@gmail.com>
3 years agoOptimize repcode predicate, hardcode hasStep == 0 scenario, cosmetic fixes
Elliot Gorokhovsky [Wed, 20 Apr 2022 15:50:00 +0000 (11:50 -0400)] 
Optimize repcode predicate, hardcode hasStep == 0 scenario, cosmetic fixes

3 years agoMerge pull request #3039 from eli-schwartz/meson
Yann Collet [Tue, 19 Apr 2022 22:51:19 +0000 (15:51 -0700)] 
Merge pull request #3039 from eli-schwartz/meson

Meson fixups for Windows

3 years agoMerge pull request #3112 from facebook/man2
Yann Collet [Tue, 19 Apr 2022 22:36:47 +0000 (15:36 -0700)] 
Merge pull request #3112 from facebook/man2

updated man page, providing more details for --train mode

3 years agoNits
Elliot Gorokhovsky [Tue, 19 Apr 2022 15:36:06 +0000 (11:36 -0400)] 
Nits

3 years agoPort noDict pipeline
Elliot Gorokhovsky [Thu, 14 Apr 2022 18:19:19 +0000 (14:19 -0400)] 
Port noDict pipeline

3 years agoupdated man pages 3112/head
Yann Collet [Thu, 14 Apr 2022 01:57:27 +0000 (18:57 -0700)] 
updated man pages

had to run the conversion script on Ubuntu, as it doesn't run correctly on macos anymore.

3 years agoupdated man page, providing more details for --train mode
Yann Collet [Thu, 14 Apr 2022 01:51:59 +0000 (18:51 -0700)] 
updated man page, providing more details for --train mode

following questions from #3111.

Note : only the source markdown has been updated,
the actual man page zstd.1 still need to be processed.

3 years agoMerge pull request #3094 from dirkmueller/usage_cleanup
Yann Collet [Tue, 5 Apr 2022 14:09:54 +0000 (07:09 -0700)] 
Merge pull request #3094 from dirkmueller/usage_cleanup

Split help in long and short version, cleanup formatting

3 years agoMerge pull request #3108 from paulmenzel/fix-typo-in-zstd.1
Yann Collet [Mon, 4 Apr 2022 06:12:06 +0000 (23:12 -0700)] 
Merge pull request #3108 from paulmenzel/fix-typo-in-zstd.1

Remove superfluous *not* in description of `--long[=#]` in zstd(1)

3 years agozstd.1: Remove superfluous *not* in description of `--long[=#]` 3108/head
Paul Menzel [Sun, 3 Apr 2022 05:26:49 +0000 (07:26 +0200)] 
zstd.1: Remove superfluous *not* in description of `--long[=#]`

Resolves: https://github.com/facebook/zstd/issues/3101

3 years agoDisable visual-2015 tests (#3106)
Elliot Gorokhovsky [Thu, 31 Mar 2022 16:26:20 +0000 (12:26 -0400)] 
Disable visual-2015 tests (#3106)

3 years agoMerge pull request #3103 from facebook/fix45586
Yann Collet [Wed, 30 Mar 2022 17:08:57 +0000 (10:08 -0700)] 
Merge pull request #3103 from facebook/fix45586

fix minor bug in sequence_compression_api tester

3 years agofix minor bug in sequence_compression_api tester 3103/head
Yann Collet [Tue, 29 Mar 2022 23:45:09 +0000 (16:45 -0700)] 
fix minor bug in sequence_compression_api tester

margin was merely slightly too short for extra splitting.

3 years agoSplit help in long and short version, cleanup formatting 3094/head
Dirk Müller [Thu, 10 Mar 2022 00:34:12 +0000 (01:34 +0100)] 
Split help in long and short version, cleanup formatting

Adopt the more standard Usage: formatting style
List short and long options alongside where available
Print lists as a table
Use command style description

3 years agoMerge pull request #3052 from dirkmueller/gzip_keep
Nick Terrell [Mon, 28 Mar 2022 17:35:21 +0000 (10:35 -0700)] 
Merge pull request #3052 from dirkmueller/gzip_keep

Keep original file if -c or --stdout is given

3 years agoSoftware pipeline for ZSTD_compressBlock_fast_dictMatchState (#3086)
Elliot Gorokhovsky [Thu, 17 Mar 2022 16:35:11 +0000 (09:35 -0700)] 
Software pipeline for ZSTD_compressBlock_fast_dictMatchState (#3086)

* prefetch dict content inside loop

* ip0/ip1 pipeline

* add L2_4 prefetch to dms pipeline

* Remove L1 prefetch

* Remove L2 prefetching

* Reduce # of gotos

* Cosmetic fixes

* Check final position sometimes

* Track step size as in bc768bc

* Fix nits

3 years agoMerge pull request #3095 from dpelle/typo-and-grammar-fixes
Nick Terrell [Mon, 14 Mar 2022 16:17:21 +0000 (09:17 -0700)] 
Merge pull request #3095 from dpelle/typo-and-grammar-fixes

Typo and grammar fixes

3 years agoOn more mistake (Node -> Note) 3095/head
Dominique Pelle [Sat, 12 Mar 2022 23:08:55 +0000 (00:08 +0100)] 
On more mistake (Node -> Note)

3 years agoTypo and grammar fixes
Dominique Pelle [Sat, 12 Mar 2022 07:52:40 +0000 (08:52 +0100)] 
Typo and grammar fixes

3 years agoMerge pull request #3088 from cyberknight777/dev
Nick Terrell [Fri, 11 Mar 2022 18:01:11 +0000 (10:01 -0800)] 
Merge pull request #3088 from cyberknight777/dev

[contrib][linux] Fix a warning in zstd_reset_cstream()

3 years agoMerge pull request #3093 from dirkmueller/cli_tests_fixup
Nick Terrell [Thu, 10 Mar 2022 18:41:52 +0000 (10:41 -0800)] 
Merge pull request #3093 from dirkmueller/cli_tests_fixup

Handle newer less versions in zstdless testing

3 years agoHandle newer less versions in zstdless testing 3093/head
Dirk Müller [Wed, 9 Mar 2022 23:25:05 +0000 (00:25 +0100)] 
Handle newer less versions in zstdless testing

Newer less versions appear to have changed how stderr
and stdout are showing error messages. hardcode the
expected behavior to make the tests pass with any less version.

Also set locale to C so that the strings are matching.

3 years ago[contrib][linux] Make zstd_reset_cstream() functionally identical to ZSTD_resetCStream() 3088/head
Cyber Knight [Thu, 10 Mar 2022 07:32:13 +0000 (15:32 +0800)] 
[contrib][linux] Make zstd_reset_cstream() functionally identical to ZSTD_resetCStream()

- As referenced by Nick Terrelln ~ the ZSTD maintainer in the linux kernel, making zstd_reset_cstream() functionally identical to ZSTD_resetCStream() would be the perfect way to fix the warning without touching any core functions or breaking other parts of the code.

Suggested-by: Nick Terrell <terrelln@fb.com>
Signed-off-by: Cyber Knight <cyberknight755@gmail.com>
3 years agoMerge pull request #3092 from terrelln/2022-03-09-decoder-errata-doc
Nick Terrell [Wed, 9 Mar 2022 23:10:29 +0000 (15:10 -0800)] 
Merge pull request #3092 from terrelln/2022-03-09-decoder-errata-doc

[doc] Add decompressor errata document

3 years ago[doc] Add decompressor errata document 3092/head
Nick Terrell [Wed, 9 Mar 2022 22:39:13 +0000 (14:39 -0800)] 
[doc] Add decompressor errata document

Add a document that lists the known bugs in the decoder where valid
frames are rejected, along with the version that they were fixed.

3 years agoKeep original file if -c or --stdout is given 3052/head
Dirk Müller [Mon, 7 Feb 2022 19:39:15 +0000 (20:39 +0100)] 
Keep original file if -c or --stdout is given

Set removeSrcFile back to false when -c or --stdout is used to improve
compatibility with gzip(1) behavior.

gzip(1) is removing the original file on compression unless --stdout or
/-c is used. zstd is defaulting to keep the file unless --rm is used or
when it is called via a gzip symlink, in which it is removing by
default. Specifying -c/--stdout turns this behavior off.

3 years agoMerge pull request #3059 from dirkmueller/gzip_fast_best
Felix Handte [Tue, 8 Mar 2022 20:32:06 +0000 (15:32 -0500)] 
Merge pull request #3059 from dirkmueller/gzip_fast_best

Implement more gzip compatibility (#3037)

3 years agoMerge pull request #3079 from niamster/cmake-compat-5
Yann Collet [Tue, 8 Mar 2022 08:21:23 +0000 (00:21 -0800)] 
Merge pull request #3079 from niamster/cmake-compat-5

build:cmake: enable ZSTD legacy support by default

3 years ago[contrib][linux] Use ZSTD_CCtx_setPledgedSrcSize() instead of ZSTD_CCtx_reset()
Cyber Knight [Tue, 8 Mar 2022 05:38:06 +0000 (13:38 +0800)] 
[contrib][linux] Use ZSTD_CCtx_setPledgedSrcSize() instead of ZSTD_CCtx_reset()

- The previous patch throws the following warning:

 ../linux/lib/zstd/zstd_compress_module.c: In function ‘zstd_reset_cstream’:
../linux/lib/zstd/zstd_compress_module.c:136:34: error: enum conversion when passing argument 2 of ‘ZSTD_CCtx_reset’ is invalid in C++ [-Werror=c++-compat]
  136 |  return ZSTD_CCtx_reset(cstream, pledged_src_size);
      |                                  ^~~~~~~~~~~~~~~~
In file included from ../linux/include/linux/zstd.h:26,
                 from ../linux/lib/zstd/zstd_compress_module.c:15:
../linux/include/linux/zstd_lib.h:501:20: note: expected ‘ZSTD_ResetDirective’ {aka ‘enum <anonymous>’} but argument is of type ‘long long unsigned int’
  501 | ZSTDLIB_API size_t ZSTD_CCtx_reset(ZSTD_CCtx* cctx, ZSTD_ResetDirective reset);
      |                    ^~~~~~~~~~~~~~~
cc1: all warnings being treated as errors

Since we have a choice to either use ZSTD_CCtx_reset or ZSTD_CCtx_setPledgedSrcSize instead of ZSTD_resetCStream, let's switch to ZSTD_CCtx_setPledgedSrcSize to not have any unnecessary warns alongside the kernel build and CI test build.

Signed-off-by: Cyber Knight <cyberknight755@gmail.com>
3 years ago[contrib][linux] Fix a warning in zstd_reset_cstream()
Cyber Knight [Mon, 7 Mar 2022 03:55:33 +0000 (11:55 +0800)] 
[contrib][linux] Fix a warning in zstd_reset_cstream()

- This fixes the below warning:

../lib/zstd/zstd_compress_module.c: In function 'zstd_reset_cstream':
../lib/zstd/zstd_compress_module.c:136:9: warning: 'ZSTD_resetCStream' is deprecated [-Wdeprecated-declarations]
  136 |         return ZSTD_resetCStream(cstream, pledged_src_size);
      |         ^~~~~~
In file included from ../include/linux/zstd.h:26,
                 from ../lib/zstd/zstd_compress_module.c:15:
../include/linux/zstd_lib.h:2277:8: note: declared here
 2277 | size_t ZSTD_resetCStream(ZSTD_CStream* zcs, unsigned long long pledgedSrcSize);
      |        ^~~~~~~~~~~~~~~~~

ZSTD_resetCstream is deprecated and zstd_CCtx_reset is suggested to use hence let's switch to it.

Signed-off-by: Cyber Knight <cyberknight755@gmail.com>
3 years agoMerge pull request #3060 from rex4539/typos
Yann Collet [Sat, 5 Mar 2022 22:21:58 +0000 (14:21 -0800)] 
Merge pull request #3060 from rex4539/typos

Fix typos

3 years agoFix typos 3060/head
Dimitris Apostolou [Wed, 9 Feb 2022 06:58:23 +0000 (08:58 +0200)] 
Fix typos

3 years agofix the assertion in readLinesFromFile (#3084)
Xi Ruoyao [Fri, 4 Mar 2022 19:56:44 +0000 (03:56 +0800)] 
fix the assertion in readLinesFromFile (#3084)

* fix the assertion in readLinesFromFile

When the file is not terminated by endline, readLineFromFile will append
a '\0' for the last line.  In this case pos + lineLength == dstCapacity.

* test: don't print very long text garbage