]> git.ipfire.org Git - thirdparty/zstd.git/log
thirdparty/zstd.git
4 years ago[test] Add unit tests for ZSTD_c_stable{In,Out}Buffer 2354/head
Nick Terrell [Tue, 13 Oct 2020 01:40:14 +0000 (18:40 -0700)] 
[test] Add unit tests for ZSTD_c_stable{In,Out}Buffer

4 years ago[lib] Avoid allocating the input buffer when ZSTD_c_stableInBuffer is set
Nick Terrell [Mon, 12 Oct 2020 21:47:55 +0000 (14:47 -0700)] 
[lib] Avoid allocating the input buffer when ZSTD_c_stableInBuffer is set

We don't use it when we have a stable input buffer, so don't allocate
it. I had to slightly modify `ZSTD_copyCCtx()` by storing the
`ZSTD_buffered_policy_e` in the `ZSTD_CCtx`, since `inBuffSize > 0` is
no longer the correct signal for the buffered mode.

4 years ago[lib] Skip the input window buffer when ZSTD_c_stableInBuffer is set
Nick Terrell [Mon, 12 Oct 2020 21:36:30 +0000 (14:36 -0700)] 
[lib] Skip the input window buffer when ZSTD_c_stableInBuffer is set

Compress directly from the `ZSTD_inBuffer`. We still allocate the input
buffer. A following commit will remove that allocation.

4 years ago[cwksp] Return NULL when 0 bytes are requested
Nick Terrell [Mon, 12 Oct 2020 21:19:04 +0000 (14:19 -0700)] 
[cwksp] Return NULL when 0 bytes are requested

This ensures that the buffer is never used.

4 years ago[lib] Avoid allocating output buffer when ZSTD_c_stableOutBuffer is set
Nick Terrell [Mon, 12 Oct 2020 21:17:22 +0000 (14:17 -0700)] 
[lib] Avoid allocating output buffer when ZSTD_c_stableOutBuffer is set

We compress directly to the `ZSTD_outBuffer` so we don't need to
allocate it.

4 years ago[lib] Compress directly into output when ZSTD_c_stableOutBuffer is set
Nick Terrell [Mon, 12 Oct 2020 21:12:23 +0000 (14:12 -0700)] 
[lib] Compress directly into output when ZSTD_c_stableOutBuffer is set

When we have a stable output buffer always compress directly into the
`ZSTD_outBuffer`. We are allowed to return `dstSizeTooSmall`.

4 years ago[lib] Take the shortcut when ZSTD_c_stableOutBuffer is set
Nick Terrell [Mon, 12 Oct 2020 21:09:12 +0000 (14:09 -0700)] 
[lib] Take the shortcut when ZSTD_c_stableOutBuffer is set

When we have a stable output buffer take the single-pass shortcut.
It is okay to return `dstSizeTooSmall` if the output buffer isn't
big enough, because we know it will never grow.

4 years ago[lib] Set ZSTD_c_stable{In,Out}Buffer in ZSTD_compress2()
Nick Terrell [Mon, 12 Oct 2020 20:51:35 +0000 (13:51 -0700)] 
[lib] Set ZSTD_c_stable{In,Out}Buffer in ZSTD_compress2()

Sets these parameters in ZSTD_compress2() then resets them to their
orignal values after the compression call.

An alternative design could be to add a flush mode `ZSTD_e_singlePass`
which implies `ZSTD_c_stable{In,Out}Buffer` but only for a single
compression call, by directly setting the applied parameters. I've opted
for the smaller change, but this is open for discussion.

4 years ago[lib] Validate buffers when ZSTD_c_stable{In,Out}Buffer is set
Nick Terrell [Mon, 12 Oct 2020 20:45:33 +0000 (13:45 -0700)] 
[lib] Validate buffers when ZSTD_c_stable{In,Out}Buffer is set

Adds the validation of the input/output buffers only. They are still
unused.

4 years ago[API] Add ZSTD_c_stable{In,Out}Buffer parameters
Nick Terrell [Mon, 12 Oct 2020 20:15:39 +0000 (13:15 -0700)] 
[API] Add ZSTD_c_stable{In,Out}Buffer parameters

This commit adds the parameters and sets the value in the CCtxParams
but it does not do anything with the value.

4 years ago[lib] Set appliedParams in zstdmt mode
Nick Terrell [Tue, 13 Oct 2020 02:30:23 +0000 (19:30 -0700)] 
[lib] Set appliedParams in zstdmt mode

