]> git.ipfire.org Git - thirdparty/zstd.git/log
thirdparty/zstd.git
7 years agoFix LZ4 Compression Buffer Overflow 893/head
W. Felix Handte [Tue, 17 Oct 2017 05:19:29 +0000 (01:19 -0400)] 
Fix LZ4 Compression Buffer Overflow

Fixes issue where, when `zstd --format=lz4` is fed an input larger than 128KB,
the read overruns the input buffer. This changes Zstd to use LZ4 with chained
64KB blocks. This is technically a breaking change in that some third party
LZ4 implementations may not support linked blocks. However, progress should not
be allowed to be stopped by such petty concerns as backwards compatibility!

7 years agoAdd Test on LZ4 Format Input Buffer Overrun
W. Felix Handte [Tue, 28 Nov 2017 17:06:48 +0000 (12:06 -0500)] 
Add Test on LZ4 Format Input Buffer Overrun

7 years agoinstall: changed variable MANDIR into MAN1DIR
Yann Collet [Mon, 27 Nov 2017 21:47:35 +0000 (13:47 -0800)] 
install: changed variable MANDIR into MAN1DIR

MANDIR still exists, and is now the parent of MAN1DIR

7 years agozstreamtest : in `-T#s`, s considered a suffix meaning "seconds"
Yann Collet [Mon, 27 Nov 2017 20:15:23 +0000 (12:15 -0800)] 
zstreamtest : in `-T#s`, s considered a suffix meaning "seconds"

avoid unintentionnally triggering `seedset`,
so that seed gets automatically determined when not set.

7 years agoupdated man page
Yann Collet [Sat, 25 Nov 2017 01:20:54 +0000 (17:20 -0800)] 
updated man page

following patch #931 by @scottchiefbaker

7 years agominor update
Yann Collet [Sat, 25 Nov 2017 00:44:28 +0000 (16:44 -0800)] 
minor update

7 years agoMerge pull request #931 from scottchiefbaker/documentation
Yann Collet [Fri, 24 Nov 2017 08:01:34 +0000 (00:01 -0800)] 
Merge pull request #931 from scottchiefbaker/documentation

Include information about the benchmark output/methodology

7 years agoInclude information about the benchmark output/methodology 931/head
Scott Baker [Thu, 23 Nov 2017 04:29:46 +0000 (20:29 -0800)] 
Include information about the benchmark output/methodology

Addresses #930

7 years agoMerge pull request #924 from facebook/opt2
Yann Collet [Wed, 22 Nov 2017 00:34:37 +0000 (16:34 -0800)] 
Merge pull request #924 from facebook/opt2

faster btopt variant

7 years agofixed comment, reported by @gyscos 924/head
Yann Collet [Tue, 21 Nov 2017 18:36:14 +0000 (10:36 -0800)] 
fixed comment, reported by @gyscos

7 years agofixed comment, as suggested by @terrelln
Yann Collet [Tue, 21 Nov 2017 18:26:17 +0000 (10:26 -0800)] 
fixed comment, as suggested by @terrelln

7 years agoMerge pull request #925 from dusta/patch-1
Yann Collet [Mon, 20 Nov 2017 22:34:03 +0000 (14:34 -0800)] 
Merge pull request #925 from dusta/patch-1

Missing dot

7 years agoMissing dot 925/head
Dusta [Mon, 20 Nov 2017 20:35:28 +0000 (21:35 +0100)] 
Missing dot

7 years agostrategy ZSTD_btopt pinned to (0) variant (faster one)
Yann Collet [Mon, 20 Nov 2017 19:53:20 +0000 (11:53 -0800)] 
strategy ZSTD_btopt pinned to (0) variant (faster one)

7 years agoslightly improved compression speed
Yann Collet [Sun, 19 Nov 2017 22:40:21 +0000 (14:40 -0800)] 
slightly improved compression speed

