Commit Graph
100 Commits
Author SHA1 Message Date
Felix HandteandGitHub 54a173e9fc Merge pull request #3477 from facebook/dependabot/github_actions/ilammy/msvc-dev-cmd-1.12.1
Bump ilammy/msvc-dev-cmd from 1.12.0 to 1.12.1
2023-02-06 13:04:21 -05:00
Felix HandteandGitHub 3d25502c2d Merge pull request #3432 from felixhandte/fix-perms
Fix CLI Handling of Permissions and Ownership (Again)
2023-01-20 19:19:05 -05:00
Felix HandteandGitHub 772229afd5 Merge pull request #3442 from felixhandte/pgo-tests
Test PGO Builds
2023-01-20 19:18:51 -05:00
W. Felix Handte aab3dd4312 Add PGO Build Jobs to CI 2023-01-20 18:37:04 -05:00
W. Felix Handte 87e169d05d Add Additional Flags to PGO Build
In GCC, we can add a couple more flags to give us confidence that the profile
data is actually being found and used.

Also, my system for example doesn't have a binary installed under the name
`llvm-profdata`, but it does have, e.g., `llvm-profdata-13`, etc. So this
commit adds a variable that can be overridden.
2023-01-20 17:32:49 -05:00
W. Felix Handte 7a8c8f3fe7 Easy: Print Mode as Octal in chmod() Trace 2023-01-18 11:57:54 -08:00
W. Felix Handte 0d2d460223 Mimic gzip chown(gid), chmod(), chown(uid) Behavior
Avoids a race condition in which we unintentionally open up permissions to
the wrong group.
2023-01-18 11:57:54 -08:00
W. Felix Handte 1e3eba65a6 Copy Permissions from Source File 2023-01-18 11:57:35 -08:00
W. Felix Handte 0382076af7 Re-Use stat_t in FIO_compressFilename_srcFile() 2023-01-18 11:33:07 -08:00
W. Felix Handte a5ed28f1fb Use Existing Src File Stat in *_dstFile() Funcs
One fewer `stat()` call to make per operation!
2023-01-17 14:08:22 -08:00
W. Felix Handte 5653f96776 Pass stat_t into *_dstFile() Functions 2023-01-17 14:05:15 -08:00
W. Felix Handte 2ad6855ac1 FIO_openSrcFile() Returns File Stat 2023-01-17 14:01:06 -08:00
Felix HandteandGitHub 23a356cdde Merge pull request #3424 from felixhandte/disable-asan-msan-poison-mingw
Disable Custom ASAN/MSAN Poisoning on MinGW Builds
2023-01-17 12:41:41 -05:00
W. Felix Handte d78fbedd96 Don't Even Declare Poisoning Functions if Poisoning is Disabled
This guarantees that we won't accidentally forget to check the macro somewhere
where we use these functions.
2023-01-13 11:56:48 -05:00
W. Felix Handte f10922a8fa Disable Custom ASAN/MSAN Poisoning on MinGW Builds
Addresses #3240.
2023-01-13 11:53:09 -05:00
Felix HandteandGitHub fd2eb8a68e Merge pull request #3402 from facebook/dependabot/github_actions/ossf/scorecard-action-2.1.2
Bump ossf/scorecard-action from 2.1.0 to 2.1.2
2023-01-12 13:28:04 -05:00
Felix HandteandGitHub f5ea3a196f Merge pull request #3397 from felixhandte/man-page-tweaks
Man Page Tweaks, Edits, Formatting Fixes
2022-12-22 14:49:59 -05:00
W. Felix Handte 11aba9b316 make man 2022-12-22 14:13:24 -05:00
W. Felix Handte 382026f096 Man Page Tweaks, Edits, Formatting Fixes
This started as an application of the edits suggested in #3201 and expanded
from there.
2022-12-22 14:13:17 -05:00
Felix HandteandGitHub 0694f1435d Merge pull request #3386 from felixhandte/pin-other-action-commit-hashes
Pin Remaining Action Dependencies (Except OSS-Fuzz)
2022-12-21 11:24:23 -05:00
W. Felix Handte 150aa23ef4 Pin Remaining Action Dependencies (Except OSS-Fuzz)
The one that isn't pinned is the OSS-Fuzz builder and runner. They don't
offer tagged releases. I could pin to the current master commit, but I'm not
sure how desirable that is.
2022-12-20 17:10:01 -05:00
Felix HandteandGitHub 0790e86c56 Merge pull request #3384 from felixhandte/pin-checkout-action-commit-hash
Pin actions/checkout Dependency to Specific Commit Hash
2022-12-20 16:08:03 -05:00
W. Felix Handte e3f2c8b11c Pin actions/checkout Dependency to Specific Commit Hash
It's a bit silly, because if we can't trust GitHub, what are we doing here?
But OSSF complains about it, so let's fix it.
2022-12-20 14:53:12 -05:00
Felix HandteandGitHub ea199876e2 Merge pull request #3378 from facebook/dependabot/github_actions/github/codeql-action-2.1.37
Bump github/codeql-action from 1.0.26 to 2.1.37
2022-12-20 14:17:33 -05:00
Felix HandteandGitHub 5f0543a508 Merge pull request #3377 from facebook/dependabot/github_actions/ossf/scorecard-action-2.1.0
Bump ossf/scorecard-action from 2.0.6 to 2.1.0
2022-12-20 14:16:10 -05:00
Felix HandteandGitHub 3a7e2eec21 Merge pull request #3340 from facebook/dependabot/github_actions/actions/upload-artifact-3
Bump actions/upload-artifact from 1 to 3
2022-12-20 14:15:43 -05:00
Felix HandteandGitHub f302ad8811 Merge pull request #3173 from felixhandte/update-copyright-company
Update Copyright Comments
2022-12-20 13:51:01 -05:00
W. Felix Handte 5d693cc38c Coalesce Almost All Copyright Notices to Standard Phrasing
```
for f in $(find . \( -path ./.git -o -path ./tests/fuzz/corpora -o -path ./tests/regression/data-cache -o -path ./tests/regression/cache \) -prune -o -type f); do sed -i '/Copyright .* \(Yann Collet\)\|\(Meta Platforms\)/ s/Copyright .*/Copyright (c) Meta Platforms, Inc. and affiliates./' $f; done

git checkout HEAD -- build/VS2010/libzstd-dll/libzstd-dll.rc build/VS2010/zstd/zstd.rc tests/test-license.py contrib/linux-kernel/test/include/linux/xxhash.h examples/streaming_compression_thread_pool.c lib/legacy/zstd_v0*.c lib/legacy/zstd_v0*.h
nano ./programs/windres/zstd.rc
nano ./build/VS2010/zstd/zstd.rc
nano ./build/VS2010/libzstd-dll/libzstd-dll.rc
```
2022-12-20 12:52:34 -05:00
W. Felix Handte 7f12f24cf4 Rewrite Copyright Date Ranges from -present to -2022
Apparently it's better. Somehow.

