Commit Graph
100 Commits
Author SHA1 Message Date
Yann Collet c5bf6b8b88 add requested check for legacy decoder v0.1
which uses a different technique to store literals,
and therefore must check for potential overwrites.
2023-02-07 14:47:16 -08:00
Yann Collet 9419747171 fix legacy decoders v0.4, v0.5 and v0.6 2023-02-07 14:02:12 -08:00
Yann Collet 6640377783 cmake build: fix nit
reported by @jaimeMF in https://github.com/facebook/zstd/pull/3392#discussion_r1056643794
2022-12-23 14:18:11 -08:00
Yann Collet 832c1a6a1c minor reformatting
and minor reliability and maintenance changes
2022-12-18 11:26:57 -08:00
Yann Collet d081d98ae7 Fix m68k CI tests on Github Actions
seems there is a bug in the qemu version shipped with Ubuntu 22.04
2022-12-13 12:36:53 -08:00
Yann Collet 15f3605135 removed gnu99 statement from meson recipe 2022-06-20 18:18:40 -07:00
Yann Collet eb726c6a20 updated man pages
had to run the conversion script on Ubuntu, as it doesn't run correctly on macos anymore.
2022-04-13 18:57:27 -07:00
Yann Collet cdee6a7dbd Merge branch 'dev' into fix44168 2022-01-31 17:31:55 -08:00
Yann ColletandYann Collet a66e8bb437 introduced LitHufLog constant
which properly represents the maximum bit size of compressed literals (11) as defined in the specification.

To be preferred from HUF_TABLELOG_DEFAULT which represents the same value but by accident.

Name selected to keep the same convention as existing width definitions,
MLFSELog, LLFSELog and OffFSELog.
2022-01-26 14:47:24 -08:00
Yann ColletandYann Collet 32a5d95dcb moved HufLog to lib/decompress
it's only used to size decompression tables
2022-01-26 14:47:24 -08:00
Yann ColletandYann Collet e9dd923fa4 only declare debug functions in debug mode 2022-01-26 14:47:24 -08:00
Yann ColletandYann Collet fc2ea97442 refactored fuzzer tests for sequence compression api
add explicit delimiter mode to libfuzzer test
2022-01-26 00:19:35 -08:00
Yann Collet 41153071a0 updated manual 2021-12-21 08:52:50 -08:00
Yann Collet abc694f53e update man pages 2021-12-20 14:24:06 -08:00
Yann Collet 2624652a32 Merge branch 'dev' into lazy_rebalance 2021-12-20 08:28:21 -08:00
Yann Collet 80a28f2078 update regression results 2021-12-20 07:54:57 -08:00
Yann Collet 01adddc3e0 update regression results 2021-12-16 20:43:23 -08:00
Yann Collet db1b408a2f rebalance lazy compression levels 2021-12-15 21:33:31 -08:00
Yann Collet 8150891939 regenerated zstdless.1 2021-09-22 14:48:51 -07:00
Yann Collet 3addf2f277 updated zstdgrep man page 2021-09-22 14:30:59 -07:00
Yann Collet 999f8778af updated man pages
using ronn-ng
2021-09-22 14:18:24 -07:00
Yann Collet fd94b9d1c9 Merge branch 'dev' into opt_investigation 2021-09-14 01:15:51 -07:00
Yann Collet b6b2855b80 updated regression tests 2021-09-12 10:22:35 -07:00
Yann Collet f58e63bee7 Merge branch 'dev' into opt_investigation 2021-09-12 01:42:49 -07:00
Yann Collet 640c5b1f77 fix automated_benchmarking
make it able to process text output sent into either stdout or stderr
2021-09-12 01:36:18 -07:00
Yann Collet ef78611c26 change update rate to 11/10/10/10
better for larger blocks,
very small inefficiency on small block.
2021-09-08 08:58:28 -07:00
Yann Collet b096a5c626 updated regression tests 2021-09-07 09:55:14 -07:00
Yann Collet 08ceda3dfc new statistics update policy
small general compression ratio improvement for btopt+ strategies/
2021-09-04 00:52:44 -07:00
Yann Collet 23a9368c45 new starting offcode table for zstd_opt 2021-09-03 17:41:42 -07:00
Yann Collet 27a8bbe265 new initializer for ll price 2021-09-03 16:07:31 -07:00
Yann Collet f0fc8cb3e1 Disable console notification by default within the library
As a library, the default shouldn't be to write anything on console.
`cover` and `fastcover` have a `g_displayLevel` variable to control this behavior.
It's now set to 0 (no display) by default.
Setting notification to a higher level should be an explicit operation by a console application.
2021-09-03 13:44:07 -07:00
Yann Collet eab692211e removed pretty-print of sizes in benchmark
This is less appropriate for this mode :
benchmark is about accuracy,
it's important to read the exact values.
2021-09-03 12:51:02 -07:00
Yann Collet 70d89e5a12 minor rebalancing of level 13
This new setup is slighly better on `silesia.tar` :
Ratio : 3.649 -> 3.655
Speed : 11.9 MB/s -> 12.2 MB/s
At the cost of more memory : 24 MB -> 32 MB
The new memory budget is a reasonable interpolation between neighboring levels 12 and 14:
level 12 : 24 MB
level 13 : 32 MB (increased from 24 MB)
level 14 : 48 MB
Window size remains unaffected (4 MB)
2021-09-01 13:05:10 -07:00
Yann Collet 333ecf6865 add powerpc qemu emulation 2021-08-30 06:37:50 -07:00
Yann Collet 2b27d07d06 attempt at adding m68k qemu tests
with optional success (for the time being)
2021-08-29 21:39:06 -07:00
Yann Collet 1e5c90cb5b remove qemu tests
that are being transfered to GA in #2758.
This represents a saving of ~25mn of cpu time on TravisCI.
2021-08-29 20:54:18 -07:00
Yann Collet 74b4171fb8 fix alignment condition in FSE_buildCTable
2-bytes alignment is enough for 16-bit fields
2021-08-29 19:05:04 -07:00
Yann Collet f21977c5e6 fix playTests.sh when EXE_PREFIX not null 2021-08-29 17:20:12 -07:00
Yann Collet 18191c85c9 adding optional QEMU_SYS 2021-08-29 16:43:32 -07:00
Yann Collet 1c97ec73d7 added qemu tests
running zstd library on emulated targets
2021-08-29 16:28:41 -07:00
Yann Collet b341aa2f95 remove versions-compatibility test from GA
since it fails on Github Actions specifically.