7 years agoslightly improved ratio at -22
Yann Collet [Sun, 19 Nov 2017 21:39:12 +0000 (13:39 -0800)] 
slightly improved ratio at -22

merging of repcode search into btsearch introduced a small compression ratio regressio at max level :
1.3.2 : 52728769
after repMerge patch : 52760789 (+32020)

A few minor changes have produced this difference.
They can be hard to spot.

This patch buys back about half of the difference,
by no longer inserting position at hc3 when a long match is found there.
It feels strangely counter-intuitive, but works :
after this patch : 52742555 (-18234)

7 years agominor : search early-out on sufficient_len for hc3 and rep
Yann Collet [Sun, 19 Nov 2017 20:58:04 +0000 (12:58 -0800)] 
minor : search early-out on sufficient_len for hc3 and rep

very very small speed and ratio increases

7 years agobtopt0 : a bit faster and weaker
Yann Collet [Sun, 19 Nov 2017 18:38:02 +0000 (10:38 -0800)] 
btopt0 : a bit faster and weaker

7 years agocreated (hidden) new strategy btopt0
Yann Collet [Sun, 19 Nov 2017 18:21:21 +0000 (10:21 -0800)] 
created (hidden) new strategy btopt0

about ~+10% faster but losing ~0.01 compression ratio
(note : amplitude vary a lot depending on files, but direction remains the same)

7 years agozstd_opt: minor speed optimization
Yann Collet [Sun, 19 Nov 2017 00:24:02 +0000 (16:24 -0800)] 
zstd_opt: minor speed optimization

Calculate reference log2sums only once per serie of sequence
(as opposed to once per sequence)

Also: improved code comments

7 years agobench: slightly adjusted display format
Yann Collet [Sat, 18 Nov 2017 23:54:32 +0000 (15:54 -0800)] 
bench: slightly adjusted display format

adapt accuracy depending on value.
makes it possible to have higher accuracy for small value,
notably small compression speed.
This capability is expected to be useful while modifying optimal parser.

7 years agominor spelling fixes
Yann Collet [Sat, 18 Nov 2017 19:28:00 +0000 (11:28 -0800)] 
minor spelling fixes

7 years agofix ZSTD_COMPRESSBOUND() macro
Yann Collet [Sat, 18 Nov 2017 19:16:39 +0000 (11:16 -0800)] 
fix ZSTD_COMPRESSBOUND() macro

It was using macro `KB`, which is not defined in `zstd.h`.

7 years agoMerge pull request #922 from terrelln/signal
Yann Collet [Sat, 18 Nov 2017 02:50:02 +0000 (18:50 -0800)] 
Merge pull request #922 from terrelln/signal

[zstd] Fix rare bug with signal handler

7 years agoMerge pull request #921 from facebook/ubfix
Yann Collet [Sat, 18 Nov 2017 01:11:18 +0000 (17:11 -0800)] 
Merge pull request #921 from facebook/ubfix

Fixes some arithmetic pointer operations

7 years ago[zstd] Fix rare bug with signal handler 922/head
Nick Terrell [Sat, 18 Nov 2017 00:38:56 +0000 (16:38 -0800)] 
[zstd] Fix rare bug with signal handler

7 years agofix un-initialized memory warning 921/head
Yann Collet [Fri, 17 Nov 2017 23:51:52 +0000 (15:51 -0800)] 
fix un-initialized memory warning

harmless, but cleaner

7 years agoMerge pull request #920 from facebook/benchSeparate
Yann Collet [Fri, 17 Nov 2017 21:25:12 +0000 (13:25 -0800)] 
Merge pull request #920 from facebook/benchSeparate

Bench multiple files

7 years agofix one UB pointer arithmetic in encoder
Yann Collet [Fri, 17 Nov 2017 20:55:37 +0000 (12:55 -0800)] 
fix one UB pointer arithmetic in encoder

Instead of calculating distance between 2 memory objects, which is UB,
we extract the offset from object 1, and transfer it into object 2.