```
for f in $(find . \( -path ./.git -o -path ./tests/fuzz/corpora -o -path ./tests/regression/data-cache -o -path ./tests/regression/cache \) -prune -o -type f); do echo $f; sed -i 's/\-present/-2022/' $f; done

g co HEAD -- build/meson/
```
2022-12-20 12:44:56 -05:00
W. Felix Handte 4c999cf968 Update test-license.py 2022-12-20 12:43:16 -05:00
W. Felix Handte 36d5c2f326 Update Copyright Year ('2021' -> 'present')
```
for f in $(find . \( -path ./.git -o -path ./tests/fuzz/corpora -o -path ./tests/regression/data-cache -o -path ./tests/regression/cache \) -prune -o -type f);
do
  sed -i 's/\-2021/-present/' $f;
done

g co HEAD -- .github/workflows/dev-short-tests.yml # fix bad match
```
2022-12-20 12:42:50 -05:00
W. Felix Handte 8927f985ff Update Copyright Headers 'Facebook' -> 'Meta Platforms'
```
for f in $(find . \( -path ./.git -o -path ./tests/fuzz/corpora \) -prune -o -type f);
do
  sed -i 's/Facebook, Inc\./Meta Platforms, Inc. and affiliates./' $f;
done
```
2022-12-20 12:37:57 -05:00
W. Felix Handte a05cca6208 Manually Update VS Code Copyright Definitions 2022-12-20 12:36:06 -05:00
Felix HandteandGitHub bd4581c311 Merge pull request #3309 from joycebrum/dev
Fix action error by upgrading Scorecard GHA to 2.0.6
2022-11-01 17:53:37 -04:00
Felix HandteandGitHub 99d239de32 Merge pull request #3290 from felixhandte/ddict-dict-id-from-ddict
Make ZSTD_getDictID_fromDDict() Read DictID from DDict
2022-10-18 13:33:32 -04:00
W. Felix Handte d7841d150b Make ZSTD_getDictID_fromDDict() Read DictID from DDict
Currently this function actually reads the dict ID from the dictionary's
header, via `ZSTD_getDictID_fromDict()`. But during decompression the decomp-
ressor actually compares the dict ID in the frame header with the dict ID in
the DDict. Now of course the dict ID in the dictionary contents and the dict
ID in the DDict struct *should* be the same. But in cases of memory corrupt-
ion, where they can drift out of sync, it's misleading for this function to
read it again from the dict buffer rather then return the dict ID that will
actually be used.

