1
0
mirror of https://github.com/facebook/zstd.git synced 2025-07-30 22:23:13 +03:00
Commit Graph

10385 Commits

Author SHA1 Message Date
f4a4f65f4c fixed path 2024-01-28 18:38:53 -08:00
c768c600ad cmake: no need for CXX compiler 2024-01-28 18:25:08 -08:00
ba8ff52970 fix cmake test on Solaris
write the recipe directly in the .yml file

For some reason, SolarisOS is not considered posix by the Makefile (?)
2024-01-28 17:40:32 -08:00
5f18da53ad add a Solaris VM test
to Github Actions CI
2024-01-28 17:10:47 -08:00
60829445bf Merge pull request #3880 from facebook/dependabot/github_actions/actions/upload-artifact-4.2.0
Bump actions/upload-artifact from 4.1.0 to 4.2.0
2024-01-27 21:49:29 -08:00
798034aeae Merge pull request #3883 from facebook/cmake_test
improve cmake test
2024-01-27 18:18:15 -08:00
2fc7248412 fix cmakebuild test
write it in a way which is more compatible with older versions of cmake (<3.13)

Also:
fix pzstd compilation (notably on macos)
2024-01-27 17:30:06 -08:00
799b904628 Merge pull request #3884 from facebook/disable_intelcet
disable Intel CET Compatibility tests
2024-01-27 17:29:17 -08:00
c7611d6964 disable Intel CET Compatibility tests
The binary blob that must be downloaded from intel.com is no longer available
2024-01-27 15:37:29 -08:00
ee2efb634e Bump actions/upload-artifact from 4.1.0 to 4.2.0
Bumps [actions/upload-artifact](https://github.com/actions/upload-artifact) from 4.1.0 to 4.2.0.
- [Release notes](https://github.com/actions/upload-artifact/releases)
- [Commits](1eb3cb2b3e...694cdabd8b)

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

Signed-off-by: dependabot[bot] <support@github.com>
2024-01-22 05:21:32 +00:00
1a860c8737 Merge pull request #3877 from facebook/oldgrep
minor: playTests.sh more compatible with older versions of grep
2024-01-21 11:31:58 -08:00
81f444f4f9 made playTests.sh more compatible with older versions of grep
replaced `\+` by `*`.
`\+` means `[1-N]`,
while `*` means `[0-N]`,
so it's not strictly equivalent
but `\+` happens to be badly supported on some flavors of grep,
and for the purpose of these tests, `*` is good enough.
2024-01-16 12:14:35 -08:00
050fec5c37 Merge pull request #3865 from facebook/grep_e
playTests.sh does no longer needs grep -E
2024-01-15 12:44:46 -08:00
e6f4b46493 playTests.sh does no longer needs grep -E
it makes the test script more portable across posix systems
because `grep -E` is not guaranteed
while `grep` is fairly common.
2024-01-15 11:16:46 -08:00
d2ea3fb5ef Merge pull request #3863 from facebook/dependabot/github_actions/github/codeql-action-3.23.0
Bump github/codeql-action from 2.21.4 to 3.23.0
2024-01-15 09:44:19 -08:00
572acb9c5d Merge pull request #3864 from facebook/dependabot/github_actions/actions/upload-artifact-4.1.0
Bump actions/upload-artifact from 4.0.0 to 4.1.0
2024-01-14 23:44:56 -08:00
e2fe266279 Bump actions/upload-artifact from 4.0.0 to 4.1.0
Bumps [actions/upload-artifact](https://github.com/actions/upload-artifact) from 4.0.0 to 4.1.0.
- [Release notes](https://github.com/actions/upload-artifact/releases)
- [Commits](c7d193f32e...1eb3cb2b3e)

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

Signed-off-by: dependabot[bot] <support@github.com>
2024-01-15 05:24:46 +00:00
3a2e302b2c Bump github/codeql-action from 2.21.4 to 3.23.0
Bumps [github/codeql-action](https://github.com/github/codeql-action) from 2.21.4 to 3.23.0.
- [Release notes](https://github.com/github/codeql-action/releases)
- [Changelog](https://github.com/github/codeql-action/blob/main/CHANGELOG.md)
- [Commits](a09933a12a...e5f05b81d5)

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

Signed-off-by: dependabot[bot] <support@github.com>
2024-01-15 05:24:41 +00:00
dcf784a04b Merge pull request #3760 from jcelerier/patch-1
[x-compile] Fix cross-compiling for AArch64 with lld
2024-01-13 11:41:30 -08:00
7971fd16f7 Merge pull request #3817 from elasota/oversized-probs-clarification
Clarify that probability tables must not contain non-zero probabilities for invalid values
2024-01-13 11:37:54 -08:00
7f76d37044 Merge pull request #3850 from KapJI/better-errors
cli: better errors on argument parsing
2024-01-13 11:37:25 -08:00
17332454e5 Merge pull request #3858 from eli-schwartz/msvc-dev-cmd
CI: meson: use builtin handling for MSVC
2024-01-13 11:36:20 -08:00
923cf3dc92 CI: meson: use builtin handling for MSVC
This avoids downloading -- and periodically bumping the checksum for --
a third-party action that isn't strictly required, and thus helps keep
down dependencies and reduce update churn.
2024-01-02 01:36:45 -05:00
ffde100b68 Merge pull request #3855 from emaste/freebsd-14-ci
Cirrus-CI: Add FreeBSD 14
2023-12-30 22:16:42 -08:00
a07cae3976 Merge pull request #3847 from michoecho/fix_nullptr_deref_in_createCDict
Fix a nullptr dereference in ZSTD_createCDict_advanced2()
2023-12-30 13:23:39 -08:00
a52d897d60 Cirrus-CI: Add FreeBSD 14 2023-12-29 15:44:25 -05:00
903bc264ad Merge pull request #3846 from emaste/c89
zlibWrapper: convert to C89 / ANSI C
2023-12-29 12:34:47 -08:00
c6cabf9441 Make offload API compatible with static CCtx (#3854)
* Add ZSTD_CCtxParams_registerSequenceProducer() to public API

* add unit test

* add docs to zstd.h

* nits

* Add ZSTDLIB_STATIC_API prefix

* Add asserts
2023-12-28 14:48:46 -05:00
7cf62bc274 Merge pull request #3849 from facebook/dependabot/github_actions/actions/upload-artifact-4.0.0
Bump actions/upload-artifact from 3.1.3 to 4.0.0
2023-12-18 09:49:57 -08:00
377ecefce9 Update windows-artifacts.yml
and fixed version number in comment
2023-12-18 09:39:42 -08:00
8052cd0131 cli: better errors on arguent parsing 2023-12-18 13:59:33 +00:00
e515327764 Bump actions/upload-artifact from 3.1.3 to 4.0.0
Bumps [actions/upload-artifact](https://github.com/actions/upload-artifact) from 3.1.3 to 4.0.0.
- [Release notes](https://github.com/actions/upload-artifact/releases)
- [Commits](a8a3f3ad30...c7d193f32e)

---
updated-dependencies:
- dependency-name: actions/upload-artifact
  dependency-type: direct:production
  update-type: version-update:semver-major
...

Signed-off-by: dependabot[bot] <support@github.com>
2023-12-18 05:26:39 +00:00
9a3b17c4d6 Fix a nullptr dereference in ZSTD_createCDict_advanced2()
If the relevant allocation returns NULL, ZSTD_createCDict_advanced_internal()
will return NULL. But ZSTD_createCDict_advanced2() doesn't check for
this and attempts to use the returned pointer anyway, which leads to
a segfault.
2023-12-16 13:02:18 +01:00
2ce0290e4d zlibWrapper: convert to C89 / ANSI C
Clang 16 (which is the system compiler in FreeBSD 14.0) no longer allows
K&R function definitions.  Formatting of the changes matches current
zlib.
2023-12-14 08:45:04 -05:00
86ead9f4a4 Merge pull request #3845 from emaste/dev
Update FreeBSD CI: drop 12.4 (nearly EOL)
2023-12-13 23:54:41 -08:00
20f8df6440 Update FreeBSD CI: drop 12.4 as it is nearly EOL
12.4 is EOL as of the end of December 2023, and pkg installation will
start failing some time after that so remove those jobs now.
2023-12-13 19:10:43 -05:00
126ec2669c Merge pull request #3839 from embg/offload_refactor
Move offload API params into ZSTD_CCtx_params
2023-11-28 20:04:08 -05:00
d151a4880b Move offload API params into ZSTD_CCtx_params 2023-11-27 08:11:01 -08:00
809c7eb6bf Refactor ZSTD_sequenceProducer_F typedef to ZSTD_sequenceProducer_F* 2023-11-27 06:56:37 -08:00
05059e5a48 Clarify that there must be at least 2 weights, i.e. encoding all weights as 0 is invalid 2023-11-24 16:49:40 -05:00
dc84e35138 Clarify that the presence of a value with weight 1 is required 2023-11-24 16:49:40 -05:00
8193250615 Modernize macros to use do { } while (0)
This PR introduces no functional changes. It attempts to change all
macros currently using `{ }` or some variant of that to to
`do { } while (0)`, and introduces trailing `;` where necessary.
There were no bugs found during this migration.

The bug in Visual Studios warning on this has been fixed since VS2015.
Additionally, we have several instances of `do { } while (0)` which have
been present for several releases, so we don't have to worry about
breaking peoples builds.

Fixes Issue #3830.
2023-11-21 20:05:17 -05:00
6b3d12fe54 Merge pull request #3820 from facebook/xxh082
update xxhash library to v0.8.2
2023-11-21 09:11:40 -08:00
dd4de1dd7a [huf] Fix null pointer addition
`HUF_DecompressFastArgs_init()` was adding 0 to NULL. Fix it by exiting
early for empty outputs. This is no change in behavior, because the
function was already exiting 0 in this case, just slightly later.
2023-11-20 17:13:01 -05:00
5ab78c0418 [huf] Improve fast C & ASM performance on small data
* Rename `ilimit` to `ilowest` and set it equal to `src` instead of
  `src + 6 + 8`. This is safe because the fast decoding loops guarantee
  to never read below `ilowest` already. This allows the fast decoder to
  run for at least two more iterations, because it consumes at most 7
  bytes per iteration.
* Continue the fast loop all the way until the number of safe iterations
 is 0. Initially, I thought that when it got towards the end, the
 computation of how many iterations of safe might become expensive. But
 it ends up being slower to have to decode each of the 4 streams
 individually, which makes sense.

This drastically speeds up the Huffman decoder on the `github` dataset
for the issue raised in #3762, measured with `zstd -b1e1r github/`.

| Decoder  | Speed before | Speed after |
|----------|--------------|-------------|
| Fallback | 477 MB/s     | 477 MB/s    |
| Fast C   | 384 MB/s     | 492 MB/s    |
| Assembly | 385 MB/s     | 501 MB/s    |

We can also look at the speed delta for different block sizes of silesia
using `zstd -b1e1r silesia.tar -B#`.

| Decoder  | -B1K ∆ | -B2K ∆ | -B4K ∆ | -B8K ∆ | -B16K ∆ | -B32K ∆ | -B64K ∆ | -B128K ∆ |
|----------|--------|--------|--------|--------|---------|---------|---------|----------|
| Fast C   | +11.2% | +8.2%  | +6.1%  | +4.4%  | +2.7%   | +1.5%   | +0.6%   | +0.2%    |
| Assembly | +12.5% | +9.0%  | +6.2%  | +3.6%  | +1.5%   | +0.7%   | +0.2%   | +0.03%   |
2023-11-20 17:13:01 -05:00
c7269add7e [huf] Improve fast huffman decoding speed in linux kernel
gcc in the linux kernel was not unrolling the inner loops of the Huffman
decoder, which was destroying decoding performance. The compiler was
generating crazy code with all sorts of branches. I suspect because of
Spectre mitigations, but I'm not certain. Once the loops were manually
unrolled, performance was restored.

Additionally, when gcc couldn't prove that the variable left shift in
the 4X2 decode loop wasn't greater than 63, it inserted checks to verify
it. To fix this, mask `entry.nbBits & 0x3F`, which allows gcc to eliete
this check. This is a no op, because `entry.nbBits` is guaranteed to be
less than 64.

Lastly, introduce the `HUF_DISABLE_FAST_DECODE` macro to disable the
fast C loops for Issue #3762. So if even after this change, there is a
performance regression, users can opt-out at compile time.
2023-11-20 14:56:46 -05:00
e122fcbf58 [debug] Don't define g_debuglevel in the kernel
We only use this constant when `DEBUGLEVEL>=2`, but we get
-Werror=pedantic errors for empty translation units, so still define it
except in kernel environments.

Backport from the kernel:

https://lore.kernel.org/lkml/20230616144400.172683-1-ben.dooks@codethink.co.uk/
2023-11-17 09:54:10 -08:00
c2d470581e [linux] Remove usage of deprecated function
ZSTD_resetDStream() is deprecated and replaced by ZSTD_DCtx_reset().
This removes deprecation warnings from the kernel build.

This change is a no-op, see the docs suggesting this replacement.

fcbf2fde9a/lib/zstd.h (L2655-L2663)
2023-11-17 09:54:10 -08:00
a419265d30 [linux] Backport intptr_t removal
Linux started providing intptr_t in <linux/types.h> so we no longer need
to define it here.

https://lkml.kernel.org/r/ed66b9e4-1fb7-45be-9bb9-d4bc291c691f@p183
2023-11-17 09:54:10 -08:00
59dcc47579 update license text 2023-11-16 16:19:25 -08:00