]> git.ipfire.org Git - thirdparty/zstd.git/log
thirdparty/zstd.git
2 years agoci: test pkg-config file 3267/head
Andrea Pappacoda [Tue, 20 Sep 2022 20:13:23 +0000 (22:13 +0200)] 
ci: test pkg-config file

As mentioned in
https://github.com/facebook/zstd/pull/3252#issuecomment-1251733791 ,
this patch adds a CI job that builds and installs libzstd on the job
runner, and then compiles a sample binary linking against the installed
library; the needed build flags are passed by invoking pkg-config.

2 years agoMerge pull request #3252 from Tachi107/build-cmake-pkg-config-always
Yann Collet [Tue, 20 Sep 2022 18:31:15 +0000 (11:31 -0700)] 
Merge pull request #3252 from Tachi107/build-cmake-pkg-config-always

build(cmake): improve pkg-config generation

2 years agoMerge pull request #3265 from DimitriPapadopoulos/actions
Yann Collet [Tue, 20 Sep 2022 18:30:26 +0000 (11:30 -0700)] 
Merge pull request #3265 from DimitriPapadopoulos/actions

Update GitHub Actions

2 years agoUpdate GitHub Actions 3265/head
Dimitri Papadopoulos [Tue, 20 Sep 2022 07:15:09 +0000 (09:15 +0200)] 
Update GitHub Actions

2 years agoMerge pull request #3199 from JunHe77/comp
Yann Collet [Mon, 19 Sep 2022 17:49:10 +0000 (10:49 -0700)] 
Merge pull request #3199 from JunHe77/comp

compress:check more bytes to reduce ZSTD_count call

2 years agoMerge pull request #3245 from haampie/fix/SED_ERE_OPT
Yann Collet [Mon, 19 Sep 2022 17:48:11 +0000 (10:48 -0700)] 
Merge pull request #3245 from haampie/fix/SED_ERE_OPT

drop -E flag in sed

2 years agoMerge pull request #3247 from haampie/fix/grep
Yann Collet [Mon, 19 Sep 2022 17:47:38 +0000 (10:47 -0700)] 
Merge pull request #3247 from haampie/fix/grep

Fix make variable

2 years agoMerge pull request #3264 from sashashura/patch-1
Yann Collet [Mon, 19 Sep 2022 17:47:00 +0000 (10:47 -0700)] 
Merge pull request #3264 from sashashura/patch-1

GitHub Workflows security hardening

2 years agobuild: harden GitHub Workflow permissions 3264/head
Alex [Mon, 19 Sep 2022 15:51:59 +0000 (17:51 +0200)] 
build: harden GitHub Workflow permissions
Signed-off-by: Alex Low <aleksandrosansan@gmail.com>
2 years agocompress:check more bytes to reduce ZSTD_count call 3199/head
Jun He [Fri, 24 Jun 2022 09:07:06 +0000 (17:07 +0800)] 
compress:check more bytes to reduce ZSTD_count call

Comparing 4B instead of comparing 1B in ZSTD_noDict
mode, thus it can avoid cases like match in match[ml]
but mismatch in match[ml-3]..match[ml-1]. So the call
count of ZSTD_count can be reduced.

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

2 years agoMerge pull request #3263 from daniellerozenblit/null-buffer-decompress
daniellerozenblit [Tue, 13 Sep 2022 14:07:35 +0000 (10:07 -0400)] 
Merge pull request #3263 from daniellerozenblit/null-buffer-decompress

ZSTD_decompressStream() fuzz fix

2 years agoMerge branch 'null-buffer-decompress' of github.com:daniellerozenblit/zstd into null... 3263/head
Danielle Rozenblit [Tue, 13 Sep 2022 01:57:53 +0000 (18:57 -0700)] 
Merge branch 'null-buffer-decompress' of github.com:daniellerozenblit/zstd into null-buffer-decompress

2 years agofix indentation
Danielle Rozenblit [Tue, 13 Sep 2022 01:56:59 +0000 (18:56 -0700)] 
fix indentation

2 years agoMerge pull request #3256 from facebook/clean
Yann Collet [Mon, 12 Sep 2022 20:23:34 +0000 (13:23 -0700)] 
Merge pull request #3256 from facebook/clean

streamline `make clean` list maintenance