Also doing it this way avoids rechecking the magic and so on and so it is a
tiny bit more efficient.
2022-10-14 22:53:03 -04:00
Felix HandteandGitHub 33273e1b9c Merge pull request #3277 from felixhandte/ossf-scorecard
Enable OpenSSF Scorecard Action
2022-10-03 14:33:21 -04:00
W. Felix Handte de9a450c00 Restrict from Running on Forks 2022-10-03 11:23:29 -04:00
Felix Handte 79729f8a2d Create scorecards.yml
Addresses #3269.
2022-09-30 14:30:22 -04:00
Felix HandteandGitHub 7e6278a706 Merge pull request #3196 from mileshu/dev
[T124890272] Mark 2 Obsolete Functions(ZSTD_copy*Ctx) Deprecated in Zstd
2022-08-02 12:34:04 -04:00
Felix HandteandGitHub 02ef78be58 Merge pull request #3184 from htnhan/features/list_verbose_to_show_dictionary_id
zstd -lv <file> to show dictID
2022-07-08 16:04:39 -04:00
Felix HandteandGitHub 8af64f4116 Merge pull request #3129 from felixhandte/zstd-fast-nodict-unconditional-ip1-table-write
ZSTD_fast_noDict: Avoid Safety Check When Writing `ip1` into Table
2022-05-11 17:04:02 -04:00
W. Felix Handte 1bc8019e10 Update results.csv 2022-05-11 10:27:35 -07:00
W. Felix Handte 1dd046a507 Fix Comments Slightly 2022-05-11 12:38:45 -04:00
W. Felix Handte cd1f582943 Hoist Hash Table Writes Up into Each Match Found Block
Refactoring this way avoids the bad write in the case that `step > 4`, and
is a bit more straightforward. It also seems to perform better!
2022-05-11 11:27:34 -04:00
W. Felix Handte 040986a4f4 ZSTD_fast_noDict: Minimize Checks When Writing Hash Table for ip1
This commit avoids checking whether a hashtable write is safe in two of the
three match-found paths in `ZSTD_compressBlock_fast_noDict_generic`. This pro-
duces a ~0.5% speed-up in compression.

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

