Commit Graph

7363 Commits (6a426ef65e0864b658dc78bbb45eb23c29b1275d)

Author SHA1 Message Date
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
Bimba Shrestha eb76f786bc [bench] Automated benchmarking script (#1906)
* Initial revised automated benchmarking script

* Updating nb_iterations and making loop infinite

* Allowing benchmarking params to be changed from cli

* Renaming old speed test

* Removing numpy dependency for cli

* Change filename and benchmakr on pr level

* Moving build outside loop and adding iterations param

* Moving benchmarking to seperate travis ci test

* Fixing typo and using unused variable

* Added mode labels and updated README accordingly

* Adding new mode 'current' that compraes facebook:dev against current hash

* Typo

* Reverting previous accidental diff

* Typo

* Adding frequency config variable to prevent github from blacklisting

* Added new argument for frequency of fetching new prs

* Updating documentation
2020-01-06 14:19:11 -08:00
Bimba Shrestha b1f53b1a10 [fuzz] Dividing by targetCBlockSize instead of blockSize for nbBlocks fit (#1936)
* Adding fail logging for superblock flow

* Dividing by targetCBlockSize instead of blockSize

* Adding new const and using more acurate formula for nbBlocks

* Only do dstCapacity check if using superblock

* Remvoing disabling logic

* Updating test to make it catch more extreme case of previou bug

* Also updating comment

* Only taking compressEnd shortcut on non-superblock
2020-01-03 16:53:51 -08:00
Bimba Shrestha ef1684f29a [doc] Adding -M# decompression operation modifier documentation (#1938)
* Adding -M# operation modifier documentation

* Adding long name, typo and update desc
2020-01-03 16:36:47 -08:00
Felix Handte 68160372be
Merge pull request #1920 from felixhandte/fix-mtim-again
Use statbuf->st_mtim Again
2020-01-03 16:07:16 -05:00
Felix Handte 6f4341c432 Fix playTests.sh Under QEMU (#1923) 2019-12-26 11:16:23 -08:00
W. Felix Handte e2a99db2dd Also Define _ATFILE_SOURCE 2019-12-23 13:24:28 -05:00
W. Felix Handte 5666835ea7 Add Comment 2019-12-23 13:24:28 -05:00
W. Felix Handte 5af8cb7aea Use statbuf->st_mtim Again 2019-12-23 13:24:28 -05:00
W. Felix Handte 976c055a9a Add Travis Test that Builds ARM on Trusty 2019-12-23 13:24:28 -05:00
W. Felix Handte 5f46894184 Fix playTests.sh Under QEMU 2019-12-23 13:24:28 -05:00
Yann Collet 1c9ac4ccf4
Merge pull request #1928 from bimbashrestha/bimba-oss
[fuzz] Adding bool to check if there is enough room to emit noCompress Superblocks
2019-12-19 12:58:24 -08:00
Felix Handte 07ad866754
Merge pull request #1932 from felixhandte/diagnose-corruption-dicts
Add Support for Dictionaries in Corruption Diagnosis Tool
2019-12-19 12:08:28 -05:00