Previously only `nbWorkers` was set. Set all parameters, because that is
what is expected. This is needed for the `ZSTD_c_stable{In,Out}Buffer`
parameters.

4 years agoMerge pull request #2375 from senhuang42/ldm_oss_fuzz_testcase
sen [Thu, 29 Oct 2020 13:32:05 +0000 (09:32 -0400)] 
Merge pull request #2375 from senhuang42/ldm_oss_fuzz_testcase

Add a test case for LDM + opt parser with small uncompressible block

4 years agoUn-mix declarations and code 2375/head
senhuang42 [Wed, 28 Oct 2020 21:49:54 +0000 (17:49 -0400)] 
Un-mix declarations and code

4 years agoAdd check for allocation
senhuang42 [Wed, 28 Oct 2020 20:22:22 +0000 (16:22 -0400)] 
Add check for allocation

4 years agoMerge pull request #2373 from facebook/libzstd_autoconf_full
Yann Collet [Wed, 28 Oct 2020 18:57:08 +0000 (11:57 -0700)] 
Merge pull request #2373 from facebook/libzstd_autoconf_full

Automatic detection of configuration changes

4 years agoMerge branch 'dev' into libzstd_autoconf_full 2373/head
Yann Collet [Wed, 28 Oct 2020 17:53:08 +0000 (10:53 -0700)] 
Merge branch 'dev' into libzstd_autoconf_full

4 years agoMerge branch 'libzstd_autoconf_full' of github.com:facebook/zstd into libzstd_autocon...
Yann Collet [Wed, 28 Oct 2020 17:25:55 +0000 (10:25 -0700)] 
Merge branch 'libzstd_autoconf_full' of github.com:facebook/zstd into libzstd_autoconf_full

4 years agominor Makefile refactor
Yann Collet [Wed, 28 Oct 2020 16:39:15 +0000 (09:39 -0700)] 
minor Makefile refactor

hopefully improving readability

4 years agoMerge pull request #2339 from terrelln/zstdmt-stability
Nick Terrell [Wed, 28 Oct 2020 02:43:13 +0000 (19:43 -0700)] 
Merge pull request #2339 from terrelln/zstdmt-stability

Fix zstdmt stability issues and clean up the zstdmt code

4 years agoMerge branch 'dev' into libzstd_autoconf_full
Yann Collet [Tue, 27 Oct 2020 22:45:30 +0000 (15:45 -0700)] 
Merge branch 'dev' into libzstd_autoconf_full

4 years agoMerge pull request #2374 from bket/portability
Yann Collet [Tue, 27 Oct 2020 21:15:35 +0000 (14:15 -0700)] 
Merge pull request #2374 from bket/portability

'head -c BYTES' is non-portable

4 years agoMove test to appropriate location
senhuang42 [Tue, 27 Oct 2020 20:59:43 +0000 (16:59 -0400)] 
Move test to appropriate location

4 years agoAdd test to fuzzer.c
senhuang42 [Tue, 27 Oct 2020 20:57:24 +0000 (16:57 -0400)] 
Add test to fuzzer.c

4 years agoMerge pull request #2366 from senhuang42/enable_ldm_by_default
sen [Tue, 27 Oct 2020 18:59:28 +0000 (14:59 -0400)] 
Merge pull request #2366 from senhuang42/enable_ldm_by_default

Enable LDM by default if window size >= 128MB and strategy uses opt parser

4 years agoMerge pull request #2362 from senhuang42/fix_ldm_fuzz_issue
Nick Terrell [Tue, 27 Oct 2020 18:13:03 +0000 (11:13 -0700)] 
Merge pull request #2362 from senhuang42/fix_ldm_fuzz_issue

Fix long distance matcher OSS-fuzz issue

4 years ago'head -c BYTES' is non-portable 2374/head
Björn Ketelaars [Tue, 27 Oct 2020 15:51:24 +0000 (16:51 +0100)] 
'head -c BYTES' is non-portable

4 years agoMerge branch 'dev' into libzstd_autoconf_full
Yann Collet [Mon, 26 Oct 2020 22:17:39 +0000 (15:17 -0700)] 
Merge branch 'dev' into libzstd_autoconf_full