The test is run on TravisCI for the time being.
Its duration has been reduced to ~6mn anyway.
2021-08-29 15:47:04 -07:00
Yann Collet 72bd2a83a0 reduce length of scanbuild static analyzer test
This was ~30mn, by far the longest run on travisCI.
That's because it re-analyzes multiple times the same files (library files notably).
It also performs actions that make no sense for the static analyzer purpose,
such as building the single-file library.

Reduced time spent in this test by reducing its scope :
just build the CLI, and obviously the library along it.
These are the only ones that really deserve to be analyzed.

Unfortunately, it still results in a number of false positives when using newer versions of scanbuild
(each version of scanbuild generates a different list of false positives).
These will have to be fixed before transfering to Github Actions.
2021-08-29 15:26:31 -07:00
Yann Collet 7f37b8a547 accelerate versionsCompatibilityTest
by allowing parallel build of units,
and reducing optimization levels.

Parallel build is only effective on "recent" versions of `zstd`,
as previously, the list of units was passed as a list of source files,
which is something neither `make` nor `gcc` can parallelize.
So its impact is mildly effective (-20%).

Reducing optimization level to `-O1` makes compilation much faster.
It also makes runtime slower,
but in this test, compilation time dominates run time.
The savings are very significant (-50%).

On my test system, it reduces the length of this test from 13mn to 5mn.
2021-08-29 14:48:11 -07:00
Yann Collet ef69539849 transferred inter-versions compatibility tests to GA 2021-08-29 11:53:56 -07:00
Yann Collet a4d55c8748 Merge branch 'dev' into d_prefetch_refactor 2021-05-07 09:32:53 -07:00
Yann Collet 7ef6d7b36c deeper prefetching pipeline for decompressSequencesLong
pipeline increased from 4 to 8 slots.
This change substantially improves decompression speed when there are long distance offsets.
example with enwik9 compressed at level 22 :
gcc-9 : 947 -> 1039 MB/s
clang-10: 884 -> 946 MB/s

I also checked the "cold dictionary" scenario,
and found a smaller benefit, around ~2%
(measurements are more noisy for this scenario).
2021-05-05 10:04:03 -07:00
Yann Collet 713d4953f7 fixed gcc-7 conversion warning 2021-03-03 18:00:41 -08:00
Yann Collet 0d793a675a removed internal dependency from CLI
ZSTD_cycleLog() is a very short function,
creating a rather large dependency onto libzstd's internal just for it is overkill.
Prefer duplicating this 2-lines function.