7 years agofixed one UB pointer arithmetic
Yann Collet [Fri, 17 Nov 2017 19:40:08 +0000 (11:40 -0800)] 
fixed one UB pointer arithmetic

7 years agoMerge pull request #916 from facebook/optMergeRep
Yann Collet [Fri, 17 Nov 2017 19:29:47 +0000 (11:29 -0800)] 
Merge pull request #916 from facebook/optMergeRep

Optimal parser part 2 : Merge normal and _extDict parsers

7 years agofixed circle-ci script 920/head
Yann Collet [Fri, 17 Nov 2017 10:14:16 +0000 (02:14 -0800)] 
fixed circle-ci script

7 years agominor interface adjustments
Yann Collet [Fri, 17 Nov 2017 09:21:40 +0000 (01:21 -0800)] 
minor interface adjustments

7 years agobench: added cli command `-S` to benchmark multiple files separately
Yann Collet [Fri, 17 Nov 2017 08:22:55 +0000 (00:22 -0800)] 
bench: added cli command `-S` to benchmark multiple files separately

Currently, all files are joined by default,
they are compressed separately but benchmarked together,
providing a single final result.

Benchmarking files separately make it possible to accurately measure difference for each file.
This is expected to be useful while tuning optimal parser.

7 years agobench: realTime is a global parameter
Yann Collet [Fri, 17 Nov 2017 08:02:37 +0000 (00:02 -0800)] 
bench: realTime is a global parameter

like most parameters not directly related to compression

7 years agofixed minor warning 916/head
Yann Collet [Thu, 16 Nov 2017 23:21:30 +0000 (15:21 -0800)] 
fixed minor warning

warning: void function returning a value
(even if the return value is void)

7 years agofixed some complex scenarios
Yann Collet [Thu, 16 Nov 2017 23:02:28 +0000 (15:02 -0800)] 
fixed some complex scenarios

Fixed : multithreading to compress some small data with dictionary
Fixed : ZSTD_initCStream_usingCDict()
Improved streaming memory usage when pledgedSrcSize is known.

7 years agoFixed Btree update
Yann Collet [Thu, 16 Nov 2017 20:18:56 +0000 (12:18 -0800)] 
Fixed Btree update

ZSTD_updateTree() expected to be followed by a Bt match finder, which would update zc->nextToUpdate.
With the new optimal match finder, it's not necessarily the case : a match might be found during repcode or hash3, and stops there because it reaches sufficient_len, without even entering the binary tree.
Previous policy was to nonetheless update zc->nextToUpdate, but the current position would not be inserted, creating "holes" in the btree, aka positions that will no longer be searched.
Now, when current position is not inserted, zc->nextToUpdate is not update, expecting ZSTD_updateTree() to fill the tree later on.

Solution selected is that ZSTD_updateTree() takes care of properly setting zc->nextToUpdate,
so that it no longer depends on a future function to do this job.

It took time to get there, as the issue started with a memory sanitizer error.
The pb would have been easier to spot with a proper `assert()`.
So this patch add a few of them.

Additionnally, I discovered that `make test` does not enable `assert()` during CLI tests.
This patch enables them.

Unfortunately, these `assert()` triggered other (unrelated) bugs during CLI tests, mostly within zstdmt.
So this patch also fixes them.

- Changed packed structure for gcc memory access : memory sanitizer would complain that a read "might" reach out-of-bound position on the ground that the `union` is larger than the type accessed.
  Now, to avoid this issue, each type is independent.
- ZSTD_CCtxParams_setParameter() : @return provides the value of parameter, clamped/fixed appropriately.
- ZSTDMT : changed constant name to ZSTDMT_JOBSIZE_MIN
- ZSTDMT : multithreading is automatically disabled when srcSize <= ZSTDMT_JOBSIZE_MIN, since only one thread will be used in this case (saves memory and runtime).
- ZSTDMT : nbThreads is automatically clamped on setting the value.

