]> git.ipfire.org Git - thirdparty/zstd.git/log
thirdparty/zstd.git
2 days agoMerge pull request #4448 from Cyan4973/install_oses dev
Yann Collet [Mon, 28 Jul 2025 19:01:58 +0000 (11:01 -0800)] 
Merge pull request #4448 from Cyan4973/install_oses

regroup list of OSes for install inside common variable

2 days agoregroup list of OSes for install inside common variable 4448/head
Yann Collet [Wed, 23 Jul 2025 22:59:23 +0000 (15:59 -0700)] 
regroup list of OSes for install inside common variable

within lib/install_oses.mk.

fixes #4445

2 days agoMerge pull request #4450 from facebook/dependabot/github_actions/github/codeql-action...
Yann Collet [Mon, 28 Jul 2025 15:33:09 +0000 (07:33 -0800)] 
Merge pull request #4450 from facebook/dependabot/github_actions/github/codeql-action-3.29.4

Bump github/codeql-action from 3.28.9 to 3.29.4

3 days agoBump github/codeql-action from 3.28.9 to 3.29.4 4450/head
dependabot[bot] [Mon, 28 Jul 2025 06:30:43 +0000 (06:30 +0000)] 
Bump github/codeql-action from 3.28.9 to 3.29.4

Bumps [github/codeql-action](https://github.com/github/codeql-action) from 3.28.9 to 3.29.4.
- [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/9e8d0789d4a0fa9ceb6b1738f7e269594bdd67f0...4e828ff8d448a8a6e532957b1811f387a63867e8)

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

Signed-off-by: dependabot[bot] <support@github.com>
6 days agoMerge pull request #4447 from facebook/android-cmake
Yann Collet [Thu, 24 Jul 2025 18:07:16 +0000 (10:07 -0800)] 
Merge pull request #4447 from facebook/android-cmake

added android cmake build

7 days agoMerge pull request #4413 from arpadpanyik-arm/huf_decode2x
Yann Collet [Wed, 23 Jul 2025 23:03:37 +0000 (15:03 -0800)] 
Merge pull request #4413 from arpadpanyik-arm/huf_decode2x

AArch64: Enhance struct access in Huffman decode 2X

7 days agoMerge pull request #4443 from facebook/opt_simplify_4442
Yann Collet [Wed, 23 Jul 2025 23:01:36 +0000 (15:01 -0800)] 
Merge pull request #4443 from facebook/opt_simplify_4442

simplify sequence resolution in zstd_opt

7 days agoadded android cmake build android-cmake 4447/head
Yann Collet [Wed, 23 Jul 2025 21:54:18 +0000 (14:54 -0700)] 
added android cmake build

is expecte to fail, due to #4444

12 days agosimplify sequence resolution in zstd_opt opt_simplify_4442 4443/head
Yann Collet [Sat, 19 Jul 2025 04:21:47 +0000 (21:21 -0700)] 
simplify sequence resolution in zstd_opt

initially hinted by @pitaj in #4442

12 days agoMerge pull request #4394 from AZero13/zstd
Yann Collet [Sat, 19 Jul 2025 02:55:47 +0000 (18:55 -0800)] 
Merge pull request #4394 from AZero13/zstd

Remove redundant setting of allJobsCompleted to 1

12 days agoMerge pull request #4418 from arpadpanyik-arm/decode_seq_opt
Yann Collet [Sat, 19 Jul 2025 02:54:49 +0000 (18:54 -0800)] 
Merge pull request #4418 from arpadpanyik-arm/decode_seq_opt

AArch64: Improve ZSTD_decodeSequence performance

12 days agoMerge pull request #4435 from zijianli1234/dev
Yann Collet [Sat, 19 Jul 2025 02:54:24 +0000 (18:54 -0800)] 
Merge pull request #4435 from zijianli1234/dev

add riscv  ci

2 weeks agoMerge pull request #4429 from arpadpanyik-arm/convertSequences_Neon
Yann Collet [Mon, 14 Jul 2025 07:52:48 +0000 (23:52 -0800)] 
Merge pull request #4429 from arpadpanyik-arm/convertSequences_Neon

Improve speed of ZSTD_compressSequencesAndLiterals using Neon

2 weeks agoMerge pull request #4436 from facebook/dependabot/github_actions/cygwin/cygwin-instal...
Yann Collet [Mon, 14 Jul 2025 07:52:32 +0000 (23:52 -0800)] 
Merge pull request #4436 from facebook/dependabot/github_actions/cygwin/cygwin-install-action-6

Bump cygwin/cygwin-install-action from 5 to 6

2 weeks agoBump cygwin/cygwin-install-action from 5 to 6 4436/head
dependabot[bot] [Mon, 14 Jul 2025 06:27:46 +0000 (06:27 +0000)] 
Bump cygwin/cygwin-install-action from 5 to 6

Bumps [cygwin/cygwin-install-action](https://github.com/cygwin/cygwin-install-action) from 5 to 6.
- [Release notes](https://github.com/cygwin/cygwin-install-action/releases)
- [Commits](https://github.com/cygwin/cygwin-install-action/compare/f61179d72284ceddc397ed07ddb444d82bf9e559...f2009323764960f80959895c7bc3bb30210afe4d)

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

Signed-off-by: dependabot[bot] <support@github.com>
2 weeks agoMerge pull request #4433 from facebook/vs2025
Yann Collet [Sun, 13 Jul 2025 03:44:28 +0000 (19:44 -0800)] 
Merge pull request #4433 from facebook/vs2025

removed VS2019 runners

2 weeks agoadd -DMEM_FORCE_MEMORY_ACCESS=0 in CI RVV test 4435/head
ZijianLi [Sun, 13 Jul 2025 02:46:00 +0000 (10:46 +0800)] 
add -DMEM_FORCE_MEMORY_ACCESS=0 in CI RVV test

2 weeks agoremoved VS2019 runners vs2025 4433/head
Yann Collet [Fri, 11 Jul 2025 17:29:07 +0000 (10:29 -0700)] 
removed VS2019 runners

replaced by one vs2025 runner,
which is badly named since it still running MSVC 2022,
but it's a good test that  shows that the matrix is able to handle multiple MSVC versions.

2 weeks agoAArch64: Enable optimized QEMU CI builds 4429/head
Arpad Panyik [Tue, 8 Jul 2025 17:09:09 +0000 (17:09 +0000)] 
AArch64: Enable optimized QEMU CI builds

Add missing `-O3` flag to the compilation of AArch64 SVE2 builds
executed by QEMU. This can decrease the CI job runtime considerably.

2 weeks agoAArch64: Add Neon path for convertSequences_noRepcodes
Arpad Panyik [Tue, 8 Jul 2025 17:07:41 +0000 (17:07 +0000)] 
AArch64: Add Neon path for convertSequences_noRepcodes

Add a 4-way Neon implementation for the convertSequences_noRepcodes
function. Remove 'static' keywords from all of its implementations to
be able to add unit tests.

Relative performance to Clang-18 using: `./fullbench -b18 -l5 enwik5`

Neoverse-V2   before     after
Clang-18:    100.000%  311.703%
Clang-19:    100.191%  311.714%
Clang-20:    100.181%  311.723%
GCC-13:      107.520%  252.309%
GCC-14:      107.652%  253.158%
GCC-15:      107.674%  253.168%

Cortex-A720   before     after
Clang-18:    100.000%  204.512%
Clang-19:    102.825%  204.600%
Clang-20:    102.807%  204.558%
GCC-13:      110.668%  203.594%
GCC-14:      110.684%  203.978%
GCC-15:      102.864%  204.299%

Co-authored by, Thomas Daubney <Thomas.Daubney@arm.com>

2 weeks agoImprove ZSTD_get1BlockSummary
Arpad Panyik [Tue, 8 Jul 2025 17:05:45 +0000 (17:05 +0000)] 
Improve ZSTD_get1BlockSummary

Add a faster scalar implementation of ZSTD_get1BlockSummary which
removes the data dependency of the accumulators in the hot loop to
leverage the superscalar potential of recent out-of-order CPUs.
The new algorithm leverages SWAR (SIMD Within A Register) methodology
to exploit the capabilities of 64-bit architectures. It achieves this
by packing two 32-bit data elements into a single 64-bit register,
enabling parallel operations on these subcomponents while ensuring
that the 32-bit boundaries prevent overflow, thereby optimizing
computational efficiency.

Corresponding unit tests are included.

Relative performance to GCC-13 using: `./fullbench -b19 -l5 enwik5`

Neoverse-V2   before     after
GCC-13:      100.000%  290.527%
GCC-14:      100.000%  291.714%
GCC-15:       99.914%  291.495%
Clang-18:    148.072%  264.524%
Clang-19:    148.075%  264.512%
Clang-20:    148.062%  264.490%

Cortex-A720   before     after
GCC-13:      100.000%  235.261%
GCC-14:      101.064%  234.903%
GCC-15:      112.977%  218.547%
Clang-18:    127.135%  180.359%
Clang-19:    127.149%  180.297%
Clang-20:    127.154%  180.260%

Co-authored by, Thomas Daubney <Thomas.Daubney@arm.com>

3 weeks agoadd compiler version check.
ZijianLi [Mon, 7 Jul 2025 15:07:39 +0000 (23:07 +0800)] 
add compiler version check.

4 weeks agofix dereferencing type-punned pointer error
ZijianLi [Sun, 29 Jun 2025 07:36:25 +0000 (15:36 +0800)] 
fix dereferencing type-punned pointer error

4 weeks agoadd riscv rvv ci
ZijianLi [Sun, 29 Jun 2025 07:33:50 +0000 (15:33 +0800)] 
add riscv rvv ci

5 weeks agoMerge pull request #4414 from arpadpanyik-arm/copy8
Yann Collet [Wed, 25 Jun 2025 11:47:01 +0000 (07:47 -0400)] 
Merge pull request #4414 from arpadpanyik-arm/copy8

AArch64: Use better block COPY8

5 weeks agoRemove redundant setting of allJobsCompleted to 1 4394/head
Rose [Mon, 26 May 2025 19:56:55 +0000 (15:56 -0400)] 
Remove redundant setting of allJobsCompleted to 1

This will do it automatically.

5 weeks agoAArch64: Improve ZSTD_decodeSequence performance 4418/head
Arpad Panyik [Tue, 24 Jun 2025 11:26:58 +0000 (11:26 +0000)] 
AArch64: Improve ZSTD_decodeSequence performance

LLVM's alias-analysis sometimes fails to see that a static-array member
of a struct cannot alias other members. This patch:

- Reduces array accesses via struct indirection to aid load/store alias
  analysis under Clang.
- Converts dynamic array indexing into conditional-move arithmetic,
  eliminating branches and extra loads/stores on out-of-order CPUs.
- Reloads the bitstream only when match-length bits are consumed
  (assuming each reload only needs to happen once per match-length
  read), improving branch-prediction rates.
- Removes the UNLIKELY() hint, which recent compilers already handle
  well without cost.

Decompression uplifts on a Neoverse V2 system, using Zstd-1.5.8
compiled with "-O3 -march=armv8.2-a+sve2":

                 Clang-19  Clang-20   Clang-*    GCC-14    GCC-15
 1#silesia.tar:  +11.556%  +16.203%   +0.240%   +2.216%   +7.891%
 2#silesia.tar:  +15.493%  +21.140%   -0.041%   +2.850%   +9.926%
 3#silesia.tar:  +16.887%  +22.570%   -0.183%   +3.056%  +10.660%
 4#silesia.tar:  +17.785%  +23.315%   -0.262%   +3.343%  +11.187%
 5#silesia.tar:  +18.125%  +24.175%   -0.466%   +3.350%  +11.228%
 6#silesia.tar:  +17.607%  +23.339%   -0.591%   +3.175%  +10.851%
 7#silesia.tar:  +17.463%  +22.837%   -0.486%   +3.292%  +10.868%

* Requires Clang-21 support from LLVM commit hash
  `a53003fe23cb6c871e72d70ff2d3a075a7490da2`
   (Clang-21 hasn’t been released as of this writing)

Co-authored by:
 David Sherwood, David.Sherwood@arm.com
 Ola Liljedahl, Ola.Liljedahl@arm.com

5 weeks agoAArch64: Enhance struct access in Huffman decode 2X 4413/head
Arpad Panyik [Fri, 20 Jun 2025 15:29:17 +0000 (15:29 +0000)] 
AArch64: Enhance struct access in Huffman decode 2X

In the multi-stream multi-symbol Huffman decoder GCC generates
suboptimal code - emitting more loads for HUF_DEltX2 struct member
accesses. Forcing it to use 32-bit loads and bit arithmetic to extract
the necessary parts (UBFX) improves the overall decode speed.

Also avoid integer type conversions in the symbol decodes, which
leads to better instruction selection in table lookup accesses.

On AArch64 the decoder no longer runs into register-pressure limits,
so we can simplify the hot path and improve throughput

Decompression uplifts on a Neoverse V2 system, using Zstd-1.5.8
compiled with "-O3 -march=armv8.2-a+sve2":

                 Clang-20   Clang-*    GCC-13    GCC-14    GCC-15
 1#silesia.tar:   +0.820%   +1.365%   +2.480%   +1.348%   +0.987%
 2#silesia.tar:   +0.426%   +0.784%   +1.218%   +0.665%   +0.554%
 3#silesia.tar:   +0.112%   +0.389%   +0.508%   +0.188%   +0.261%

* Requires Clang-21 support from LLVM commit hash
  `a53003fe23cb6c871e72d70ff2d3a075a7490da2`
  (Clang-21 hasn’t been released as of this writing)

5 weeks agoMerge pull request #4417 from facebook/dependabot/github_actions/msys2/setup-msys2...
Yann Collet [Mon, 23 Jun 2025 13:32:14 +0000 (06:32 -0700)] 
Merge pull request #4417 from facebook/dependabot/github_actions/msys2/setup-msys2-2.28.0

Bump msys2/setup-msys2 from 2.27.0 to 2.28.0

5 weeks agoBump msys2/setup-msys2 from 2.27.0 to 2.28.0 4417/head
dependabot[bot] [Mon, 23 Jun 2025 06:24:00 +0000 (06:24 +0000)] 
Bump msys2/setup-msys2 from 2.27.0 to 2.28.0

Bumps [msys2/setup-msys2](https://github.com/msys2/setup-msys2) from 2.27.0 to 2.28.0.
- [Release notes](https://github.com/msys2/setup-msys2/releases)
- [Changelog](https://github.com/msys2/setup-msys2/blob/main/CHANGELOG.md)
- [Commits](https://github.com/msys2/setup-msys2/compare/61f9e5e925871ba6c9e3e8da24ede83ea27fa91f...40677d36a502eb2cf0fb808cc9dec31bf6152638)

---
updated-dependencies:
- dependency-name: msys2/setup-msys2
  dependency-version: 2.28.0
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>
5 weeks agoMerge pull request #4415 from bgilbert/buildtype
Yann Collet [Sun, 22 Jun 2025 03:31:26 +0000 (20:31 -0700)] 
Merge pull request #4415 from bgilbert/buildtype

meson: drop unused variable

5 weeks agoMerge pull request #4416 from facebook/test_largeDictionary
Yann Collet [Sat, 21 Jun 2025 19:37:08 +0000 (12:37 -0700)] 
Merge pull request #4416 from facebook/test_largeDictionary

added test-largeDictionary to dev-long CI script

5 weeks agoupdate tests duration indications test_largeDictionary 4416/head
Yann Collet [Sat, 21 Jun 2025 19:01:07 +0000 (12:01 -0700)] 
update tests duration indications

5 weeks agoadded test-largeDictionary to dev-long CI script
Yann Collet [Sat, 21 Jun 2025 17:55:34 +0000 (10:55 -0700)] 
added test-largeDictionary to dev-long CI script

5 weeks agoMerge pull request #4402 from mugitya03/tests
Yann Collet [Sat, 21 Jun 2025 18:33:44 +0000 (11:33 -0700)] 
Merge pull request #4402 from mugitya03/tests

Release resources in error paths via cleanup

5 weeks agofix 4402/head
jinyaoguo [Sat, 21 Jun 2025 17:43:47 +0000 (13:43 -0400)] 
fix

5 weeks agodelete
jinyaoguo [Sat, 21 Jun 2025 17:03:13 +0000 (13:03 -0400)] 
delete

5 weeks agomerge
jinyaoguo [Sat, 21 Jun 2025 16:57:12 +0000 (12:57 -0400)] 
merge

5 weeks agomeson: drop unused variable 4415/head
Benjamin Gilbert [Sat, 21 Jun 2025 06:34:13 +0000 (23:34 -0700)] 
meson: drop unused variable

5 weeks agoAArch64: Use better block copy8 4414/head
Arpad Panyik [Fri, 20 Jun 2025 14:48:33 +0000 (14:48 +0000)] 
AArch64: Use better block copy8

The vector copy is only necessary for 16-byte blocks on AArch64.

Decompression uplifts on a Neoverse V2 system, using Zstd-1.5.8
compiled with "-O3 -march=armv8.2-a+sve2":

                 Clang-19  Clang-20    GCC-14    GCC-15
 1#silesia.tar:   +0.316%   +0.865%   +0.025%   +0.096%
 2#silesia.tar:   +0.689%   +1.374%   +0.027%   +0.065%
 3#silesia.tar:   +0.811%   +1.654%   +0.034%   +0.033%
 4#silesia.tar:   +0.912%   +1.755%   +0.027%   +0.042%
 5#silesia.tar:   +0.995%   +1.826%   +0.062%   +0.094%
 6#silesia.tar:   +0.976%   +1.777%   +0.065%   +0.104%
 7#silesia.tar:   +0.910%   +1.738%   +0.077%   +0.110%

5 weeks agoMerge pull request #4367 from ClickHouse/cfi
Yann Collet [Fri, 20 Jun 2025 06:41:38 +0000 (23:41 -0700)] 
Merge pull request #4367 from ClickHouse/cfi

Add unwind information in huf_decompress_amd64.S

5 weeks agoMerge pull request #4412 from Cyan4973/rm_bd
Yann Collet [Thu, 19 Jun 2025 21:32:32 +0000 (14:32 -0700)] 
Merge pull request #4412 from Cyan4973/rm_bd

remove duplicate

6 weeks agoremoved duplicate 4412/head
Yann Collet [Wed, 18 Jun 2025 22:07:32 +0000 (15:07 -0700)] 
removed duplicate

this file is already present as `largeDictionary.c`

6 weeks agoMerge pull request #4411 from arpadpanyik-arm/hist_sve2
Yann Collet [Wed, 18 Jun 2025 20:48:54 +0000 (13:48 -0700)] 
Merge pull request #4411 from arpadpanyik-arm/hist_sve2

AArch64: Add SVE2 implementation of histogram computation

6 weeks agoMerge pull request #4409 from bgilbert/meson-license
Yann Collet [Mon, 16 Jun 2025 17:54:43 +0000 (10:54 -0700)] 
Merge pull request #4409 from bgilbert/meson-license

meson: use SPDX expression for license

6 weeks agoMerge pull request #4408 from mugitya03/MLK-3
Yann Collet [Mon, 16 Jun 2025 16:01:58 +0000 (09:01 -0700)] 
Merge pull request #4408 from mugitya03/MLK-3

Ensure BMK_timedFnState is always freed in benchMem

6 weeks agomeson: use SPDX expression for license 4409/head
Benjamin Gilbert [Sun, 15 Jun 2025 02:47:54 +0000 (19:47 -0700)] 
meson: use SPDX expression for license

This is the format recommended by Meson documentation.

6 weeks agoAdd unit tests for HIST_count_wksp 4411/head
Arpad Panyik [Wed, 11 Jun 2025 12:19:42 +0000 (12:19 +0000)] 
Add unit tests for HIST_count_wksp

The following tests are included:
- Empty input scenario test.
- Workspace size and alignment tests.
- Symbol out-of-range tests.
- Cover multiple input sizes, vary permitted maximum symbol
  values, and include diverse symbol distributions.

These tests verifies count table correctness, maxSymbolValuePtr
updates, and error-handling paths. It enables automated regression
of core histogram logic as well.

6 weeks agoEnsure BMK_timedFnState is always freed in benchMem 4408/head
jinyaoguo [Thu, 12 Jun 2025 23:52:58 +0000 (19:52 -0400)] 
Ensure BMK_timedFnState is always freed in benchMem

When an error occurs in BMK_isSuccessful_runOutcome, the code
previously skipped the call to BMK_freeTimedFnState(tfs),
leaking the allocated tfs object.
Fiexed by calling BMK_freeTimedFnState(tfs) before goto _cleanOut.

7 weeks agoAArch64: Add SVE2 implementation of histogram computation
Arpad Panyik [Wed, 11 Jun 2025 12:14:22 +0000 (12:14 +0000)] 
AArch64: Add SVE2 implementation of histogram computation

The existing scalar implementation uses a 4-way pipelined histogram
calculation which is very efficient on out-of-order CPUs. However,
this can be further accelerated using the SVE2 HISTSEG instructions -
which compute a histogram for 16 byte chunks in a vector register.

On a system with 128-bit vectors (VL128) we need 16 HISTSEG executions
to compute the histogram for the whole symbol space (0..255) of 16
bytes input. However we can only accumulate 15 of such 16 byte strips
before possible overflow. So we need to extend and save the 8-bit
histogram accumulators to 16-bit after every 240 byte chunks of input.
To store all in registers we would need 32 128-bit registers. Longer
SVE2 vectors could help here, if such machines become available.

The maximum input block size in Zstd is 128 KiB, so 16-bit accumulators
would not be enough. However an LZ pass will prepend the histogram
calculation, so it is impossible (my assumption) to overflow the 16-bit
accumulators.

The symbol distribution is also not uniform, the lower values are more
common, so we used a 3 pass algorithm to prevent stack spilling. In the
first pass we only compute histograms for 64 symbols (4-way SIMD) while
also computing the maximum symbol value. If we have symbol values
larger than 64 we start the second pass to compute the next 96 elements
of the histogram. The final pass calculates the remaining part of the
histogram (256 symbols in total) if needed. This split of histogram
generation gave the best overall results for performance.

This implementation is the best performing of a number of different
cache blocking schemes tested.

Compression uplifts on a Neoverse V2 system, using Zstd-1.5.8
(e26dde3d) as a baseline, compiled with "-O3 -march=armv8.2-a+sve2":

                 Clang-20    GCC-14
 1#silesia.tar:   +6.173%   +5.987%
 2#silesia.tar:   +5.200%   +5.011%
 3#silesia.tar:   +4.332%   +5.031%
 4#silesia.tar:   +2.789%   +3.064%
 5#silesia.tar:   +2.028%   +1.838%
 6#silesia.tar:   +1.562%   +1.340%
 7#silesia.tar:   +1.160%   +0.959%

7 weeks agoMerge pull request #4406 from Cyan4973/separate-cmake-tests
Yann Collet [Mon, 9 Jun 2025 22:19:47 +0000 (15:19 -0700)] 
Merge pull request #4406 from Cyan4973/separate-cmake-tests

cmake CI tests refactor

7 weeks agoremove global variable 4406/head
Yann Collet [Mon, 9 Jun 2025 21:55:06 +0000 (21:55 +0000)] 
remove global variable

overkill and leaky to transport a test result just in one place.

7 weeks agoMerge pull request #4403 from dloidolt/fix_FUZZ_malloc_rand
Yann Collet [Mon, 9 Jun 2025 17:57:59 +0000 (10:57 -0700)] 
Merge pull request #4403 from dloidolt/fix_FUZZ_malloc_rand

fuzz: Fix FUZZ_malloc_rand() to return non-NULL for zero-size allocations

7 weeks agoMerge pull request #4397 from xiaoge1001/free
Yann Collet [Mon, 9 Jun 2025 17:06:36 +0000 (10:06 -0700)] 
Merge pull request #4397 from xiaoge1001/free

Fix several locations with potential memory leak

7 weeks agoFix several locations with potential memory leak 4397/head
shixuantong [Sat, 31 May 2025 16:37:57 +0000 (00:37 +0800)] 
Fix several locations with potential memory leak

7 weeks agofix #4405
Yann Collet [Mon, 9 Jun 2025 07:24:03 +0000 (07:24 +0000)] 
fix #4405

7 weeks agofixed cmake + windows + visual + clang-cl
Yann Collet [Mon, 9 Jun 2025 07:09:51 +0000 (07:09 +0000)] 
fixed cmake + windows + visual + clang-cl

by removing processing of resource files in this case

7 weeks agoremove fail-fast so that the outcome of other tests can be observed
Yann Collet [Mon, 9 Jun 2025 06:47:28 +0000 (06:47 +0000)] 
remove fail-fast so that the outcome of other tests can be observed

7 weeks agorefactor: modularize CMakeLists.txt for better maintainability
Yann Collet [Mon, 9 Jun 2025 03:47:33 +0000 (03:47 +0000)] 
refactor: modularize CMakeLists.txt for better maintainability

- Split monolithic 235-line CMakeLists.txt into focused modules
- Main file reduced to 78 lines with clear section organization
- Created 5 specialized modules:
  * ZstdVersion.cmake - CMake policies and version management
  * ZstdOptions.cmake - Build options and platform configuration
  * ZstdDependencies.cmake - External dependency management
  * ZstdBuild.cmake - Build targets and validation
  * ZstdPackage.cmake - Package configuration generation

Benefits:
- Improved readability and maintainability
- Better separation of concerns
- Easier debugging and modification
- Preserved 100% backward compatibility
- All existing build options and targets unchanged

The refactored build system passes all tests and maintains
identical functionality while being much easier to understand
and maintain.

7 weeks agoadd cmake build test with ZSTD_BUILD_TESTS disabled
Yann Collet [Sun, 8 Jun 2025 23:51:55 +0000 (23:51 +0000)] 
add cmake build test with ZSTD_BUILD_TESTS disabled

should reproduce #4405 and fail

7 weeks agoadded macos arm64 tests
Yann Collet [Sun, 8 Jun 2025 22:40:15 +0000 (22:40 +0000)] 
added macos arm64 tests

and comment out windows arm64 tests due to unacceptably long queue time

7 weeks agoadded windows arm64 runner to cmake tests
Yann Collet [Sun, 8 Jun 2025 22:19:57 +0000 (22:19 +0000)] 
added windows arm64 runner to cmake tests

7 weeks agorefactor CMake tests workflow for readability
Yann Collet [Sun, 8 Jun 2025 21:39:59 +0000 (21:39 +0000)] 
refactor CMake tests workflow for readability

7 weeks agoci: separate cmake tests into dedicated workflow file
Yann Collet [Sun, 8 Jun 2025 20:25:25 +0000 (20:25 +0000)] 
ci: separate cmake tests into dedicated workflow file

- Create new .github/workflows/cmake-tests.yml with all cmake-related jobs
- Move cmake-build-and-test-check, cmake-source-directory-with-spaces, and cmake-visual-2022 jobs
- Remove cmake tests from dev-short-tests.yml to improve organization
- Maintain same trigger conditions and test configurations
- Add dedicated concurrency group for cmake tests

This separation allows cmake tests to run independently and makes
the CI configuration more modular and easier to maintain.

7 weeks agoMerge pull request #4384 from xiaoge1001/dev
Yann Collet [Sun, 8 Jun 2025 19:39:26 +0000 (12:39 -0700)] 
Merge pull request #4384 from xiaoge1001/dev

update `--rm` cmd help info

7 weeks agoMerge pull request #4392 from mugitya03/MLK
Yann Collet [Sun, 8 Jun 2025 19:38:31 +0000 (12:38 -0700)] 
Merge pull request #4392 from mugitya03/MLK

Fix potential memory leak in function `benchMem`

7 weeks agoMerge pull request #4399 from zijianli1234/dev
Yann Collet [Sun, 8 Jun 2025 19:38:02 +0000 (12:38 -0700)] 
Merge pull request #4399 from zijianli1234/dev

Improve speed of convertSequences() and get1BlockSummary() using RVV

7 weeks agoFix Darwin build of huf_decompress_amd64.S 4367/head
Michael Kolupaev [Thu, 17 Apr 2025 20:43:19 +0000 (20:43 +0000)] 
Fix Darwin build of huf_decompress_amd64.S

7 weeks agoAdd unwind information in huf_decompress_amd64.S
Michael Kolupaev [Thu, 17 Apr 2025 02:10:14 +0000 (02:10 +0000)] 
Add unwind information in huf_decompress_amd64.S

7 weeks agofuzz: Fix FUZZ_malloc_rand() to return non-NULL for zero-size allocations 4403/head
Dominik Loidolt [Thu, 5 Jun 2025 13:36:29 +0000 (15:36 +0200)] 
fuzz: Fix FUZZ_malloc_rand() to return non-NULL for zero-size allocations

The FUZZ_malloc_rand() function was incorrectly always returning NULL for
zero-size allocations. The random offset generated by
FUZZ_dataProducer_int32Range() was not being added to the pointer variable,
causing the function to always return (void *)0.

8 weeks agoRelease resources in error paths via cleanup
jinyaoguo [Wed, 4 Jun 2025 22:08:11 +0000 (18:08 -0400)] 
Release resources in error paths via cleanup

Replace direct returns in error-handling branches with a unified
cleanup block that frees allocated resources before returning,
improving code quality and robustness.

8 weeks agoMerge pull request #4401 from mugitya03/MLK-1
Yann Collet [Wed, 4 Jun 2025 19:49:38 +0000 (12:49 -0700)] 
Merge pull request #4401 from mugitya03/MLK-1

Release resources before returning

8 weeks agoRelease resources before returning 4401/head
jinyaoguo [Tue, 3 Jun 2025 19:28:11 +0000 (15:28 -0400)] 
Release resources before returning

In main, resources were freed on the success path but not in the error path.
This change ensures all allocated resources are released before returning.

8 weeks agoImprove speed of ZSTD_compressSequencesAndLiterals() using RVV 4399/head
李子建 [Fri, 16 May 2025 06:57:32 +0000 (14:57 +0800)] 
Improve speed of ZSTD_compressSequencesAndLiterals() using RVV

2 months agoupdate `--rm` cmd help info 4384/head
shixuantong [Fri, 9 May 2025 14:47:08 +0000 (22:47 +0800)] 
update `--rm` cmd help info

Starting from cee6bec9fa6aa249f2df9f84165b682eb793eab, --rm is ignored when the output is `stdout`.

2 months agoFix memory leak in function benchMem 4392/head
jinyaoguo [Sun, 25 May 2025 19:21:23 +0000 (15:21 -0400)] 
Fix memory leak in function benchMem

`speedPerRound` is allocated at the start of benchMem to collect per-round speeds,
but is never freed, causing a leak on each invocation.

2 months agolz4: Remove ancient test helpers
Dave Vasilevsky [Wed, 7 May 2025 07:03:29 +0000 (03:03 -0400)] 
lz4: Remove ancient test helpers

Building lz4 as root was causing `make clean` to fail with permission
errors.

We used to have to install lz4 from source back in Ubuntu 14.04, but
nowadays the installed lz4 is fine. Get rid of ancient helpers and
cruft!

2 months agoseekable_format: Fix conversion warnings in parallel_compression
Dave Vasilevsky [Wed, 7 May 2025 06:12:29 +0000 (02:12 -0400)] 
seekable_format: Fix conversion warnings in parallel_compression

2 months agoseekable_format: Add test for parallel_compression memory usage
Dave Vasilevsky [Wed, 7 May 2025 05:43:36 +0000 (01:43 -0400)] 
seekable_format: Add test for parallel_compression memory usage

Use ulimit to fail the test if we use O(filesize) memory, rather than
O(threads).

2 months agoseekable_format: Fix race in parallel_processing
Dave Vasilevsky [Wed, 7 May 2025 04:10:10 +0000 (00:10 -0400)] 
seekable_format: Fix race in parallel_processing

There was no memory barrier between writing and reading `done`, which
would allow reordering to cause races. With so little data to handle
after each job completes, we might as well just join.

2 months agoseekable_format: Cleanup POOL in parallel_compression
Dave Vasilevsky [Wed, 7 May 2025 03:45:04 +0000 (23:45 -0400)] 
seekable_format: Cleanup POOL in parallel_compression

2 months agoseekable_format: Make parallel_compression use memory properly
Dave Vasilevsky [Wed, 7 May 2025 03:26:32 +0000 (23:26 -0400)] 
seekable_format: Make parallel_compression use memory properly

Previously, parallel_compression would only handle each job's results
after ALL jobs were successfully queued. This caused all src/dst
buffers to remain in memory until then!

It also polled to check whether a job completed, which is racy without
any memory barrier.

Now, we flush results as a side effect of completing a job. Completed
frames are placed in an ordered linked-list, and any eligible frames
are flushed. This may be zero or multiple frames, depending on the
order in which jobs finish.

This design also makes it simple to support streaming input, so that
is now available. Just pass `-` as the filename, and stdin/stdout will
be used for I/O.

2 months agoseekable_format: Link against multi-threaded libzstd.a
Dave Vasilevsky [Wed, 7 May 2025 01:57:29 +0000 (21:57 -0400)] 
seekable_format: Link against multi-threaded libzstd.a

Some of these examples are intended to be parallel, and don't make
sense to link against single-threaded libzstd.

The filename of mt and nomt libzstd are identical, so it's still
possible to link against the single-threaded one, just harder.

2 months agoseekable_format: Build with $(MAKE)
Dave Vasilevsky [Wed, 7 May 2025 01:55:22 +0000 (21:55 -0400)] 
seekable_format: Build with $(MAKE)

This passes make flags, such as `-jN` for building in parallel, to
the underlying make.

2 months ago[cmake] only require a CXX compiler when tests are build
Thomas Devoogdt [Tue, 1 Apr 2025 20:47:45 +0000 (22:47 +0200)] 
[cmake] only require a CXX compiler when tests are build

Signed-off-by: Thomas Devoogdt <thomas@devoogdt.com>
2 months agoAdd License variable to pkg-config file
Nobuhiro Iwamatsu [Mon, 28 Apr 2025 09:03:33 +0000 (18:03 +0900)] 
Add License variable to pkg-config file

The pkg-config file has License variable that allows you to set the license for
the software. This sets 'BSD-3-Clause OR GPL-2.0-only' to License.

Ref: https://github.com/pkgconf/pkgconf/blob/master/man/pc.5#L116
Signed-off-by: Nobuhiro Iwamatsu <iwamatsu@nigauri.org>
3 months agoMerge pull request #4378 from Cyan4973/fix_zstreamtest_minor
Yann Collet [Tue, 29 Apr 2025 21:01:14 +0000 (14:01 -0700)] 
Merge pull request #4378 from Cyan4973/fix_zstreamtest_minor

fix minor warning in zstreamtest

3 months agoMerge pull request #4371 from ecordonnier-sc/eco/fix-macos-duplicate-lc-rpath
Yann Collet [Tue, 29 Apr 2025 21:00:41 +0000 (14:00 -0700)] 
Merge pull request #4371 from ecordonnier-sc/eco/fix-macos-duplicate-lc-rpath

Fix duplicate LC_RPATH error on MacOS

3 months agofix minor warning in zstreamtest 4378/head
Yann Collet [Tue, 29 Apr 2025 15:55:19 +0000 (08:55 -0700)] 
fix minor warning in zstreamtest

3 months agoFix duplicate LC_RPATH error on MacOS 4370/head 4371/head
Etienne Cordonnier [Fri, 18 Apr 2025 12:37:50 +0000 (14:37 +0200)] 
Fix duplicate LC_RPATH error on MacOS

After the update to MacOS 15.4, the dynamic loader dyld treats duplicated LC_RPATH as an error.
The `FLAGS` variable already contains `LDFLAGS`, thus using both `FLAGS` and `LDFLAGS`
duplicates all `LDFLAGS`, including `-Wl,rpath` parameters.

The duplicate LC_RPATH causes this kind of errors:

```
dyld[29361]: Library not loaded: @loader_path/../lib/libzstd.1.dylib
      Referenced from: <7131C877-3CF0-33AC-AA05-257BA4FDD770> /Users/foobar/...
      Reason: tried: '/Users/foobar/..../lib/libzstd.1.dylib' (duplicate LC_RPATH '/usr/mypath.../lib')
```

Closes https://github.com/facebook/zstd/issues/4369

Signed-off-by: Etienne Cordonnier <ecordonnier@snap.com>
3 months agoMerge pull request #4362 from facebook/dependabot/github_actions/actions/setup-java...
Yann Collet [Mon, 14 Apr 2025 10:19:07 +0000 (03:19 -0700)] 
Merge pull request #4362 from facebook/dependabot/github_actions/actions/setup-java-4.7.1

Bump actions/setup-java from 4.7.0 to 4.7.1

3 months agoBump actions/setup-java from 4.7.0 to 4.7.1 4362/head
dependabot[bot] [Mon, 14 Apr 2025 05:21:33 +0000 (05:21 +0000)] 
Bump actions/setup-java from 4.7.0 to 4.7.1

Bumps [actions/setup-java](https://github.com/actions/setup-java) from 4.7.0 to 4.7.1.
- [Release notes](https://github.com/actions/setup-java/releases)
- [Commits](https://github.com/actions/setup-java/compare/3a4f6e1af504cf6a31855fa899c6aa5355ba6c12...c5195efecf7bdfc987ee8bae7a71cb8b11521c00)

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

Signed-off-by: dependabot[bot] <support@github.com>
3 months agoMerge pull request #4353 from afq984/sparse
Yann Collet [Mon, 7 Apr 2025 10:48:41 +0000 (03:48 -0700)] 
Merge pull request #4353 from afq984/sparse

Check regular file for sparse support after opening

4 months agoUpdate cli-tests/file-stat tests 4353/head
Li-Yu Yu [Fri, 28 Mar 2025 21:45:47 +0000 (21:45 +0000)] 
Update cli-tests/file-stat tests

4 months agoCheck regular file for sparse support after opening
Li-Yu Yu [Fri, 28 Mar 2025 21:16:29 +0000 (21:16 +0000)] 
Check regular file for sparse support after opening

A regular file may be created by the open call.
Checking after opening allows sparseFileSupport even
if dstFileName does not already exist.

4 months agoMerge pull request #4349 from Cyan4973/devfd
Yann Collet [Fri, 28 Mar 2025 17:35:45 +0000 (10:35 -0700)] 
Merge pull request #4349 from Cyan4973/devfd

Support process substitution for `--filelist=`

4 months agoupdate error message 4349/head
Yann Collet [Fri, 28 Mar 2025 17:02:37 +0000 (10:02 -0700)] 
update error message

4 months agofix test
Yann Collet [Thu, 27 Mar 2025 04:33:26 +0000 (21:33 -0700)] 
fix test

4 months agoadd error message clarification for inputs as process substitution
Yann Collet [Thu, 27 Mar 2025 02:21:48 +0000 (19:21 -0700)] 
add error message clarification for inputs as process substitution

4 months agoadded CI test
Yann Collet [Tue, 25 Mar 2025 23:39:42 +0000 (16:39 -0700)] 
added CI test