This PR makes the zstd CLI one step closer to being linkable to the dynamic library (see #2450)
More steps are still needed to reach this goal.
2021-01-06 01:35:52 -08:00
Yann Collet fed1c62571 fix gcc10 warnings
gcc10 doesn't like its own strncpy
2020-11-30 04:44:37 -08:00
Yann Collet 95e74616d5 fix multiple minor conversion warnings
unrelated to #2386, just cleaning up while I'm updating this file ...
2020-11-06 09:57:05 -08:00
Yann Collet 2769e4d459 fix incorrect assert
fix #2386, reported by @Neumann-A
2020-11-06 09:44:04 -08:00
Yann Collet f6ecf1568f minor Makefile refactor
hopefully improving readability
2020-10-28 09:39:15 -07:00
Yann Collet 89b961ea46 simplified silent mode maintenance 2020-10-23 10:41:17 -07:00
Yann Collet ffe8d9e428 fix partial lib test 2020-10-23 10:27:12 -07:00
Yann Collet b5d4728713 simplified silent mode 2020-10-23 10:22:52 -07:00
Yann Collet a7ad05bf57 fixed building libzstd with manual BUILD_DIR
and when HASH is not found
2020-10-23 10:14:04 -07:00
Yann Collet 91a8cb9559 fix DEBUGLEVEL redefinition from tests/ 2020-10-22 00:20:40 -07:00
Yann Collet 494f7169ed fix directory creation for Windows' libzstd 2020-10-22 00:15:31 -07:00
Yann Collet ca75da8fa3 fix test
DEBUGLEVEL redefinition
2020-10-21 23:51:13 -07:00
Yann Collet dd24496951 programs/zstd also automatically generate object dir per conf
same rules as lib/libzstd
can also be controlled via HASH and BUILD_DIR
2020-10-21 23:38:33 -07:00
Yann Collet 01ecad2326 zstd in programs/ can also receive a DEBUGLEVEL value
simplify tests : only set DEBUGLEVEL, not the flags directly
2020-10-21 23:13:46 -07:00
Yann Collet 0f8ee5c51e Merge branch 'dev' into libzstd_autoconf 2020-10-21 22:36:09 -07:00
Yann Collet d0436b2a45 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
2020-10-21 19:22:45 -07:00
Yann Collet 8a453a34c5 automatic %.h header dependency tracking
also : BUILD_DIR can be manually specified
2020-10-21 17:25:07 -07:00
Yann Collet 2b99bc29bf consolidated vpath 2020-10-21 04:01:01 -07:00
Yann Collet e8eb2939fe store %.o object files into obj/
both static and dynamic libraries have their own object directory
2020-10-21 03:44:38 -07:00
Yann Collet 3e519be965 minor cleaning 2020-10-21 03:22:27 -07:00
Yann Collet 911dbdbb4b 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.
2020-10-20 22:19:57 -07:00
Yann Collet 684f8ea970 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.
2020-10-20 18:16:11 -07:00
Yann Collet a9f7e77d44 fixed travis tests 2020-10-20 17:08:14 -07:00
Yann Collet eb1959d926 fix .deps list
and minor simplications
2020-10-16 11:08:52 -07:00
Yann Collet c355d149de support verbose build output with V=1 2020-10-16 00:21:49 -07:00
Yann Collet b6b87c2b77 track header dependencies during build
modifying a header file will now trigger recompilation of related *.c units
2020-10-16 00:18:16 -07:00
Yann Collet 80cee8d3fe 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.
2020-10-16 00:01:41 -07:00
Yann Collet 5618e000bd update fullbench for compressStream2()
makes it possible to measure scenarios such as #2314
2020-09-21 07:19:20 -07:00
Yann Collet 16b353b207 minor doc clarification regarding MT parameters 2020-07-11 02:16:52 -07:00
Yann Collet dd026ca505 re-inforced tests for initStaticCCtx
ensure that `estimateCCtxSize()` works as intended.
2020-05-09 11:30:45 -07:00
Yann Collet cf854f4660 support for verbose make
A commonly accepted makefile idiom is V=1 or VERBOSE=1
to request the printing of all commands.

This is not "default" though, and must be manually added.

Example :
Before :
```
make libzstd
compiling dynamic library 1.4.5
creating versioned links

make libzstd V=1
compiling dynamic library 1.4.5
creating versioned links
```

After :
```
make libzstd
compiling dynamic library 1.4.5
creating versioned links

make libzstd V=1
compiling dynamic library 1.4.5
cc -DXXH_NAMESPACE=ZSTD_ -DZSTD_LEGACY_SUPPORT=5 -Wall -Wextra -Wcast-qual -Wcast-align -Wshadow -Wstrict-aliasing=1 -Wswitch-enum -Wdeclaration-after-statement -Wstrict-prototypes -Wundef -Wpointer-arith -Wvla -Wformat=2 -Winit-self -Wfloat-equal -Wwrite-strings -Wredundant-decls -Wmissing-prototypes -Wc++-compat  -O3 common/debug.c common/entropy_common.c common/error_private.c common/fse_decompress.c common/pool.c common/threading.c common/xxhash.c common/zstd_common.c compress/fse_compress.c compress/hist.c compress/huf_compress.c compress/zstd_compress.c compress/zstd_compress_literals.c compress/zstd_compress_sequences.c compress/zstd_compress_superblock.c compress/zstd_double_fast.c compress/zstd_fast.c compress/zstd_lazy.c compress/zstd_ldm.c compress/zstd_opt.c compress/zstdmt_compress.c decompress/huf_decompress.c decompress/zstd_ddict.c decompress/zstd_decompress.c decompress/zstd_decompress_block.c deprecated/zbuff_common.c deprecated/zbuff_compress.c deprecated/zbuff_decompress.c dictBuilder/cover.c dictBuilder/divsufsort.c dictBuilder/fastcover.c dictBuilder/zdict.c legacy/zstd_v05.c legacy/zstd_v06.c legacy/zstd_v07.c -shared -fPIC -fvisibility=hidden -Wl,-soname=libzstd.so.1 -o libzstd.so.1.4.5
creating versioned links
ln -sf libzstd.so.1.4.5 libzstd.so.1
ln -sf libzstd.so.1.4.5 libzstd.so
```
2020-05-07 08:04:10 -07:00
Yann Collet 54144285fd small speed improvement for strategy fast
gcc 9.3.0 :
kennedy : 459 -> 466
silesia : 360 -> 365
enwik8  : 267 -> 269

clang 10.0.0 :
kennedy : 436 -> 441
silesia : 364 -> 366
enwik8  : 271 -> 272
2020-05-07 06:15:58 -07:00
Yann Collet 6f62a9caaa fixed zstd-nolegacy target
when compiled as part of allVariants

(though I'm unsure why it was working before ...)
2020-04-29 11:56:21 -07:00
Yann Collet 3746693b71 added ppc64le tests on travis
on real hardware
2019-12-15 01:30:12 -08:00
Yann Collet 52dc6ff00e travis: updated mingw cross compilation test
- only compiles zstd CLI
- enforces zero warning tolerance policy

note : mingw compilation of the library complains (warning) about -fPIC flag.
It mostly ignores it, so it's not a big issue.
Still, it would need to be fixed if library cross-compilation becomes part of CI.
At this stage, it's unclear if this is a scenario.
2019-11-27 14:39:43 -08:00
Yann Collet d6e32afa0a added mingw cross compilation tests
based on a script in RocksDB project.

also : pushed qemu aarch64 tests to master/cron,
since there are already hardware aarch64 tests on dev.
2019-11-27 12:44:02 -08:00
Yann Collet 54bd39abdf Revert "added clang test in travis"
This reverts commit 4909a341db.
2019-01-20 11:13:01 -08:00
Yann Collet 4909a341db added clang test in travis 2019-01-20 00:11:07 -08:00
Yann Collet 2a6aa6be5f updated clang tests
target clangbuild
2019-01-19 23:40:41 -08:00
Yann Collet a1394399b4 fixed minor conversion warnings in examples/ 2019-01-19 23:38:20 -08:00
cyan4973 e85b4c56b2 speed up appveyor tests 2018-07-30 17:13:13 +02:00
cyan4973 3f535007e4 fix %zu support under minGW
and relevant test on Appveyor
2018-07-30 16:56:18 +02:00
cyan4973 c738a2c795 ensure appveyor test fails due to formatting error
to catch %zu incompatibility
2018-07-30 16:44:20 +02:00
cyan4973 aade1e5904 Merge branch 'dev' into fix1241 2018-07-30 16:30:35 +02:00
cyan4973 3d4b09a5aa support %zu under mingw 2018-07-30 16:29:20 +02:00
cyan4973 7d1bc9cc8c fix minor conversion warning 2018-07-18 16:10:23 +02:00
cyan4973 0840d02ecf fix make test on Linux
MOREFLAGS+= doesn't work on Linux
2018-07-17 19:19:48 +02:00
cyan4973 b8a81a988c added a test to be played on travis
to check a make variable construction
2018-07-17 19:02:17 +02:00
cyan4973 9597b438e9 fix #1241
Ensure that first input position is valid for a match
even during first usage of context
by starting reference at 1
(avoiding the problematic 0).
2018-07-17 18:52:57 +02:00
cyan4973 53e1f0504e zstdmt debug traces compatibles with mingw
since mingw does not have `sys/times.h`,
remove this path when detecting mingw compilation.
2018-07-17 14:39:44 +02:00
cyan4973 f741fb8fcd minor fixes for MSYS2 compilation 2018-06-26 01:22:45 -07:00
cyan4973 ae0b7ffa0a made Visual Studio compatible with DEBUGLEVEL >= 2 2018-06-20 09:45:02 -07:00
cyan4973 b095bffac6 ignore Windows build/test artefacts 2018-05-01 05:45:46 -07:00