2 years agosimplify clean target maintenance within programs/ 3256/head
Yann Collet [Mon, 12 Sep 2022 19:18:51 +0000 (12:18 -0700)] 
simplify clean target maintenance within programs/

2 years agoMerge branch 'facebook:dev' into null-buffer-decompress
daniellerozenblit [Mon, 12 Sep 2022 18:54:36 +0000 (14:54 -0400)] 
Merge branch 'facebook:dev' into null-buffer-decompress

2 years agofuzzer error fix
Danielle Rozenblit [Mon, 12 Sep 2022 18:53:37 +0000 (11:53 -0700)] 
fuzzer error fix

2 years agoMerge branch 'dev' into clean
Yann Collet [Mon, 12 Sep 2022 17:56:00 +0000 (10:56 -0700)] 
Merge branch 'dev' into clean

2 years agoMerge pull request #3262 from daniellerozenblit/sequence-bound
daniellerozenblit [Fri, 9 Sep 2022 21:40:42 +0000 (17:40 -0400)] 
Merge pull request #3262 from daniellerozenblit/sequence-bound

Add sequenceBound(srcSize) method

2 years agouse ZSTD_sequenceBound in seqBench 3262/head
Danielle Rozenblit [Fri, 9 Sep 2022 20:04:41 +0000 (13:04 -0700)] 
use ZSTD_sequenceBound in seqBench

2 years agoMerge branch 'facebook:dev' into sequence-bound
daniellerozenblit [Fri, 9 Sep 2022 19:57:05 +0000 (15:57 -0400)] 
Merge branch 'facebook:dev' into sequence-bound

2 years agoMerge pull request #3257 from embg/seqBench2
Elliot Gorokhovsky [Fri, 9 Sep 2022 19:53:28 +0000 (15:53 -0400)] 
Merge pull request #3257 from embg/seqBench2

Benchmark program for sequence compression API

2 years agoadd sequence bound function
Danielle Rozenblit [Fri, 9 Sep 2022 19:34:25 +0000 (12:34 -0700)] 
add sequence bound function

2 years agoMerge pull request #3259 from DimitriPapadopoulos/codespell
Elliot Gorokhovsky [Fri, 9 Sep 2022 15:15:05 +0000 (11:15 -0400)] 
Merge pull request #3259 from DimitriPapadopoulos/codespell

Fix typos found by codespell

2 years agoMerge pull request #3258 from daniellerozenblit/null-buffer-decompress
daniellerozenblit [Fri, 9 Sep 2022 13:39:59 +0000 (09:39 -0400)] 
Merge pull request #3258 from daniellerozenblit/null-buffer-decompress

Fix undefined behavior in ZSTD_decompressStream()

2 years agosome additional comments, remove apt-get from clang jobs, better test titles 3258/head
Danielle Rozenblit [Fri, 9 Sep 2022 01:30:07 +0000 (18:30 -0700)] 
some additional comments, remove apt-get from clang jobs, better test titles

2 years agoFix typos found by codespell 3259/head
Dimitri Papadopoulos [Thu, 8 Sep 2022 21:12:23 +0000 (23:12 +0200)] 
Fix typos found by codespell

2 years agoskip flush operation in case where op is NULL
Danielle Rozenblit [Thu, 8 Sep 2022 20:53:13 +0000 (13:53 -0700)] 
skip flush operation in case where op is NULL

2 years agoternary operator instead of if statement
Danielle Rozenblit [Thu, 8 Sep 2022 19:59:49 +0000 (12:59 -0700)] 
ternary operator instead of if statement

2 years agoremove 32-bit ubsan clang test (bug in clang that produces an error)
Danielle Rozenblit [Thu, 8 Sep 2022 19:04:57 +0000 (12:04 -0700)] 
remove 32-bit ubsan clang test (bug in clang that produces an error)

2 years agoBenchmark program for sequence compression API 3257/head
Elliot Gorokhovsky [Mon, 5 Sep 2022 09:44:56 +0000 (02:44 -0700)] 
Benchmark program for sequence compression API

2 years agoadd clang jobs for ubsan in github workflow
Danielle Rozenblit [Thu, 8 Sep 2022 16:00:39 +0000 (09:00 -0700)] 
add clang jobs for ubsan in github workflow