7 years agoremoved wrong assertion
Yann Collet [Wed, 15 Nov 2017 23:35:56 +0000 (15:35 -0800)] 
removed wrong assertion

7 years agoremoved a few specialized traces
Yann Collet [Wed, 15 Nov 2017 23:04:53 +0000 (15:04 -0800)] 
removed a few specialized traces

7 years agoshortened repcode match finder implementation
Yann Collet [Wed, 15 Nov 2017 22:37:40 +0000 (14:37 -0800)] 
shortened repcode match finder implementation

7 years agofixed corruption issue
Yann Collet [Wed, 15 Nov 2017 21:44:24 +0000 (13:44 -0800)] 
fixed corruption issue

7 years agostill fighting data corruption
Yann Collet [Wed, 15 Nov 2017 19:29:24 +0000 (11:29 -0800)] 
still fighting data corruption

due to messed up tree.
Seems to happen when reaching end of buffer.

7 years agomerged rep search into btMatchSearch
Yann Collet [Wed, 15 Nov 2017 02:08:17 +0000 (18:08 -0800)] 
merged rep search into btMatchSearch

but there is a tree corruption somewhere ...
bug hunt ongoing

7 years agoMerge pull request #912 from facebook/opt
Yann Collet [Tue, 14 Nov 2017 22:51:24 +0000 (14:51 -0800)] 
Merge pull request #912 from facebook/opt

Optimal parser refactoring

7 years agomerged repcode search into BT match search
Yann Collet [Mon, 13 Nov 2017 10:19:36 +0000 (02:19 -0800)] 
merged repcode search into BT match search

this version has same speed as branch `opt`
which is itself 5-10% slower than branch `dev`
(no identified reason)

It does not compress exactly the same as `opt` or `dev`,
maybe because it doesn't stop search after repcodes,
leading to sometimes better compression, sometimes worse
(by a small margin).

warning : _extDict path does not work for the time being
This means that benchmark module works,
but file module will fail with large files (and high compression level).
Objective is to fuse _extDict path into current one,
in order to have a single parser to maintain.

7 years agocmake: fixed lib/CMakeLists.txt 912/head
Yann Collet [Fri, 10 Nov 2017 17:39:11 +0000 (09:39 -0800)] 
cmake: fixed lib/CMakeLists.txt

changed file name from zstd_compress.h to zstd_compress_internal.h

7 years agoreduced scope of multiple variables
Yann Collet [Thu, 9 Nov 2017 20:46:34 +0000 (12:46 -0800)] 
reduced scope of multiple variables

renamed some variables for better understanding

7 years agolib/compress: created ZSTD_LLcode() and ZSTD_MLcode()
Yann Collet [Wed, 8 Nov 2017 20:33:06 +0000 (12:33 -0800)] 
lib/compress: created ZSTD_LLcode() and ZSTD_MLcode()

transform length into code.
Since transformation is needed in several places throughout the code,
better write the logic in one place.

7 years agozstd_opt: simplified ZSTD_getPrice() and ZSTD_updatePrice() interface
Yann Collet [Wed, 8 Nov 2017 20:20:07 +0000 (12:20 -0800)] 
zstd_opt: simplified ZSTD_getPrice() and ZSTD_updatePrice() interface

ZSTD_getPrice() and ZSTD_updatePrice() accept normal matchlength as argument
instead of matchlength-MINMATCH,
which makes them easier / more logical to use and read.
Conversion is simply done internally.

7 years agozstd_opt: refactor code for improved readability
Yann Collet [Wed, 8 Nov 2017 19:36:38 +0000 (11:36 -0800)] 
zstd_opt: refactor code for improved readability

renamed variables to be more meaningful
reduced scope of multiple variables
removed some useless var attribution

7 years agozstd_opt: ensure sufficient_len < ZSTD_OPT_NUM to simplify some tests
Yann Collet [Wed, 8 Nov 2017 19:05:32 +0000 (11:05 -0800)] 
zstd_opt: ensure sufficient_len < ZSTD_OPT_NUM to simplify some tests

