]> git.ipfire.org Git - thirdparty/zstd.git/log
thirdparty/zstd.git
2 years agoReorder Definitions in zstd_opt.c to Group Under Macro Guards (Slightly) 3623/head
W. Felix Handte [Mon, 22 May 2023 16:41:48 +0000 (12:41 -0400)] 
Reorder Definitions in zstd_opt.c to Group Under Macro Guards (Slightly)

2 years agoReorder Definitions in zstd_lazy.c to Group Under Macro Guards
W. Felix Handte [Mon, 22 May 2023 16:37:03 +0000 (12:37 -0400)] 
Reorder Definitions in zstd_lazy.c to Group Under Macro Guards

2 years agoAlso Allow/Document/Test Excluding dfast and Up
W. Felix Handte [Thu, 4 May 2023 16:31:41 +0000 (12:31 -0400)] 
Also Allow/Document/Test Excluding dfast and Up

2 years agoAdd Documentation to lib/README.md
W. Felix Handte [Thu, 4 May 2023 16:20:02 +0000 (12:20 -0400)] 
Add Documentation to lib/README.md

2 years agoAlso Reorganize Zstd Opt Declarations
W. Felix Handte [Mon, 24 Apr 2023 20:53:30 +0000 (16:53 -0400)] 
Also Reorganize Zstd Opt Declarations

2 years agoRemove blockCompressor NULL Checks
W. Felix Handte [Mon, 24 Apr 2023 18:50:54 +0000 (14:50 -0400)] 
Remove blockCompressor NULL Checks

2 years agoAbort if Unsupported Parameters Used
W. Felix Handte [Mon, 24 Apr 2023 15:50:01 +0000 (11:50 -0400)] 
Abort if Unsupported Parameters Used

2 years agoRe-Order Lazy Declarations; Minimize ifndefs
W. Felix Handte [Mon, 24 Apr 2023 14:40:52 +0000 (10:40 -0400)] 
Re-Order Lazy Declarations; Minimize ifndefs

2 years agoAdd CI Test for Excluding Matchfinders
W. Felix Handte [Fri, 21 Apr 2023 20:14:27 +0000 (16:14 -0400)] 
Add CI Test for Excluding Matchfinders

2 years agoAdd ZSTD_LIB_EXCLUDE_COMPRESSORS_DFAST_AND_UP Build Variable
W. Felix Handte [Fri, 21 Apr 2023 20:14:11 +0000 (16:14 -0400)] 
Add ZSTD_LIB_EXCLUDE_COMPRESSORS_DFAST_AND_UP Build Variable

2 years agoDefine Macros for Possibly-Present Functions; Use Them Rather than Ifdef Guards
W. Felix Handte [Fri, 21 Apr 2023 15:32:41 +0000 (11:32 -0400)] 
Define Macros for Possibly-Present Functions; Use Them Rather than Ifdef Guards

2 years agoMerge Ultra and Ultra2 Exclusion
W. Felix Handte [Thu, 20 Apr 2023 15:53:23 +0000 (11:53 -0400)] 
Merge Ultra and Ultra2 Exclusion

Ultra2 does not exist for dict compression, and so uses ultra. So ultra must
be present if ultra2 is.

2 years agoTweak Ultra/Opt Guards
W. Felix Handte [Thu, 20 Apr 2023 15:46:29 +0000 (11:46 -0400)] 
Tweak Ultra/Opt Guards

2 years agoAvoid Ratio Regression Tests When Compressors are Excluded
W. Felix Handte [Thu, 20 Apr 2023 15:46:04 +0000 (11:46 -0400)] 
Avoid Ratio Regression Tests When Compressors are Excluded

2 years agoAdjust Strategy in CParams to Avoid Using Excluded Block Compressors
W. Felix Handte [Wed, 19 Apr 2023 21:53:40 +0000 (17:53 -0400)] 
Adjust Strategy in CParams to Avoid Using Excluded Block Compressors

2 years agoMacro-Exclude Block Compressors from Declaration/Definition
W. Felix Handte [Wed, 19 Apr 2023 19:38:04 +0000 (15:38 -0400)] 
Macro-Exclude Block Compressors from Declaration/Definition

2 years agoNULL Out Block Compressor Table Entries When Excluded
W. Felix Handte [Wed, 19 Apr 2023 16:19:56 +0000 (12:19 -0400)] 
NULL Out Block Compressor Table Entries When Excluded

Don't check about excluding `ZSTD_fast`. It's always included so that we know
we can resolve downwards and hit a strategy that's present.

2 years agoAllow `ZSTD_selectBlockCompressor()` to Return NULL
W. Felix Handte [Wed, 19 Apr 2023 15:41:51 +0000 (11:41 -0400)] 
Allow `ZSTD_selectBlockCompressor()` to Return NULL

Return an error rather than segfaulting.

2 years agoMerge pull request #3634 from facebook/dependabot/github_actions/github/codeql-action... 3645/head
Felix Handte [Mon, 1 May 2023 15:06:07 +0000 (08:06 -0700)] 
Merge pull request #3634 from facebook/dependabot/github_actions/github/codeql-action-2.3.2