A downside is that in the new position where we make this check, we have not
yet computed `mLength`. We therefore have to avoid writing *possibly* dangerous
positions, rather than the old check which only avoids writing *actually*
dangerous positions. This leads to a miniscule loss in ratio (remember that
this scenario can only been triggered in very negative levels or under incomp-
ressibility acceleration).
2022-05-10 14:29:39 -07:00
Felix HandteandGitHub 8814aa5bfa Merge pull request #3059 from dirkmueller/gzip_fast_best
Implement more gzip compatibility (#3037)
2022-03-08 15:32:06 -05:00
Felix HandteandGitHub 4a35912b3b Merge pull request #3018 from felixhandte/gh-action-release-artifacts-trigger-fix
Trigger Release Artifact Generation on Publish
2022-01-20 21:08:59 -05:00
W. Felix Handte fa9cb4510a Trigger Release Artifact Generation on Publish
We previously triggered release artifact generation on release creation. We
sometimes observed that the action failed to run. I hypothesized that we were
hitting rate limiting or something. I just stumbled across [this documentat-
ion](https://docs.github.com/en/actions/using-workflows/events-that-trigger-workflows#release), which says:

> Note: Workflows are not triggered for the `created`, `edited`, or `deleted`
> activity types for draft releases. When you create your release through the
> GitHub browser UI, your release may automatically be saved as a draft.

This must have been what was happening. This commit therefore changes the
trigger to the `published` activity. This should be more reliable.

This does have the unfortunate side effect that artifacts won't be generated
or attached until *after* the release has been published, which is what I was
trying to avoid by using the `created` activity. Oh well.
2022-01-20 17:36:28 -05:00
Felix HandteandGitHub 330c97d2bf Merge pull request #3015 from felixhandte/enable-cet-test-illegal-instruction
Add GitHub Action Checking that Zstd Runs Successfully Under CET
2022-01-20 16:18:42 -05:00
Felix HandteandGitHub e47e674cd0 Merge pull request #2995 from facebook/v1.5.2-rc
Zstandard v1.5.2
2022-01-20 16:17:18 -05:00
Felix HandteandGitHub c7e8315d88 Merge pull request #2994 from hjl-tools/hjl/cet-report/dev
x86: Append -z cet-report=error to LDFLAGS
2022-01-20 14:58:13 -05:00
W. Felix Handte 7cf80cb94c Add GitHub Action Checking that Zstd Runs Successfully Under CET 2022-01-20 11:25:52 -05:00
Felix HandteandGitHub 4dfc4eca9a Merge pull request #2992 from hjl-tools/hjl/cet/dev
x86-64: Enable Intel CET
2022-01-20 11:24:47 -05:00
Felix HandteandGitHub f4a552a3fa Merge pull request #2987 from felixhandte/prepare-v1.5.2
Prepare v1.5.2
2022-01-11 17:47:39 -05:00
Felix HandteandGitHub e113c0ca49 Merge pull request #2993 from hjl-tools/hjl/asm/dev
x86-64: Hide internal assembly functions
2022-01-11 14:31:51 -05:00
Felix HandteandGitHub 4dfaf0003f Merge pull request #2957 from hmaarrfk/fix_cmake_msvc
Fixup MSVC source file inclusion for cmake builds
2022-01-11 13:25:16 -05:00
W. Felix Handte 144879a7cd Update Changelog 2022-01-10 12:48:40 -05:00
W. Felix Handte e1323744b6 Update Docs 2022-01-07 14:14:26 -05:00
W. Felix Handte 46ad9377e8 Bump Version Number to 1.5.2 2022-01-07 14:14:26 -05:00
Felix HandteandGitHub 844c53ed75 Merge pull request #2977 from felixhandte/fix-2950
Remove Dependencies to Allow the Zstd Binary to Dynamically Link to the Library
2022-01-07 12:10:46 -05:00
W. Felix Handte 4bd96a61f1 Avoid xxHash Dependency by Inlining
xxHash symbols are present in `libzstd.so`, but they are local and therefore
unavailable outside the lib. There are two possible solutions to the problem.
We could make those symbols global, or we could remove the dependency.

This commit chooses the latter approach. I suppose this comes at the cost of
code size / build time. I'm open to comments on whether this is a good thing
to do, especially since this will apply even when we are statically linking
everything.
2022-01-06 00:25:26 -05:00
W. Felix Handte fc946d131b Remove Unused Include 2022-01-06 00:25:26 -05:00
Felix HandteandGitHub 26d88c05f0 Merge pull request #2953 from felixhandte/modulemap-improvements
Improve Module Map File
2022-01-05 23:54:50 -05:00
W. Felix Handte 1778222446 Update the Swift Package Definition to Reflect Move 2022-01-05 18:32:56 -05:00
W. Felix Handte 8dd943e42c Improve Module Map File
This commit makes several changes:

1. It adds modules for the dictionary builder and errors headers.
2. It captures all of the macros that are used to configure these headers.
   When the headers are imported as modules and one of these macros is defined
   the compiler issues a warning that it needs to be defined on the CLI.
3. It promotes the modulemap file into the root of the lib directory.
   Experimentation shows that clang's `-fimplicit-module-maps` will find the
   modulemap when placed here, but not when it's put in a subdirectory.
2022-01-05 18:32:53 -05:00
Felix HandteandGitHub 7e679511a8 Merge pull request #2964 from felixhandte/noexecstack-all-archs
Mark Huffman Decoder Assembly `noexecstack` on All Architectures
2022-01-05 16:52:39 -05:00
W. Felix Handte ff5d1daf33 Clean Up Debugging Statements 2022-01-05 16:13:00 -05:00
W. Felix Handte ef1f9e80ff Restrict GNU-stack Note to GNU Assemblers 2022-01-05 16:03:32 -05:00
W. Felix Handte b12edddb37 Write GNU-stack Section on All ELF Architectures
Previously we did this only on Linux, which missed other Unices.
2022-01-05 15:44:40 -05:00
W. Felix Handte 4620ce6a9a Makefiles: Add noexecstack Options to Compilation and Linking
Hopefully this marks the binary artifacts `noexecstack` even on platforms
where binaries default to true.
2022-01-05 15:12:31 -05:00
W. Felix Handte 35208f702f Add Test Validating Stack is not Executable in playTests.sh 2022-01-04 16:57:35 -05:00
W. Felix Handte 9a9d1ec6f4 Mark Huffman Decoder Assembly noexecstack on All Architectures
Apparently, even when the assembly file is empty (because
`ZSTD_ENABLE_ASM_X86_64_BMI2` is false), it still is marked as possibly
needing an executable stack and so the whole library is marked as such. This
commit applies a simple patch for this problem by moving the noexecstack
indication outside the macro guard.

This commit builds on #2857.

This commit addresses #2963.
2021-12-29 17:47:12 -08:00
Felix HandteandGitHub d5933a4009 Merge pull request #2930 from nolange/reduce_tables_to_8bit
Reduce tables to 8bit
2021-12-15 12:43:25 -05:00
Felix HandteandGitHub 5e2fede604 Merge pull request #2921 from felixhandte/neg-lvl-stagger-step
Stagger Stepping in Negative Levels
2021-12-14 14:13:57 -05:00
W. Felix Handte 450fca9704 Update Regression Tests w/ New Sizes 2021-12-13 17:29:32 -05:00
W. Felix Handte 82a49c88f9 Increment Step by 1 not 2
I couldn't find a good way to spread `ip0` and `ip1` apart when we accelerate
due to incompressible inputs. (The methods I tried slowed things down quite a
bit.)

Since we aren't splaying ip0 and ip1 apart (which would be like `0_1_2_3_`, as
opposed to the `01__23__` we were actually doing), it's a big ambitious to
increment `step` by 2. Instead, let's increment it by 1, which has the benefit
sliiightly improving compression. Speed remains pretty much unchanged.
2021-12-13 16:59:33 -05:00
W. Felix Handte 6ca5f42402 Rewrite step to Track Increment Between Pairs of Positions
The position updates are rewritten from `ip[N] = ip[N-1] + step` to be
`ip[N] = ip[N-2] + step`. This lets us only deal with the asymmetric spacing
of gaps at setup and then we only have to keep a single `step` variable.

This seems to work quite well on GCC and Clang!
2021-12-13 14:48:26 -05:00
W. Felix Handte b8434cb754 Allow Templating ZSTD_fast Matchfinders on Acceleration (Lvl < -1) 2021-12-13 14:46:57 -05:00
Felix HandteandGitHub 65404fe14a Merge pull request #2923 from IAL32/patch-1
typo: Small spelling mistake in example
2021-12-13 13:15:21 -05:00
W. Felix Handte ace6a7e746 Decompose step into Two Variables
This avoids an additional addition, at the cost of an additional variable.
2021-12-10 16:44:23 -05:00
W. Felix Handte 22501cd283 Stagger Application of stepSize in ZSTD_fast
This replicates the behavior of @terrelln's `ZSTD_fast` implementation. That
is, it always looks at adjacent pairs of positions, and only applies the
acceleration every other position. This produces a more fine-grained
acceleration.
2021-12-10 16:44:23 -05:00
Felix HandteandGitHub 0c26d98c0d Merge pull request #2910 from felixhandte/reject-irregular-dicts
Reject Irregular Dictionary Files
2021-12-09 11:44:37 -05:00
W. Felix Handte 9985e10fda Reject Irregular Dictionary Files
I hadn't seen #2890, so I wrote my own version. I like this approach a little
better, since it does an explicit check for a regular file, rather than
passing a magic value.

Addresses #2874.
2021-12-08 16:17:04 -05:00
Felix HandteandGitHub 33562c55de Merge pull request #2912 from felixhandte/pkg-config-fix
Fix Up #2659; Build libzstd.pc Whenever Building the Lib on Unix
2021-12-08 15:22:56 -05:00
W. Felix Handte 9f1dee8fa5 Fix Up #2659; Build libzstd.pc Whenever Building the Lib on Unix 2021-12-08 12:43:34 -05:00
Felix HandteandGitHub 9118ee04c2 Merge pull request #2659 from ericonr/pc
[lib] Fix libzstd.pc for lib-mt builds
2021-12-07 14:18:38 -05:00
Felix HandteandGitHub d2c86ec898 Merge pull request #2897 from felixhandte/zstd-deprecated-avoid-deprecated
Avoid Using Deprecated Functions in Deprecated Code
2021-12-03 12:09:58 -05:00
Felix HandteandGitHub fd6c34f641 Merge pull request #2899 from felixhandte/cmake-disable-multithreading-android
Disable Multithreading in CMake Builds for Android
2021-12-03 12:09:39 -05:00
W. Felix Handte 4a82bc9d00 Disable Multithreading in CMake Builds for Android 2021-12-02 17:23:42 -05:00
W. Felix Handte e688317652 Fix Include Path 2021-12-02 16:53:52 -05:00
W. Felix Handte d82d67d073 Migrate to FORWARD_IF_ERROR 2021-12-02 16:06:07 -05:00
W. Felix Handte a3ee9815c7 Avoid Using Deprecated Functions in Deprecated Code
`lib/deprecated` is no longer built by zstd's bundled build files. However,
users may try to build these files when they import the source tree into
their own build systems. And if they have `-Wdeprecated-declarations` on,
this can produce warnings.

This PR migrates these files away from using deprecated declarations.

This addresses #2767.
2021-12-02 14:25:33 -05:00
Felix HandteandGitHub c2c6a4ab40 Merge pull request #2869 from felixhandte/oss-fuzz-fix-41005
Determinism: Avoid Mapping Window into Reserved Indices during Reduction
2021-11-18 10:11:48 -05:00
W. Felix Handte 66079085f0 Determinism: Avoid Mapping Window into Reserved Indices during Reduction
PR #2850 attempted to fix a determinism bug that was uncovered by OSS-Fuzz. It
succeeded in addressing that source of non-determinism, but introduced a new
one: it was possible, when index reduction occurred, to map indices in the
window to the reserved value, which would cause them to be zeroed, potentially
altering parsing of the input.

This PR addresses this issue. It makes sure that the bottom of the window is
always `>= ZSTD_WINDOW_START_INDEX`.

I'm not sure if this makes #2850 redundant. I think it's probably still
valuable to have that protection as well.

Credit to OSS-Fuzz for discovering this issue.
2021-11-17 18:09:18 -05:00
Felix HandteandGitHub a071e00696 Merge pull request #2850 from felixhandte/oss-fuzz-fix-40829-for-real-this-time
Fix Determinism Bug: Avoid Reducing Indices to Reserved Values
2021-11-10 12:00:43 -05:00
W. Felix Handte 48572f52b1 Rewrite Fix to Still Auto-Vectorize 2021-11-09 12:17:03 -05:00
W. Felix Handte 61765cacd0 Avoid Reducing Indices to Reserved Values
Previously, if an index was equal to `reducerValue + 1`, it would get remapped
during index reduction to 1 i.e. `ZSTD_DUBT_UNSORTED_MARK`. This can affect the
parsing of the input slightly, by causing tree nodes to be nullified when they
otherwise wouldn't be. This hardly matters from a correctness or efficiency
perspective, but it does impact determinism.

So this commit changes index reduction to avoid mapping indices to collide with
`ZSTD_DUBT_UNSORTED_MARK`.
2021-11-08 20:03:52 -05:00
Felix HandteandGitHub 23c1a2d260 Merge pull request #2774 from felixhandte/zstd-dfast-pipelined-single
Pipelined Implementation of ZSTD_dfast
2021-10-13 16:38:43 -04:00
W. Felix Handte 0bfc935add Convert Outer Control Structure to Loop 2021-10-12 13:34:17 -04:00