7 years agorenamed zstd_compress.h into zstd_compress_internal.h
Yann Collet [Wed, 8 Nov 2017 00:15:23 +0000 (16:15 -0800)] 
renamed zstd_compress.h into zstd_compress_internal.h

to emphasize the fact that all definitions it contains
must remain private, accross lib/compress modules.

7 years agomoved a few structures from `zstd_internal.h` to `zstd_compress.h`
Yann Collet [Tue, 7 Nov 2017 23:27:06 +0000 (15:27 -0800)] 
moved a few structures from `zstd_internal.h` to `zstd_compress.h`

which is a more precise scope

7 years agoMerge pull request #908 from facebook/ubsan
Yann Collet [Tue, 7 Nov 2017 19:45:34 +0000 (11:45 -0800)] 
Merge pull request #908 from facebook/ubsan

Modified one pointer arithmetic expression to a more conformant way.

7 years agoMerge pull request #906 from facebook/fixAutoPledge
Yann Collet [Thu, 2 Nov 2017 17:14:20 +0000 (10:14 -0700)] 
Merge pull request #906 from facebook/fixAutoPledge

fix : ZSTD_compress_generic(,,,ZSTD_e_end) automatically sets pledgedSrcSize

7 years agofixed zstreamtest declaration after statement 908/head
Yann Collet [Thu, 2 Nov 2017 00:36:31 +0000 (17:36 -0700)] 
fixed zstreamtest declaration after statement

7 years agoremoved line with `//` comment 906/head
Yann Collet [Thu, 2 Nov 2017 00:01:45 +0000 (17:01 -0700)] 
removed line with `//` comment

this is for a different topic
(better parameter adaptation for small files + dictionary and/or custome parameters)

7 years agominor refactor
Yann Collet [Wed, 1 Nov 2017 23:57:48 +0000 (16:57 -0700)] 
minor refactor