Bump github/codeql-action from 2.3.0 to 2.3.2

2 years agoBump github/codeql-action from 2.3.0 to 2.3.2 3634/head
dependabot[bot] [Mon, 1 May 2023 06:04:02 +0000 (06:04 +0000)] 
Bump github/codeql-action from 2.3.0 to 2.3.2

Bumps [github/codeql-action](https://github.com/github/codeql-action) from 2.3.0 to 2.3.2.
- [Release notes](https://github.com/github/codeql-action/releases)
- [Changelog](https://github.com/github/codeql-action/blob/main/CHANGELOG.md)
- [Commits](https://github.com/github/codeql-action/compare/b2c19fb9a2a485599ccf4ed5d65527d94bc57226...f3feb00acb00f31a6f60280e6ace9ca31d91c76a)

---
updated-dependencies:
- dependency-name: github/codeql-action
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
2 years agoMerge pull request #3629 from facebook/dependabot/github_actions/github/codeql-action...
Elliot Gorokhovsky [Wed, 26 Apr 2023 02:58:25 +0000 (22:58 -0400)] 
Merge pull request #3629 from facebook/dependabot/github_actions/github/codeql-action-2.3.0

Bump github/codeql-action from 2.2.11 to 2.3.0

2 years agoBump github/codeql-action from 2.2.11 to 2.3.0 3629/head
dependabot[bot] [Mon, 24 Apr 2023 06:03:24 +0000 (06:03 +0000)] 
Bump github/codeql-action from 2.2.11 to 2.3.0

Bumps [github/codeql-action](https://github.com/github/codeql-action) from 2.2.11 to 2.3.0.
- [Release notes](https://github.com/github/codeql-action/releases)
- [Changelog](https://github.com/github/codeql-action/blob/main/CHANGELOG.md)
- [Commits](https://github.com/github/codeql-action/compare/d186a2a36cc67bfa1b860e6170d37fb9634742c7...b2c19fb9a2a485599ccf4ed5d65527d94bc57226)

---
updated-dependencies:
- dependency-name: github/codeql-action
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>
2 years agoMerge pull request #3624 from danlark1/patch-4
Yann Collet [Thu, 20 Apr 2023 17:46:20 +0000 (10:46 -0700)] 
Merge pull request #3624 from danlark1/patch-4

Disable unused variable warning in msan configurations

2 years agoDisable unused variable warning in msan configurations 3624/head
Daniel Kutenin [Thu, 20 Apr 2023 10:14:08 +0000 (11:14 +0100)] 
Disable unused variable warning in msan configurations

2 years agoMerge pull request #3614 from mredig/darwin-fat
Yann Collet [Wed, 19 Apr 2023 22:06:36 +0000 (15:06 -0700)] 
Merge pull request #3614 from mredig/darwin-fat

add makefile entry to build fat binary on macos

2 years agoMerge pull request #3620 from facebook/errata_128k
Yann Collet [Wed, 19 Apr 2023 18:31:16 +0000 (11:31 -0700)] 
Merge pull request #3620 from facebook/errata_128k

[doc] add decoder errata paragraph

2 years agoadded golden file for the new decompressor erratum 3620/head
Yann Collet [Wed, 19 Apr 2023 07:24:35 +0000 (00:24 -0700)] 
added golden file for the new decompressor erratum

2 years agoAdd ZSTD_d_maxBlockSize parameter
Nick Terrell [Sat, 15 Apr 2023 00:06:24 +0000 (17:06 -0700)] 
Add ZSTD_d_maxBlockSize parameter

Reduces memory when blocks are guaranteed to be smaller than allowed by
the format. This is useful for streaming compression in conjunction with
ZSTD_c_maxBlockSize.

This PR saves 2 * (formatMaxBlockSize - paramMaxBlockSize) when streaming.
Once it is rebased on top of PR #3616 it will save
3 * (formatMaxBlockSize - paramMaxBlockSize).

2 years agoMerge pull request #3621 from facebook/remove_CIs
Yann Collet [Tue, 18 Apr 2023 00:54:40 +0000 (17:54 -0700)] 
Merge pull request #3621 from facebook/remove_CIs

removed travis & appveyor scripts

2 years agoReduce streaming decompression memory by 128KB
Nick Terrell [Fri, 14 Apr 2023 21:27:06 +0000 (14:27 -0700)] 
Reduce streaming decompression memory by 128KB

The split literals buffer patch increased streaming decompression memory
by 64KB (shrunk lit buffer from 128KB to 64KB, and added 128KB). This
patch removes the added 128KB buffer, because it isn't necessary.

The buffer was there because the literals compression code didn't know
the true `blockSizeMax` of the frame, and always put split literals so
they ended 128KB - 32 from the beginning of the block. Instead, we can
pass down the true `blockSizeMax` and ensure that the split literals
end up at `blockSizeMax - 32` from the beginning of the block. We
already reserve a full `blockSizeMax` bytes in streaming mode, so we
won't be overwriting the extDict window.

2 years agoremoved travis & appveyor scripts 3621/head
Yann Collet [Mon, 17 Apr 2023 22:50:31 +0000 (15:50 -0700)] 
removed travis & appveyor scripts

we don't employ these CI systems anymore

2 years agoadded decoder errata paragraph
Yann Collet [Mon, 17 Apr 2023 22:43:27 +0000 (15:43 -0700)] 
added decoder errata paragraph

for compressed blocks of size exactly 128 KB
which used to be disallowed by the spec
but have become allowed in more recent version of the spec.

While this limitation is fixed in decoders v1.5.4+,
implementers should refrain from generating such block with their custom encoder
as they could be misclassified as corrupted by older decoder versions.

2 years agoMerge pull request #3619 from facebook/dependabot/github_actions/actions/checkout...
Yann Collet [Mon, 17 Apr 2023 06:50:36 +0000 (23:50 -0700)] 
Merge pull request #3619 from facebook/dependabot/github_actions/actions/checkout-3.5.2

Bump actions/checkout from 3.5.0 to 3.5.2

2 years agoBump actions/checkout from 3.5.0 to 3.5.2 3619/head
dependabot[bot] [Mon, 17 Apr 2023 06:02:27 +0000 (06:02 +0000)] 
Bump actions/checkout from 3.5.0 to 3.5.2

Bumps [actions/checkout](https://github.com/actions/checkout) from 3.5.0 to 3.5.2.
- [Release notes](https://github.com/actions/checkout/releases)
- [Changelog](https://github.com/actions/checkout/blob/main/CHANGELOG.md)
- [Commits](https://github.com/actions/checkout/compare/8f4b7f84864484a7bf31766abe9204da3cbe65b3...8e5e7e5ab8b370d6c329ec480221332ada57f0ab)

---
updated-dependencies:
- dependency-name: actions/checkout
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
2 years agoadd makefile entry to build fat binary on macos 3614/head
Michael Redig [Thu, 13 Apr 2023 23:43:06 +0000 (18:43 -0500)] 
add makefile entry to build fat binary on macos

2 years ago[oss-fuzz] Fix simple_round_trip fuzzer with overlapping decompression
Nick Terrell [Wed, 12 Apr 2023 23:00:28 +0000 (16:00 -0700)] 
[oss-fuzz] Fix simple_round_trip fuzzer with overlapping decompression

When `ZSTD_c_maxBlockSize` is set, we weren't computing the
decompression margin correctly, leading to `dstSize_tooSmall` errors.
Fix that computation.

This is just a bug in the fuzzer, not a bug in the library itself.

Credit to OSS-Fuzz

2 years agoMerge pull request #3606 from facebook/dependabot/github_actions/github/codeql-action...
Felix Handte [Mon, 10 Apr 2023 15:32:54 +0000 (08:32 -0700)] 
Merge pull request #3606 from facebook/dependabot/github_actions/github/codeql-action-2.2.11

Bump github/codeql-action from 2.2.9 to 2.2.11

2 years agoMerge pull request #3607 from facebook/dependabot/github_actions/cygwin/cygwin-instal...
Yann Collet [Mon, 10 Apr 2023 08:30:20 +0000 (01:30 -0700)] 
Merge pull request #3607 from facebook/dependabot/github_actions/cygwin/cygwin-install-action-4

Bump cygwin/cygwin-install-action from 3 to 4

2 years agoBump cygwin/cygwin-install-action from 3 to 4 3607/head
dependabot[bot] [Mon, 10 Apr 2023 06:00:18 +0000 (06:00 +0000)] 
Bump cygwin/cygwin-install-action from 3 to 4

Bumps [cygwin/cygwin-install-action](https://github.com/cygwin/cygwin-install-action) from 3 to 4.
- [Release notes](https://github.com/cygwin/cygwin-install-action/releases)
- [Commits](https://github.com/cygwin/cygwin-install-action/compare/f5e0f048310c425e84bc789f493a828c6dc80a25...006ad0b0946ca6d0a3ea2d4437677fa767392401)

---
updated-dependencies:
- dependency-name: cygwin/cygwin-install-action
  dependency-type: direct:production
  update-type: version-update:semver-major
...

Signed-off-by: dependabot[bot] <support@github.com>
2 years agoBump github/codeql-action from 2.2.9 to 2.2.11 3606/head
dependabot[bot] [Mon, 10 Apr 2023 06:00:15 +0000 (06:00 +0000)] 
Bump github/codeql-action from 2.2.9 to 2.2.11

Bumps [github/codeql-action](https://github.com/github/codeql-action) from 2.2.9 to 2.2.11.
- [Release notes](https://github.com/github/codeql-action/releases)
- [Changelog](https://github.com/github/codeql-action/blob/main/CHANGELOG.md)
- [Commits](https://github.com/github/codeql-action/compare/04df1262e6247151b5ac09cd2c303ac36ad3f62b...d186a2a36cc67bfa1b860e6170d37fb9634742c7)

---
updated-dependencies:
- dependency-name: github/codeql-action
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
2 years agoAdd new line + [no-] to mmap-dict help output (#3601)
daniellerozenblit [Thu, 6 Apr 2023 17:01:58 +0000 (13:01 -0400)] 
Add new line + [no-] to mmap-dict help output (#3601)

2 years agoMerge pull request #3600 from Kim-SSi/dev
Yann Collet [Wed, 5 Apr 2023 16:27:11 +0000 (09:27 -0700)] 
Merge pull request #3600 from Kim-SSi/dev

Add win32 to windows-artifacts.yml

2 years agoChange to use strategy.matrix 3600/head
Kim [Wed, 5 Apr 2023 08:22:29 +0000 (20:22 +1200)] 
Change to use strategy.matrix

2 years agoAdd win32 to windows-artifacts.yml
Kim [Wed, 5 Apr 2023 06:35:58 +0000 (18:35 +1200)] 
Add win32 to windows-artifacts.yml

2 years agoMerge pull request #3587 from facebook/dependabot/github_actions/github/codeql-action...
Yann Collet [Tue, 4 Apr 2023 23:53:55 +0000 (16:53 -0700)] 
Merge pull request #3587 from facebook/dependabot/github_actions/github/codeql-action-2.2.9

Bump github/codeql-action from 2.2.8 to 2.2.9

2 years agoMerge pull request #3588 from facebook/dependabot/github_actions/ossf/scorecard-actio...
Yann Collet [Tue, 4 Apr 2023 23:53:28 +0000 (16:53 -0700)] 
Merge pull request #3588 from facebook/dependabot/github_actions/ossf/scorecard-action-2.1.3

Bump ossf/scorecard-action from 2.1.2 to 2.1.3

2 years agoMerge pull request #3593 from facebook/appvbadge 3595/head
Yann Collet [Tue, 4 Apr 2023 01:25:06 +0000 (18:25 -0700)] 
Merge pull request #3593 from facebook/appvbadge

removed Appveyor Badge

2 years agoMerge pull request #3592 from facebook/overRead_magicless
Yann Collet [Tue, 4 Apr 2023 00:46:37 +0000 (17:46 -0700)] 
Merge pull request #3592 from facebook/overRead_magicless

fix potential over-reads

2 years agoremoved Appveyor Badge 3593/head
Yann Collet [Tue, 4 Apr 2023 00:40:39 +0000 (17:40 -0700)] 
removed Appveyor Badge

as we don't use Appveyor CI anymore.

2 years agofixing potential over-reads 3592/head
Yann Collet [Mon, 3 Apr 2023 23:52:32 +0000 (16:52 -0700)] 
fixing potential over-reads

detected by @terrelln,
these issue could be triggered in specific scenarios
namely decompression of certain invalid magic-less frames,
or requested properties from certain invalid skippable frames.

2 years agoMerge pull request #3591 from felixhandte/win-rel-artifact-name 3590/head
Felix Handte [Mon, 3 Apr 2023 20:46:17 +0000 (13:46 -0700)] 
Merge pull request #3591 from felixhandte/win-rel-artifact-name

Rename/Restructure Windows Release Artifact

2 years agoRename/Restructure Windows Release Artifact 3591/head
W. Felix Handte [Mon, 3 Apr 2023 19:00:05 +0000 (15:00 -0400)] 
Rename/Restructure Windows Release Artifact

https://github.com/facebook/zstd/releases/tag/v1.5.0 describes the structure
we want to adhere to. This commit tries to accomplish that automatically, so
we can avoid manual fixups on future releases.

2 years agoMerge pull request #3589 from facebook/fix3583
Yann Collet [Mon, 3 Apr 2023 17:58:49 +0000 (10:58 -0700)] 
Merge pull request #3589 from facebook/fix3583

fix #3583

2 years agofix #3583 3589/head
Yann Collet [Mon, 3 Apr 2023 16:45:11 +0000 (09:45 -0700)] 
fix #3583

As reported by @georgmu,
the previous fix is undone by the later initialization.
Switch order, so that initialization is adjusted by special case.

2 years agoBump ossf/scorecard-action from 2.1.2 to 2.1.3 3588/head
dependabot[bot] [Mon, 3 Apr 2023 06:00:58 +0000 (06:00 +0000)] 
Bump ossf/scorecard-action from 2.1.2 to 2.1.3

Bumps [ossf/scorecard-action](https://github.com/ossf/scorecard-action) from 2.1.2 to 2.1.3.
- [Release notes](https://github.com/ossf/scorecard-action/releases)
- [Changelog](https://github.com/ossf/scorecard-action/blob/main/RELEASE.md)
- [Commits](https://github.com/ossf/scorecard-action/compare/e38b1902ae4f44df626f11ba0734b14fb91f8f86...80e868c13c90f172d68d1f4501dee99e2479f7af)

---
updated-dependencies:
- dependency-name: ossf/scorecard-action
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
2 years agoBump github/codeql-action from 2.2.8 to 2.2.9 3587/head
dependabot[bot] [Mon, 3 Apr 2023 06:00:54 +0000 (06:00 +0000)] 
Bump github/codeql-action from 2.2.8 to 2.2.9

Bumps [github/codeql-action](https://github.com/github/codeql-action) from 2.2.8 to 2.2.9.
- [Release notes](https://github.com/github/codeql-action/releases)
- [Changelog](https://github.com/github/codeql-action/blob/main/CHANGELOG.md)
- [Commits](https://github.com/github/codeql-action/compare/67a35a08586135a9573f4327e904ecbf517a882d...04df1262e6247151b5ac09cd2c303ac36ad3f62b)

---
updated-dependencies:
- dependency-name: github/codeql-action
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
2 years agoupdated changelog 3585/head
Yann Collet [Thu, 30 Mar 2023 00:20:15 +0000 (17:20 -0700)] 
updated changelog

in preparation for v1.5.5

2 years agoupdated version number to v1.5.5
Yann Collet [Tue, 28 Mar 2023 23:43:33 +0000 (16:43 -0700)] 
updated version number to v1.5.5

also : updated man pages

2 years agoMerge pull request #3584 from facebook/fix_o_blockdev
Yann Collet [Sat, 1 Apr 2023 06:01:50 +0000 (23:01 -0700)] 
Merge pull request #3584 from facebook/fix_o_blockdev

fix decompression with -o writing into a block device

2 years agoCheck that `dest` is valid for decompression (#3555)
daniellerozenblit [Sat, 1 Apr 2023 06:00:55 +0000 (02:00 -0400)] 
Check that `dest` is valid for decompression (#3555)

* add check for valid dest buffer and fuzz on random dest ptr when malloc 0

* add uptrval to linux-kernel

* remove bin files

* get rid of uptrval

* restrict max pointer value check to platforms where sizeof(size_t) == sizeof(void*)

2 years agodo not add invocation of UTIL_isRegularFile() 3584/head
Yann Collet [Fri, 31 Mar 2023 20:09:52 +0000 (13:09 -0700)] 
do not add invocation of UTIL_isRegularFile()

2 years agoMerge pull request #3581 from facebook/seekable_readOpt
Yann Collet [Fri, 31 Mar 2023 19:26:16 +0000 (12:26 -0700)] 
Merge pull request #3581 from facebook/seekable_readOpt

Seekable format read optimization

2 years agoMerge pull request #3579 from facebook/clangclwintest
Yann Collet [Fri, 31 Mar 2023 19:26:01 +0000 (12:26 -0700)] 
Merge pull request #3579 from facebook/clangclwintest

added a Clang-CL Windows test to CI

2 years agoMerge pull request #3540 from dvoropaev/tests_timeout
Yann Collet [Fri, 31 Mar 2023 19:25:38 +0000 (12:25 -0700)] 
Merge pull request #3540 from dvoropaev/tests_timeout

Increase tests timeout

2 years agoMerge pull request #3576 from zhuhan0/dev
Yann Collet [Fri, 31 Mar 2023 19:25:13 +0000 (12:25 -0700)] 
Merge pull request #3576 from zhuhan0/dev

Couple tweaks to improve decompression speed with clang PGO compilation

2 years agofix decompression with -o writing into a block device
Yann Collet [Fri, 31 Mar 2023 18:13:52 +0000 (11:13 -0700)] 
fix decompression with -o writing into a block device

decompression features automatic support of sparse files,
aka a form of "compression" where entire blocks consists only of zeroes.
This only works for some compatible file systems (like ext4),
others simply ignore it (like afs).

Triggering this feature relies of `fseek()`.
But `fseek()` is not compatible with non-seekable devices, such as pipes.
Therefore it's disabled for pipes.

However, there are other objects which are not compatible with `fseek()`, such as block devices.

Changed the logic, so that `fseek()` (and therefore sparse write) is only automatically enabled on regular files.

Note that this automatic behavior can always be overridden by explicit commands `--sparse` and `--no-sparse`.

fix #3583

2 years agoseekable_format: Add unit test for multiple decompress calls 3581/head
Yoni Gilad [Tue, 22 Mar 2022 16:24:09 +0000 (18:24 +0200)] 
seekable_format: Add unit test for multiple decompress calls

This does the following:
1. Compress test data into multiple frames
2. Perform a series of small decompressions and seeks forward, checking
   that compressed data wasn't reread unnecessarily.
3. Perform some seeks forward and backward to ensure correctness.

2 years agoseekable_format: Prevent rereading frame when seeking forward
Yoni Gilad [Thu, 17 Feb 2022 17:46:29 +0000 (19:46 +0200)] 
seekable_format: Prevent rereading frame when seeking forward

When decompressing a seekable file, if seeking forward within
a frame (by issuing multiple ZSTD_seekable_decompress calls
with a small gap between them), the frame will be unnecessarily
reread from the beginning. This patch makes it continue using
the current frame data and simply skip over the unneeded bytes.

2 years agoadded a Clang-CL Windows test to CI 3579/head
Yann Collet [Wed, 29 Mar 2023 00:37:23 +0000 (17:37 -0700)] 
added a Clang-CL Windows test to CI

If I understand correctly,
this should trigger the issue notified in #3569.

2 years agoMerge pull request #3569 from tru/linker_flag_fix
Yann Collet [Wed, 29 Mar 2023 05:05:07 +0000 (22:05 -0700)] 
Merge pull request #3569 from tru/linker_flag_fix

Disable linker flag detection on MSVC/ClangCL.

2 years agoMerge pull request #3573 from facebook/dependabot/github_actions/github/codeql-action...
Yann Collet [Tue, 28 Mar 2023 23:59:41 +0000 (16:59 -0700)] 
Merge pull request #3573 from facebook/dependabot/github_actions/github/codeql-action-2.2.8

Bump github/codeql-action from 2.2.6 to 2.2.8

2 years agommap for windows (#3557)
daniellerozenblit [Tue, 28 Mar 2023 23:44:53 +0000 (19:44 -0400)] 
mmap for windows (#3557)

* mmap for windows

* remove enabling mmap for testing

* rename FIO dictionary initialization methods + un-const dictionary objects in free functions

* remove enabling mmap for testing

* initDict returns void, underlying setDictBuffer methods return the size of the set buffer

* fix comment

2 years agoRemove clang-only branch hints from ZSTD_decodeSequence 3576/head
Han Zhu [Tue, 28 Mar 2023 21:33:50 +0000 (14:33 -0700)] 
Remove clang-only branch hints from ZSTD_decodeSequence

Looking at the __builtin_expect in ZSTD_decodeSequence:

{   size_t offset;
    #if defined(__clang__)
 if (LIKELY(ofBits > 1)) {
    #else
 if (ofBits > 1) {
    #endif
 ZSTD_STATIC_ASSERT(ZSTD_lo_isLongOffset == 1);

From profile-annotated assembly, the probability of ofBits > 1 is about 75%
(101k counts out of 135k counts). This is much smaller than the recommended
likelihood to use __builtin_expect which is 99%. As a result, clang moved the
else block further away which hurts cache locality. Removing this
__built_expect along with two others in ZSTD_decodeSequence gave better
performance when PGO is enabled. I suggest to remove these branch hints and
rely on PGO which leverages runtime profiles from actual workload to calculate
branch probability instead.

2 years agoInline BIT_reloadDStream
Han Zhu [Mon, 27 Mar 2023 22:57:55 +0000 (15:57 -0700)] 
Inline BIT_reloadDStream

Inlining `BIT_reloadDStream` provided >3% decompression speed improvement for
clang PGO-optimized zstd binary, measured using the Silesia corpus with
compression level 1. The win comes from improved register allocation which leads
to fewer spills and reloads. Take a look at this comparison of
profile-annotated hot assembly before and after this change:
https://www.diffchecker.com/UjDGIyLz/. The diff is a bit messy, but notice three
fewer moves after inlining.

In general LLVM's register allocator works better when it can see more code. For
example, when the register allocator sees a call instruction, it partitions the
registers into caller registers and callee registers, and it is not free to do
whatever it wants with all the registers for the current function. Inlining the
callee lets the register allocation access all registers and use them more
flexsibly.

2 years agoMerge pull request #3551 from embg/seq_prod_fuzz
Elliot Gorokhovsky [Tue, 28 Mar 2023 21:20:54 +0000 (14:20 -0700)] 
Merge pull request #3551 from embg/seq_prod_fuzz

Provide an interface for fuzzing sequence producer plugins

2 years agoProvide an interface for fuzzing sequence producer plugins 3551/head
Elliot Gorokhovsky [Tue, 14 Mar 2023 16:40:53 +0000 (09:40 -0700)] 
Provide an interface for fuzzing sequence producer plugins

2 years agoMerge pull request #3568 from facebook/readme_cmake_fat
Yann Collet [Tue, 28 Mar 2023 17:48:39 +0000 (10:48 -0700)] 
Merge pull request #3568 from facebook/readme_cmake_fat

Add instructions for building Universal2 on macOS via CMake

2 years agoMerge pull request #3574 from felixhandte/pzstd-max-cpp-std
Felix Handte [Mon, 27 Mar 2023 23:44:07 +0000 (16:44 -0700)] 
Merge pull request #3574 from felixhandte/pzstd-max-cpp-std

[contrib/pzstd] Detect and Select Maximum Available C++ Standard

2 years agoSwitch Strategies: Only Set `-std=c++11` When Default is Older 3574/head
W. Felix Handte [Mon, 27 Mar 2023 22:37:19 +0000 (18:37 -0400)] 
Switch Strategies: Only Set `-std=c++11` When Default is Older

2 years agoUpdate README.md 3568/head
Yann Collet [Mon, 27 Mar 2023 16:09:22 +0000 (09:09 -0700)] 
Update README.md

fix minor doc mistake (`ninja build` doesn't work)

2 years agoMerge pull request #3570 from facebook/rsync_doc
Yann Collet [Mon, 27 Mar 2023 16:07:13 +0000 (09:07 -0700)] 
Merge pull request #3570 from facebook/rsync_doc

[easy] minor doc update for --rsyncable

2 years ago[contrib/pzstd] Detect and Select Maximum Available C++ Standard
W. Felix Handte [Mon, 27 Mar 2023 15:24:47 +0000 (11:24 -0400)] 
[contrib/pzstd] Detect and Select Maximum Available C++ Standard

Rather than remove the flag entirely, as proposed in #3499, this commit uses
the newest C++ standard the compiler supports. This retains the selection of
using only standardized features (excluding GNU extensions) and keeps the
recency requirements of the codebase explicit.

Tested with various versions of `g++` and `clang++`.

2 years agoMerge pull request #3572 from facebook/dependabot/github_actions/actions/checkout...
Yann Collet [Mon, 27 Mar 2023 14:07:55 +0000 (07:07 -0700)] 
Merge pull request #3572 from facebook/dependabot/github_actions/actions/checkout-3.5.0

Bump actions/checkout from 3.3.0 to 3.5.0

2 years agoBump github/codeql-action from 2.2.6 to 2.2.8 3573/head
dependabot[bot] [Mon, 27 Mar 2023 06:06:11 +0000 (06:06 +0000)] 
Bump github/codeql-action from 2.2.6 to 2.2.8

Bumps [github/codeql-action](https://github.com/github/codeql-action) from 2.2.6 to 2.2.8.
- [Release notes](https://github.com/github/codeql-action/releases)
- [Changelog](https://github.com/github/codeql-action/blob/main/CHANGELOG.md)
- [Commits](https://github.com/github/codeql-action/compare/16964e90ba004cdf0cd845b866b5df21038b7723...67a35a08586135a9573f4327e904ecbf517a882d)

---
updated-dependencies:
- dependency-name: github/codeql-action
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
2 years agoBump actions/checkout from 3.3.0 to 3.5.0 3572/head
dependabot[bot] [Mon, 27 Mar 2023 06:06:05 +0000 (06:06 +0000)] 
Bump actions/checkout from 3.3.0 to 3.5.0

Bumps [actions/checkout](https://github.com/actions/checkout) from 3.3.0 to 3.5.0.
- [Release notes](https://github.com/actions/checkout/releases)
- [Changelog](https://github.com/actions/checkout/blob/main/CHANGELOG.md)
- [Commits](https://github.com/actions/checkout/compare/ac593985615ec2ede58e132d2e21d2b1cbd6127c...8f4b7f84864484a7bf31766abe9204da3cbe65b3)

---
updated-dependencies:
- dependency-name: actions/checkout
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>
2 years agominor doc update on --rsyncable 3570/head
Yann Collet [Thu, 23 Mar 2023 09:05:13 +0000 (03:05 -0600)] 
minor doc update on --rsyncable

as requested by @devZer0.
fix #3567

2 years agoMerge branch 'readme_cmake_fat' of github.com:facebook/zstd into readme_cmake_fat
Rick Mark [Thu, 23 Mar 2023 16:44:06 +0000 (09:44 -0700)] 
Merge branch 'readme_cmake_fat' of github.com:facebook/zstd into readme_cmake_fat

2 years agoAdd instructions for building Universal2 on macOS via CMake
Rick Mark [Wed, 22 Mar 2023 18:28:03 +0000 (11:28 -0700)] 
Add instructions for building Universal2 on macOS via CMake

2 years agoDisable linker flag detection on MSVC/ClangCL. 3569/head
Tobias Hieta [Wed, 22 Mar 2023 21:13:57 +0000 (22:13 +0100)] 
Disable linker flag detection on MSVC/ClangCL.

This fixes compilation with clang-cl on Windows. There
is a bug in cmake so that check_linker_flag() doesn't give
the correct result when using link.exe/lld-link.exe.

Details in CMake's gitlab: https://gitlab.kitware.com/cmake/cmake/-/issues/22023

Fixes #3522

2 years agoAdd instructions for building Universal2 on macOS via CMake
Rick Mark [Wed, 22 Mar 2023 18:28:03 +0000 (11:28 -0700)] 
Add instructions for building Universal2 on macOS via CMake

2 years agofix window update (#3556)
daniellerozenblit [Tue, 21 Mar 2023 17:28:26 +0000 (13:28 -0400)] 
fix window update (#3556)

2 years ago[lazy] Skip over incompressible data
Nick Terrell [Fri, 10 Mar 2023 01:26:07 +0000 (17:26 -0800)] 
[lazy] Skip over incompressible data

Every 256 bytes the lazy match finders process without finding a match,
they will increase their step size by 1. So for bytes [0, 256) they search
every position, for bytes [256, 512) they search every other position,
and so on. However, they currently still insert every position into
their hash tables. This is different from fast & dfast, which only
insert the positions they search.

This PR changes that, so now after we've searched 2KB without finding
any matches, at which point we'll only be searching one in 9 positions,
we'll stop inserting every position, and only insert the positions we
search. The exact cutoff of 2KB isn't terribly important, I've just
selected a cutoff that is reasonably large, to minimize the impact on
"normal" data.

This PR only adds skipping to greedy, lazy, and lazy2, but does not
touch btlazy2.

| Dataset | Level | Compiler     | CSize ∆ | Speed ∆ |
|---------|-------|--------------|---------|---------|
| Random  |     5 | clang-14.0.6 |    0.0% |   +704% |
| Random  |     5 | gcc-12.2.0   |    0.0% |   +670% |
| Random  |     7 | clang-14.0.6 |    0.0% |   +679% |
| Random  |     7 | gcc-12.2.0   |    0.0% |   +657% |
| Random  |    12 | clang-14.0.6 |    0.0% |  +1355% |
| Random  |    12 | gcc-12.2.0   |    0.0% |  +1331% |
| Silesia |     5 | clang-14.0.6 | +0.002% |  +0.35% |
| Silesia |     5 | gcc-12.2.0   | +0.002% |  +2.45% |
| Silesia |     7 | clang-14.0.6 | +0.001% |  -1.40% |
| Silesia |     7 | gcc-12.2.0   | +0.007% |  +0.13% |
| Silesia |    12 | clang-14.0.6 | +0.011% | +22.70% |
| Silesia |    12 | gcc-12.2.0   | +0.011% |  -6.68% |
| Enwik8  |     5 | clang-14.0.6 |    0.0% |  -1.02% |
| Enwik8  |     5 | gcc-12.2.0   |    0.0% |  +0.34% |
| Enwik8  |     7 | clang-14.0.6 |    0.0% |  -1.22% |
| Enwik8  |     7 | gcc-12.2.0   |    0.0% |  -0.72% |
| Enwik8  |    12 | clang-14.0.6 |    0.0% | +26.19% |
| Enwik8  |    12 | gcc-12.2.0   |    0.0% |  -5.70% |

The speed difference for clang at level 12 is real, but is probably
caused by some sort of alignment or codegen issues. clang is
significantly slower than gcc before this PR, but gets up to parity with
it.

I also measured the ratio difference for the HC match finder, and it
looks basically the same as the row-based match finder. The speedup on
random data looks similar. And performance is about neutral, without the
big difference at level 12 for either clang or gcc.

2 years agoSimplify line splitting in the CLI tests
Peter Pentchev [Sat, 18 Mar 2023 20:43:56 +0000 (22:43 +0200)] 
Simplify line splitting in the CLI tests

2 years agoFix a Python bytes/int mismatch in CLI tests
Peter Pentchev [Sat, 18 Mar 2023 20:32:42 +0000 (22:32 +0200)] 
Fix a Python bytes/int mismatch in CLI tests

In Python 3.x, a single element of a bytes array is returned as
an integer number. Thus, NEWLINE is an int variable, and attempting
to add it to the line array will fail with a type mismatch error
that may be demonstrated as follows:

    [roam@straylight ~]$ python3 -c 'b"hello" + b"\n"[0]'
    Traceback (most recent call last):
      File "<string>", line 1, in <module>
    TypeError: can't concat int to bytes
    [roam@straylight ~]$

2 years agoMerge pull request #3553 from facebook/ldm_dict
Yann Collet [Thu, 16 Mar 2023 18:20:32 +0000 (11:20 -0700)] 
Merge pull request #3553 from facebook/ldm_dict

added documentation for LDM + dictionary compatibility

2 years agoDeprecated bufferless and block level APIs
Nick Terrell [Tue, 24 Jan 2023 20:21:49 +0000 (12:21 -0800)] 
Deprecated bufferless and block level APIs

* Mark all bufferless and block level functions as deprecated
* Update documentation to suggest not using these functions
* Add `_deprecated()` wrappers for functions that we use internally and
  call those instead

2 years agopatch-from speed optimization (#3545)
daniellerozenblit [Wed, 15 Mar 2023 00:36:56 +0000 (20:36 -0400)] 
patch-from speed optimization (#3545)

* patch-from speed optimization: only load portion of dictionary into normal matchfinders

* test regression for x8 multiplier

* fix off-by-one error for bit shift bound

* restrict patchfrom speed optimization to strategy < ZSTD_btultra

* update results.csv

* update regression test

2 years agoadded documentation for LDM + dictionary compatibility 3553/head
Yann Collet [Wed, 15 Mar 2023 00:17:21 +0000 (17:17 -0700)] 
added documentation for LDM + dictionary compatibility

2 years agoMerge pull request #3547 from facebook/seekable_doc
Yann Collet [Tue, 14 Mar 2023 03:25:58 +0000 (20:25 -0700)] 
Merge pull request #3547 from facebook/seekable_doc

added documentation for the seekable format

2 years agoAdd salt into row hash (#3528 part 2) (#3533)
Yonatan Komornik [Mon, 13 Mar 2023 22:34:13 +0000 (15:34 -0700)] 
Add salt into row hash (#3528 part 2) (#3533)

Part 2 of #3528

Adds hash salt that helps to avoid regressions where consecutive compressions use the same tag space with similar data (running zstd -b5e7 enwik8 -B128K reproduces this regression).