2 years agofix zero offset to nullpointer errors
Danielle Rozenblit [Thu, 8 Sep 2022 00:52:26 +0000 (17:52 -0700)] 
fix zero offset to nullpointer errors

2 years agostreamline `make clean` list maintenance
Yann Collet [Wed, 7 Sep 2022 23:10:13 +0000 (16:10 -0700)] 
streamline `make clean` list maintenance

When creating a new `Makefile` target to build,
it's also necessary to update the `clean` target,
which purpose is to remove built targets when they are present.

This process is simple, but it's also easy to forget :
since there is a large distance between the position in the `Makefile` where the new built target is added,
and the place where the list of files to `clean` is defined.
Moreover, the list of files becomes pretty long over time,
hence it's difficult to visually ensure that all built targets are present there,
or that no old target (no longer produced) is no longer in the list

This PR tries to improve this process by adding a CLEAN variable.
Now, when a new built target is added to the `Makefile`,
it should preceded by :
```
CLEAN += newTarget
newTarget:
<TAB> ...recipe...
```

This new requirement is somewhat similar to `.PHONY: newTarget` for non-built targets.

This new method offers the advantage of locality :
there is no separate place in the file to maintain a list of files to clean.
This makes maintenance of `make clean` easier.

2 years agorevert change
Danielle Rozenblit [Wed, 7 Sep 2022 19:37:25 +0000 (12:37 -0700)] 
revert change

2 years agodo not recover pointer overflow for testing
Danielle Rozenblit [Wed, 7 Sep 2022 19:21:54 +0000 (12:21 -0700)] 
do not recover pointer overflow for testing

2 years agoadded zstreamtest_ubsan to make file + added ubsan zstreamtest job for CI tests
Danielle Rozenblit [Wed, 7 Sep 2022 18:54:17 +0000 (11:54 -0700)] 
added zstreamtest_ubsan to make file + added ubsan zstreamtest job for CI tests

2 years agoadded test that exposes zero offset to null pointer error when built with clang
Danielle Rozenblit [Wed, 7 Sep 2022 15:58:08 +0000 (08:58 -0700)] 
added test that exposes zero offset to null pointer error when built with clang

2 years agoremove zstream_ubsan from git and add to gitignore
Danielle Rozenblit [Wed, 7 Sep 2022 14:40:43 +0000 (07:40 -0700)] 
remove zstream_ubsan from git and add to gitignore

2 years agonull decompress buffer test and ubsan flag added 3253/head 3254/head
Danielle Rozenblit [Tue, 6 Sep 2022 21:34:55 +0000 (14:34 -0700)] 
null decompress buffer test and ubsan flag added

2 years agobuild(cmake): improve pkg-config generation 3252/head
Andrea Pappacoda [Sun, 28 Aug 2022 11:01:20 +0000 (13:01 +0200)] 
build(cmake): improve pkg-config generation

With this patch the pkg-config generation when using the CMake build
system is improved in the following ways:

- Libs.private is now filled when needed
- The JoinPaths module is now used to join paths, leading to simpler
  code
- The .pc file is always generated, regardless of the platform, as it
  can also be consumed on Windows

Here's how the .pc file is affected by these changes, in comparison to
the one generated with the official Makefiles:

    $ diff -s lib/libzstd.pc build/cmake/build-old/lib/libzstd.pc
    15c15
    < Libs.private: -pthread
    ---
    > Libs.private:

    $ diff -s lib/libzstd.pc build/cmake/build-new/lib/libzstd.pc
    Files lib/libzstd.pc and build/cmake/build-new/lib/libzstd.pc are
    identical

2 years agoFix make variable 3247/head
Harmen Stoppels [Fri, 19 Aug 2022 10:06:43 +0000 (12:06 +0200)] 
Fix make variable

2 years agodrop -E flag in sed 3245/head
Harmen Stoppels [Fri, 19 Aug 2022 10:00:32 +0000 (12:00 +0200)] 
drop -E flag in sed

2 years agoMerge pull request #3241 from wahern/wahern-combine-sh-faster
Yann Collet [Tue, 16 Aug 2022 23:09:43 +0000 (16:09 -0700)] 
Merge pull request #3241 from wahern/wahern-combine-sh-faster