added some traces and assert
related to hunting a potential ubsan error in 32-bits more
(it ends up being a compiler-side issue : https://gcc.gnu.org/bugzilla/show_bug.cgi?id=82802).

Modified one pointer arithmetic expression for a more conformant way.

7 years agoMerge pull request #905 from terrelln/skip
Yann Collet [Wed, 1 Nov 2017 21:36:48 +0000 (14:36 -0700)] 
Merge pull request #905 from terrelln/skip

Allow skippable frames of any size

7 years agofix : ZSTD_compress_generic(,,,ZSTD_e_end) automatically sets pledgedSrcSize
Yann Collet [Wed, 1 Nov 2017 20:15:23 +0000 (13:15 -0700)] 
fix : ZSTD_compress_generic(,,,ZSTD_e_end) automatically sets pledgedSrcSize

as per documentation, on ZSTD_setPledgedSrcSize() :
> If all data is provided and consumed in a single round,
> this value (pledgedSrcSize) is overriden by srcSize instead.

This wasn't applied before compression level is transformed into compression parameters.
As a consequence, small input missed compression parameters adaptation.

It seems to work fine now : compression was compared with ZSTD_compress_advanced(),
results were the same.

7 years agoTest large skippable frames 905/head
Nick Terrell [Wed, 1 Nov 2017 20:10:03 +0000 (13:10 -0700)] 
Test large skippable frames

7 years agoAllow skippable frames of any size
Nick Terrell [Wed, 1 Nov 2017 19:49:51 +0000 (12:49 -0700)] 
Allow skippable frames of any size

7 years agoremoved direct call to malloc() from pool.c
Yann Collet [Wed, 1 Nov 2017 00:43:24 +0000 (17:43 -0700)] 
removed direct call to malloc() from pool.c

7 years agoMerge pull request #903 from terrelln/empty-input
Yann Collet [Sun, 29 Oct 2017 00:28:08 +0000 (17:28 -0700)] 
Merge pull request #903 from terrelln/empty-input

[libzstd] Fix parameter selection for empty input

7 years agoMerge pull request #902 from terrelln/buck
Yann Collet [Sun, 29 Oct 2017 00:26:45 +0000 (17:26 -0700)] 
Merge pull request #902 from terrelln/buck

Update BUCK files

7 years ago[libzstd] Fix parameter selection for empty input 903/head
Nick Terrell [Thu, 26 Oct 2017 00:10:57 +0000 (17:10 -0700)] 
[libzstd] Fix parameter selection for empty input

ZSTD_compress() and friends would treat an empty input as an unknown size
when selecting parameters. Thus, they would drastically overallocate the
context. Tell ZSTD_getParams() that the source size is 1 when it is empty.

7 years agoUpdate BUCK files 902/head
Nick Terrell [Wed, 25 Oct 2017 19:47:57 +0000 (12:47 -0700)] 
Update BUCK files

* Correct XXH namespace (Fixes #901)
* Multithreading always enabled
* GZIP/LZ4/LZMA always enabled
* Legacy support always fully enabled

7 years agofixed zbufftest
Yann Collet [Thu, 19 Oct 2017 21:05:23 +0000 (14:05 -0700)] 
fixed zbufftest

preserve "pledgedSrcSize=0" means "unknown" in init_advanced()

7 years agoMerge pull request #896 from facebook/simplifyio
Yann Collet [Thu, 19 Oct 2017 20:59:59 +0000 (13:59 -0700)] 
Merge pull request #896 from facebook/simplifyio

fileio and bench : ZSTD_NEWAPI as the only code path

7 years agofixed missing zstdmt_compress.h dependency 896/head
Yann Collet [Thu, 19 Oct 2017 19:09:34 +0000 (12:09 -0700)] 
fixed missing zstdmt_compress.h dependency

we lose a warning message :
when a job size is chosen < minimum job size for multithreading,
it is automatically resized to minimum size.

If this information is really useful, it should be present in zstd.h now.

7 years agobench: fixed Visual warning regarding struct initialization
Yann Collet [Thu, 19 Oct 2017 18:56:14 +0000 (11:56 -0700)] 
bench: fixed Visual warning regarding struct initialization

also :
removed dependency on zstdmt_compress.h
removed several unused macros
fileio : small code refactoring to reduce some variable scope

7 years agoIO and bench : ZSTD_NEWAPI is the only remaining code path
Yann Collet [Thu, 19 Oct 2017 00:01:53 +0000 (17:01 -0700)] 
IO and bench : ZSTD_NEWAPI is the only remaining code path

removed the other 2 code paths (single thread, and ZSTDMT ones)
keeping only the new advanced API, for easier code coverage.

It shall also fix identified issue with Visual Studio
which doesn't have ZSTD_NEWAPI defined.

7 years agoMerge pull request #895 from facebook/fileSize_unknown
Yann Collet [Wed, 18 Oct 2017 23:50:17 +0000 (16:50 -0700)] 
Merge pull request #895 from facebook/fileSize_unknown

Distinguish 0-size from size-unavailable

7 years agofixed wrong test to display compression status 895/head
Yann Collet [Wed, 18 Oct 2017 18:41:52 +0000 (11:41 -0700)] 
fixed wrong test to display compression status

7 years agofixed zlib wrapper
Yann Collet [Wed, 18 Oct 2017 18:18:27 +0000 (11:18 -0700)] 
fixed zlib wrapper

it was invoking ZSTD_initCStream_advanced() with pledgedSrcSize==0 and contentSizeFlag=1
which means "empty"
while the intention was to mean "unknown".

The contentSizeFlag==1 is new, it is a consequence of setting this value to 1 by default.

The solution selected here is to pass ZSTD_CONTENTSIZE_UNKNOWN to mean "unknown".
So contentSizeFlag remains set (it wasn't in previous versions).

7 years agoMerge pull request #891 from facebook/contentSize
Yann Collet [Wed, 18 Oct 2017 00:24:51 +0000 (17:24 -0700)] 
Merge pull request #891 from facebook/contentSize

Content size

7 years agoMerge pull request #890 from terrelln/dev
Yann Collet [Tue, 17 Oct 2017 23:34:53 +0000 (16:34 -0700)] 
Merge pull request #890 from terrelln/dev

Don't allow default tables to repeat

7 years agoadded a check to ensure 0-size is present in frame header
Yann Collet [Tue, 17 Oct 2017 23:23:20 +0000 (16:23 -0700)] 
added a check to ensure 0-size is present in frame header

7 years agoUTIL_getFileSize() returns UTIL_FILESIZE_UNKNOWN on failure
Yann Collet [Tue, 17 Oct 2017 23:14:25 +0000 (16:14 -0700)] 
UTIL_getFileSize() returns UTIL_FILESIZE_UNKNOWN on failure

UTIL_getFileSize() used to return zero on failure.
This made it impossible to distinguish a failure from a genuine empty file.
Both cases where coalesced.

Adding UTIL_FILESIZE_UNKNOWN constant has many consequences on user code,
since in many places, the `0` was assumed to mean "error".
This is no longer the case, and the error code must be actively checked.

7 years agoMerge pull request #892 from terrelln/seq-test
Yann Collet [Tue, 17 Oct 2017 21:11:38 +0000 (14:11 -0700)] 
Merge pull request #892 from terrelln/seq-test

[test] Exercise all codes in dictionary tables

7 years agofixed : Visual build compressing stdin with multi-threading enabled fails 891/head
Yann Collet [Tue, 17 Oct 2017 21:07:43 +0000 (14:07 -0700)] 
fixed : Visual build compressing stdin with multi-threading enabled fails

It was multiple reasons stacked :
- Visual use a different code path, because ZSTD_NEWAPI is not defined
- fileio.c sends `0` as `pledgedSrcSize` to mean `ZSTD_CONTENTSIZE_UNKNOWN`  (fixed)
- ZSTDMT_resetCCtx() interpreted `0` as "empty" instead of "unknown" (fixed)

7 years agoMerge pull request #894 from felixhandte/add-check-target
Yann Collet [Tue, 17 Oct 2017 20:51:27 +0000 (13:51 -0700)] 
Merge pull request #894 from felixhandte/add-check-target

Add `check` Target to Makefile

7 years agoAdd `check` Target to Makefile 894/head
W. Felix Handte [Tue, 17 Oct 2017 20:02:39 +0000 (16:02 -0400)] 
Add `check` Target to Makefile

7 years ago[test] Exercise all codes in dictionary tables 892/head
Nick Terrell [Tue, 17 Oct 2017 00:18:43 +0000 (17:18 -0700)] 
[test] Exercise all codes in dictionary tables

7 years agoedited ZSTD_initCStream_advanced() comment
Yann Collet [Mon, 16 Oct 2017 21:06:22 +0000 (14:06 -0700)] 
edited ZSTD_initCStream_advanced() comment

7 years agoplaytest : minor cosmetic changes
Yann Collet [Mon, 16 Oct 2017 21:01:42 +0000 (14:01 -0700)] 
playtest : minor cosmetic changes

7 years agoDon't allow default tables to repeat 890/head
Nick Terrell [Fri, 13 Oct 2017 20:23:57 +0000 (13:23 -0700)] 
Don't allow default tables to repeat

It isn't useful in any case to repeat default tables.
Saves a few bytes on Silesia, since we don't trigger the dictionary
heuristic.

Before: 211988480 => 73651998 bytes
After:  211988480 => 73651721 bytes

7 years agoMerge pull request #889 from terrelln/bug-fix
Yann Collet [Sat, 14 Oct 2017 08:29:42 +0000 (01:29 -0700)] 
Merge pull request #889 from terrelln/bug-fix

Fix invalid use of dictionary offcode table

7 years agodictionary compression use correct file size estimation
Yann Collet [Sat, 14 Oct 2017 08:21:43 +0000 (01:21 -0700)] 
dictionary compression use correct file size estimation

when determining compression parameters
to compress one file only.

For multiple files, it still "bets" that files are going to be small.

There was also a bug recently added in ZSTD_CCtx_loadDictionary_advanced()
making it incapable to use pledgedSrcSize to determine compression parameters.

7 years agochanged API comments to invite using macro ZSTD_CONTENTSIZE_UNKNOWN
Yann Collet [Sat, 14 Oct 2017 07:32:06 +0000 (00:32 -0700)] 
changed API comments to invite using macro ZSTD_CONTENTSIZE_UNKNOWN

to mean "pledgedSrcSize is not known at init time" instead of `0`.
Note that, a few prototypes created and documented with `0` to mean "unknown" still interpret "0" as unknown,
to avoid breaking 3rd party applications which depend on this behavior.
But this value is no longer recommended to mean "unknown".

In some future version, it might be possible to switch "0" to mean "empty",
as is already the case for several prototypes.
The advantage is that pledgedSrcSize field would have same behavior accross entire API,
making it easier to reason about.

Note that all concerned prototypes belong to the "experimental" API section.

srcSize is controlled at end of compression,
so if someone uses "0" to mean "unknown" while it effectively means "empty",
this is immediately caught by the compression function, which generates an error code : ZSTD_ERROR_srcSize_wrong

7 years agominor : zstd -l -v display each file name
Yann Collet [Sat, 14 Oct 2017 07:02:32 +0000 (00:02 -0700)] 
minor : zstd -l -v display each file name

7 years agoadd test for presence of decompressed size field in header
Yann Collet [Sat, 14 Oct 2017 06:47:01 +0000 (23:47 -0700)] 
add test for presence of decompressed size field in header

previous test was "display" only, it wouldn't trigger an error in case of missing header.

7 years agofixed ZSTDMT_initCStream() when contentSizeFlag==1 by default
Yann Collet [Sat, 14 Oct 2017 02:09:30 +0000 (19:09 -0700)] 
fixed ZSTDMT_initCStream() when contentSizeFlag==1 by default

and a wrong test in zstreamtest --mt

7 years agofixed ZSTD_initCStream_advanced() behavior, which depends on contentSizeFlag,
Yann Collet [Sat, 14 Oct 2017 02:01:58 +0000 (19:01 -0700)] 
fixed ZSTD_initCStream_advanced() behavior, which depends on contentSizeFlag,

and a stream fuzzer test, which was incorrect
(relied on 0 being unconditionnally transformed into `ZSTD_CONTENTSIZE_UNKNOWN`)

7 years agocontentSizeFlag enabled by default would also fail for streaming and MT operations
Yann Collet [Sat, 14 Oct 2017 01:32:06 +0000 (18:32 -0700)] 
contentSizeFlag enabled by default would also fail for streaming and MT operations

fixed

7 years agoensure fParams.contentSizeFlag starts at 1
Yann Collet [Sat, 14 Oct 2017 00:39:13 +0000 (17:39 -0700)] 
ensure fParams.contentSizeFlag starts at 1

such default was failing for ZSTD_compressBegin/ZSTD_compressContinue
fixed too

7 years agofileio: content size is enabled by default
Yann Collet [Fri, 13 Oct 2017 23:32:18 +0000 (16:32 -0700)] 
fileio: content size is enabled by default

7 years agoAdd DEBUGLOG() that prints FSE encoding types 889/head
Nick Terrell [Fri, 13 Oct 2017 21:09:17 +0000 (14:09 -0700)] 
Add DEBUGLOG() that prints FSE encoding types

7 years agoFix invalid use of dictionary offcode table
Nick Terrell [Fri, 13 Oct 2017 19:47:00 +0000 (12:47 -0700)] 
Fix invalid use of dictionary offcode table

Fixes #888.