4 years agoMerge pull request #2370 from facebook/libzstd_autoconf
Yann Collet [Mon, 26 Oct 2020 22:16:04 +0000 (15:16 -0700)] 
Merge pull request #2370 from facebook/libzstd_autoconf

Automatic configuration detection

4 years agomake install only rebuild binaries if they don't exist
Yann Collet [Fri, 23 Oct 2020 23:46:49 +0000 (16:46 -0700)] 
make install only rebuild binaries if they don't exist

Now `make` followed by `make install` doesn't rebuild binaries

also : only generated target directories if they don't already exist

4 years agomake zstd is now differentiated from zstd-nomt
Yann Collet [Fri, 23 Oct 2020 23:08:21 +0000 (16:08 -0700)] 
make zstd is now differentiated from zstd-nomt

avoids mixing object files using different flags

4 years agosimplified silent mode maintenance
Yann Collet [Fri, 23 Oct 2020 17:41:17 +0000 (10:41 -0700)] 
simplified silent mode maintenance

4 years agofix partial lib test
Yann Collet [Fri, 23 Oct 2020 17:27:12 +0000 (10:27 -0700)] 
fix partial lib test

4 years agosimplified silent mode
Yann Collet [Fri, 23 Oct 2020 17:22:52 +0000 (10:22 -0700)] 
simplified silent mode

4 years agofixed building libzstd with manual BUILD_DIR
Yann Collet [Fri, 23 Oct 2020 17:14:04 +0000 (10:14 -0700)] 
fixed building libzstd with manual BUILD_DIR

and when HASH is not found

4 years agofix partial-build test 2370/head
Yann Collet [Fri, 23 Oct 2020 02:53:01 +0000 (19:53 -0700)] 
fix partial-build test

sometimes, the scope difference is solely determined by the list of source files,
not by the flags.

4 years agoMerge branch 'dev' into libzstd_autoconf
Yann Collet [Fri, 23 Oct 2020 01:55:30 +0000 (18:55 -0700)] 
Merge branch 'dev' into libzstd_autoconf

4 years agocan integrate later dynamic flags changes
Yann Collet [Fri, 23 Oct 2020 01:48:06 +0000 (18:48 -0700)] 
can integrate later dynamic flags changes