restore combine.sh bash performance while still sticking to POSIX

2 years agoMerge pull request #3230 from grossws/fix3229-docs
Elliot Gorokhovsky [Tue, 16 Aug 2022 16:48:23 +0000 (12:48 -0400)] 
Merge pull request #3230 from grossws/fix3229-docs

Add description for ZSTD_decompressStream and ZSTD_initDStream

2 years agoDocument pass-through behavior (#3242)
Chris Burgess [Mon, 15 Aug 2022 17:29:54 +0000 (13:29 -0400)] 
Document pass-through behavior (#3242)

Adds documentation to help and man pages for legacy pass-through behavior
when force is set and destination is stdout. Documents --pass-through in
man pages

2 years agoescape glob pattern special characters in subject string before generating search... 3241/head
William Ahern [Thu, 11 Aug 2022 03:58:55 +0000 (20:58 -0700)] 
escape glob pattern special characters in subject string before generating search patterns in combine.sh list_has_item

2 years agorestore combine.sh bash performance while still sticking to POSIX
William Ahern [Wed, 10 Aug 2022 23:51:17 +0000 (16:51 -0700)] 
restore combine.sh bash performance while still sticking to POSIX

2 years agoMerge pull request #3235 from facebook/docTraining
Yann Collet [Mon, 8 Aug 2022 19:06:49 +0000 (12:06 -0700)] 
Merge pull request #3235 from facebook/docTraining

[easy] added a few documentation words about dictionary training

2 years agoAdd description for ZSTD_decompressStream and ZSTD_initDStream 3230/head
Konstantin Gribov [Mon, 1 Aug 2022 20:50:54 +0000 (23:50 +0300)] 
Add description for ZSTD_decompressStream and ZSTD_initDStream

With that these functions become visible in generated docs.

Fixes #3229

2 years agoadded a few documentation words about dictionary training 3235/head
Yann Collet [Fri, 5 Aug 2022 15:09:22 +0000 (17:09 +0200)] 
added a few documentation words about dictionary training

partially answering questions such as #3233
which looks for guidance within `exmaples/`.

3 years agoAdd explicit --pass-through flag and default to enabled for *cat (#3223)
Nick Terrell [Fri, 5 Aug 2022 00:15:59 +0000 (17:15 -0700)] 
Add explicit --pass-through flag and default to enabled for *cat (#3223)

Fixes #3211.

Adds the `--[no-]pass-through` flag which enables/disables pass-through mode.

* `zstdcat`, `zcat`, and `gzcat` default to `--pass-through`.
  Pass-through mode can be disabled by passing `--no-pass-through`.
* All other binaries default to not setting pass-through mode.
  However, we preserve the legacy behavior of enabling pass-through
  mode when writing to stdout with `-f` set, unless pass-through
  mode is explicitly disabled with `--no-pass-through`.

Adds a new test for this behavior that should codify the behavior we want.

3 years agofix issue #3144 (#3226)
zengyijing [Thu, 4 Aug 2022 20:51:14 +0000 (16:51 -0400)] 
fix issue #3144 (#3226)

* fix issue #3144

* add test case for verbose-wlog

Co-authored-by: zengyijing <yijingzeng@fb.com>
3 years agoMerge pull request #3232 from facebook/fileiotypes_nomemh
Yann Collet [Wed, 3 Aug 2022 20:57:16 +0000 (22:57 +0200)] 
Merge pull request #3232 from facebook/fileiotypes_nomemh

fileio_types.h : avoid dependency on mem.h

3 years agoMerge pull request #3231 from facebook/fileio_missingInclude
Yann Collet [Wed, 3 Aug 2022 20:48:05 +0000 (22:48 +0200)] 
Merge pull request #3231 from facebook/fileio_missingInclude

[easy] fixed missing include

3 years agofileio_types.h : avoid dependency on mem.h 3232/head
Yann Collet [Wed, 3 Aug 2022 19:39:35 +0000 (21:39 +0200)] 
fileio_types.h : avoid dependency on mem.h

fileio_types.h cannot be parsed by itself
because it relies on basic types defined in `lib/common/mem.h`.
As for #3231, it likely wasn't detected because `mem.h` was probably included before within target files.
But this is not proper.

A "easy" solution would be to add the missing include,
but each dependency should be considered "bad" by default,
and only allowed if it brings some tangible value.

In this case, since these types are only used to declare internal structure variables
which are effectively only flags,
I believe it's really not valuable to add a dependency on `mem.h` for this purpose
while the standard `int` type can do the same job.

I was expecting some compiler warnings following this change,
but it turns out we don't use `-Wconversion` by default on `zstd` source code,
so there is none.

Nevertheless, I enabled `-Wconversion` locally and proceeded to fix a few conversion warnings in the process.

Adding `-Wconversion` to the list of flags used for `zstd` is something I would be favorable over the long term,
but it cannot be done overnight,
because the nb of places where this warning is triggered is daunting.
Better progressively reduce the nb of triggered `-Wconversion` warnings before enabling this flag by default.

3 years agominor : fixed missing include 3231/head
Yann Collet [Wed, 3 Aug 2022 18:52:15 +0000 (20:52 +0200)] 
minor : fixed missing include

I presume it was not detected before
because "fileio.h" is probably always included after "util.h".

3 years agoFix off-by-one error in superblock mode (#3221)
Nick Terrell [Wed, 3 Aug 2022 18:28:39 +0000 (11:28 -0700)] 
Fix off-by-one error in superblock mode (#3221)

Fixes #3212.

Long literal and match lengths had an off-by-one error in ZSTD_getSequenceLength.
Fix the off-by-one error, and add a golden compression test that catches the bug.
Also run all the golden tests in the cli-tests framework.

3 years agoMerge pull request #3196 from mileshu/dev
Felix Handte [Tue, 2 Aug 2022 16:34:04 +0000 (12:34 -0400)] 
Merge pull request #3196 from mileshu/dev

[T124890272] Mark 2 Obsolete Functions(ZSTD_copy*Ctx) Deprecated in Zstd

3 years agoMerge branch 'dev' of https://github.com/mileshu/zstd into dev 3196/head
Miles Hu [Tue, 2 Aug 2022 05:52:47 +0000 (22:52 -0700)] 
Merge branch 'dev' of https://github.com/mileshu/zstd into dev

3 years ago[T124890272] Mark 2 Obsolete Functions(ZSTD_copy*Ctx) Deprecated in Zstd
Miles HU [Wed, 13 Jul 2022 18:00:05 +0000 (11:00 -0700)] 
[T124890272] Mark 2 Obsolete Functions(ZSTD_copy*Ctx) Deprecated in Zstd

The discussion for this task is here: facebook/zstd#3128.

This task can probably be scoped to the first part: marking these functions deprecated.
We'll later look at removal when we roll out v1.6.0.

3 years agoDeprecate ZSTD_getDecompressedSize() (#3225)
Nick Terrell [Mon, 1 Aug 2022 18:52:14 +0000 (11:52 -0700)] 
Deprecate ZSTD_getDecompressedSize() (#3225)

Fixes #3158.

Mark ZSTD_getDecompressedSize() as deprecated and replaced by ZSTD_getFrameContentSize().

3 years agoMerge pull request #3220 from embg/issue3200
Elliot Gorokhovsky [Mon, 1 Aug 2022 18:04:57 +0000 (14:04 -0400)] 
Merge pull request #3220 from embg/issue3200

Disallow empty string as argument for --output-dir-flat and --output-dir-mirror

3 years agoFix hash4Ptr for big endian (#3227)
Qiongsi Wu [Mon, 1 Aug 2022 17:41:24 +0000 (13:41 -0400)] 
Fix hash4Ptr for big endian (#3227)

3 years agostdin multiple file fixes (#3222)
Yonatan Komornik [Fri, 29 Jul 2022 23:13:07 +0000 (16:13 -0700)] 
stdin multiple file fixes (#3222)

* Fixes for https://github.com/facebook/zstd/issues/3206 - bugs when handling stdin as part of multiple files.

* new line at end of multiple-files.sh

3 years agoDisallow empty output directory 3220/head
Elliot Gorokhovsky [Fri, 29 Jul 2022 21:44:22 +0000 (14:44 -0700)] 
Disallow empty output directory

3 years agoAdd warning when multi-thread decompression is requested (#3208)
Tom Wang [Fri, 29 Jul 2022 19:51:58 +0000 (12:51 -0700)] 
Add warning when multi-thread decompression is requested (#3208)

When user pass in argument for both decompression and multi-thread, print a warning message
to indicate that multi-threaded decompression is not supported.

* Add warning when multi-thread decompression is requested
* add test case for multi-threaded decoding warning
   Expectation is for -d -T0 we will not throw any warning,
   and see warning for any other -d -T(>1) inputs

3 years agoFix small file passthrough (#3215)
Chris Burgess [Fri, 29 Jul 2022 19:22:46 +0000 (15:22 -0400)] 
Fix small file passthrough (#3215)

3 years agozlibWrapper: Update for zlib 1.2.12 (#3217)
orbea [Fri, 29 Jul 2022 19:22:10 +0000 (12:22 -0700)] 
zlibWrapper: Update for zlib 1.2.12 (#3217)

In zlib 1.2.12 the OF macro was changed to _Z_OF breaking any
project that used zlibWrapper. To fix this the OF has been
changed to _Z_OF everywhere and _Z_OF is defined as OF in the
case it is not yet defined for zlib 1.2.11 and older.

Fixes: https://github.com/facebook/zstd/issues/3216
3 years ago[AIX] Fix Compiler Flags and Bugs on AIX to Pass All Tests (#3219)
Qiongsi Wu [Fri, 29 Jul 2022 19:21:59 +0000 (15:21 -0400)] 
[AIX] Fix Compiler Flags and Bugs on AIX to Pass All Tests (#3219)

* Fixing compiler warnings

* Replace the old -s flag with the -Wl,-s flag

* Fixing compiler warnings

* Fixing the linker strip flag and tests/code not working as expected on AIX

3 years agoFix buffer underflow for null dir1
Elliot Gorokhovsky [Fri, 29 Jul 2022 18:10:47 +0000 (11:10 -0700)] 
Fix buffer underflow for null dir1

3 years agolib: add hint to generate more pipeline friendly code (#3138)
Jun He [Fri, 29 Jul 2022 17:28:04 +0000 (01:28 +0800)] 
lib: add hint to generate more pipeline friendly code (#3138)

With statistic data of test data files of silesia
the chance of position beyond highThreshold is very
low (~1.3%@L8 in most cases, all <2.5%), and is in
"lowprob area". Add the branch hint so compiler can
get better pipiline codegen.
With this change it is observed ~1% of mozilla and
xml, and slight (0.3%~0.8%) but consistent uplift on
other files on Arm N1.

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

3 years agodecomp: add prefetch for matched seq on aarch64 (#3164)
Jun He [Fri, 29 Jul 2022 17:27:20 +0000 (01:27 +0800)] 
decomp: add prefetch for matched seq on aarch64 (#3164)

match is used for following sequence copy. It is
only updated when extDict is needed, which is a
low probability case. So it can be prefetched to
reduce cache miss.
The benchmarks on various Arm platforms showed
uplift from 1% ~ 14% with gcc-11/clang-14.

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

3 years agoAdd transparency and optimize logo (#3218)
Mathew R Gordon [Fri, 29 Jul 2022 17:17:31 +0000 (11:17 -0600)] 
Add transparency and optimize logo (#3218)

Make the front page look better in dark GH themes

3 years agoMerge pull request #3197 from embg/docstring_clarify
Elliot Gorokhovsky [Tue, 26 Jul 2022 17:26:15 +0000 (13:26 -0400)] 
Merge pull request #3197 from embg/docstring_clarify

Clarify benchmark chunking docstring

3 years agoMerge pull request #3209 from zhuhan0/dev
Elliot Gorokhovsky [Tue, 26 Jul 2022 17:19:38 +0000 (13:19 -0400)] 
Merge pull request #3209 from zhuhan0/dev

[largeNbDicts] Second try at fixing decompression segfault to always create compressInstructions

3 years ago[largeNbDicts] Second try at fixing decompression segfault to always create compressI... 3209/head
Han Zhu [Wed, 20 Jul 2022 23:01:32 +0000 (16:01 -0700)] 
[largeNbDicts] Second try at fixing decompression segfault to always create compressInstructions

Summary:
Freeing an uninitialized pointer is undefined behavior. This caused a segfault
when compiling the benchmark with Clang -O3 and benching decompression.

V2: always create compressInstructions but check if cctxParams is NULL before
setting CCtx params to avoid segfault.

Test Plan:
make and run

3 years agoMerge pull request #3205 from zhuhan0/dev
Elliot Gorokhovsky [Wed, 20 Jul 2022 20:07:04 +0000 (16:07 -0400)] 
Merge pull request #3205 from zhuhan0/dev

[contrib][largeNbDicts] Fix decompression segfault; Add additional benchmark metrics

3 years ago[largeNbDicts] Add an option to print out median speed 3205/head
Han Zhu [Wed, 20 Jul 2022 18:14:51 +0000 (11:14 -0700)] 
[largeNbDicts] Add an option to print out median speed

Summary:
Added an option -p# where -p0 (default) sets the aggregation method to fastest
speed while -p1 sets the aggregation method to median. Also added a new column
in the csv file to report this option's value.

Test Plan:
``
$ ./largeNbDicts -1 --nbDicts=1 -D ~/benchmarks/html/html_8_16K.32K.dict
~/benchmarks/html/html_8_16K/*
loading 7450 files...
created src buffer of size 83.4 MB
split input into 7450 blocks
loading dictionary /home/zhuhan/benchmarks/html/html_8_16K.32K.dict
compressing at level 1 without dictionary : Ratio=3.03  (28827863 bytes)
compressed using a 32768 bytes dictionary : Ratio=4.28  (20410262 bytes)
generating 1 dictionaries, using 0.1 MB of memory
Compression Speed : 306.0 MB/s
Fastest Speed : 310.6 MB/s

$ ./largeNbDicts -1 --nbDicts=1 -p1 -D ~/benchmarks/html/html_8_16K.32K.dict
~/benchmarks/html/html_8_16K/*
loading 7450 files...
created src buffer of size 83.4 MB
split input into 7450 blocks
loading dictionary /home/zhuhan/benchmarks/html/html_8_16K.32K.dict
compressing at level 1 without dictionary : Ratio=3.03  (28827863 bytes)
compressed using a 32768 bytes dictionary : Ratio=4.28  (20410262 bytes)
generating 1 dictionaries, using 0.1 MB of memory
Compression Speed : 306.9 MB/s
Median Speed : 298.4 MB/s
```

3 years ago[largeNbDicts] Print more metrics into csv file
Han Zhu [Tue, 19 Jul 2022 23:50:28 +0000 (16:50 -0700)] 
[largeNbDicts] Print more metrics into csv file

Summary:
Add column headers and data for whether it's a compression or a decompression
run, compression level, nbDicts and dictAttachPref in additional to
compr/decompr speed.

Test Plan:
Example output:

```
./largeNbDicts
Compression/Decompression,Level,nbDicts,dictAttachPref,Speed
Compression,1,1,0,300.9
Compression,1,1,1,296.4
Compression,1,1,2,307.8
Compression,1,10,0,292.3
Compression,1,100,0,293.3
Compression,3,110,0,106.0
Decompression,-1,110,-1,155.6
Decompression,-1,110,-1,709.4
Decompression,-1,120,-1,709.1
Decompression,-1,120,-1,734.6
```

3 years ago[largeNbDicts] Fix decompression segfault in createCompressInstructions
Han Zhu [Tue, 19 Jul 2022 20:55:48 +0000 (13:55 -0700)] 
[largeNbDicts] Fix decompression segfault in createCompressInstructions

Benchmarking decompression results in a segfault in `createCompressInstructions`
because `cctxParams` is NULL. Skip running that function if we are not benching
compression.

3 years agoIntial commit to address 3090. Added support to decompress empty block. (#3118)
udayanbapat [Thu, 14 Jul 2022 18:54:34 +0000 (11:54 -0700)] 
Intial commit to address 3090. Added support to decompress empty block. (#3118)

* Intial commit to address 3090. Added support to decompress empty block

* Update zstd_decompress_block.c

Addressed review comments for the case of 'set_basic'

* Update lib/decompress/zstd_decompress_block.c

Co-authored-by: Nick Terrell <nickrterrell@gmail.com>
* Update lib/decompress/zstd_decompress_block.c

Co-authored-by: Nick Terrell <nickrterrell@gmail.com>
Co-authored-by: Nick Terrell <nickrterrell@gmail.com>
3 years agoClarify -B docstring 3197/head
Elliot Gorokhovsky [Wed, 13 Jul 2022 20:54:29 +0000 (16:54 -0400)] 
Clarify -B docstring

3 years ago[T124890272] Mark 2 Obsolete Functions(ZSTD_copy*Ctx) Deprecated in Zstd 3187/head
Miles HU [Wed, 13 Jul 2022 18:00:05 +0000 (11:00 -0700)] 
[T124890272] Mark 2 Obsolete Functions(ZSTD_copy*Ctx) Deprecated in Zstd

The discussion for this task is here: facebook/zstd#3128.

This task can probably be scoped to the first part: marking these functions deprecated.
We'll later look at removal when we roll out v1.6.0.

3 years agoRevert "T119975957"
Miles HU [Tue, 12 Jul 2022 18:17:25 +0000 (11:17 -0700)] 
Revert "T119975957"

This reverts commit 962746edffa5340315136af34ac3331eba82c3c8.

3 years agoT119975957
Miles HU [Fri, 8 Jul 2022 22:01:36 +0000 (15:01 -0700)] 
T119975957

Signed-off-by: Miles HU <yuanpu@fb.com>
3 years agoMerge pull request #3184 from htnhan/features/list_verbose_to_show_dictionary_id
Felix Handte [Fri, 8 Jul 2022 20:04:39 +0000 (16:04 -0400)] 
Merge pull request #3184 from htnhan/features/list_verbose_to_show_dictionary_id

zstd -lv <file> to show dictID

3 years agoDetect multiple dictIDs in one file 3184/head
htnhan [Fri, 8 Jul 2022 17:20:50 +0000 (12:20 -0500)] 
Detect multiple dictIDs in one file

3 years agozstd -lv <file> to show dictID
htnhan [Wed, 6 Jul 2022 02:28:33 +0000 (21:28 -0500)] 
zstd -lv <file> to show dictID

3 years agoMerge pull request #3180 from nocnokneo/MSVCBuildTests
Elliot Gorokhovsky [Tue, 5 Jul 2022 17:13:34 +0000 (13:13 -0400)] 
Merge pull request #3180 from nocnokneo/MSVCBuildTests

Fix ZSTD_BUILD_TESTS=ON with MSVC

3 years agoFix ZSTD_BUILD_TESTS=ON build with MSVC 3180/head
Taylor Braun-Jones [Thu, 30 Jun 2022 17:20:42 +0000 (13:20 -0400)] 
Fix ZSTD_BUILD_TESTS=ON build with MSVC

Fixes:

    Command line error D8021 : invalid numeric argument '/Wno-deprecated-declarations'

3 years agoMerge pull request #3179 from embg/1.5.3_bump
Elliot Gorokhovsky [Wed, 29 Jun 2022 20:03:52 +0000 (13:03 -0700)] 
Merge pull request #3179 from embg/1.5.3_bump

Prepare v1.5.3

3 years agomake -C programs zstd.1 3179/head
Elliot Gorokhovsky [Wed, 29 Jun 2022 18:55:14 +0000 (14:55 -0400)] 
make -C programs zstd.1

3 years ago1.5.3 version bump
Elliot Gorokhovsky [Wed, 29 Jun 2022 17:11:13 +0000 (13:11 -0400)] 
1.5.3 version bump

3 years agoMerge pull request #3177 from embg/dms_prefetch2
Elliot Gorokhovsky [Fri, 24 Jun 2022 15:24:43 +0000 (08:24 -0700)] 
Merge pull request #3177 from embg/dms_prefetch2

Add prefetchCDictTables CCtxParam (+10-20% cold dict compression speed)

3 years agoNits 3177/head
Elliot Gorokhovsky [Thu, 23 Jun 2022 20:58:03 +0000 (16:58 -0400)] 
Nits

3 years agoUpdate README.md for fuzzers (#3174)
Elliot Gorokhovsky [Thu, 23 Jun 2022 01:02:07 +0000 (18:02 -0700)] 
Update README.md for fuzzers (#3174)

* Update README.md for fuzzers

* Add ls corpora/*crash command

* nit

* Clarify wording and add Nick's command

* Minor clarification

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