Commit Graph

7675 Commits

Author SHA1 Message Date
Bimba Shrestha
38d010eea0 Adding static assert and using it in cli 2020-01-31 10:47:17 -08:00
Bimba Shrestha
0fa6c90e89 Moving to same category as -v 2020-01-31 10:38:19 -08:00
Bimba Shrestha
f4ae6c0b94 Moving documentation and elaborating 2020-01-30 17:54:42 -08:00
Bimba Shrestha
9d9cfa9ef9 Adding assert and using ZSTD_STRATEGY_MAX as ZSTD_NB_STRATEGIES 2020-01-30 17:54:01 -08:00
Bimba Shrestha
6ad2f0d7d6 Adding back one cast and using UTIL_FILESIZE_UNKNOWN to check unknown file size 2020-01-30 17:16:02 -08:00
Bimba Shrestha
6bf05a53ab Documenting in the man file 2020-01-30 17:11:38 -08:00
Bimba Shrestha
c203341292 Removing more casts 2020-01-30 17:07:58 -08:00
Bimba Shrestha
2a0771cfdb Removing unnecessary cast 2020-01-30 17:05:33 -08:00
Bimba Shrestha
b0ceab4dc0 Moving default cparams back, checking for unknown file size, using getCParams() 2020-01-30 16:52:07 -08:00
Bimba Shrestha
b660ef87f8 Convertion nit U32 -> size_t 2020-01-30 14:29:04 -08:00
Bimba Shrestha
71754a26f8 Update comment 2020-01-30 14:14:27 -08:00
Bimba Shrestha
2f10019b92 Adding --show-default-cparams (show cparams before compressing 2020-01-30 14:12:03 -08:00
Nick Terrell
6a426ef65e
Merge pull request #1977 from terrelln/copyless
Improve wildcopy performance across the board
2020-01-29 15:32:19 -08:00
Bimba Shrestha
3b10060b71
Merge pull request #1978 from bimbashrestha/quick
[Typo][fix] make benchmarking typo fix
2020-01-28 22:11:51 -08:00
Bimba Shrestha
9b049836c9 Typo baseline_build -> baseline_label 2020-01-28 21:39:20 -08:00
Nick Terrell
e32e3e8662 Improve wildcopy performance across the board 2020-01-28 20:37:04 -08:00
Bimba Shrestha
8fe562a770 [automated_benchmarking] Make arguments optional and add --dict argument (#1968)
* Make arugments optional and add --dict argument

* Removing accidental print statement

* Change to more likely scenario for dictionary compression benchmark
2020-01-28 11:29:43 -08:00
Yann Collet
9a71d07aa4
added ability to remove error messages and dictionary support (#1975)
for the benefit of smaller binary.
2020-01-27 11:39:29 -08:00
Yann Collet
5bcd6448b6
refactor of harness, for clarity (#1974)
following #1953 (false positive, due to heuristic confusion)
2020-01-24 20:16:28 -08:00
Yann Collet
5c769e33f8 Merge branch 'dev' of github.com:facebook/zstd into dev 2020-01-24 15:04:02 -08:00
Yann Collet
f34eab162f updated CHANGELOG 2020-01-24 14:12:25 -08:00
Nick Terrell
7627759b4e
Merge pull request #1972 from terrelln/check-cont
Move ZSTD_checkContinuity() to zstd_decompress_block.c
2020-01-23 22:02:50 -08:00
Nick Terrell
e6d3a61db8
Merge pull request #1973 from terrelln/mobile-perf
Fix performance regression on aarch64 with clang
2020-01-23 22:02:32 -08:00
Nick Terrell
fa6a772f38 Initialize dctx->bType to silence valgrind false positive 2020-01-23 17:54:48 -08:00
Nick Terrell
cb2abc3dbe Fix performance regression on aarch64 with clang 2020-01-23 17:31:14 -08:00
Nick Terrell
6e3cd5b024 Move ZSTD_checkContinuity() to zstd_decompress_block.c 2020-01-23 12:27:39 -08:00
Nick Terrell
2f31050a3f
Merge pull request #1965 from terrelln/android-fix
Fix timefn on android
2020-01-22 15:42:50 -08:00
Nick Terrell
7ec87cfb28 Update comment in timefn 2020-01-22 11:17:30 -08:00
Nick Terrell
768adc0774 Fix timefn on android 2020-01-21 18:57:16 -08:00
Felix Handte
3a9a079ed1
Merge pull request #1956 from PhoebeHui/dev
Add vcpkg installation instructions
2020-01-21 11:54:00 -05:00
PhoebeHui
7738709020 Update comments 2020-01-19 23:51:40 -08:00
Nick Terrell
db9c8af600
Merge pull request #1957 from terrelln/fix-ultra
Fix lowLimit underflow in overflow correction
2020-01-17 18:01:35 -08:00
Nick Terrell
76e01f3555
Merge pull request #1958 from terrelln/docs
Add --single-thread to zstd --help
2020-01-17 14:46:00 -08:00
Nick Terrell
009f388457 Fix playTests.sh for 32-bit mode 2020-01-17 14:20:44 -08:00
Nick Terrell
fa48af545f Add --single-thread to zstd --help 2020-01-17 13:54:49 -08:00
Nick Terrell
a11a9271d6 Fix lowLimit underflow in overflow correction 2020-01-17 12:10:18 -08:00
PhoebeHui
3e8222be58 Add vcpkg installation instructions 2020-01-17 03:31:08 -08:00
Nick Terrell
957d59c721
Merge pull request #1950 from terrelln/ctest
[cmake] Add playTests.sh as a test
2020-01-13 16:16:25 -08:00
Nick Terrell
f6d00c059f [util] Fix readLineFromFile on Cygwin 2020-01-13 14:37:22 -08:00
Nick Terrell
3ed0f65158 [cmake] Add playTests.sh as a test 2020-01-13 14:16:15 -08:00
Nick Terrell
f27b4b4ec5
Merge pull request #1948 from lazka/cygwin-fix-c99-build
Fix the c99/cmake build under Cygwin/MSYS2
2020-01-13 11:35:28 -08:00
Christoph Reiter
9a5d8a6cb4 appveyor: build with CMake under Cygwin 2020-01-11 11:37:22 +01:00
Nick Terrell
036b30b555
Fix super block compression and stream raw blocks in decompression (#1947)
Super blocks must never violate the zstd block bound of input_size + ZSTD_blockHeaderSize. The individual sub-blocks may, but not the super block. If the superblock violates the block bound we are liable to violate ZSTD_compressBound(), which we must not do. Whenever the super block violates the block bound we instead emit an uncompressed block.

This means we increase the latency because of the single uncompressed block. I fix this by enabling streaming an uncompressed block, so the latency of an uncompressed block is 1 byte. This doesn't reduce the latency of the buffer-less API, but I don't think we really care.

* I added a test case that verifies that the decompression has 1 byte latency.
* I rely on existing zstreamtest / fuzzer / libfuzzer regression tests for correctness. During development I had several correctness bugs, and they easily caught them.
* The added assert that the superblock doesn't violate the block bound will help us discover any missed conditions (though I think I got them all).

Credit to OSS-Fuzz.
2020-01-10 18:02:11 -08:00
Christoph Reiter
ddd4c39736 Fix the c99/cmake build under Cygwin/MSYS2
When building zst under cygwin or msys2 with std=c99 the build would fail because
of an undefined fileno()/_fileno(), which is used by the IS_CONSOLE() macro.

When building with -std=c99 (gcc otherwise defaults to gnu, which implies POSIX),
which is the default of the cmake build, then including unistd.h wont define
_POSIX_VERSION and all other headers also wont expose POSIX API.

To fix this make sure to define _POSIX_C_SOURCE with the version we want before including
unistd.h and so that _POSIX_VERSION is set to the version provided by the system.

Since Cygwin/MSYS2 just follow POSIX we can also remove their special cases for
defining IS_CONSOLE().

And, for completeness, also explicitly include stdio.h which is what actually declares fileno().

Tested with the normal make file and cmake under MSYS2 and Cygwin.
2020-01-11 01:39:10 +01:00
Bimba Shrestha
f25a6e9f8f Adding new cli endpoint --patch-from= (#1940)
* Adding new cli endpoint --diff-from=

* Appveyor conversion nit

* Using bool set trick instead of direct set

* Removing --diff-from and only leaving --diff-from=#

* Throwing error when both dictFileName vars are set

* Clean up syntax

* Renaming diff-from to patch-from

* Revering comma separated syntax clean up

* Updating playtests with patch-from

* Uncommenting accidentally commented

* Updating remaining docs and var names to be patch-from instead of diff-from

* Constifying

* Using existing log2 function and removing newly created one

* Argument order (moving prefs to end)

* Using comma separated syntax

* Moving to outside #ifndef
2020-01-10 14:25:24 -08:00
Nick Terrell
d1cc9d2797
[fuzz] Allow zero sized buffers for streaming fuzzers (#1945)
* Allow zero sized buffers in `stream_decompress`. Ensure that we never have two
  zero sized buffers in a row so we guarantee forwards progress.
* Make case 4 in `stream_round_trip` do a zero sized buffers call followed by
  a full call to guarantee forwards progress.
* Fix `limitCopy()` in legacy decoders.
* Fix memcpy in `zstdmt_compress.c`.

Catches the bug fixed in PR #1939
2020-01-09 11:38:50 -08:00
Igor Sugak
03ffda7b88 fix UBSAN's invalid-null-argument error in zstd_decompress.c (#1939) 2020-01-08 16:17:42 -08:00
Nick Terrell
b77ad810c9
[fuzz] Fix regression_driver.c with directory input (#1944)
The `numFiles` variable wasn't updated, so the fuzzer didn't do anything.
I did two things to fix this:

1. Remove the `numFiles` variable entirely.
2. Error if we can't open a file and print the number of files tested.
2020-01-08 13:20:56 -08:00
Christoph Reiter
d0dcaf56c2 Make UTIL_countPhysicalCores() work under Cygwin (#1941)
Cygwin currently uses the fallback implementation which just returns 1 every time,
which leads to bad performance when zstd is called with -T0 for example.

Instead use the POSIX implementation used for the BSDs which works just fine under Cygwin.

Tested under Cygwin and MSYS2.
2020-01-07 15:48:26 -08:00
Yann Collet
3119256267 updated CHANGELOG
one missing item in v1.4.4
2020-01-07 09:51:22 -08:00