for example `libzstd-mt` is `differentiated from `libzstd`

4 years agoMerge pull request #2368 from facebook/progressive_libzstd
Yann Collet [Fri, 23 Oct 2020 00:36:56 +0000 (17:36 -0700)] 
Merge pull request #2368 from facebook/progressive_libzstd

faster rebuild of libzstd

4 years agoupdated build documentation
Yann Collet [Thu, 22 Oct 2020 19:31:23 +0000 (12:31 -0700)] 
updated build documentation

4 years agofixed libzstd.dll compilation on mingw
Yann Collet [Thu, 22 Oct 2020 18:28:46 +0000 (11:28 -0700)] 
fixed libzstd.dll compilation on mingw

and zstd linking

4 years agofix DEBUGLEVEL redefinition from tests/
Yann Collet [Thu, 22 Oct 2020 07:20:40 +0000 (00:20 -0700)] 
fix DEBUGLEVEL redefinition from tests/

4 years agofix directory creation for Windows' libzstd
Yann Collet [Thu, 22 Oct 2020 07:15:31 +0000 (00:15 -0700)] 
fix directory creation for Windows' libzstd

4 years agofix test
Yann Collet [Thu, 22 Oct 2020 06:51:13 +0000 (23:51 -0700)] 
fix test

DEBUGLEVEL redefinition

4 years agoprograms/zstd also automatically generate object dir per conf
Yann Collet [Thu, 22 Oct 2020 06:38:33 +0000 (23:38 -0700)] 
programs/zstd also automatically generate object dir per conf

same rules as lib/libzstd
can also be controlled via HASH and BUILD_DIR

4 years agozstd in programs/ can also receive a DEBUGLEVEL value
Yann Collet [Thu, 22 Oct 2020 06:13:46 +0000 (23:13 -0700)] 
zstd in programs/ can also receive a DEBUGLEVEL value

simplify tests : only set DEBUGLEVEL, not the flags directly

4 years agoMerge branch 'dev' into libzstd_autoconf
Yann Collet [Thu, 22 Oct 2020 05:36:09 +0000 (22:36 -0700)] 
Merge branch 'dev' into libzstd_autoconf

4 years agoautomatically detect configuration changes
Yann Collet [Thu, 22 Oct 2020 02:22:45 +0000 (19:22 -0700)] 
automatically detect configuration changes

Makefile now automatically detects modifications of compilation flags,
and produce object files in directories dedicated to this compilation flags.
This makes it possible, for example, to compile libzstd with different DEBUGLEVEL.
Object files sharing the same configration will be generated into their dedicated directories.

Also : new compilation variables
- DEBUGLEVEL : select the debug level (assert & traces) inserted during compilation (default == 0 == release)
- HASH : select a hash function to differentiate configuration (default == md5sum)
- BUILD_DIR : skip the hash stage, store object files into manually specified directory

4 years agoautomatic %.h header dependency tracking 2368/head
Yann Collet [Thu, 22 Oct 2020 00:25:07 +0000 (17:25 -0700)] 
automatic %.h header dependency tracking

also : BUILD_DIR can be manually specified

4 years agoMerge pull request #2367 from facebook/progressive_build
Yann Collet [Wed, 21 Oct 2020 22:43:14 +0000 (15:43 -0700)] 
Merge pull request #2367 from facebook/progressive_build

faster rebuild of zstd

4 years agoconsolidated vpath
Yann Collet [Wed, 21 Oct 2020 11:01:01 +0000 (04:01 -0700)] 
consolidated vpath

4 years agostore %.o object files into obj/
Yann Collet [Wed, 21 Oct 2020 10:44:38 +0000 (03:44 -0700)] 
store %.o object files into obj/

both static and dynamic libraries have their own object directory

4 years agominor cleaning
Yann Collet [Wed, 21 Oct 2020 10:22:27 +0000 (03:22 -0700)] 
minor cleaning

4 years agobuild libzstd.so from object files
Yann Collet [Wed, 21 Oct 2020 05:19:57 +0000 (22:19 -0700)] 
build libzstd.so from object files

%.o object files generated for dynamic library
must be different from those generated for static library.

Due to this difference, %.o were so far only generated for the static library.
The dynamic library was rebuilt from %.c source.

This meant that, for every minor change, the entire dynamic library had to be rebuilt.

This is fixed in this PR :
only the modified %.c source get rebuilt.

4 years agodecouple zstd object files from lib/ 2367/head
Yann Collet [Wed, 21 Oct 2020 01:16:11 +0000 (18:16 -0700)] 
decouple zstd object files from lib/

That was a subtle one :
VPATH is affecting search for both %.c source and %.o object files.
This meant that, when an object file already exists in lib/,
it's used in programs/,
even though programs/ is supposed to generate its own %.o object files.

With the new vpath directive, this is no longer the case :
the search is only activated for %.c source files.
Now, local programs/%.o are always generated
even if equivalent ones are already created in lib/.

It more clearly guarantees that lib/ and programs/ can use different compilation directives
without mixing resulting %.o object files.

4 years agofixed travis tests
Yann Collet [Tue, 20 Oct 2020 23:32:22 +0000 (16:32 -0700)] 
fixed travis tests

4 years agoAdd a function for LDM enable check 2366/head
senhuang42 [Tue, 20 Oct 2020 17:46:02 +0000 (13:46 -0400)] 
Add a function for LDM enable check

4 years agoMove ldm enable to compressStream2()
senhuang42 [Tue, 20 Oct 2020 17:01:04 +0000 (13:01 -0400)] 
Move ldm enable to compressStream2()

4 years agoMerge pull request #2365 from senhuang42/move_opt_parser_test_to_long_tests
Nick Terrell [Tue, 20 Oct 2020 15:34:36 +0000 (11:34 -0400)] 
Merge pull request #2365 from senhuang42/move_opt_parser_test_to_long_tests

Move ldm + opt parser no regression test to long tests

4 years agoInclude LDM tables size for CCtx size estimation where relevant
senhuang42 [Mon, 19 Oct 2020 19:22:10 +0000 (15:22 -0400)] 
Include LDM tables size for CCtx size estimation where relevant

4 years agoMove ldm no regression test to fuzzer longtests 2365/head
senhuang42 [Mon, 19 Oct 2020 19:27:40 +0000 (15:27 -0400)] 
Move ldm no regression test to fuzzer longtests

4 years agoAdd compatibility for multithreading
senhuang42 [Mon, 19 Oct 2020 16:07:06 +0000 (12:07 -0400)] 
Add compatibility for multithreading

4 years agoDocument ldm enabled by default in zstd.h
senhuang42 [Mon, 19 Oct 2020 15:02:29 +0000 (11:02 -0400)] 
Document ldm enabled by default in zstd.h

4 years agoAdd unit test for no cctx requested params change
senhuang42 [Mon, 19 Oct 2020 14:52:41 +0000 (10:52 -0400)] 
Add unit test for no cctx requested params change

4 years agoAdd ldm enable condition in ZSTD_resetCCtx_internal
senhuang42 [Mon, 19 Oct 2020 14:26:17 +0000 (10:26 -0400)] 
Add ldm enable condition in ZSTD_resetCCtx_internal

4 years agoExpose and call ZSTD_ldm_skipRawSeqStoreBytes() 2362/head
senhuang42 [Sat, 17 Oct 2020 00:30:00 +0000 (20:30 -0400)] 
Expose and call ZSTD_ldm_skipRawSeqStoreBytes()

4 years agofix appveyor test
Yann Collet [Fri, 16 Oct 2020 21:31:40 +0000 (14:31 -0700)] 
fix appveyor test

was mixing `*.o` object files from different compilation settings

4 years agoMerge pull request #2359 from senhuang42/fuzz_makefile_cleanup
Nick Terrell [Fri, 16 Oct 2020 20:53:34 +0000 (13:53 -0700)] 
Merge pull request #2359 from senhuang42/fuzz_makefile_cleanup

[minor] Fix some /tests/fuzz Makefile annoyances

4 years agoMerge pull request #2355 from senhuang42/change_ldm_mt_config
Yann Collet [Fri, 16 Oct 2020 20:35:50 +0000 (13:35 -0700)] 
Merge pull request #2355 from senhuang42/change_ldm_mt_config

Reduce --long mode MT jobsize at higher levels

4 years agoMerge pull request #2357 from senhuang42/fix_ldm_nd_behavior
Yann Collet [Fri, 16 Oct 2020 20:35:28 +0000 (13:35 -0700)] 
Merge pull request #2357 from senhuang42/fix_ldm_nd_behavior

Fix nondeterministic LDM behavior in multithreading

4 years agominor : change test order
Yann Collet [Fri, 16 Oct 2020 20:26:47 +0000 (13:26 -0700)] 
minor : change test order

to reduce a warning with `clang` on Windows

4 years agofix .deps list
Yann Collet [Fri, 16 Oct 2020 17:19:16 +0000 (10:19 -0700)] 
fix .deps list

and minor simplications

4 years agosupport verbose build output with V=1
Yann Collet [Fri, 16 Oct 2020 07:21:49 +0000 (00:21 -0700)] 
support verbose build output with V=1

4 years agotrack header dependencies during build
Yann Collet [Fri, 16 Oct 2020 07:18:16 +0000 (00:18 -0700)] 
track header dependencies during build

modifying a header file will now trigger recompilation of related *.c units

4 years agofaster rebuild of zstd
Yann Collet [Fri, 16 Oct 2020 07:01:41 +0000 (00:01 -0700)] 
faster rebuild of zstd

Building the zstd CLI costs time.
Some part of it is incompressible, leading to substantial iteration delay when testing code modifications.
That's mainly because all source files from the library must be rebuilt from source every time.

The main reason we don't build the CLI from library object files
is that we can't just build the object directly in the lib/ directory
(which they would by default)
since they use different compilation flags.
Specifically, the CLI enables multithreading, while the library doesn't (by default).

This is solved in this commit, by generating the object files locally.
Now, the CLI and the library can employ different sets of flags, without tripping over each other.
All library object files are generated directly into programs/ dir.
This works because no 2 source files have the same name.

Now, modifying a file doesn't require to recompile the entire lib, just the modified files.
The recipe is also compatible with `-j` parallel build, leading to large build time reductions on multi-core systems.

4 years agoMerge pull request #2361 from senhuang42/fix_travis_minimal_decompressor_macros_test
Yann Collet [Thu, 15 Oct 2020 22:35:57 +0000 (15:35 -0700)] 
Merge pull request #2361 from senhuang42/fix_travis_minimal_decompressor_macros_test

[travis CI] Change make -j all check to make -j all && make check

4 years agoChange make -j all check to make -j all && make check 2361/head
senhuang42 [Thu, 15 Oct 2020 19:00:26 +0000 (15:00 -0400)] 
Change make -j all check to make -j all && make check

4 years agoMerge pull request #2360 from facebook/zwrap_parallel_build
Yann Collet [Thu, 15 Oct 2020 18:54:15 +0000 (11:54 -0700)] 
Merge pull request #2360 from facebook/zwrap_parallel_build

fix zwrapbench parallel build

4 years agofix zlibwrap parallel build 2360/head
Yann Collet [Thu, 15 Oct 2020 17:56:37 +0000 (10:56 -0700)] 
fix zlibwrap parallel build

previous recipe would build object files directly within programs/
which could be in competition with other local builds happening in programs/ at the same time.

fixed by generating the relevant object file locally.

4 years agoAdd libregression build target, also fix make clean and .gitignore 2359/head
senhuang42 [Thu, 15 Oct 2020 14:32:49 +0000 (10:32 -0400)] 
Add libregression build target, also fix make clean and .gitignore

4 years agoChange cycleLog adjustment to +3 from +4 2355/head
senhuang42 [Thu, 15 Oct 2020 13:56:05 +0000 (09:56 -0400)] 
Change cycleLog adjustment to +3 from +4

4 years agoReset posInSequence when using ZSTD_referenceExternalSequences()
senhuang42 [Thu, 15 Oct 2020 02:06:08 +0000 (22:06 -0400)] 
Reset posInSequence when using ZSTD_referenceExternalSequences()

4 years agoClarify argument names, fix DEBUGLOG() statements 2357/head
senhuang42 [Wed, 14 Oct 2020 19:45:43 +0000 (15:45 -0400)] 
Clarify argument names, fix DEBUGLOG() statements

4 years agoAdjust match backwards count args
senhuang42 [Wed, 14 Oct 2020 19:23:03 +0000 (15:23 -0400)] 
Adjust match backwards count args

4 years agoIntroduce, implement, and call ZSTD_ldm_countBackwardsMatch_2segments()
senhuang42 [Mon, 12 Oct 2020 20:17:39 +0000 (16:17 -0400)] 
Introduce, implement, and call ZSTD_ldm_countBackwardsMatch_2segments()

4 years agoMerge branch 'dev' of github.com:senhuang42/zstd into change_ldm_mt_config
senhuang42 [Wed, 14 Oct 2020 14:17:50 +0000 (10:17 -0400)] 
Merge branch 'dev' of github.com:senhuang42/zstd into change_ldm_mt_config

4 years agoMerge pull request #2356 from bsdimp/neon
Nick Terrell [Tue, 13 Oct 2020 22:42:46 +0000 (15:42 -0700)] 
Merge pull request #2356 from bsdimp/neon

aarch64: use __ARM_NEON instead of __aarch64__ to control use of neon

4 years agoMerge pull request #2281 from likema/fix-aix-51
Yann Collet [Tue, 13 Oct 2020 20:09:33 +0000 (13:09 -0700)] 
Merge pull request #2281 from likema/fix-aix-51

Fix building on AIX 5.1

4 years agoMerge pull request #2341 from senhuang42/ldm_optimized_for_opt_parser
Yann Collet [Tue, 13 Oct 2020 20:09:07 +0000 (13:09 -0700)] 
Merge pull request #2341 from senhuang42/ldm_optimized_for_opt_parser

Integrate long distance matches into optimal parser

4 years agoaarch64: use __ARM_NEON instead of __aarch64__ to control use of neon 2356/head
Warner Losh [Tue, 13 Oct 2020 18:12:46 +0000 (12:12 -0600)] 
aarch64: use __ARM_NEON instead of __aarch64__ to control use of neon

There are compilation environments in aarch64 where NEON isn't
available. While these environments could define ZSTD_NO_INTRINSICS,
it's more fail-safe to use the more specific symbol to know if NEON
extensions are available.

__ARM_NEON is the proper symbol, defined in ARM C Language Extensions
Release 2.1 (https://developer.arm.com/documentation/ihi0053/d/). Some
sources suggest __ARM_NEON__, but that's the obsolete spelling from
prior versions of the standard.

Signed-off-by: Warner Losh <imp@bsdimp.com>
4 years agoFix incorrect usage of cycleLog() in --patch-from
senhuang42 [Tue, 13 Oct 2020 17:00:27 +0000 (13:00 -0400)] 
Fix incorrect usage of cycleLog() in --patch-from

4 years agoMerge pull request #2337 from terrelln/adjust-params
Nick Terrell [Tue, 13 Oct 2020 01:42:24 +0000 (18:42 -0700)] 
Merge pull request #2337 from terrelln/adjust-params

Fix ZSTD_adjustCParams_internal() to handle dictionary logic

4 years ago[minor] Improve docs and add an assert in response to review 2337/head
Nick Terrell [Mon, 12 Oct 2020 19:52:42 +0000 (12:52 -0700)] 
[minor] Improve docs and add an assert in response to review

4 years agoUse cycleLog instead of chainLog to determine LDM jobLog
senhuang42 [Mon, 12 Oct 2020 16:20:18 +0000 (12:20 -0400)] 
Use cycleLog instead of chainLog to determine LDM jobLog

4 years ago[zstdmt] Clarify a comment 2339/head
Nick Terrell [Mon, 12 Oct 2020 19:58:13 +0000 (12:58 -0700)] 
[zstdmt] Clarify a comment

4 years ago[zstdmt] Fix determinism issue with rsyncable mode
Nick Terrell [Tue, 6 Oct 2020 02:14:19 +0000 (19:14 -0700)] 
[zstdmt] Fix determinism issue with rsyncable mode

The problem occurs in this scenario:
1. We find a synchronization point.
2. We attmept to create the job.
3. We fail because the job table is full: `mtctx->nextJobID > mtctx->doneJobID + mtctx->jobIDMask`.
4. We call `ZSTDMT_compressStream_generic` again.
5. We forget that we're at a sync point already, and we continue looking
   for the next sync point.

This fix is to detect if we're currently paused at a sync point, and if
we are then don't load any more input.

Caught by zstreamtest. I modified it to make the bug occur more often
(~1/100K -> ~1/200) and verified that it is fixed after. I then ran a
few hundred thousand unmodified zstreamtest iterations to verify.

4 years ago[zstdmt] Fix bug where extra empty blocks are emitted
Nick Terrell [Tue, 6 Oct 2020 00:37:19 +0000 (17:37 -0700)] 
[zstdmt] Fix bug where extra empty blocks are emitted

When zstdmt cannot get a buffer and `ZSTD_e_end` is passed an empty
compression job can be created. Additionally, `mtctx->frameEnded` can be
set to 1, which could potentially cause problems like unterminated blocks.

The fix is to adjust to `ZSTD_e_flush` even when we can't get a buffer.

4 years ago[zstreamtest] Add compression determinism tests
Nick Terrell [Thu, 1 Oct 2020 22:02:15 +0000 (15:02 -0700)] 
[zstreamtest] Add compression determinism tests

* Run compression twice and check the compressed data is byte-identical.
  The compression loop had to be rewritten to ensure deteriminism. It is
  guaranteed by always making maximal forward progress.
* When nbWorkers > 0, change the number of workers 1/8 of the time.
* Run in single-pass mode 1/4 of the time.

I've run a few hundred thousand iterations of zstreamtest and have seen
no deteriminism issues so far. Before the zstdmt fix that skips the
single-pass shortcut non-determinism showed up in a few hundred
iterations.

4 years ago[zstdmt] Rip out the zstdmt API
Nick Terrell [Fri, 2 Oct 2020 01:47:54 +0000 (18:47 -0700)] 
[zstdmt] Rip out the zstdmt API

This commit leaves only the functions used by zstd_compress.c. All other
functions have been removed from the API. The ZSTDMT unit tests in
fuzzer.c and zstreamtest.c have been rewritten to use the ZSTD API. And
the --mt zstreamtest tests have been ripped out.

4 years ago[zstdmt] Remove single-pass shortcut
Nick Terrell [Thu, 1 Oct 2020 21:29:13 +0000 (14:29 -0700)] 
[zstdmt] Remove single-pass shortcut

Simplifies the code and removes blocking from zstdmt.

At this point we could completely delete
`ZSTDMT_compress_advanced_internal()`. However I'm leaving it in because
I think we want to do that in the zstd-1.5.0 release, in case anyone is
still using the ZSTDMT API, even though it is not installed by default.

Fixes #2327.

4 years ago[zstdmt] Remove singleBlockingThread mode
Nick Terrell [Thu, 1 Oct 2020 20:45:29 +0000 (13:45 -0700)] 
[zstdmt] Remove singleBlockingThread mode

This is already handled by zstd, so this logic is never used.