diff options
Diffstat (limited to 'tests')
| -rw-r--r-- | tests/.gitignore | 1 | ||||
| -rw-r--r-- | tests/Makefile | 13 | ||||
| -rw-r--r-- | tests/bigdict.c | 128 | ||||
| -rw-r--r-- | tests/decodecorpus.c | 32 | ||||
| -rw-r--r-- | tests/fullbench.c | 194 | ||||
| -rw-r--r-- | tests/fuzz/Makefile | 25 | ||||
| -rw-r--r-- | tests/fuzz/default.options | 2 | ||||
| -rw-r--r-- | tests/fuzz/dictionary_decompress.c | 37 | ||||
| -rwxr-xr-x | tests/fuzz/fuzz.py | 2 | ||||
| -rw-r--r-- | tests/fuzz/simple_compress.c | 47 | ||||
| -rw-r--r-- | tests/fuzz/simple_decompress.c | 24 | ||||
| -rw-r--r-- | tests/fuzz/zstd_frame_info.c | 43 | ||||
| -rw-r--r-- | tests/fuzzer.c | 75 | ||||
| -rw-r--r-- | tests/paramgrill.c | 14 | ||||
| -rwxr-xr-x | tests/playTests.sh | 576 | ||||
| -rw-r--r-- | tests/poolTests.c | 41 | ||||
| -rw-r--r-- | tests/regression/results.csv | 632 | ||||
| -rw-r--r-- | tests/zstreamtest.c | 52 | 
18 files changed, 1169 insertions, 769 deletions
| diff --git a/tests/.gitignore b/tests/.gitignore index 1f08c3995e858..4edf6ce13838f 100644 --- a/tests/.gitignore +++ b/tests/.gitignore @@ -55,6 +55,7 @@ _*  tmp*  *.zst  *.gz +!gzip/hufts-segv.gz  result  out  *.zstd diff --git a/tests/Makefile b/tests/Makefile index f11b731835ea3..bd2f909769cb6 100644 --- a/tests/Makefile +++ b/tests/Makefile @@ -215,6 +215,9 @@ roundTripCrash : $(ZSTD_OBJECTS) roundTripCrash.c  longmatch  : $(ZSTD_OBJECTS) longmatch.c  	$(CC) $(FLAGS) $^ -o $@$(EXT) +bigdict: $(ZSTDMT_OBJECTS) $(PRGDIR)/datagen.c bigdict.c +	$(CC) $(FLAGS) $(MULTITHREAD) $^ -o $@$(EXT) +  invalidDictionaries : $(ZSTD_OBJECTS) invalidDictionaries.c  	$(CC) $(FLAGS) $^ -o $@$(EXT) @@ -247,7 +250,7 @@ clean:  	$(MAKE) -C $(ZSTDDIR) clean  	$(MAKE) -C $(PRGDIR) clean  	@$(RM) -fR $(TESTARTEFACT) -	@$(RM) -f core *.o tmp* result* *.gcda dictionary *.zst \ +	@$(RM) -f core *.o tmp* *.tmp result* *.gcda dictionary *.zst \          $(PRGDIR)/zstd$(EXT) $(PRGDIR)/zstd32$(EXT) \          fullbench$(EXT) fullbench32$(EXT) \          fullbench-lib$(EXT) fullbench-dll$(EXT) \ @@ -256,7 +259,7 @@ clean:          zstreamtest$(EXT) zstreamtest32$(EXT) \          datagen$(EXT) paramgrill$(EXT) roundTripCrash$(EXT) longmatch$(EXT) \          symbols$(EXT) invalidDictionaries$(EXT) legacy$(EXT) poolTests$(EXT) \ -        decodecorpus$(EXT) checkTag$(EXT) +        decodecorpus$(EXT) checkTag$(EXT) bigdict$(EXT)  	@echo Cleaning completed @@ -359,6 +362,9 @@ test-zstdgrep: gzstd  	-echo 'hello world' > test.txt && $(PRGDIR)/zstd test.txt  	env ZCAT=/tmp/zstdcat $(PRGDIR)/zstdgrep hello test.txt.zst  	env ZCAT=/tmp/zstdcat $(PRGDIR)/zstdgrep weird test.txt.zst && return 1 || return 0 +	-echo 'hello' > pattern.txt +	env ZCAT=/tmp/zstdcat $(PRGDIR)/zstdgrep -f pattern.txt test.txt.zst +	$(RM) test.txt test.txt.zst pattern.txt  test-fullbench: fullbench datagen  	$(QEMU_SYS) ./fullbench -i1 @@ -394,6 +400,9 @@ test-zstream32: zstreamtest32  test-longmatch: longmatch  	$(QEMU_SYS) ./longmatch +test-bigdict: bigdict +	$(QEMU_SYS) ./bigdict +  test-invalidDictionaries: invalidDictionaries  	$(QEMU_SYS) ./invalidDictionaries diff --git a/tests/bigdict.c b/tests/bigdict.c new file mode 100644 index 0000000000000..11501f6df0fac --- /dev/null +++ b/tests/bigdict.c @@ -0,0 +1,128 @@ +/* + * Copyright (c) 2017-present, Yann Collet, Facebook, Inc. + * All rights reserved. + * + * This source code is licensed under both the BSD-style license (found in the + * LICENSE file in the root directory of this source tree) and the GPLv2 (found + * in the COPYING file in the root directory of this source tree). + * You may select, at your option, one of the above-listed licenses. + */ + +#include <assert.h> +#include <stdio.h> +#include <stddef.h> +#include <stdlib.h> +#include <stdint.h> +#include "datagen.h" +#include "mem.h" +#define ZSTD_STATIC_LINKING_ONLY +#include "zstd.h" + +static int +compress(ZSTD_CCtx* cctx, ZSTD_DCtx* dctx, +         void* dst, size_t dstCapacity, +         void const* src, size_t srcSize, +         void* roundtrip, ZSTD_EndDirective end) +{ +    ZSTD_inBuffer in = {src, srcSize, 0}; +    ZSTD_outBuffer out = {dst, dstCapacity, 0}; +    int ended = 0; + +    while (!ended && (in.pos < in.size || out.pos > 0)) { +        size_t rc; +        out.pos = 0; +        rc = ZSTD_compressStream2(cctx, &out, &in, end); +        if (ZSTD_isError(rc)) +            return 1; +        if (end == ZSTD_e_end && rc == 0) +            ended = 1; +        { +            ZSTD_inBuffer rtIn = {dst, out.pos, 0}; +            ZSTD_outBuffer rtOut = {roundtrip, srcSize, 0}; +            rc = 1; +            while (rtIn.pos < rtIn.size || rtOut.pos > 0) { +                rtOut.pos = 0; +                rc = ZSTD_decompressStream(dctx, &rtOut, &rtIn); +                if (ZSTD_isError(rc)) { +                    fprintf(stderr, "Decompression error: %s\n", ZSTD_getErrorName(rc)); +                    return 1; +                } +                if (rc == 0) +                    break; +            } +            if (ended && rc != 0) { +                fprintf(stderr, "Frame not finished!\n"); +                return 1; +            } +        } +    } + +    return 0; +} + +int main(int argc, const char** argv) +{ +    ZSTD_CCtx* cctx = ZSTD_createCCtx(); +    ZSTD_DCtx* dctx = ZSTD_createDCtx(); +    const size_t dataSize = (size_t)1 << 30; +    const size_t outSize = ZSTD_compressBound(dataSize); +    const size_t bufferSize = (size_t)1 << 31; +    char* buffer = (char*)malloc(bufferSize); +    void* out = malloc(outSize); +    void* roundtrip = malloc(dataSize); +    (void)argc; +    (void)argv; + +    if (!buffer || !out || !roundtrip || !cctx || !dctx) { +        fprintf(stderr, "Allocation failure\n"); +        return 1; +    } + +    if (ZSTD_isError(ZSTD_CCtx_setParameter(cctx, ZSTD_c_windowLog, 31))) +        return 1; +    if (ZSTD_isError(ZSTD_CCtx_setParameter(cctx, ZSTD_c_nbWorkers, 1))) +        return 1; +    if (ZSTD_isError(ZSTD_CCtx_setParameter(cctx, ZSTD_c_overlapLog, 9))) +        return 1; +    if (ZSTD_isError(ZSTD_CCtx_setParameter(cctx, ZSTD_c_checksumFlag, 1))) +        return 1; +    if (ZSTD_isError(ZSTD_CCtx_setParameter(cctx, ZSTD_c_strategy, ZSTD_btopt))) +        return 1; +    if (ZSTD_isError(ZSTD_CCtx_setParameter(cctx, ZSTD_c_targetLength, 7))) +        return 1; +    if (ZSTD_isError(ZSTD_CCtx_setParameter(cctx, ZSTD_c_minMatch, 7))) +        return 1; +    if (ZSTD_isError(ZSTD_CCtx_setParameter(cctx, ZSTD_c_searchLog, 1))) +        return 1; +    if (ZSTD_isError(ZSTD_CCtx_setParameter(cctx, ZSTD_c_hashLog, 10))) +        return 1; +    if (ZSTD_isError(ZSTD_CCtx_setParameter(cctx, ZSTD_c_chainLog, 10))) +        return 1; + +    if (ZSTD_isError(ZSTD_DCtx_setParameter(dctx, ZSTD_d_windowLogMax, 31))) +        return 1; + +    RDG_genBuffer(buffer, bufferSize, 1.0, 0.0, 0xbeefcafe); + +    /* Compress 30 GB */ +    { +        int i; +        for (i = 0; i < 10; ++i) { +            fprintf(stderr, "Compressing 1 GB\n"); +            if (compress(cctx, dctx, out, outSize, buffer, dataSize, roundtrip, ZSTD_e_continue)) +                return 1; +        } +    } +    fprintf(stderr, "Compressing 1 GB\n"); +    if (compress(cctx, dctx, out, outSize, buffer, dataSize, roundtrip, ZSTD_e_end)) +        return 1; + +    fprintf(stderr, "Success!\n"); + +    free(roundtrip); +    free(out); +    free(buffer); +    ZSTD_freeDCtx(dctx); +    ZSTD_freeCCtx(cctx); +    return 0; +} diff --git a/tests/decodecorpus.c b/tests/decodecorpus.c index 9910d3c551a9a..df40862b2f553 100644 --- a/tests/decodecorpus.c +++ b/tests/decodecorpus.c @@ -840,16 +840,16 @@ static size_t writeSequences(U32* seed, frame_t* frame, seqStore_t* seqStorePtr,      {   unsigned max = MaxLL;          size_t const mostFrequent = HIST_countFast_wksp(count, &max, llCodeTable, nbSeq, WKSP, sizeof(WKSP));   /* cannot fail */          assert(!HIST_isError(mostFrequent)); -        if (mostFrequent == nbSeq) { -            /* do RLE if we have the chance */ -            *op++ = llCodeTable[0]; -            FSE_buildCTable_rle(CTable_LitLength, (BYTE)max); -            LLtype = set_rle; -        } else if (frame->stats.fseInit && !(RAND(seed) & 3) && +        if (frame->stats.fseInit && !(RAND(seed) & 3) &&                     isSymbolSubset(llCodeTable, nbSeq,                                    frame->stats.litlengthSymbolSet, 35)) {              /* maybe do repeat mode if we're allowed to */              LLtype = set_repeat; +        } else if (mostFrequent == nbSeq) { +            /* do RLE if we have the chance */ +            *op++ = llCodeTable[0]; +            FSE_buildCTable_rle(CTable_LitLength, (BYTE)max); +            LLtype = set_rle;          } else if (!(RAND(seed) & 3)) {              /* maybe use the default distribution */              FSE_buildCTable_wksp(CTable_LitLength, LL_defaultNorm, MaxLL, LL_defaultNormLog, scratchBuffer, sizeof(scratchBuffer)); @@ -872,14 +872,14 @@ static size_t writeSequences(U32* seed, frame_t* frame, seqStore_t* seqStorePtr,      {   unsigned max = MaxOff;          size_t const mostFrequent = HIST_countFast_wksp(count, &max, ofCodeTable, nbSeq, WKSP, sizeof(WKSP));   /* cannot fail */          assert(!HIST_isError(mostFrequent)); -        if (mostFrequent == nbSeq) { -            *op++ = ofCodeTable[0]; -            FSE_buildCTable_rle(CTable_OffsetBits, (BYTE)max); -            Offtype = set_rle; -        } else if (frame->stats.fseInit && !(RAND(seed) & 3) && +        if (frame->stats.fseInit && !(RAND(seed) & 3) &&                     isSymbolSubset(ofCodeTable, nbSeq,                                    frame->stats.offsetSymbolSet, 28)) {              Offtype = set_repeat; +        } else if (mostFrequent == nbSeq) { +            *op++ = ofCodeTable[0]; +            FSE_buildCTable_rle(CTable_OffsetBits, (BYTE)max); +            Offtype = set_rle;          } else if (!(RAND(seed) & 3)) {              FSE_buildCTable_wksp(CTable_OffsetBits, OF_defaultNorm, DefaultMaxOff, OF_defaultNormLog, scratchBuffer, sizeof(scratchBuffer));              Offtype = set_basic; @@ -900,14 +900,14 @@ static size_t writeSequences(U32* seed, frame_t* frame, seqStore_t* seqStorePtr,      {   unsigned max = MaxML;          size_t const mostFrequent = HIST_countFast_wksp(count, &max, mlCodeTable, nbSeq, WKSP, sizeof(WKSP));   /* cannot fail */          assert(!HIST_isError(mostFrequent)); -        if (mostFrequent == nbSeq) { -            *op++ = *mlCodeTable; -            FSE_buildCTable_rle(CTable_MatchLength, (BYTE)max); -            MLtype = set_rle; -        } else if (frame->stats.fseInit && !(RAND(seed) & 3) && +        if (frame->stats.fseInit && !(RAND(seed) & 3) &&                     isSymbolSubset(mlCodeTable, nbSeq,                                    frame->stats.matchlengthSymbolSet, 52)) {              MLtype = set_repeat; +        } else if (mostFrequent == nbSeq) { +            *op++ = *mlCodeTable; +            FSE_buildCTable_rle(CTable_MatchLength, (BYTE)max); +            MLtype = set_rle;          } else if (!(RAND(seed) & 3)) {              /* sometimes do default distribution */              FSE_buildCTable_wksp(CTable_MatchLength, ML_defaultNorm, MaxML, ML_defaultNormLog, scratchBuffer, sizeof(scratchBuffer)); diff --git a/tests/fullbench.c b/tests/fullbench.c index b06e2edc53a65..f750ee0d78f6c 100644 --- a/tests/fullbench.c +++ b/tests/fullbench.c @@ -15,7 +15,7 @@  #include "util.h"        /* Compiler options, UTIL_GetFileSize */  #include <stdlib.h>      /* malloc */  #include <stdio.h>       /* fprintf, fopen, ftello64 */ -#include <assert.h>      /* assert */ +#include <assert.h>  #include "timefn.h"      /* UTIL_clockSpanNano, UTIL_getTime */  #include "mem.h"         /* U32 */ @@ -31,8 +31,8 @@  #include "zstd.h"        /* ZSTD_versionString */  #include "util.h"        /* time functions */  #include "datagen.h" -#include "benchfn.h"       /* CustomBench*/ -#include "benchzstd.h"     /* MB_UNIT */ +#include "benchfn.h"     /* CustomBench */ +#include "benchzstd.h"   /* MB_UNIT */  /*_************************************ @@ -51,7 +51,7 @@  #define DEFAULT_CLEVEL 1  #define COMPRESSIBILITY_DEFAULT 0.50 -static const size_t g_sampleSize = 10000000; +static const size_t kSampleSizeDefault = 10000000;  #define TIMELOOP_NANOSEC      (1*1000000000ULL) /* 1 second */ @@ -61,12 +61,12 @@ static const size_t g_sampleSize = 10000000;  **************************************/  #define DISPLAY(...)  fprintf(stderr, __VA_ARGS__) +#define CONTROL(c)  { if (!(c)) { abort(); } }   /* like assert(), but cannot be disabled */  /*_************************************  *  Benchmark Parameters  **************************************/  static unsigned g_nbIterations = NBLOOPS; -static double g_compressibility = COMPRESSIBILITY_DEFAULT;  /*_******************************************************* @@ -100,12 +100,12 @@ static ZSTD_CCtx* g_zcc = NULL;  static size_t  local_ZSTD_compress(const void* src, size_t srcSize,                      void* dst, size_t dstSize, -                    void* buff2) +                    void* payload)  {      ZSTD_parameters p;      ZSTD_frameParameters f = { 1 /* contentSizeHeader*/, 0, 0 };      p.fParams = f; -    p.cParams = *(ZSTD_compressionParameters*)buff2; +    p.cParams = *(ZSTD_compressionParameters*)payload;      return ZSTD_compress_advanced (g_zcc, dst, dstSize, src, srcSize, NULL ,0, p);      //return ZSTD_compress(dst, dstSize, src, srcSize, cLevel);  } @@ -126,7 +126,7 @@ extern size_t ZSTD_decodeLiteralsBlock(ZSTD_DCtx* ctx, const void* src, size_t s  static size_t local_ZSTD_decodeLiteralsBlock(const void* src, size_t srcSize, void* dst, size_t dstSize, void* buff2)  {      (void)src; (void)srcSize; (void)dst; (void)dstSize; -    return ZSTD_decodeLiteralsBlock((ZSTD_DCtx*)g_zdc, buff2, g_cSize); +    return ZSTD_decodeLiteralsBlock(g_zdc, buff2, g_cSize);  }  static size_t local_ZSTD_decodeSeqHeaders(const void* src, size_t srcSize, void* dst, size_t dstSize, void* buff2) @@ -141,14 +141,14 @@ static ZSTD_CStream* g_cstream= NULL;  static size_t  local_ZSTD_compressStream(const void* src, size_t srcSize,                            void* dst, size_t dstCapacity, -                          void* buff2) +                          void* payload)  {      ZSTD_outBuffer buffOut;      ZSTD_inBuffer buffIn;      ZSTD_parameters p;      ZSTD_frameParameters f = {1 /* contentSizeHeader*/, 0, 0};      p.fParams = f; -    p.cParams = *(ZSTD_compressionParameters*)buff2; +    p.cParams = *(ZSTD_compressionParameters*)payload;      ZSTD_initCStream_advanced(g_cstream, NULL, 0, p, ZSTD_CONTENTSIZE_UNKNOWN);      buffOut.dst = dst;      buffOut.size = dstCapacity; @@ -162,22 +162,38 @@ local_ZSTD_compressStream(const void* src, size_t srcSize,  }  static size_t +local_ZSTD_compressStream_freshCCtx(const void* src, size_t srcSize, +                          void* dst, size_t dstCapacity, +                          void* payload) +{ +    ZSTD_CCtx* const cctx = ZSTD_createCCtx(); +    size_t r; +    assert(cctx != NULL); + +    r = local_ZSTD_compressStream(src, srcSize, dst, dstCapacity, payload); + +    ZSTD_freeCCtx(cctx); + +    return r; +} + +static size_t  local_ZSTD_compress_generic_end(const void* src, size_t srcSize,                                  void* dst, size_t dstCapacity, -                                void* buff2) +                                void* payload)  { -    (void)buff2; +    (void)payload;      return ZSTD_compress2(g_cstream, dst, dstCapacity, src, srcSize);  }  static size_t  local_ZSTD_compress_generic_continue(const void* src, size_t srcSize,                                       void* dst, size_t dstCapacity, -                                     void* buff2) +                                     void* payload)  {      ZSTD_outBuffer buffOut;      ZSTD_inBuffer buffIn; -    (void)buff2; +    (void)payload;      buffOut.dst = dst;      buffOut.size = dstCapacity;      buffOut.pos = 0; @@ -192,9 +208,9 @@ local_ZSTD_compress_generic_continue(const void* src, size_t srcSize,  static size_t  local_ZSTD_compress_generic_T2_end(const void* src, size_t srcSize,                                     void* dst, size_t dstCapacity, -                                   void* buff2) +                                   void* payload)  { -    (void)buff2; +    (void)payload;      ZSTD_CCtx_setParameter(g_cstream, ZSTD_c_nbWorkers, 2);      return ZSTD_compress2(g_cstream, dst, dstCapacity, src, srcSize);  } @@ -202,11 +218,11 @@ local_ZSTD_compress_generic_T2_end(const void* src, size_t srcSize,  static size_t  local_ZSTD_compress_generic_T2_continue(const void* src, size_t srcSize,                                          void* dst, size_t dstCapacity, -                                        void* buff2) +                                        void* payload)  {      ZSTD_outBuffer buffOut;      ZSTD_inBuffer buffIn; -    (void)buff2; +    (void)payload;      ZSTD_CCtx_setParameter(g_cstream, ZSTD_c_nbWorkers, 2);      buffOut.dst = dst;      buffOut.size = dstCapacity; @@ -242,27 +258,28 @@ local_ZSTD_decompressStream(const void* src, size_t srcSize,  #ifndef ZSTD_DLL_IMPORT  static size_t local_ZSTD_compressContinue(const void* src, size_t srcSize,                                            void* dst, size_t dstCapacity, -                                          void* buff2) +                                          void* payload)  {      ZSTD_parameters p;      ZSTD_frameParameters f = { 1 /* contentSizeHeader*/, 0, 0 };      p.fParams = f; -    p.cParams = *(ZSTD_compressionParameters*)buff2; +    p.cParams = *(ZSTD_compressionParameters*)payload;      ZSTD_compressBegin_advanced(g_zcc, NULL, 0, p, srcSize);      return ZSTD_compressEnd(g_zcc, dst, dstCapacity, src, srcSize);  }  #define FIRST_BLOCK_SIZE 8 -static size_t local_ZSTD_compressContinue_extDict(const void* src, size_t srcSize, -                                                  void* dst, size_t dstCapacity, -                                                  void* buff2) +static size_t +local_ZSTD_compressContinue_extDict(const void* src, size_t srcSize, +                                    void* dst, size_t dstCapacity, +                                    void* payload)  {      BYTE firstBlockBuf[FIRST_BLOCK_SIZE];      ZSTD_parameters p; -    ZSTD_frameParameters f = { 1, 0, 0 }; +    ZSTD_frameParameters const f = { 1, 0, 0 };      p.fParams = f; -    p.cParams = *(ZSTD_compressionParameters*)buff2; +    p.cParams = *(ZSTD_compressionParameters*)payload;      ZSTD_compressBegin_advanced(g_zcc, NULL, 0, p, srcSize);      memcpy(firstBlockBuf, src, FIRST_BLOCK_SIZE); @@ -318,7 +335,7 @@ static int benchMem(unsigned benchNb,      size_t dstBuffSize = ZSTD_compressBound(srcSize);      BYTE*  dstBuff;      void*  dstBuff2; -    void*  buff2; +    void*  payload;      const char* benchName;      BMK_benchFn_t benchFunction;      int errorcode = 0; @@ -355,6 +372,9 @@ static int benchMem(unsigned benchNb,      case 42:          benchFunction = local_ZSTD_decompressStream; benchName = "decompressStream";          break; +    case 43: +        benchFunction = local_ZSTD_compressStream_freshCCtx; benchName = "compressStream_freshCCtx"; +        break;      case 51:          benchFunction = local_ZSTD_compress_generic_continue; benchName = "compress_generic, continue";          break; @@ -379,7 +399,7 @@ static int benchMem(unsigned benchNb,          free(dstBuff); free(dstBuff2);          return 12;      } -    buff2 = dstBuff2; +    payload = dstBuff2;      if (g_zcc==NULL) g_zcc = ZSTD_createCCtx();      if (g_zdc==NULL) g_zdc = ZSTD_createDCtx();      if (g_cstream==NULL) g_cstream = ZSTD_createCStream(); @@ -412,62 +432,66 @@ static int benchMem(unsigned benchNb,      switch(benchNb)      {      case 1: -        buff2 = &cparams; +        payload = &cparams;          break;      case 2: -        g_cSize = ZSTD_compress(buff2, dstBuffSize, src, srcSize, cLevel); +        g_cSize = ZSTD_compress(dstBuff2, dstBuffSize, src, srcSize, cLevel);          break;  #ifndef ZSTD_DLL_IMPORT      case 11: -        buff2 = &cparams; +        payload = &cparams;          break;      case 12: -        buff2 = &cparams; +        payload = &cparams;          break;      case 13 : -        g_cSize = ZSTD_compress(buff2, dstBuffSize, src, srcSize, cLevel); +        g_cSize = ZSTD_compress(dstBuff2, dstBuffSize, src, srcSize, cLevel);          break; -    case 31:  /* ZSTD_decodeLiteralsBlock */ -        {   blockProperties_t bp; -            ZSTD_frameHeader zfp; -            size_t frameHeaderSize, skippedSize; +    case 31:  /* ZSTD_decodeLiteralsBlock : starts literals block in dstBuff2 */ +        {   size_t frameHeaderSize;              g_cSize = ZSTD_compress(dstBuff, dstBuffSize, src, srcSize, cLevel); -            frameHeaderSize = ZSTD_getFrameHeader(&zfp, dstBuff, ZSTD_FRAMEHEADERSIZE_MIN); -            if (frameHeaderSize==0) frameHeaderSize = ZSTD_FRAMEHEADERSIZE_MIN; -            ZSTD_getcBlockSize(dstBuff+frameHeaderSize, dstBuffSize, &bp);  /* Get 1st block type */ -            if (bp.blockType != bt_compressed) { -                DISPLAY("ZSTD_decodeLiteralsBlock : impossible to test on this sample (not compressible)\n"); -                goto _cleanOut; +            frameHeaderSize = ZSTD_frameHeaderSize(dstBuff, ZSTD_FRAMEHEADERSIZE_PREFIX); +            CONTROL(!ZSTD_isError(frameHeaderSize)); +            /* check block is compressible, hence contains a literals section */ +            {   blockProperties_t bp; +                ZSTD_getcBlockSize(dstBuff+frameHeaderSize, dstBuffSize, &bp);  /* Get 1st block type */ +                if (bp.blockType != bt_compressed) { +                    DISPLAY("ZSTD_decodeLiteralsBlock : impossible to test on this sample (not compressible)\n"); +                    goto _cleanOut; +            }   } +            {   size_t const skippedSize = frameHeaderSize + ZSTD_blockHeaderSize; +                memcpy(dstBuff2, dstBuff+skippedSize, g_cSize-skippedSize);              } -            skippedSize = frameHeaderSize + ZSTD_blockHeaderSize; -            memcpy(buff2, dstBuff+skippedSize, g_cSize-skippedSize);              srcSize = srcSize > 128 KB ? 128 KB : srcSize;    /* speed relative to block */              ZSTD_decompressBegin(g_zdc);              break;          }      case 32:   /* ZSTD_decodeSeqHeaders */          {   blockProperties_t bp; -            ZSTD_frameHeader zfp;              const BYTE* ip = dstBuff;              const BYTE* iend; -            size_t frameHeaderSize, cBlockSize; -            ZSTD_compress(dstBuff, dstBuffSize, src, srcSize, cLevel);   /* it would be better to use direct block compression here */ -            g_cSize = ZSTD_compress(dstBuff, dstBuffSize, src, srcSize, cLevel); -            frameHeaderSize = ZSTD_getFrameHeader(&zfp, dstBuff, ZSTD_FRAMEHEADERSIZE_MIN); -            if (frameHeaderSize==0) frameHeaderSize = ZSTD_FRAMEHEADERSIZE_MIN; -            ip += frameHeaderSize;   /* Skip frame Header */ -            cBlockSize = ZSTD_getcBlockSize(ip, dstBuffSize, &bp);   /* Get 1st block type */ -            if (bp.blockType != bt_compressed) { -                DISPLAY("ZSTD_decodeSeqHeaders : impossible to test on this sample (not compressible)\n"); -                goto _cleanOut; +            {   size_t const cSize = ZSTD_compress(dstBuff, dstBuffSize, src, srcSize, cLevel); +                CONTROL(cSize > ZSTD_FRAMEHEADERSIZE_PREFIX);              } -            iend = ip + ZSTD_blockHeaderSize + cBlockSize;   /* End of first block */ -            ip += ZSTD_blockHeaderSize;                      /* skip block header */ +            /* Skip frame Header */ +            {   size_t const frameHeaderSize = ZSTD_frameHeaderSize(dstBuff, ZSTD_FRAMEHEADERSIZE_PREFIX); +                CONTROL(!ZSTD_isError(frameHeaderSize)); +                ip += frameHeaderSize; +            } +            /* Find end of block */ +            {   size_t const cBlockSize = ZSTD_getcBlockSize(ip, dstBuffSize, &bp);   /* Get 1st block type */ +                if (bp.blockType != bt_compressed) { +                    DISPLAY("ZSTD_decodeSeqHeaders : impossible to test on this sample (not compressible)\n"); +                    goto _cleanOut; +                } +                iend = ip + ZSTD_blockHeaderSize + cBlockSize;   /* End of first block */ +            } +            ip += ZSTD_blockHeaderSize;    /* skip block header */              ZSTD_decompressBegin(g_zdc); -            assert(iend > ip); +            CONTROL(iend > ip);              ip += ZSTD_decodeLiteralsBlock(g_zdc, ip, (size_t)(iend-ip));   /* skip literal segment */              g_cSize = (size_t)(iend-ip); -            memcpy(buff2, ip, g_cSize);   /* copy rest of block (it starts by SeqHeader) */ +            memcpy(dstBuff2, ip, g_cSize);   /* copy rest of block (it starts by SeqHeader) */              srcSize = srcSize > 128 KB ? 128 KB : srcSize;   /* speed relative to block */              break;          } @@ -476,10 +500,13 @@ static int benchMem(unsigned benchNb,          goto _cleanOut;  #endif      case 41 : -        buff2 = &cparams; +        payload = &cparams;          break;      case 42 : -        g_cSize = ZSTD_compress(buff2, dstBuffSize, src, srcSize, cLevel); +        g_cSize = ZSTD_compress(payload, dstBuffSize, src, srcSize, cLevel); +        break; +    case 43 : +        payload = &cparams;          break;      /* test functions */ @@ -498,10 +525,10 @@ static int benchMem(unsigned benchNb,          BMK_runTime_t bestResult;          bestResult.sumOfReturn = 0;          bestResult.nanoSecPerRun = (double)TIMELOOP_NANOSEC * 2000000000;  /* hopefully large enough : must be larger than any potential measurement */ -        assert(tfs != NULL); +        CONTROL(tfs != NULL);          bp.benchFn = benchFunction; -        bp.benchPayload = buff2; +        bp.benchPayload = payload;          bp.initFn = NULL;          bp.initPayload = NULL;          bp.errorFn = ZSTD_isError; @@ -549,21 +576,19 @@ _cleanOut:  static int benchSample(U32 benchNb, +                       size_t benchedSize, double compressibility,                         int cLevel, ZSTD_compressionParameters cparams)  { -    size_t const benchedSize = g_sampleSize; -    const char* const name = "Sample 10MiB"; -      /* Allocation */      void* const origBuff = malloc(benchedSize);      if (!origBuff) { DISPLAY("\nError: not enough memory!\n"); return 12; }      /* Fill buffer */ -    RDG_genBuffer(origBuff, benchedSize, g_compressibility, 0.0, 0); +    RDG_genBuffer(origBuff, benchedSize, compressibility, 0.0, 0);      /* bench */      DISPLAY("\r%70s\r", ""); -    DISPLAY(" %s : \n", name); +    DISPLAY(" Sample %u bytes : \n", (unsigned)benchedSize);      if (benchNb) {          benchMem(benchNb, origBuff, benchedSize, cLevel, cparams);      } else {  /* 0 == run all tests */ @@ -696,10 +721,11 @@ static int usage_advanced(const char* exename)      usage(exename);      DISPLAY( "\nAdvanced options :\n");      DISPLAY( " -b#    : test only function # \n"); -    DISPLAY( " -i#    : iteration loops [1-9](default : %i)\n", NBLOOPS); -    DISPLAY( " -P#    : sample compressibility (default : %.1f%%)\n", COMPRESSIBILITY_DEFAULT * 100);      DISPLAY( " -l#    : benchmark functions at that compression level (default : %i)\n", DEFAULT_CLEVEL);      DISPLAY( " --zstd : custom parameter selection. Format same as zstdcli \n"); +    DISPLAY( " -P#    : sample compressibility (default : %.1f%%)\n", COMPRESSIBILITY_DEFAULT * 100); +    DISPLAY( " -B#    : sample size (default : %u)\n", (unsigned)kSampleSizeDefault); +    DISPLAY( " -i#    : iteration loops [1-9](default : %i)\n", NBLOOPS);      return 0;  } @@ -718,13 +744,15 @@ int main(int argc, const char** argv)      U32 benchNb = 0, main_pause = 0;      int cLevel = DEFAULT_CLEVEL;      ZSTD_compressionParameters cparams = ZSTD_getCParams(cLevel, 0, 0); +    size_t sampleSize = kSampleSizeDefault; +    double compressibility = COMPRESSIBILITY_DEFAULT;      DISPLAY(WELCOME_MESSAGE);      if (argc<1) return badusage(exename);      for (argNb=1; argNb<argc; argNb++) {          const char* argument = argv[argNb]; -        assert(argument != NULL); +        CONTROL(argument != NULL);          if (longCommandWArg(&argument, "--zstd=")) {              for ( ; ;) { @@ -767,21 +795,29 @@ int main(int argc, const char** argv)                      benchNb = readU32FromChar(&argument);                      break; -                    /* Modify Nb Iterations */ -                case 'i': +                    /* Select compression level to use */ +                case 'l':                      argument++; -                    g_nbIterations = readU32FromChar(&argument); +                    cLevel = (int)readU32FromChar(&argument); +                    cparams = ZSTD_getCParams(cLevel, 0, 0);                      break;                      /* Select compressibility of synthetic sample */                  case 'P':                      argument++; -                    g_compressibility = (double)readU32FromChar(&argument) / 100.; +                    compressibility = (double)readU32FromChar(&argument) / 100.;                      break; -                case 'l': + +                    /* Select size of synthetic sample */ +                case 'B':                      argument++; -                    cLevel = (int)readU32FromChar(&argument); -                    cparams = ZSTD_getCParams(cLevel, 0, 0); +                    sampleSize = (size_t)readU32FromChar(&argument); +                    break; + +                    /* Modify Nb Iterations */ +                case 'i': +                    argument++; +                    g_nbIterations = readU32FromChar(&argument);                      break;                      /* Unknown command */ @@ -798,7 +834,7 @@ int main(int argc, const char** argv)      if (filenamesStart==0)   /* no input file */ -        result = benchSample(benchNb, cLevel, cparams); +        result = benchSample(benchNb, sampleSize, compressibility, cLevel, cparams);      else          result = benchFiles(benchNb, argv+filenamesStart, argc-filenamesStart, cLevel, cparams); diff --git a/tests/fuzz/Makefile b/tests/fuzz/Makefile index 31b151b857b30..8bf16b1fb0e46 100644 --- a/tests/fuzz/Makefile +++ b/tests/fuzz/Makefile @@ -26,8 +26,8 @@ ZSTDDIR = ../../lib  PRGDIR = ../../programs  FUZZ_CPPFLAGS := -I$(ZSTDDIR) -I$(ZSTDDIR)/common -I$(ZSTDDIR)/compress \ -	-I$(ZSTDDIR)/dictBuilder -I$(ZSTDDIR)/deprecated -I$(PRGDIR) \ -	-DZSTD_MULTITHREAD $(CPPFLAGS) +	-I$(ZSTDDIR)/dictBuilder -I$(ZSTDDIR)/deprecated -I$(ZSTDDIR)/legacy \ +	-I$(PRGDIR) -DZSTD_MULTITHREAD -DZSTD_LEGACY_SUPPORT=1 $(CPPFLAGS)  FUZZ_EXTRA_FLAGS := -Wall -Wextra -Wcast-qual -Wcast-align -Wshadow \  	-Wstrict-aliasing=1 -Wswitch-enum -Wdeclaration-after-statement \  	-Wstrict-prototypes -Wundef \ @@ -47,12 +47,14 @@ ZSTDCOMMON_SRC := $(ZSTDDIR)/common/*.c  ZSTDCOMP_SRC   := $(ZSTDDIR)/compress/*.c  ZSTDDECOMP_SRC := $(ZSTDDIR)/decompress/*.c  ZSTDDICT_SRC := $(ZSTDDIR)/dictBuilder/*.c +ZSTDLEGACY_SRC := $(ZSTDDIR)/legacy/*.c  FUZZ_SRC       := \  	$(FUZZ_SRC) \  	$(ZSTDDECOMP_SRC) \  	$(ZSTDCOMMON_SRC) \  	$(ZSTDCOMP_SRC) \ -	$(ZSTDDICT_SRC) +	$(ZSTDDICT_SRC) \ +	$(ZSTDLEGACY_SRC)  FUZZ_OBJ := $(patsubst %.c,%.o, $(wildcard $(FUZZ_SRC))) @@ -69,7 +71,9 @@ FUZZ_TARGETS :=       \  	stream_decompress \  	block_decompress  \  	dictionary_round_trip \ -	dictionary_decompress +	dictionary_decompress \ +	zstd_frame_info \ +	simple_compress  all: $(FUZZ_TARGETS) @@ -100,6 +104,12 @@ dictionary_round_trip: $(FUZZ_HEADERS) $(FUZZ_OBJ) dictionary_round_trip.o  dictionary_decompress: $(FUZZ_HEADERS) $(FUZZ_OBJ) dictionary_decompress.o  	$(CXX) $(FUZZ_TARGET_FLAGS) $(FUZZ_OBJ) dictionary_decompress.o $(LIB_FUZZING_ENGINE) -o $@ +simple_compress: $(FUZZ_HEADERS) $(FUZZ_OBJ) simple_compress.o +	$(CXX) $(FUZZ_TARGET_FLAGS) $(FUZZ_OBJ) simple_compress.o $(LIB_FUZZING_ENGINE) -o $@ + +zstd_frame_info: $(FUZZ_HEADERS) $(FUZZ_OBJ) zstd_frame_info.o +	$(CXX) $(FUZZ_TARGET_FLAGS) $(FUZZ_OBJ) zstd_frame_info.o $(LIB_FUZZING_ENGINE) -o $@ +  libregression.a: $(FUZZ_HEADERS) $(PRGDIR)/util.h $(PRGDIR)/util.c regression_driver.o  	$(AR) $(FUZZ_ARFLAGS) $@ regression_driver.o @@ -122,6 +132,9 @@ corpora/%: corpora/%_seed_corpus.zip  .PHONY: corpora  corpora: $(patsubst %,corpora/%,$(FUZZ_TARGETS)) +.PHONY: seedcorpora +seedcorpora: $(patsubst %,corpora/%_seed_corpus.zip,$(FUZZ_TARGETS)) +  regressiontest: corpora  	CC="$(CC)" CXX="$(CXX)" CFLAGS="$(CFLAGS)" CXXFLAGS="$(CXXFLAGS)" LDFLAGS="$(LDFLAGS)" $(PYTHON) ./fuzz.py build all  	$(PYTHON) ./fuzz.py regression all @@ -130,7 +143,9 @@ clean:  	@$(MAKE) -C $(ZSTDDIR) clean  	@$(RM) *.a *.o  	@$(RM) simple_round_trip stream_round_trip simple_decompress \ -           stream_decompress block_decompress block_round_trip +           stream_decompress block_decompress block_round_trip \ +           simple_compress dictionary_round_trip dictionary_decompress \ +           zstd_frame_info  cleanall:  	@$(RM) -r Fuzzer diff --git a/tests/fuzz/default.options b/tests/fuzz/default.options deleted file mode 100644 index 8ea8588375d7e..0000000000000 --- a/tests/fuzz/default.options +++ /dev/null @@ -1,2 +0,0 @@ -[libfuzzer] -max_len = 8192 diff --git a/tests/fuzz/dictionary_decompress.c b/tests/fuzz/dictionary_decompress.c index 7d3a7678adc64..e900054f5a6fd 100644 --- a/tests/fuzz/dictionary_decompress.c +++ b/tests/fuzz/dictionary_decompress.c @@ -20,43 +20,42 @@  #include "zstd_helpers.h"  static ZSTD_DCtx *dctx = NULL; -static void* rBuf = NULL; -static size_t bufSize = 0;  int LLVMFuzzerTestOneInput(const uint8_t *src, size_t size)  { -    FUZZ_dict_t dict; -    size_t neededBufSize; -      uint32_t seed = FUZZ_seed(&src, &size); -    neededBufSize = MAX(20 * size, (size_t)256 << 10); +    FUZZ_dict_t dict; +    ZSTD_DDict* ddict = NULL; +    int i; -    /* Allocate all buffers and contexts if not already allocated */ -    if (neededBufSize > bufSize) { -        free(rBuf); -        rBuf = malloc(neededBufSize); -        bufSize = neededBufSize; -        FUZZ_ASSERT(rBuf); -    }      if (!dctx) {          dctx = ZSTD_createDCtx();          FUZZ_ASSERT(dctx);      }      dict = FUZZ_train(src, size, &seed);      if (FUZZ_rand32(&seed, 0, 1) == 0) { -        ZSTD_decompress_usingDict(dctx, -                rBuf, neededBufSize, -                src, size, -                dict.buff, dict.size); +        ddict = ZSTD_createDDict(dict.buff, dict.size); +        FUZZ_ASSERT(ddict);      } else {          FUZZ_ZASSERT(ZSTD_DCtx_loadDictionary_advanced(                  dctx, dict.buff, dict.size,                  (ZSTD_dictLoadMethod_e)FUZZ_rand32(&seed, 0, 1),                  (ZSTD_dictContentType_e)FUZZ_rand32(&seed, 0, 2))); -        ZSTD_decompressDCtx(dctx, rBuf, neededBufSize, src, size);      } - +    /* Run it 10 times over 10 output sizes. Reuse the context and dict. */ +    for (i = 0; i < 10; ++i) { +        size_t const bufSize = FUZZ_rand32(&seed, 0, 2 * size); +        void* rBuf = malloc(bufSize); +        FUZZ_ASSERT(rBuf); +        if (ddict) { +            ZSTD_decompress_usingDDict(dctx, rBuf, bufSize, src, size, ddict); +        } else { +            ZSTD_decompressDCtx(dctx, rBuf, bufSize, src, size); +        } +        free(rBuf); +    }      free(dict.buff); +    ZSTD_freeDDict(ddict);  #ifndef STATEFUL_FUZZING      ZSTD_freeDCtx(dctx); dctx = NULL;  #endif diff --git a/tests/fuzz/fuzz.py b/tests/fuzz/fuzz.py index cd2a5b4d442e1..d993209a07ce2 100755 --- a/tests/fuzz/fuzz.py +++ b/tests/fuzz/fuzz.py @@ -36,6 +36,8 @@ TARGETS = [      'block_decompress',      'dictionary_round_trip',      'dictionary_decompress', +    'zstd_frame_info', +    'simple_compress',  ]  ALL_TARGETS = TARGETS + ['all']  FUZZ_RNG_SEED_SIZE = 4 diff --git a/tests/fuzz/simple_compress.c b/tests/fuzz/simple_compress.c new file mode 100644 index 0000000000000..aaed4035750c3 --- /dev/null +++ b/tests/fuzz/simple_compress.c @@ -0,0 +1,47 @@ +/* + * Copyright (c) 2016-present, Facebook, Inc. + * All rights reserved. + * + * This source code is licensed under both the BSD-style license (found in the + * LICENSE file in the root directory of this source tree) and the GPLv2 (found + * in the COPYING file in the root directory of this source tree). + */ + +/** + * This fuzz target attempts to comprss the fuzzed data with the simple + * compression function with an output buffer that may be too small to + * ensure that the compressor never crashes. + */ + +#include <stddef.h> +#include <stdlib.h> +#include <stdio.h> +#include "fuzz_helpers.h" +#include "zstd.h" + +static ZSTD_CCtx *cctx = NULL; + +int LLVMFuzzerTestOneInput(const uint8_t *src, size_t size) +{ +    uint32_t seed = FUZZ_seed(&src, &size); +    size_t const maxSize = ZSTD_compressBound(size); +    int i; +    if (!cctx) { +        cctx = ZSTD_createCCtx(); +        FUZZ_ASSERT(cctx); +    } +    /* Run it 10 times over 10 output sizes. Reuse the context. */ +    for (i = 0; i < 10; ++i) { +        int const level = (int)FUZZ_rand32(&seed, 0, 19 + 3) - 3; /* [-3, 19] */ +        size_t const bufSize = FUZZ_rand32(&seed, 0, maxSize); +        void* rBuf = malloc(bufSize); +        FUZZ_ASSERT(rBuf); +        ZSTD_compressCCtx(cctx, rBuf, bufSize, src, size, level); +        free(rBuf); +    } + +#ifndef STATEFUL_FUZZING +    ZSTD_freeCCtx(cctx); cctx = NULL; +#endif +    return 0; +} diff --git a/tests/fuzz/simple_decompress.c b/tests/fuzz/simple_decompress.c index bba272c622568..af3f302bb092d 100644 --- a/tests/fuzz/simple_decompress.c +++ b/tests/fuzz/simple_decompress.c @@ -19,28 +19,24 @@  #include "zstd.h"  static ZSTD_DCtx *dctx = NULL; -static void* rBuf = NULL; -static size_t bufSize = 0;  int LLVMFuzzerTestOneInput(const uint8_t *src, size_t size)  { -    size_t neededBufSize; -    FUZZ_seed(&src, &size); -    neededBufSize = MAX(20 * size, (size_t)256 << 10); - -    /* Allocate all buffers and contexts if not already allocated */ -    if (neededBufSize > bufSize) { -        free(rBuf); -        rBuf = malloc(neededBufSize); -        bufSize = neededBufSize; -        FUZZ_ASSERT(rBuf); -    } +    uint32_t seed = FUZZ_seed(&src, &size); +    int i;      if (!dctx) {          dctx = ZSTD_createDCtx();          FUZZ_ASSERT(dctx);      } -    ZSTD_decompressDCtx(dctx, rBuf, neededBufSize, src, size); +    /* Run it 10 times over 10 output sizes. Reuse the context. */ +    for (i = 0; i < 10; ++i) { +        size_t const bufSize = FUZZ_rand32(&seed, 0, 2 * size); +        void* rBuf = malloc(bufSize); +        FUZZ_ASSERT(rBuf); +        ZSTD_decompressDCtx(dctx, rBuf, bufSize, src, size); +        free(rBuf); +    }  #ifndef STATEFUL_FUZZING      ZSTD_freeDCtx(dctx); dctx = NULL; diff --git a/tests/fuzz/zstd_frame_info.c b/tests/fuzz/zstd_frame_info.c new file mode 100644 index 0000000000000..7512d5f493b4c --- /dev/null +++ b/tests/fuzz/zstd_frame_info.c @@ -0,0 +1,43 @@ +/* + * Copyright (c) 2016-present, Facebook, Inc. + * All rights reserved. + * + * This source code is licensed under both the BSD-style license (found in the + * LICENSE file in the root directory of this source tree) and the GPLv2 (found + * in the COPYING file in the root directory of this source tree). + */ + +/** + * This fuzz target fuzzes all of the helper functions that consume compressed + * input. + */ + +#include <stddef.h> +#include <stdlib.h> +#include <stdio.h> +#include "fuzz_helpers.h" +#include "zstd_helpers.h" + +int LLVMFuzzerTestOneInput(const uint8_t *src, size_t size) +{ +    ZSTD_frameHeader zfh; +    /* Consume the seed to be compatible with the corpora of other decompression +     * fuzzers. +     */ +    FUZZ_seed(&src, &size); +    /* You can fuzz any helper functions here that are fast, and take zstd +     * compressed data as input. E.g. don't expect the input to be a dictionary, +     * so don't fuzz ZSTD_getDictID_fromDict(). +     */ +    ZSTD_getFrameContentSize(src, size); +    ZSTD_getDecompressedSize(src, size); +    ZSTD_findFrameCompressedSize(src, size); +    ZSTD_getDictID_fromFrame(src, size); +    ZSTD_findDecompressedSize(src, size); +    ZSTD_decompressBound(src, size); +    ZSTD_frameHeaderSize(src, size); +    ZSTD_isFrame(src, size); +    ZSTD_getFrameHeader(&zfh, src, size); +    ZSTD_getFrameHeader_advanced(&zfh, src, size, ZSTD_f_zstd1); +    return 0; +} diff --git a/tests/fuzzer.c b/tests/fuzzer.c index 1a31c78e2922c..f42de9ed55c37 100644 --- a/tests/fuzzer.c +++ b/tests/fuzzer.c @@ -62,10 +62,12 @@ static U32 g_displayLevel = 2;  static const U64 g_refreshRate = SEC_TO_MICRO / 6;  static UTIL_time_t g_displayClock = UTIL_TIME_INITIALIZER; -#define DISPLAYUPDATE(l, ...) if (g_displayLevel>=l) { \ -            if ((UTIL_clockSpanMicro(g_displayClock) > g_refreshRate) || (g_displayLevel>=4)) \ -            { g_displayClock = UTIL_getTime(); DISPLAY(__VA_ARGS__); \ -            if (g_displayLevel>=4) fflush(stderr); } } +#define DISPLAYUPDATE(l, ...) \ +    if (g_displayLevel>=l) { \ +        if ((UTIL_clockSpanMicro(g_displayClock) > g_refreshRate) || (g_displayLevel>=4)) \ +        { g_displayClock = UTIL_getTime(); DISPLAY(__VA_ARGS__); \ +        if (g_displayLevel>=4) fflush(stderr); } \ +    }  /*-******************************************************* @@ -73,7 +75,7 @@ static UTIL_time_t g_displayClock = UTIL_TIME_INITIALIZER;  *********************************************************/  #undef MIN  #undef MAX -/* Declaring the function is it isn't unused */ +/* Declaring the function, to avoid -Wmissing-prototype */  void FUZ_bug976(void);  void FUZ_bug976(void)  {   /* these constants shall not depend on MIN() macro */ @@ -247,7 +249,7 @@ static int FUZ_mallocTests_internal(unsigned seed, double compressibility, unsig      /* advanced MT streaming API test */      if (part <= 4) -    {   unsigned nbThreads; +    {   int nbThreads;          for (nbThreads=1; nbThreads<=4; nbThreads++) {              int compressionLevel;              for (compressionLevel=1; compressionLevel<=6; compressionLevel++) { @@ -261,7 +263,7 @@ static int FUZ_mallocTests_internal(unsigned seed, double compressibility, unsig                  CHECK_Z( ZSTD_compressStream2(cctx, &out, &in, ZSTD_e_continue) );                  while ( ZSTD_compressStream2(cctx, &out, &in, ZSTD_e_end) ) {}                  ZSTD_freeCCtx(cctx); -                DISPLAYLEVEL(3, "compress_generic,-T%u,continue level %i : ", +                DISPLAYLEVEL(3, "compress_generic,-T%i,continue level %i : ",                                  nbThreads, compressionLevel);                  FUZ_displayMallocStats(malcount);      }   }   } @@ -768,13 +770,11 @@ static int basicUnitTests(U32 seed, double compressibility)              DISPLAYLEVEL(3, "OK \n");              DISPLAYLEVEL(3, "test%3i : init CCtx for small level %u (should work again) : ", testNb++, 1); -            { size_t const r = ZSTD_compressBegin(staticCCtx, 1); -              if (ZSTD_isError(r)) goto _output_error; } +            CHECK( ZSTD_compressBegin(staticCCtx, 1) );              DISPLAYLEVEL(3, "OK \n");              DISPLAYLEVEL(3, "test%3i : init CStream for small level %u : ", testNb++, 1); -            { size_t const r = ZSTD_initCStream(staticCCtx, 1); -              if (ZSTD_isError(r)) goto _output_error; } +            CHECK( ZSTD_initCStream(staticCCtx, 1) );              DISPLAYLEVEL(3, "OK \n");              DISPLAYLEVEL(3, "test%3i : init CStream with dictionary (should fail) : ", testNb++); @@ -1059,7 +1059,7 @@ static int basicUnitTests(U32 seed, double compressibility)      /* Dictionary and dictBuilder tests */      {   ZSTD_CCtx* const cctx = ZSTD_createCCtx();          size_t const dictBufferCapacity = 16 KB; -        void* dictBuffer = malloc(dictBufferCapacity); +        void* const dictBuffer = malloc(dictBufferCapacity);          size_t const totalSampleSize = 1 MB;          size_t const sampleUnitSize = 8 KB;          U32 const nbSamples = (U32)(totalSampleSize / sampleUnitSize); @@ -1104,6 +1104,22 @@ static int basicUnitTests(U32 seed, double compressibility)          }          DISPLAYLEVEL(3, "OK, created dictionary of size %u \n", (unsigned)dictSize); +        DISPLAYLEVEL(3, "test%3i : COVER dictBuilder with shrinkDict: ", testNb++); +        { U32 u; for (u=0; u<nbSamples; u++) samplesSizes[u] = sampleUnitSize; } +        {   ZDICT_cover_params_t coverParams; +            memset(&coverParams, 0, sizeof(coverParams)); +            coverParams.steps = 8; +            coverParams.nbThreads = 4; +            coverParams.shrinkDict = 1; +            coverParams.shrinkDictMaxRegression = 1; +            dictSize = ZDICT_optimizeTrainFromBuffer_cover( +                dictBuffer, dictBufferCapacity, +                CNBuffer, samplesSizes, nbSamples/8,  /* less samples for faster tests */ +                &coverParams); +            if (ZDICT_isError(dictSize)) goto _output_error; +        } +        DISPLAYLEVEL(3, "OK, created dictionary of size %u \n", (unsigned)dictSize); +          DISPLAYLEVEL(3, "test%3i : Multithreaded FASTCOVER dictBuilder : ", testNb++);          { U32 u; for (u=0; u<nbSamples; u++) samplesSizes[u] = sampleUnitSize; }          {   ZDICT_fastCover_params_t fastCoverParams; @@ -1118,6 +1134,22 @@ static int basicUnitTests(U32 seed, double compressibility)          }          DISPLAYLEVEL(3, "OK, created dictionary of size %u \n", (unsigned)dictSize); +        DISPLAYLEVEL(3, "test%3i : FASTCOVER dictBuilder with shrinkDict: ", testNb++); +        { U32 u; for (u=0; u<nbSamples; u++) samplesSizes[u] = sampleUnitSize; } +        {   ZDICT_fastCover_params_t fastCoverParams; +            memset(&fastCoverParams, 0, sizeof(fastCoverParams)); +            fastCoverParams.steps = 8; +            fastCoverParams.nbThreads = 4; +            fastCoverParams.shrinkDict = 1; +            fastCoverParams.shrinkDictMaxRegression = 1; +            dictSize = ZDICT_optimizeTrainFromBuffer_fastCover( +                dictBuffer, dictBufferCapacity, +                CNBuffer, samplesSizes, nbSamples, +                &fastCoverParams); +            if (ZDICT_isError(dictSize)) goto _output_error; +        } +        DISPLAYLEVEL(3, "OK, created dictionary of size %u \n", (unsigned)dictSize); +          DISPLAYLEVEL(3, "test%3i : check dictID : ", testNb++);          dictID = ZDICT_getDictID(dictBuffer, dictSize);          if (dictID==0) goto _output_error; @@ -1164,6 +1196,7 @@ static int basicUnitTests(U32 seed, double compressibility)              ZSTD_CDict* const cdict = ZSTD_createCDict_advanced(dictBuffer, dictSize,                                              ZSTD_dlm_byRef, ZSTD_dct_auto,                                              cParams, ZSTD_defaultCMem); +            assert(cdict != NULL);              DISPLAYLEVEL(3, "(size : %u) : ", (unsigned)ZSTD_sizeof_CDict(cdict));              cSize = ZSTD_compress_usingCDict(cctx, compressedBuffer, compressedBufferSize,                                                   CNBuffer, CNBuffSize, cdict); @@ -1221,8 +1254,11 @@ static int basicUnitTests(U32 seed, double compressibility)          {   ZSTD_frameParameters const fParams = { 0 /* frameSize */, 1 /* checksum */, 1 /* noDictID*/ };              ZSTD_compressionParameters const cParams = ZSTD_getCParams(1, CNBuffSize, dictSize);              ZSTD_CDict* const cdict = ZSTD_createCDict_advanced(dictBuffer, dictSize, ZSTD_dlm_byRef, ZSTD_dct_auto, cParams, ZSTD_defaultCMem); -            cSize = ZSTD_compress_usingCDict_advanced(cctx, compressedBuffer, compressedBufferSize, -                                                 CNBuffer, CNBuffSize, cdict, fParams); +            assert(cdict != NULL); +            cSize = ZSTD_compress_usingCDict_advanced(cctx, +                                                      compressedBuffer, compressedBufferSize, +                                                      CNBuffer, CNBuffSize, +                                                      cdict, fParams);              ZSTD_freeCDict(cdict);              if (ZSTD_isError(cSize)) goto _output_error;          } @@ -1235,7 +1271,8 @@ static int basicUnitTests(U32 seed, double compressibility)          DISPLAYLEVEL(3, "OK (unknown)\n");          DISPLAYLEVEL(3, "test%3i : frame built without dictID should be decompressible : ", testNb++); -        {   ZSTD_DCtx* const dctx = ZSTD_createDCtx(); assert(dctx != NULL); +        {   ZSTD_DCtx* const dctx = ZSTD_createDCtx(); +            assert(dctx != NULL);              CHECKPLUS(r, ZSTD_decompress_usingDict(dctx,                                             decodedBuffer, CNBuffSize,                                             compressedBuffer, cSize, @@ -2459,7 +2496,7 @@ static unsigned readU32FromChar(const char** stringPtr)   *  If yes, @return 1 and advances *stringPtr to the position which immediately follows longCommand.   *  @return 0 and doesn't modify *stringPtr otherwise.   */ -static unsigned longCommandWArg(const char** stringPtr, const char* longCommand) +static int longCommandWArg(const char** stringPtr, const char* longCommand)  {      size_t const comSize = strlen(longCommand);      int const result = !strncmp(*stringPtr, longCommand, comSize); @@ -2519,7 +2556,7 @@ int main(int argc, const char** argv)                  case 'i':                      argument++; maxDuration = 0; -                    nbTests = readU32FromChar(&argument); +                    nbTests = (int)readU32FromChar(&argument);                      break;                  case 'T': @@ -2539,12 +2576,12 @@ int main(int argc, const char** argv)                  case 't':                      argument++; -                    testNb = readU32FromChar(&argument); +                    testNb = (int)readU32FromChar(&argument);                      break;                  case 'P':   /* compressibility % */                      argument++; -                    proba = readU32FromChar(&argument); +                    proba = (int)readU32FromChar(&argument);                      if (proba>100) proba = 100;                      break; diff --git a/tests/paramgrill.c b/tests/paramgrill.c index 75c179a0ba0e8..98fb313783a87 100644 --- a/tests/paramgrill.c +++ b/tests/paramgrill.c @@ -609,8 +609,8 @@ compareResultLT(const BMK_benchResult_t result1, const BMK_benchResult_t result2  static constraint_t relaxTarget(constraint_t target) {      target.cMem = (U32)-1; -    target.cSpeed *= ((double)g_strictness) / 100; -    target.dSpeed *= ((double)g_strictness) / 100; +    target.cSpeed = (target.cSpeed * g_strictness) / 100; +    target.dSpeed = (target.dSpeed * g_strictness) / 100;      return target;  } @@ -1737,8 +1737,8 @@ static int allBench(BMK_benchResult_t* resultPtr,      /* optimistic assumption of benchres */      {   BMK_benchResult_t resultMax = benchres; -        resultMax.cSpeed *= uncertaintyConstantC * VARIANCE; -        resultMax.dSpeed *= uncertaintyConstantD * VARIANCE; +        resultMax.cSpeed = (unsigned long long)(resultMax.cSpeed * uncertaintyConstantC * VARIANCE); +        resultMax.dSpeed = (unsigned long long)(resultMax.dSpeed * uncertaintyConstantD * VARIANCE);          /* disregard infeasible results in feas mode */          /* disregard if resultMax < winner in infeas mode */ @@ -2429,9 +2429,9 @@ optimizeForSize(const char* const * const fileNamesTable, const size_t nbFiles,          }          g_lvltarget = winner.result; -        g_lvltarget.cSpeed *= ((double)g_strictness) / 100; -        g_lvltarget.dSpeed *= ((double)g_strictness) / 100; -        g_lvltarget.cSize /= ((double)g_strictness) / 100; +        g_lvltarget.cSpeed = (g_lvltarget.cSpeed * g_strictness) / 100; +        g_lvltarget.dSpeed = (g_lvltarget.dSpeed * g_strictness) / 100; +        g_lvltarget.cSize = (g_lvltarget.cSize * 100) / g_strictness;          target.cSpeed = (U32)g_lvltarget.cSpeed;          target.dSpeed = (U32)g_lvltarget.dSpeed; diff --git a/tests/playTests.sh b/tests/playTests.sh index bce2710159edd..69387321f92fa 100755 --- a/tests/playTests.sh +++ b/tests/playTests.sh @@ -1,7 +1,9 @@ -#!/bin/sh -e +#!/bin/sh + +set -e  die() { -    $ECHO "$@" 1>&2 +    println "$@" 1>&2      exit 1  } @@ -20,7 +22,7 @@ roundTripTest() {      fi      rm -f tmp1 tmp2 -    $ECHO "roundTripTest: ./datagen $1 $proba | $ZSTD -v$cLevel | $ZSTD -d$dLevel" +    println "roundTripTest: ./datagen $1 $proba | $ZSTD -v$cLevel | $ZSTD -d$dLevel"      ./datagen $1 $proba | $MD5SUM > tmp1      ./datagen $1 $proba | $ZSTD --ultra -v$cLevel | $ZSTD -d$dLevel  | $MD5SUM > tmp2      $DIFF -q tmp1 tmp2 @@ -41,7 +43,7 @@ fileRoundTripTest() {      fi      rm -f tmp.zstd tmp.md5.1 tmp.md5.2 -    $ECHO "fileRoundTripTest: ./datagen $1 $local_p > tmp && $ZSTD -v$local_c -c tmp | $ZSTD -d$local_d" +    println "fileRoundTripTest: ./datagen $1 $local_p > tmp && $ZSTD -v$local_c -c tmp | $ZSTD -d$local_d"      ./datagen $1 $local_p > tmp      < tmp $MD5SUM > tmp.md5.1      $ZSTD --ultra -v$local_c -c tmp | $ZSTD -d$local_d | $MD5SUM > tmp.md5.2 @@ -49,9 +51,17 @@ fileRoundTripTest() {  }  truncateLastByte() { -	dd bs=1 count=$(($(wc -c < "$1") - 1)) if="$1" +    dd bs=1 count=$(($(wc -c < "$1") - 1)) if="$1" +} + +println() { +    printf '%b\n' "${*}"  } + +SCRIPT_DIR=$(cd "$(dirname "$0")" && pwd) +PRGDIR="$SCRIPT_DIR/../programs" +TESTDIR="$SCRIPT_DIR/../tests"  UNAME=$(uname)  isTerminal=false @@ -86,16 +96,11 @@ case "$UNAME" in    SunOS) DIFF="gdiff" ;;  esac -ECHO="echo -e" -case "$UNAME" in -  Darwin) ECHO="echo" ;; -esac - -$ECHO "\nStarting playTests.sh isWindows=$isWindows ZSTD='$ZSTD'" +println "\nStarting playTests.sh isWindows=$isWindows ZSTD='$ZSTD'"  [ -n "$ZSTD" ] || die "ZSTD variable must be defined!" -if [ -n "$(echo hello | $ZSTD -v -T2 2>&1 > $INTOVOID | grep 'multi-threading is disabled')" ] +if echo hello | $ZSTD -v -T2 2>&1 > $INTOVOID | grep -q 'multi-threading is disabled'  then      hasMT=""  else @@ -104,103 +109,103 @@ fi -$ECHO "\n===>  simple tests " +println "\n===>  simple tests "  ./datagen > tmp -$ECHO "test : basic compression " +println "test : basic compression "  $ZSTD -f tmp                      # trivial compression case, creates tmp.zst -$ECHO "test : basic decompression" +println "test : basic decompression"  $ZSTD -df tmp.zst                 # trivial decompression case (overwrites tmp) -$ECHO "test : too large compression level => auto-fix" +println "test : too large compression level => auto-fix"  $ZSTD -99 -f tmp  # too large compression level, automatic sized down  $ZSTD -5000000000 -f tmp && die "too large numeric value : must fail" -$ECHO "test : --fast aka negative compression levels" +println "test : --fast aka negative compression levels"  $ZSTD --fast -f tmp  # == -1  $ZSTD --fast=3 -f tmp  # == -3  $ZSTD --fast=200000 -f tmp  # too low compression level, automatic fixed  $ZSTD --fast=5000000000 -f tmp && die "too large numeric value : must fail"  $ZSTD -c --fast=0 tmp > $INTOVOID && die "--fast must not accept value 0" -$ECHO "test : too large numeric argument" +println "test : too large numeric argument"  $ZSTD --fast=9999999999 -f tmp  && die "should have refused numeric value" -$ECHO "test : set compression level with environment variable ZSTD_CLEVEL" +println "test : set compression level with environment variable ZSTD_CLEVEL"  ZSTD_CLEVEL=12  $ZSTD -f tmp # positive compression level  ZSTD_CLEVEL=-12 $ZSTD -f tmp # negative compression level  ZSTD_CLEVEL=+12 $ZSTD -f tmp # valid: verbose '+' sign -ZSTD_CLEVEL=    $ZSTD -f tmp # empty env var, warn and revert to default setting +ZSTD_CLEVEL=''  $ZSTD -f tmp # empty env var, warn and revert to default setting  ZSTD_CLEVEL=-   $ZSTD -f tmp # malformed env var, warn and revert to default setting  ZSTD_CLEVEL=a   $ZSTD -f tmp # malformed env var, warn and revert to default setting  ZSTD_CLEVEL=+a  $ZSTD -f tmp # malformed env var, warn and revert to default setting  ZSTD_CLEVEL=3a7 $ZSTD -f tmp # malformed env var, warn and revert to default setting  ZSTD_CLEVEL=50000000000  $ZSTD -f tmp # numeric value too large, warn and revert to default setting -$ECHO "test : override ZSTD_CLEVEL with command line option" +println "test : override ZSTD_CLEVEL with command line option"  ZSTD_CLEVEL=12  $ZSTD --fast=3 -f tmp # overridden by command line option -$ECHO "test : compress to stdout" +println "test : compress to stdout"  $ZSTD tmp -c > tmpCompressed  $ZSTD tmp --stdout > tmpCompressed       # long command format -$ECHO "test : compress to named file" +println "test : compress to named file"  rm tmpCompressed  $ZSTD tmp -o tmpCompressed  test -f tmpCompressed   # file must be created -$ECHO "test : -o must be followed by filename (must fail)" +println "test : -o must be followed by filename (must fail)"  $ZSTD tmp -of tmpCompressed && die "-o must be followed by filename " -$ECHO "test : force write, correct order" +println "test : force write, correct order"  $ZSTD tmp -fo tmpCompressed -$ECHO "test : forgotten argument" +println "test : forgotten argument"  cp tmp tmp2  $ZSTD tmp2 -fo && die "-o must be followed by filename " -$ECHO "test : implied stdout when input is stdin" -$ECHO bob | $ZSTD | $ZSTD -d +println "test : implied stdout when input is stdin" +println bob | $ZSTD | $ZSTD -d  if [ "$isTerminal" = true ]; then -$ECHO "test : compressed data to terminal" -$ECHO bob | $ZSTD && die "should have refused : compressed data to terminal" -$ECHO "test : compressed data from terminal (a hang here is a test fail, zstd is wrongly waiting on data from terminal)" +println "test : compressed data to terminal" +println bob | $ZSTD && die "should have refused : compressed data to terminal" +println "test : compressed data from terminal (a hang here is a test fail, zstd is wrongly waiting on data from terminal)"  $ZSTD -d > $INTOVOID && die "should have refused : compressed data from terminal"  fi -$ECHO "test : null-length file roundtrip" -$ECHO -n '' | $ZSTD - --stdout | $ZSTD -d --stdout -$ECHO "test : ensure small file doesn't add 3-bytes null block" +println "test : null-length file roundtrip" +println -n '' | $ZSTD - --stdout | $ZSTD -d --stdout +println "test : ensure small file doesn't add 3-bytes null block"  ./datagen -g1 > tmp1  $ZSTD tmp1 -c | wc -c | grep "14"  $ZSTD < tmp1  | wc -c | grep "14" -$ECHO "test : decompress file with wrong suffix (must fail)" +println "test : decompress file with wrong suffix (must fail)"  $ZSTD -d tmpCompressed && die "wrong suffix error not detected!"  $ZSTD -df tmp && die "should have refused : wrong extension" -$ECHO "test : decompress into stdout" +println "test : decompress into stdout"  $ZSTD -d tmpCompressed -c > tmpResult    # decompression using stdout  $ZSTD --decompress tmpCompressed -c > tmpResult  $ZSTD --decompress tmpCompressed --stdout > tmpResult -$ECHO "test : decompress from stdin into stdout" +println "test : decompress from stdin into stdout"  $ZSTD -dc   < tmp.zst > $INTOVOID   # combine decompression, stdin & stdout  $ZSTD -dc - < tmp.zst > $INTOVOID  $ZSTD -d    < tmp.zst > $INTOVOID   # implicit stdout when stdin is used  $ZSTD -d  - < tmp.zst > $INTOVOID -$ECHO "test : impose memory limitation (must fail)" +println "test : impose memory limitation (must fail)"  $ZSTD -d -f tmp.zst -M2K -c > $INTOVOID && die "decompression needs more memory than allowed"  $ZSTD -d -f tmp.zst --memlimit=2K -c > $INTOVOID && die "decompression needs more memory than allowed"  # long command  $ZSTD -d -f tmp.zst --memory=2K -c > $INTOVOID && die "decompression needs more memory than allowed"  # long command  $ZSTD -d -f tmp.zst --memlimit-decompress=2K -c > $INTOVOID && die "decompression needs more memory than allowed"  # long command -$ECHO "test : overwrite protection" +println "test : overwrite protection"  $ZSTD -q tmp && die "overwrite check failed!" -$ECHO "test : force overwrite" +println "test : force overwrite"  $ZSTD -q -f tmp  $ZSTD -q --force tmp -$ECHO "test : overwrite readonly file" +println "test : overwrite readonly file"  rm -f tmpro tmpro.zst -$ECHO foo > tmpro.zst -$ECHO foo > tmpro +println foo > tmpro.zst +println foo > tmpro  chmod 400 tmpro.zst  $ZSTD -q tmpro && die "should have refused to overwrite read-only file"  $ZSTD -q -f tmpro -$ECHO "test: --no-progress flag" +println "test: --no-progress flag"  $ZSTD tmpro -c --no-progress | $ZSTD -d -f -o "$INTOVOID" --no-progress  $ZSTD tmpro -cv --no-progress | $ZSTD -dv -f -o "$INTOVOID" --no-progress  rm -f tmpro tmpro.zst -$ECHO "test: overwrite input file (must fail)" +println "test: overwrite input file (must fail)"  $ZSTD tmp -fo tmp && die "zstd compression overwrote the input file"  $ZSTD tmp.zst -dfo tmp.zst && die "zstd decompression overwrote the input file" -$ECHO "test: detect that input file does not exist" +println "test: detect that input file does not exist"  $ZSTD nothere && die "zstd hasn't detected that input file does not exist" -$ECHO "test: --[no-]compress-literals" +println "test: --[no-]compress-literals"  $ZSTD tmp -c --no-compress-literals -1       | $ZSTD -t  $ZSTD tmp -c --no-compress-literals --fast=1 | $ZSTD -t  $ZSTD tmp -c --no-compress-literals -19      | $ZSTD -t @@ -210,27 +215,27 @@ $ZSTD tmp -c --compress-literals    -19      | $ZSTD -t  $ZSTD -b --fast=1 -i1e1 tmp --compress-literals  $ZSTD -b --fast=1 -i1e1 tmp --no-compress-literals -$ECHO "test : file removal" +println "test : file removal"  $ZSTD -f --rm tmp  test ! -f tmp  # tmp should no longer be present  $ZSTD -f -d --rm tmp.zst  test ! -f tmp.zst   # tmp.zst should no longer be present -$ECHO "test : should quietly not remove non-regular file" -$ECHO hello > tmp +println "test : should quietly not remove non-regular file" +println hello > tmp  $ZSTD tmp -f -o "$DEVDEVICE" 2>tmplog > "$INTOVOID"  grep -v "Refusing to remove non-regular file" tmplog  rm -f tmplog  $ZSTD tmp -f -o "$INTOVOID" 2>&1 | grep -v "Refusing to remove non-regular file" -$ECHO "test : --rm on stdin" -$ECHO a | $ZSTD --rm > $INTOVOID   # --rm should remain silent +println "test : --rm on stdin" +println a | $ZSTD --rm > $INTOVOID   # --rm should remain silent  rm tmp  $ZSTD -f tmp && die "tmp not present : should have failed"  test ! -f tmp.zst  # tmp.zst should not be created -$ECHO "test : -d -f do not delete destination when source is not present" +println "test : -d -f do not delete destination when source is not present"  touch tmp    # create destination file  $ZSTD -d -f tmp.zst && die "attempt to decompress a non existing file"  test -f tmp  # destination file should still be present -$ECHO "test : -f do not delete destination when source is not present" +println "test : -f do not delete destination when source is not present"  rm tmp         # erase source file  touch tmp.zst  # create destination file  $ZSTD -f tmp && die "attempt to compress a non existing file" @@ -238,9 +243,9 @@ test -f tmp.zst  # destination file should still be present  rm tmp* -$ECHO "test : compress multiple files" -$ECHO hello > tmp1 -$ECHO world > tmp2 +println "test : compress multiple files" +println hello > tmp1 +println world > tmp2  $ZSTD tmp1 tmp2 -o "$INTOVOID" -f  $ZSTD tmp1 tmp2 -c | $ZSTD -t  $ZSTD tmp1 tmp2 -o tmp.zst @@ -261,11 +266,11 @@ fi  rm tmp* -$ECHO "\n===>  Advanced compression parameters " -$ECHO "Hello world!" | $ZSTD --zstd=windowLog=21,      - -o tmp.zst && die "wrong parameters not detected!" -$ECHO "Hello world!" | $ZSTD --zstd=windowLo=21        - -o tmp.zst && die "wrong parameters not detected!" -$ECHO "Hello world!" | $ZSTD --zstd=windowLog=21,slog  - -o tmp.zst && die "wrong parameters not detected!" -$ECHO "Hello world!" | $ZSTD --zstd=strategy=10        - -o tmp.zst && die "parameter out of bound not detected!"  # > btultra2 : does not exist +println "\n===>  Advanced compression parameters " +println "Hello world!" | $ZSTD --zstd=windowLog=21,      - -o tmp.zst && die "wrong parameters not detected!" +println "Hello world!" | $ZSTD --zstd=windowLo=21        - -o tmp.zst && die "wrong parameters not detected!" +println "Hello world!" | $ZSTD --zstd=windowLog=21,slog  - -o tmp.zst && die "wrong parameters not detected!" +println "Hello world!" | $ZSTD --zstd=strategy=10        - -o tmp.zst && die "parameter out of bound not detected!"  # > btultra2 : does not exist  test ! -f tmp.zst  # tmp.zst should not be created  roundTripTest -g512K  roundTripTest -g512K " --zstd=mml=3,tlen=48,strat=6" @@ -276,17 +281,17 @@ roundTripTest -g512K " --single-thread --long --zstd=lhlog=20,lmml=64,lblog=1,lh  roundTripTest -g64K  "19 --zstd=strat=9"   # btultra2 -$ECHO "\n===>  Pass-Through mode " -$ECHO "Hello world 1!" | $ZSTD -df -$ECHO "Hello world 2!" | $ZSTD -dcf -$ECHO "Hello world 3!" > tmp1 +println "\n===>  Pass-Through mode " +println "Hello world 1!" | $ZSTD -df +println "Hello world 2!" | $ZSTD -dcf +println "Hello world 3!" > tmp1  $ZSTD -dcf tmp1 -$ECHO "\n===>  frame concatenation " +println "\n===>  frame concatenation " -$ECHO "hello " > hello.tmp -$ECHO "world!" > world.tmp +println "hello " > hello.tmp +println "world!" > world.tmp  cat hello.tmp world.tmp > helloworld.tmp  $ZSTD -c hello.tmp > hello.zstd  $ZSTD -c world.tmp > world.zstd @@ -294,44 +299,49 @@ cat hello.zstd world.zstd > helloworld.zstd  $ZSTD -dc helloworld.zstd > result.tmp  cat result.tmp  $DIFF helloworld.tmp result.tmp -$ECHO "frame concatenation without checksum" +println "frame concatenation without checksum"  $ZSTD -c hello.tmp > hello.zstd --no-check  $ZSTD -c world.tmp > world.zstd --no-check  cat hello.zstd world.zstd > helloworld.zstd  $ZSTD -dc helloworld.zstd > result.tmp  $DIFF helloworld.tmp result.tmp -$ECHO "testing zstdcat symlink" +println "testing zstdcat symlink"  ln -sf $ZSTD zstdcat  ./zstdcat helloworld.zstd > result.tmp  $DIFF helloworld.tmp result.tmp +ln -s helloworld.zstd helloworld.link.zstd +./zstdcat helloworld.link.zstd > result.tmp +$DIFF helloworld.tmp result.tmp  rm zstdcat  rm result.tmp -$ECHO "testing zcat symlink" +println "testing zcat symlink"  ln -sf $ZSTD zcat  ./zcat helloworld.zstd > result.tmp  $DIFF helloworld.tmp result.tmp +./zcat helloworld.link.zstd > result.tmp +$DIFF helloworld.tmp result.tmp  rm zcat  rm ./*.tmp ./*.zstd -$ECHO "frame concatenation tests completed" +println "frame concatenation tests completed"  if [ "$isWindows" = false ] && [ "$UNAME" != 'SunOS' ] && [ "$UNAME" != "OpenBSD" ] ; then -$ECHO "\n**** flush write error test **** " +println "\n**** flush write error test **** " -$ECHO "$ECHO foo | $ZSTD > /dev/full" -$ECHO foo | $ZSTD > /dev/full && die "write error not detected!" -$ECHO "$ECHO foo | $ZSTD | $ZSTD -d > /dev/full" -$ECHO foo | $ZSTD | $ZSTD -d > /dev/full && die "write error not detected!" +println "println foo | $ZSTD > /dev/full" +println foo | $ZSTD > /dev/full && die "write error not detected!" +println "println foo | $ZSTD | $ZSTD -d > /dev/full" +println foo | $ZSTD | $ZSTD -d > /dev/full && die "write error not detected!"  fi  if [ "$isWindows" = false ] && [ "$UNAME" != 'SunOS' ] ; then -$ECHO "\n===>  symbolic link test " +println "\n===>  symbolic link test "  rm -f hello.tmp world.tmp world2.tmp hello.tmp.zst world.tmp.zst -$ECHO "hello world" > hello.tmp +println "hello world" > hello.tmp  ln -s hello.tmp world.tmp  ln -s hello.tmp world2.tmp  $ZSTD world.tmp hello.tmp || true @@ -349,7 +359,7 @@ rm -f hello.tmp world.tmp world2.tmp hello.tmp.zst world.tmp.zst  fi -$ECHO "\n===>  test sparse file support " +println "\n===>  test sparse file support "  ./datagen -g5M  -P100 > tmpSparse  $ZSTD tmpSparse -c | $ZSTD -dv -o tmpSparseRegen @@ -362,10 +372,10 @@ ls -ls tmpSparse*  # look at file size and block size on disk  ./datagen -s1 -g1200007 -P100 | $ZSTD | $ZSTD -dv --sparse -c > tmpSparseOdd   # Odd size file (to not finish on an exact nb of blocks)  ./datagen -s1 -g1200007 -P100 | $DIFF -s - tmpSparseOdd  ls -ls tmpSparseOdd  # look at file size and block size on disk -$ECHO "\n Sparse Compatibility with Console :" -$ECHO "Hello World 1 !" | $ZSTD | $ZSTD -d -c -$ECHO "Hello World 2 !" | $ZSTD | $ZSTD -d | cat -$ECHO "\n Sparse Compatibility with Append :" +println "\n Sparse Compatibility with Console :" +println "Hello World 1 !" | $ZSTD | $ZSTD -d -c +println "Hello World 2 !" | $ZSTD | $ZSTD -d | cat +println "\n Sparse Compatibility with Append :"  ./datagen -P100 -g1M > tmpSparse1M  cat tmpSparse1M tmpSparse1M > tmpSparse2M  $ZSTD -v -f tmpSparse1M -o tmpSparseCompressed @@ -376,187 +386,193 @@ $DIFF tmpSparse2M tmpSparseRegenerated  rm tmpSparse* -$ECHO "\n===>  multiple files tests " +println "\n===>  multiple files tests "  ./datagen -s1        > tmp1 2> $INTOVOID  ./datagen -s2 -g100K > tmp2 2> $INTOVOID  ./datagen -s3 -g1M   > tmp3 2> $INTOVOID -$ECHO "compress tmp* : " +println "compress tmp* : "  $ZSTD -f tmp*  ls -ls tmp*  rm tmp1 tmp2 tmp3 -$ECHO "decompress tmp* : " -$ZSTD -df *.zst +println "decompress tmp* : " +$ZSTD -df ./*.zst  ls -ls tmp* -$ECHO "compress tmp* into stdout > tmpall : " +println "compress tmp* into stdout > tmpall : "  $ZSTD -c tmp1 tmp2 tmp3 > tmpall  ls -ls tmp*  # check size of tmpall (should be tmp1.zst + tmp2.zst + tmp3.zst) -$ECHO "decompress tmpall* into stdout > tmpdec : " +println "decompress tmpall* into stdout > tmpdec : "  cp tmpall tmpall2  $ZSTD -dc tmpall* > tmpdec  ls -ls tmp* # check size of tmpdec (should be 2*(tmp1 + tmp2 + tmp3)) -$ECHO "compress multiple files including a missing one (notHere) : " +println "compress multiple files including a missing one (notHere) : "  $ZSTD -f tmp1 notHere tmp2 && die "missing file not detected!" -$ECHO "\n===>  dictionary tests " +println "\n===>  dictionary tests " -$ECHO "- test with raw dict (content only) " +println "- test with raw dict (content only) "  ./datagen > tmpDict  ./datagen -g1M | $MD5SUM > tmp1  ./datagen -g1M | $ZSTD -D tmpDict | $ZSTD -D tmpDict -dvq | $MD5SUM > tmp2  $DIFF -q tmp1 tmp2 -$ECHO "- Create first dictionary " -TESTFILE=../programs/zstdcli.c -$ZSTD --train *.c ../programs/*.c -o tmpDict -cp $TESTFILE tmp -$ECHO "- Test dictionary compression with tmpDict as an input file and dictionary" +println "- Create first dictionary " +TESTFILE="$PRGDIR"/zstdcli.c +$ZSTD --train "$TESTDIR"/*.c "$PRGDIR"/*.c -o tmpDict +cp "$TESTFILE" tmp +println "- Test dictionary compression with tmpDict as an input file and dictionary"  $ZSTD -f tmpDict -D tmpDict && die "compression error not detected!" -$ECHO "- Dictionary compression roundtrip" +println "- Dictionary compression roundtrip"  $ZSTD -f tmp -D tmpDict  $ZSTD -d tmp.zst -D tmpDict -fo result -$DIFF $TESTFILE result -$ECHO "- Dictionary compression with btlazy2 strategy" +$DIFF "$TESTFILE" result +println "- Dictionary compression with btlazy2 strategy"  $ZSTD -f tmp -D tmpDict --zstd=strategy=6  $ZSTD -d tmp.zst -D tmpDict -fo result -$DIFF $TESTFILE result +$DIFF "$TESTFILE" result  if [ -n "$hasMT" ]  then -    $ECHO "- Test dictionary compression with multithreading " +    println "- Test dictionary compression with multithreading "      ./datagen -g5M | $ZSTD -T2 -D tmpDict | $ZSTD -t -D tmpDict   # fails with v1.3.2  fi -$ECHO "- Create second (different) dictionary " -$ZSTD --train *.c ../programs/*.c ../programs/*.h -o tmpDictC +println "- Create second (different) dictionary " +$ZSTD --train "$TESTDIR"/*.c "$PRGDIR"/*.c "$PRGDIR"/*.h -o tmpDictC  $ZSTD -d tmp.zst -D tmpDictC -fo result && die "wrong dictionary not detected!" -$ECHO "- Create dictionary with short dictID" -$ZSTD --train *.c ../programs/*.c --dictID=1 -o tmpDict1 +println "- Create dictionary with short dictID" +$ZSTD --train "$TESTDIR"/*.c "$PRGDIR"/*.c --dictID=1 -o tmpDict1  cmp tmpDict tmpDict1 && die "dictionaries should have different ID !" -$ECHO "- Create dictionary with wrong dictID parameter order (must fail)" -$ZSTD --train *.c ../programs/*.c --dictID -o 1 tmpDict1 && die "wrong order : --dictID must be followed by argument " -$ECHO "- Create dictionary with size limit" -$ZSTD --train *.c ../programs/*.c -o tmpDict2 --maxdict=4K -v -$ECHO "- Create dictionary with small size limit" -$ZSTD --train *.c ../programs/*.c -o tmpDict3 --maxdict=1K -v -$ECHO "- Create dictionary with wrong parameter order (must fail)" -$ZSTD --train *.c ../programs/*.c -o tmpDict3 --maxdict -v 4K && die "wrong order : --maxdict must be followed by argument " -$ECHO "- Compress without dictID" +println "- Create dictionary with wrong dictID parameter order (must fail)" +$ZSTD --train "$TESTDIR"/*.c "$PRGDIR"/*.c --dictID -o 1 tmpDict1 && die "wrong order : --dictID must be followed by argument " +println "- Create dictionary with size limit" +$ZSTD --train "$TESTDIR"/*.c "$PRGDIR"/*.c -o tmpDict2 --maxdict=4K -v +println "- Create dictionary with small size limit" +$ZSTD --train "$TESTDIR"/*.c "$PRGDIR"/*.c -o tmpDict3 --maxdict=1K -v +println "- Create dictionary with wrong parameter order (must fail)" +$ZSTD --train "$TESTDIR"/*.c "$PRGDIR"/*.c -o tmpDict3 --maxdict -v 4K && die "wrong order : --maxdict must be followed by argument " +println "- Compress without dictID"  $ZSTD -f tmp -D tmpDict1 --no-dictID  $ZSTD -d tmp.zst -D tmpDict -fo result -$DIFF $TESTFILE result -$ECHO "- Compress with wrong argument order (must fail)" +$DIFF "$TESTFILE" result +println "- Compress with wrong argument order (must fail)"  $ZSTD tmp -Df tmpDict1 -c > $INTOVOID && die "-D must be followed by dictionary name " -$ECHO "- Compress multiple files with dictionary" +println "- Compress multiple files with dictionary"  rm -rf dirTestDict  mkdir dirTestDict -cp *.c dirTestDict -cp ../programs/*.c dirTestDict -cp ../programs/*.h dirTestDict +cp "$TESTDIR"/*.c dirTestDict +cp "$PRGDIR"/*.c dirTestDict +cp "$PRGDIR"/*.h dirTestDict  $MD5SUM dirTestDict/* > tmph1  $ZSTD -f --rm dirTestDict/* -D tmpDictC  $ZSTD -d --rm dirTestDict/*.zst -D tmpDictC  # note : use internal checksum by default  case "$UNAME" in -  Darwin) $ECHO "md5sum -c not supported on OS-X : test skipped" ;;  # not compatible with OS-X's md5 +  Darwin) println "md5sum -c not supported on OS-X : test skipped" ;;  # not compatible with OS-X's md5    *) $MD5SUM -c tmph1 ;;  esac  rm -rf dirTestDict -$ECHO "- dictionary builder on bogus input" -$ECHO "Hello World" > tmp +println "- dictionary builder on bogus input" +println "Hello World" > tmp  $ZSTD --train-legacy -q tmp && die "Dictionary training should fail : not enough input source"  ./datagen -P0 -g10M > tmp  $ZSTD --train-legacy -q tmp && die "Dictionary training should fail : source is pure noise" -$ECHO "- Test -o before --train" +println "- Test -o before --train"  rm -f tmpDict dictionary -$ZSTD -o tmpDict --train *.c ../programs/*.c +$ZSTD -o tmpDict --train "$TESTDIR"/*.c "$PRGDIR"/*.c  test -f tmpDict -$ZSTD --train *.c ../programs/*.c +$ZSTD --train "$TESTDIR"/*.c "$PRGDIR"/*.c  test -f dictionary  rm tmp* dictionary -$ECHO "\n===>  fastCover dictionary builder : advanced options " - -TESTFILE=../programs/zstdcli.c +println "\n===>  fastCover dictionary builder : advanced options " +TESTFILE="$PRGDIR"/zstdcli.c  ./datagen > tmpDict -$ECHO "- Create first dictionary" -$ZSTD --train-fastcover=k=46,d=8,f=15,split=80 *.c ../programs/*.c -o tmpDict -cp $TESTFILE tmp +println "- Create first dictionary" +$ZSTD --train-fastcover=k=46,d=8,f=15,split=80 "$TESTDIR"/*.c "$PRGDIR"/*.c -o tmpDict +cp "$TESTFILE" tmp  $ZSTD -f tmp -D tmpDict  $ZSTD -d tmp.zst -D tmpDict -fo result -$DIFF $TESTFILE result -$ECHO "- Create second (different) dictionary" -$ZSTD --train-fastcover=k=56,d=8 *.c ../programs/*.c ../programs/*.h -o tmpDictC +$DIFF "$TESTFILE" result +println "- Create second (different) dictionary" +$ZSTD --train-fastcover=k=56,d=8 "$TESTDIR"/*.c "$PRGDIR"/*.c "$PRGDIR"/*.h -o tmpDictC  $ZSTD -d tmp.zst -D tmpDictC -fo result && die "wrong dictionary not detected!" -$ECHO "- Create dictionary with short dictID" -$ZSTD --train-fastcover=k=46,d=8,f=15,split=80 *.c ../programs/*.c --dictID=1 -o tmpDict1 +$ZSTD --train-fastcover=k=56,d=8 && die "Create dictionary without input file" +println "- Create dictionary with short dictID" +$ZSTD --train-fastcover=k=46,d=8,f=15,split=80 "$TESTDIR"/*.c "$PRGDIR"/*.c --dictID=1 -o tmpDict1  cmp tmpDict tmpDict1 && die "dictionaries should have different ID !" -$ECHO "- Create dictionary with size limit" -$ZSTD --train-fastcover=steps=8 *.c ../programs/*.c -o tmpDict2 --maxdict=4K -$ECHO "- Compare size of dictionary from 90% training samples with 80% training samples" -$ZSTD --train-fastcover=split=90 -r *.c ../programs/*.c -$ZSTD --train-fastcover=split=80 -r *.c ../programs/*.c -$ECHO "- Create dictionary using all samples for both training and testing" -$ZSTD --train-fastcover=split=100 -r *.c ../programs/*.c -$ECHO "- Create dictionary using f=16" -$ZSTD --train-fastcover=f=16 -r *.c ../programs/*.c -$ECHO "- Create dictionary using accel=2" -$ZSTD --train-fastcover=accel=2 -r *.c ../programs/*.c -$ECHO "- Create dictionary using accel=10" -$ZSTD --train-fastcover=accel=10 -r *.c ../programs/*.c -$ECHO "- Create dictionary with multithreading" -$ZSTD --train-fastcover -T4 -r *.c ../programs/*.c -$ECHO "- Test -o before --train-fastcover" +println "- Create dictionaries with shrink-dict flag enabled" +$ZSTD --train-fastcover=steps=256,shrink "$TESTDIR"/*.c "$PRGDIR"/*.c -o tmpShrinkDict +$ZSTD --train-fastcover=steps=256,shrink=1 "$TESTDIR"/*.c "$PRGDIR"/*.c -o tmpShrinkDict1 +$ZSTD --train-fastcover=steps=256,shrink=5 "$TESTDIR"/*.c "$PRGDIR"/*.c -o tmpShrinkDict2 +println "- Create dictionary with size limit" +$ZSTD --train-fastcover=steps=8 "$TESTDIR"/*.c "$PRGDIR"/*.c -o tmpDict2 --maxdict=4K +println "- Compare size of dictionary from 90% training samples with 80% training samples" +$ZSTD --train-fastcover=split=90 -r "$TESTDIR"/*.c "$PRGDIR"/*.c +$ZSTD --train-fastcover=split=80 -r "$TESTDIR"/*.c "$PRGDIR"/*.c +println "- Create dictionary using all samples for both training and testing" +$ZSTD --train-fastcover=split=100 -r "$TESTDIR"/*.c "$PRGDIR"/*.c +println "- Create dictionary using f=16" +$ZSTD --train-fastcover=f=16 -r "$TESTDIR"/*.c "$PRGDIR"/*.c +$ZSTD --train-fastcover=accel=15 -r "$TESTDIR"/*.c "$PRGDIR"/*.c && die "Created dictionary using accel=15" +println "- Create dictionary using accel=2" +$ZSTD --train-fastcover=accel=2 -r "$TESTDIR"/*.c "$PRGDIR"/*.c +println "- Create dictionary using accel=10" +$ZSTD --train-fastcover=accel=10 -r "$TESTDIR"/*.c "$PRGDIR"/*.c +println "- Create dictionary with multithreading" +$ZSTD --train-fastcover -T4 -r "$TESTDIR"/*.c "$PRGDIR"/*.c +println "- Test -o before --train-fastcover"  rm -f tmpDict dictionary -$ZSTD -o tmpDict --train-fastcover *.c ../programs/*.c +$ZSTD -o tmpDict --train-fastcover "$TESTDIR"/*.c "$PRGDIR"/*.c  test -f tmpDict -$ZSTD --train-fastcover *.c ../programs/*.c +$ZSTD --train-fastcover "$TESTDIR"/*.c "$PRGDIR"/*.c  test -f dictionary  rm tmp* dictionary -$ECHO "\n===>  legacy dictionary builder " +println "\n===>  legacy dictionary builder " -TESTFILE=../programs/zstdcli.c +TESTFILE="$PRGDIR"/zstdcli.c  ./datagen > tmpDict -$ECHO "- Create first dictionary" -$ZSTD --train-legacy=selectivity=8 *.c ../programs/*.c -o tmpDict -cp $TESTFILE tmp +println "- Create first dictionary" +$ZSTD --train-legacy=selectivity=8 "$TESTDIR"/*.c "$PRGDIR"/*.c -o tmpDict +cp "$TESTFILE" tmp  $ZSTD -f tmp -D tmpDict  $ZSTD -d tmp.zst -D tmpDict -fo result -$DIFF $TESTFILE result -$ECHO "- Create second (different) dictionary" -$ZSTD --train-legacy=s=5 *.c ../programs/*.c ../programs/*.h -o tmpDictC +$DIFF "$TESTFILE" result +$ZSTD --train-legacy=s=8 && die "Create dictionary without input files (should error)" +println "- Create second (different) dictionary" +$ZSTD --train-legacy=s=5 "$TESTDIR"/*.c "$PRGDIR"/*.c "$PRGDIR"/*.h -o tmpDictC  $ZSTD -d tmp.zst -D tmpDictC -fo result && die "wrong dictionary not detected!" -$ECHO "- Create dictionary with short dictID" -$ZSTD --train-legacy -s5 *.c ../programs/*.c --dictID=1 -o tmpDict1 +println "- Create dictionary with short dictID" +$ZSTD --train-legacy -s5 "$TESTDIR"/*.c "$PRGDIR"/*.c --dictID=1 -o tmpDict1  cmp tmpDict tmpDict1 && die "dictionaries should have different ID !" -$ECHO "- Create dictionary with size limit" -$ZSTD --train-legacy -s9 *.c ../programs/*.c -o tmpDict2 --maxdict=4K -$ECHO "- Test -o before --train-legacy" +println "- Create dictionary with size limit" +$ZSTD --train-legacy -s9 "$TESTDIR"/*.c "$PRGDIR"/*.c -o tmpDict2 --maxdict=4K +println "- Test -o before --train-legacy"  rm -f tmpDict dictionary -$ZSTD -o tmpDict --train-legacy *.c ../programs/*.c +$ZSTD -o tmpDict --train-legacy "$TESTDIR"/*.c "$PRGDIR"/*.c  test -f tmpDict -$ZSTD --train-legacy *.c ../programs/*.c +$ZSTD --train-legacy "$TESTDIR"/*.c "$PRGDIR"/*.c  test -f dictionary  rm tmp* dictionary -$ECHO "\n===>  integrity tests " +println "\n===>  integrity tests " -$ECHO "test one file (tmp1.zst) " +println "test one file (tmp1.zst) "  ./datagen > tmp1  $ZSTD tmp1  $ZSTD -t tmp1.zst  $ZSTD --test tmp1.zst -$ECHO "test multiple files (*.zst) " -$ZSTD -t *.zst -$ECHO "test bad files (*) " -$ZSTD -t * && die "bad files not detected !" +println "test multiple files (*.zst) " +$ZSTD -t ./*.zst +println "test bad files (*) " +$ZSTD -t ./* && die "bad files not detected !"  $ZSTD -t tmp1 && die "bad file not detected !"  cp tmp1 tmp2.zst  $ZSTD -t tmp2.zst && die "bad file not detected !"  ./datagen -g0 > tmp3  $ZSTD -t tmp3 && die "bad file not detected !"   # detects 0-sized files as bad -$ECHO "test --rm and --test combined " +println "test --rm and --test combined "  $ZSTD -t --rm tmp1.zst  test -f tmp1.zst   # check file is still present  split -b16384 tmp1.zst tmpSplit. @@ -565,40 +581,40 @@ $ZSTD -t tmpSplit.* && die "bad file not detected !" -$ECHO "\n===>  golden files tests " +println "\n===>  golden files tests " -$ZSTD -t -r files -$ZSTD -c -r files | $ZSTD -t +$ZSTD -t -r "$TESTDIR/files" +$ZSTD -c -r "$TESTDIR/files" | $ZSTD -t -$ECHO "\n===>  benchmark mode tests " +println "\n===>  benchmark mode tests " -$ECHO "bench one file" +println "bench one file"  ./datagen > tmp1  $ZSTD -bi0 tmp1 -$ECHO "bench multiple levels" +println "bench multiple levels"  $ZSTD -i0b0e3 tmp1 -$ECHO "bench negative level" +println "bench negative level"  $ZSTD -bi0 --fast tmp1 -$ECHO "with recursive and quiet modes" +println "with recursive and quiet modes"  $ZSTD -rqi1b1e2 tmp1 -$ECHO "benchmark decompression only" +println "benchmark decompression only"  $ZSTD -f tmp1  $ZSTD -b -d -i1 tmp1.zst -$ECHO "\n===>  zstd compatibility tests " +println "\n===>  zstd compatibility tests "  ./datagen > tmp  rm -f tmp.zst  $ZSTD --format=zstd -f tmp  test -f tmp.zst -$ECHO "\n===>  gzip compatibility tests " +println "\n===>  gzip compatibility tests "  GZIPMODE=1  $ZSTD --format=gzip -V || GZIPMODE=0  if [ $GZIPMODE -eq 1 ]; then -    $ECHO "gzip support detected" +    println "gzip support detected"      GZIPEXE=1      gzip -V || GZIPEXE=0      if [ $GZIPEXE -eq 1 ]; then @@ -609,14 +625,14 @@ if [ $GZIPMODE -eq 1 ]; then          $ZSTD -d -f -v tmp.gz          rm tmp*      else -        $ECHO "gzip binary not detected" +        println "gzip binary not detected"      fi  else -    $ECHO "gzip mode not supported" +    println "gzip mode not supported"  fi -$ECHO "\n===>  gzip frame tests " +println "\n===>  gzip frame tests "  if [ $GZIPMODE -eq 1 ]; then      ./datagen > tmp @@ -626,7 +642,7 @@ if [ $GZIPMODE -eq 1 ]; then      truncateLastByte tmp.gz | $ZSTD -t > $INTOVOID && die "incomplete frame not detected !"      rm tmp*  else -    $ECHO "gzip mode not supported" +    println "gzip mode not supported"  fi  if [ $GZIPMODE -eq 1 ]; then @@ -636,16 +652,16 @@ if [ $GZIPMODE -eq 1 ]; then      test -f tmp.zst  fi -$ECHO "\n===>  xz compatibility tests " +println "\n===>  xz compatibility tests "  LZMAMODE=1  $ZSTD --format=xz -V || LZMAMODE=0  if [ $LZMAMODE -eq 1 ]; then -    $ECHO "xz support detected" +    println "xz support detected"      XZEXE=1      xz -Q -V && lzma -Q -V || XZEXE=0      if [ $XZEXE -eq 1 ]; then -        $ECHO "Testing zstd xz and lzma support" +        println "Testing zstd xz and lzma support"          ./datagen > tmp          $ZSTD --format=lzma -f tmp          $ZSTD --format=xz -f tmp @@ -656,18 +672,18 @@ if [ $LZMAMODE -eq 1 ]; then          $ZSTD -d -f -v tmp.xz          $ZSTD -d -f -v tmp.lzma          rm tmp* -        $ECHO "Creating symlinks" +        println "Creating symlinks"          ln -s $ZSTD ./xz          ln -s $ZSTD ./unxz          ln -s $ZSTD ./lzma          ln -s $ZSTD ./unlzma -        $ECHO "Testing xz and lzma symlinks" +        println "Testing xz and lzma symlinks"          ./datagen > tmp          ./xz tmp          xz -Q -d tmp.xz          ./lzma tmp          lzma -Q -d tmp.lzma -        $ECHO "Testing unxz and unlzma symlinks" +        println "Testing unxz and unlzma symlinks"          xz -Q tmp          ./xz -d tmp.xz          lzma -Q tmp @@ -675,14 +691,14 @@ if [ $LZMAMODE -eq 1 ]; then          rm xz unxz lzma unlzma          rm tmp*      else -        $ECHO "xz binary not detected" +        println "xz binary not detected"      fi  else -    $ECHO "xz mode not supported" +    println "xz mode not supported"  fi -$ECHO "\n===>  xz frame tests " +println "\n===>  xz frame tests "  if [ $LZMAMODE -eq 1 ]; then      ./datagen > tmp @@ -694,15 +710,15 @@ if [ $LZMAMODE -eq 1 ]; then      truncateLastByte tmp.lzma | $ZSTD -t > $INTOVOID && die "incomplete frame not detected !"      rm tmp*  else -    $ECHO "xz mode not supported" +    println "xz mode not supported"  fi -$ECHO "\n===>  lz4 compatibility tests " +println "\n===>  lz4 compatibility tests "  LZ4MODE=1  $ZSTD --format=lz4 -V || LZ4MODE=0  if [ $LZ4MODE -eq 1 ]; then -    $ECHO "lz4 support detected" +    println "lz4 support detected"      LZ4EXE=1      lz4 -V || LZ4EXE=0      if [ $LZ4EXE -eq 1 ]; then @@ -713,14 +729,14 @@ if [ $LZ4MODE -eq 1 ]; then          $ZSTD -d -f -v tmp.lz4          rm tmp*      else -        $ECHO "lz4 binary not detected" +        println "lz4 binary not detected"      fi  else -    $ECHO "lz4 mode not supported" +    println "lz4 mode not supported"  fi -$ECHO "\n===>  lz4 frame tests " +println "\n===>  lz4 frame tests "  if [ $LZ4MODE -eq 1 ]; then      ./datagen > tmp @@ -730,10 +746,10 @@ if [ $LZ4MODE -eq 1 ]; then      truncateLastByte tmp.lz4 | $ZSTD -t > $INTOVOID && die "incomplete frame not detected !"      rm tmp*  else -    $ECHO "lz4 mode not supported" +    println "lz4 mode not supported"  fi -$ECHO "\n===> suffix list test" +println "\n===> suffix list test"  ! $ZSTD -d tmp.abc 2> tmplg @@ -750,7 +766,7 @@ if [ $LZ4MODE -ne 1 ]; then      grep ".lz4" tmplg > $INTOVOID && die "Unsupported suffix listed"  fi -$ECHO "\n===>  zstd round-trip tests " +println "\n===>  zstd round-trip tests "  roundTripTest  roundTripTest -g15K       # TableID==3 @@ -763,7 +779,7 @@ roundTripTest -g516K 19   # btopt  fileRoundTripTest -g500K -$ECHO "\n===>  zstd long distance matching round-trip tests " +println "\n===>  zstd long distance matching round-trip tests "  roundTripTest -g0 "2 --single-thread --long"  roundTripTest -g1000K "1 --single-thread --long"  roundTripTest -g517K "6 --single-thread --long" @@ -775,62 +791,62 @@ fileRoundTripTest -g5M "3 --single-thread --long"  roundTripTest -g96K "5 --single-thread"  if [ -n "$hasMT" ]  then -    $ECHO "\n===>  zstdmt round-trip tests " +    println "\n===>  zstdmt round-trip tests "      roundTripTest -g4M "1 -T0"      roundTripTest -g8M "3 -T2"      roundTripTest -g8000K "2 --threads=2"      fileRoundTripTest -g4M "19 -T2 -B1M" -    $ECHO "\n===>  zstdmt long distance matching round-trip tests " +    println "\n===>  zstdmt long distance matching round-trip tests "      roundTripTest -g8M "3 --long=24 -T2" -    $ECHO "\n===>  ovLog tests " +    println "\n===>  ovLog tests "      ./datagen -g2MB > tmp      refSize=$($ZSTD tmp -6 -c --zstd=wlog=18         | wc -c)      ov9Size=$($ZSTD tmp -6 -c --zstd=wlog=18,ovlog=9 | wc -c)      ov1Size=$($ZSTD tmp -6 -c --zstd=wlog=18,ovlog=1 | wc -c) -    if [ $refSize -eq $ov9Size ]; then +    if [ "$refSize" -eq "$ov9Size" ]; then          echo ov9Size should be different from refSize          exit 1      fi -    if [ $refSize -eq $ov1Size ]; then +    if [ "$refSize" -eq "$ov1Size" ]; then          echo ov1Size should be different from refSize          exit 1      fi -    if [ $ov9Size -ge $ov1Size ]; then -        echo ov9Size=$ov9Size should be smaller than ov1Size=$ov1Size +    if [ "$ov9Size" -ge "$ov1Size" ]; then +        echo ov9Size="$ov9Size" should be smaller than ov1Size="$ov1Size"          exit 1      fi  else -    $ECHO "\n===>  no multithreading, skipping zstdmt tests " +    println "\n===>  no multithreading, skipping zstdmt tests "  fi  rm tmp* -$ECHO "\n===>  zstd --list/-l single frame tests " +println "\n===>  zstd --list/-l single frame tests "  ./datagen > tmp1  ./datagen > tmp2  ./datagen > tmp3  $ZSTD tmp* -$ZSTD -l *.zst -$ZSTD -lv *.zst | grep "Decompressed Size:"  # check that decompressed size is present in header -$ZSTD --list *.zst -$ZSTD --list -v *.zst +$ZSTD -l ./*.zst +$ZSTD -lv ./*.zst | grep "Decompressed Size:"  # check that decompressed size is present in header +$ZSTD --list ./*.zst +$ZSTD --list -v ./*.zst -$ECHO "\n===>  zstd --list/-l multiple frame tests " +println "\n===>  zstd --list/-l multiple frame tests "  cat tmp1.zst tmp2.zst > tmp12.zst  cat tmp12.zst tmp3.zst > tmp123.zst -$ZSTD -l *.zst -$ZSTD -lv *.zst +$ZSTD -l ./*.zst +$ZSTD -lv ./*.zst -$ECHO "\n===>  zstd --list/-l error detection tests " +println "\n===>  zstd --list/-l error detection tests "  $ZSTD -l tmp1 tmp1.zst && die "-l must fail on non-zstd file"  $ZSTD --list tmp* && die "-l must fail on non-zstd file"  $ZSTD -lv tmp1* && die "-l must fail on non-zstd file"  $ZSTD --list -v tmp2 tmp12.zst && die "-l must fail on non-zstd file" -$ECHO "test : detect truncated compressed file " +println "test : detect truncated compressed file "  TEST_DATA_FILE=truncatable-input.txt  FULL_COMPRESSED_FILE=${TEST_DATA_FILE}.zst  TRUNCATED_COMPRESSED_FILE=truncated-input.txt.zst @@ -843,7 +859,7 @@ rm $TEST_DATA_FILE  rm $FULL_COMPRESSED_FILE  rm $TRUNCATED_COMPRESSED_FILE -$ECHO "\n===>  zstd --list/-l errors when presented with stdin / no files" +println "\n===>  zstd --list/-l errors when presented with stdin / no files"  $ZSTD -l && die "-l must fail on empty list of files"  $ZSTD -l - && die "-l does not work on stdin"  $ZSTD -l < tmp1.zst && die "-l does not work on stdin" @@ -852,7 +868,7 @@ $ZSTD -l - tmp1.zst && die "-l does not work on stdin"  $ZSTD -l - tmp1.zst < tmp1.zst && die "-l does not work on stdin"  $ZSTD -l tmp1.zst < tmp2.zst # this will check tmp1.zst, but not tmp2.zst, which is not an error : zstd simply doesn't read stdin in this case. It must not error just because stdin is not a tty -$ECHO "\n===>  zstd --list/-l test with null files " +println "\n===>  zstd --list/-l test with null files "  ./datagen -g0 > tmp5  $ZSTD tmp5  $ZSTD -l tmp5.zst @@ -860,12 +876,12 @@ $ZSTD -l tmp5* && die "-l must fail on non-zstd file"  $ZSTD -lv tmp5.zst | grep "Decompressed Size: 0.00 KB (0 B)"  # check that 0 size is present in header  $ZSTD -lv tmp5* && die "-l must fail on non-zstd file" -$ECHO "\n===>  zstd --list/-l test with no content size field " +println "\n===>  zstd --list/-l test with no content size field "  ./datagen -g513K | $ZSTD > tmp6.zst  $ZSTD -l tmp6.zst  $ZSTD -lv tmp6.zst | grep "Decompressed Size:"  && die "Field :Decompressed Size: should not be available in this compressed file" -$ECHO "\n===>   zstd --list/-l test with no checksum " +println "\n===>   zstd --list/-l test with no checksum "  $ZSTD -f --no-check tmp1  $ZSTD -l tmp1.zst  $ZSTD -lv tmp1.zst @@ -873,7 +889,7 @@ $ZSTD -lv tmp1.zst  rm tmp* -$ECHO "\n===>   zstd long distance matching tests " +println "\n===>   zstd long distance matching tests "  roundTripTest -g0 " --single-thread --long"  roundTripTest -g9M "2 --single-thread --long"  # Test parameter parsing @@ -883,29 +899,32 @@ roundTripTest -g1M -P50 "1 --single-thread --long=29" " --long=28 --memory=512MB  roundTripTest -g1M -P50 "1 --single-thread --long=29" " --zstd=wlog=28 --memory=512MB" -$ECHO "\n===>   adaptive mode " -roundTripTest -g270000000 " --adapt" -roundTripTest -g27000000 " --adapt=min=1,max=4" -$ECHO "===>   test: --adapt must fail on incoherent bounds " -./datagen > tmp -$ZSTD -f -vv --adapt=min=10,max=9 tmp && die "--adapt must fail on incoherent bounds" +if [ -n "$hasMT" ] +then +    println "\n===>   adaptive mode " +    roundTripTest -g270000000 " --adapt" +    roundTripTest -g27000000 " --adapt=min=1,max=4" +    println "===>   test: --adapt must fail on incoherent bounds " +    ./datagen > tmp +    $ZSTD -f -vv --adapt=min=10,max=9 tmp && die "--adapt must fail on incoherent bounds" -$ECHO "\n===>   rsyncable mode " -roundTripTest -g10M " --rsyncable" -roundTripTest -g10M " --rsyncable -B100K" -$ECHO "===>   test: --rsyncable must fail with --single-thread" -$ZSTD -f -vv --rsyncable --single-thread tmp && die "--rsyncable must fail with --single-thread" +    println "\n===>   rsyncable mode " +    roundTripTest -g10M " --rsyncable" +    roundTripTest -g10M " --rsyncable -B100K" +    println "===>   test: --rsyncable must fail with --single-thread" +    $ZSTD -f -vv --rsyncable --single-thread tmp && die "--rsyncable must fail with --single-thread" +fi  if [ "$1" != "--test-large-data" ]; then -    $ECHO "Skipping large data tests" +    println "Skipping large data tests"      exit 0  fi  ############################################################################# -$ECHO "\n===>   large files tests " +println "\n===>   large files tests "  roundTripTest -g270000000 1  roundTripTest -g250000000 2 @@ -937,7 +956,7 @@ roundTripTest -g1700000000 -P0 "1 --zstd=strategy=6"   # ensure btlazy2 can surv  fileRoundTripTest -g4193M -P99 1 -$ECHO "\n===>   zstd long, long distance matching round-trip tests " +println "\n===>   zstd long, long distance matching round-trip tests "  roundTripTest -g270000000 "1 --single-thread --long"  roundTripTest -g130000000 -P60 "5 --single-thread --long"  roundTripTest -g35000000 -P70 "8 --single-thread --long" @@ -949,45 +968,54 @@ roundTripTest -g600M -P50 "1 --single-thread --long --zstd=wlog=29,clog=28"  if [ -n "$hasMT" ]  then -    $ECHO "\n===>   zstdmt long round-trip tests " +    println "\n===>   zstdmt long round-trip tests "      roundTripTest -g80000000 -P99 "19 -T2" " "      roundTripTest -g5000000000 -P99 "1 -T2" " "      roundTripTest -g500000000 -P97 "1 -T999" " "      fileRoundTripTest -g4103M -P98 " -T0" " "      roundTripTest -g400000000 -P97 "1 --long=24 -T2" " " +    # Exposes the bug in https://github.com/facebook/zstd/pull/1678 +    # This test fails on 4 different travis builds at the time of writing +    # because it needs to allocate 8 GB of memory. +    # roundTripTest -g10G -P99 "1 -T1 --long=31 --zstd=clog=27 --fast=1000"  else -    $ECHO "\n**** no multithreading, skipping zstdmt tests **** " +    println "\n**** no multithreading, skipping zstdmt tests **** "  fi -$ECHO "\n===>  cover dictionary builder : advanced options " +println "\n===>  cover dictionary builder : advanced options " -TESTFILE=../programs/zstdcli.c +TESTFILE="$PRGDIR"/zstdcli.c  ./datagen > tmpDict -$ECHO "- Create first dictionary" -$ZSTD --train-cover=k=46,d=8,split=80 *.c ../programs/*.c -o tmpDict -cp $TESTFILE tmp +println "- Create first dictionary" +$ZSTD --train-cover=k=46,d=8,split=80 "$TESTDIR"/*.c "$PRGDIR"/*.c -o tmpDict +cp "$TESTFILE" tmp  $ZSTD -f tmp -D tmpDict  $ZSTD -d tmp.zst -D tmpDict -fo result -$DIFF $TESTFILE result -$ECHO "- Create second (different) dictionary" -$ZSTD --train-cover=k=56,d=8 *.c ../programs/*.c ../programs/*.h -o tmpDictC +$DIFF "$TESTFILE" result +$ZSTD --train-cover=k=56,d=8 && die "Create dictionary without input file (should error)" +println "- Create second (different) dictionary" +$ZSTD --train-cover=k=56,d=8 "$TESTDIR"/*.c "$PRGDIR"/*.c "$PRGDIR"/*.h -o tmpDictC  $ZSTD -d tmp.zst -D tmpDictC -fo result && die "wrong dictionary not detected!" -$ECHO "- Create dictionary with short dictID" -$ZSTD --train-cover=k=46,d=8,split=80 *.c ../programs/*.c --dictID=1 -o tmpDict1 +println "- Create dictionary using shrink-dict flag" +$ZSTD --train-cover=steps=256,shrink "$TESTDIR"/*.c "$PRGDIR"/*.c --dictID=1 -o tmpShrinkDict +$ZSTD --train-cover=steps=256,shrink=1 "$TESTDIR"/*.c "$PRGDIR"/*.c --dictID=1 -o tmpShrinkDict1 +$ZSTD --train-cover=steps=256,shrink=5 "$TESTDIR"/*.c "$PRGDIR"/*.c --dictID=1 -o tmpShrinkDict2 +println "- Create dictionary with short dictID" +$ZSTD --train-cover=k=46,d=8,split=80 "$TESTDIR"/*.c "$PRGDIR"/*.c --dictID=1 -o tmpDict1  cmp tmpDict tmpDict1 && die "dictionaries should have different ID !" -$ECHO "- Create dictionary with size limit" -$ZSTD --train-cover=steps=8 *.c ../programs/*.c -o tmpDict2 --maxdict=4K -$ECHO "- Compare size of dictionary from 90% training samples with 80% training samples" -$ZSTD --train-cover=split=90 -r *.c ../programs/*.c -$ZSTD --train-cover=split=80 -r *.c ../programs/*.c -$ECHO "- Create dictionary using all samples for both training and testing" -$ZSTD --train-cover=split=100 -r *.c ../programs/*.c -$ECHO "- Test -o before --train-cover" +println "- Create dictionary with size limit" +$ZSTD --train-cover=steps=8 "$TESTDIR"/*.c "$PRGDIR"/*.c -o tmpDict2 --maxdict=4K +println "- Compare size of dictionary from 90% training samples with 80% training samples" +$ZSTD --train-cover=split=90 -r "$TESTDIR"/*.c "$PRGDIR"/*.c +$ZSTD --train-cover=split=80 -r "$TESTDIR"/*.c "$PRGDIR"/*.c +println "- Create dictionary using all samples for both training and testing" +$ZSTD --train-cover=split=100 -r "$TESTDIR"/*.c "$PRGDIR"/*.c +println "- Test -o before --train-cover"  rm -f tmpDict dictionary -$ZSTD -o tmpDict --train-cover *.c ../programs/*.c +$ZSTD -o tmpDict --train-cover "$TESTDIR"/*.c "$PRGDIR"/*.c  test -f tmpDict -$ZSTD --train-cover *.c ../programs/*.c +$ZSTD --train-cover "$TESTDIR"/*.c "$PRGDIR"/*.c  test -f dictionary  rm -f tmp* dictionary diff --git a/tests/poolTests.c b/tests/poolTests.c index 272e961d3800b..26d57fb5c867a 100644 --- a/tests/poolTests.c +++ b/tests/poolTests.c @@ -90,6 +90,7 @@ static int testWait(size_t numThreads, size_t queueSize) {  typedef struct {      ZSTD_pthread_mutex_t mut; +    int countdown;      int val;      int max;      ZSTD_pthread_cond_t cond; @@ -97,48 +98,56 @@ typedef struct {  static void waitLongFn(void *opaque) {    poolTest_t* const test = (poolTest_t*) opaque; +  ZSTD_pthread_mutex_lock(&test->mut); +  test->val++; +  if (test->val > test->max) +      test->max = test->val; +  ZSTD_pthread_mutex_unlock(&test->mut); +    UTIL_sleepMilli(10); +    ZSTD_pthread_mutex_lock(&test->mut); -  test->val = test->val + 1; -  if (test->val == test->max) -    ZSTD_pthread_cond_signal(&test->cond); +  test->val--; +  test->countdown--; +  if (test->countdown == 0) +      ZSTD_pthread_cond_signal(&test->cond);    ZSTD_pthread_mutex_unlock(&test->mut);  }  static int testThreadReduction_internal(POOL_ctx* ctx, poolTest_t test)  {      int const nbWaits = 16; -    UTIL_time_t startTime; -    U64 time4threads, time2threads; +    test.countdown = nbWaits;      test.val = 0; -    test.max = nbWaits; +    test.max = 0; -    startTime = UTIL_getTime();      {   int i;          for (i=0; i<nbWaits; i++)              POOL_add(ctx, &waitLongFn, &test);      }      ZSTD_pthread_mutex_lock(&test.mut); -    ZSTD_pthread_cond_wait(&test.cond, &test.mut); -    ASSERT_EQ(test.val, nbWaits); +    while (test.countdown > 0) +        ZSTD_pthread_cond_wait(&test.cond, &test.mut); +    ASSERT_EQ(test.val, 0); +    ASSERT_EQ(test.max, 4);      ZSTD_pthread_mutex_unlock(&test.mut); -    time4threads = UTIL_clockSpanNano(startTime);      ASSERT_EQ( POOL_resize(ctx, 2/*nbThreads*/) , 0 ); +    test.countdown = nbWaits;      test.val = 0; -    startTime = UTIL_getTime(); +    test.max = 0;      {   int i;          for (i=0; i<nbWaits; i++)              POOL_add(ctx, &waitLongFn, &test);      }      ZSTD_pthread_mutex_lock(&test.mut); -    ZSTD_pthread_cond_wait(&test.cond, &test.mut); -    ASSERT_EQ(test.val, nbWaits); +    while (test.countdown > 0) +        ZSTD_pthread_cond_wait(&test.cond, &test.mut); +    ASSERT_EQ(test.val, 0); +    ASSERT_EQ(test.max, 2);      ZSTD_pthread_mutex_unlock(&test.mut); -    time2threads = UTIL_clockSpanNano(startTime); -    if (time4threads >= time2threads) return 1;   /* check 4 threads were effectively faster than 2 */      return 0;  } @@ -246,7 +255,7 @@ int main(int argc, const char **argv) {        printf("FAIL: thread reduction not effective \n");        return 1;    } else { -      printf("SUCCESS: thread reduction effective (slower execution) \n"); +      printf("SUCCESS: thread reduction effective \n");    }    if (testAbruptEnding()) { diff --git a/tests/regression/results.csv b/tests/regression/results.csv index 7ac94f207a6c9..e66787fc02f5d 100644 --- a/tests/regression/results.csv +++ b/tests/regression/results.csv @@ -2,59 +2,59 @@ Data,                               Config,                             Method,  silesia.tar,                        level -5,                           compress simple,                    6738558  silesia.tar,                        level -3,                           compress simple,                    6446362  silesia.tar,                        level -1,                           compress simple,                    6186038 -silesia.tar,                        level 0,                            compress simple,                    4875008 +silesia.tar,                        level 0,                            compress simple,                    4861374  silesia.tar,                        level 1,                            compress simple,                    5334825 -silesia.tar,                        level 3,                            compress simple,                    4875008 -silesia.tar,                        level 4,                            compress simple,                    4813507 -silesia.tar,                        level 5,                            compress simple,                    4722235 -silesia.tar,                        level 6,                            compress simple,                    4672194 -silesia.tar,                        level 7,                            compress simple,                    4606658 -silesia.tar,                        level 9,                            compress simple,                    4554098 -silesia.tar,                        level 13,                           compress simple,                    4491702 -silesia.tar,                        level 16,                           compress simple,                    4381277 -silesia.tar,                        level 19,                           compress simple,                    4281514 -silesia.tar,                        uncompressed literals,              compress simple,                    4875008 -silesia.tar,                        uncompressed literals optimal,      compress simple,                    4281514 +silesia.tar,                        level 3,                            compress simple,                    4861374 +silesia.tar,                        level 4,                            compress simple,                    4799583 +silesia.tar,                        level 5,                            compress simple,                    4722271 +silesia.tar,                        level 6,                            compress simple,                    4672231 +silesia.tar,                        level 7,                            compress simple,                    4606657 +silesia.tar,                        level 9,                            compress simple,                    4554099 +silesia.tar,                        level 13,                           compress simple,                    4491706 +silesia.tar,                        level 16,                           compress simple,                    4381265 +silesia.tar,                        level 19,                           compress simple,                    4281551 +silesia.tar,                        uncompressed literals,              compress simple,                    4861374 +silesia.tar,                        uncompressed literals optimal,      compress simple,                    4281551  silesia.tar,                        huffman literals,                   compress simple,                    6186038  silesia,                            level -5,                           compress cctx,                      6737567  silesia,                            level -3,                           compress cctx,                      6444663  silesia,                            level -1,                           compress cctx,                      6178442 -silesia,                            level 0,                            compress cctx,                      4862377 +silesia,                            level 0,                            compress cctx,                      4849491  silesia,                            level 1,                            compress cctx,                      5313144 -silesia,                            level 3,                            compress cctx,                      4862377 -silesia,                            level 4,                            compress cctx,                      4800629 +silesia,                            level 3,                            compress cctx,                      4849491 +silesia,                            level 4,                            compress cctx,                      4786913  silesia,                            level 5,                            compress cctx,                      4710178  silesia,                            level 6,                            compress cctx,                      4659996  silesia,                            level 7,                            compress cctx,                      4596234  silesia,                            level 9,                            compress cctx,                      4543862  silesia,                            level 13,                           compress cctx,                      4482073 -silesia,                            level 16,                           compress cctx,                      4377391 +silesia,                            level 16,                           compress cctx,                      4377389  silesia,                            level 19,                           compress cctx,                      4293262 -silesia,                            long distance mode,                 compress cctx,                      4862377 -silesia,                            multithreaded,                      compress cctx,                      4862377 -silesia,                            multithreaded long distance mode,   compress cctx,                      4862377 -silesia,                            small window log,                   compress cctx,                      7115734 +silesia,                            long distance mode,                 compress cctx,                      4849491 +silesia,                            multithreaded,                      compress cctx,                      4849491 +silesia,                            multithreaded long distance mode,   compress cctx,                      4849491 +silesia,                            small window log,                   compress cctx,                      7112784  silesia,                            small hash log,                     compress cctx,                      6554898  silesia,                            small chain log,                    compress cctx,                      4931093 -silesia,                            explicit params,                    compress cctx,                      4813352 -silesia,                            uncompressed literals,              compress cctx,                      4862377 +silesia,                            explicit params,                    compress cctx,                      4794609 +silesia,                            uncompressed literals,              compress cctx,                      4849491  silesia,                            uncompressed literals optimal,      compress cctx,                      4293262  silesia,                            huffman literals,                   compress cctx,                      6178442 -silesia,                            multithreaded with advanced params, compress cctx,                      4862377 +silesia,                            multithreaded with advanced params, compress cctx,                      4849491  github,                             level -5,                           compress cctx,                      205285  github,                             level -5 with dict,                 compress cctx,                      47294  github,                             level -3,                           compress cctx,                      190643  github,                             level -3 with dict,                 compress cctx,                      48047  github,                             level -1,                           compress cctx,                      175568  github,                             level -1 with dict,                 compress cctx,                      43527 -github,                             level 0,                            compress cctx,                      136397 -github,                             level 0 with dict,                  compress cctx,                      41536 +github,                             level 0,                            compress cctx,                      136311 +github,                             level 0 with dict,                  compress cctx,                      41534  github,                             level 1,                            compress cctx,                      142450  github,                             level 1 with dict,                  compress cctx,                      42157 -github,                             level 3,                            compress cctx,                      136397 -github,                             level 3 with dict,                  compress cctx,                      41536 +github,                             level 3,                            compress cctx,                      136311 +github,                             level 3 with dict,                  compress cctx,                      41534  github,                             level 4,                            compress cctx,                      136144 -github,                             level 4 with dict,                  compress cctx,                      41721 +github,                             level 4 with dict,                  compress cctx,                      41725  github,                             level 5,                            compress cctx,                      135106  github,                             level 5 with dict,                  compress cctx,                      38934  github,                             level 6,                            compress cctx,                      135108 @@ -69,82 +69,82 @@ github,                             level 16,                           compress  github,                             level 16 with dict,                 compress cctx,                      37568  github,                             level 19,                           compress cctx,                      133717  github,                             level 19 with dict,                 compress cctx,                      37567 -github,                             long distance mode,                 compress cctx,                      141473 -github,                             multithreaded,                      compress cctx,                      141473 -github,                             multithreaded long distance mode,   compress cctx,                      141473 -github,                             small window log,                   compress cctx,                      141473 +github,                             long distance mode,                 compress cctx,                      141101 +github,                             multithreaded,                      compress cctx,                      141101 +github,                             multithreaded long distance mode,   compress cctx,                      141101 +github,                             small window log,                   compress cctx,                      141101  github,                             small hash log,                     compress cctx,                      138943  github,                             small chain log,                    compress cctx,                      139239  github,                             explicit params,                    compress cctx,                      140924 -github,                             uncompressed literals,              compress cctx,                      136397 +github,                             uncompressed literals,              compress cctx,                      136311  github,                             uncompressed literals optimal,      compress cctx,                      133717  github,                             huffman literals,                   compress cctx,                      175568 -github,                             multithreaded with advanced params, compress cctx,                      141473 +github,                             multithreaded with advanced params, compress cctx,                      141101  silesia,                            level -5,                           zstdcli,                            6882514  silesia,                            level -3,                           zstdcli,                            6568406  silesia,                            level -1,                           zstdcli,                            6183433 -silesia,                            level 0,                            zstdcli,                            4862425 +silesia,                            level 0,                            zstdcli,                            4849539  silesia,                            level 1,                            zstdcli,                            5314157 -silesia,                            level 3,                            zstdcli,                            4862425 -silesia,                            level 4,                            zstdcli,                            4800677 +silesia,                            level 3,                            zstdcli,                            4849539 +silesia,                            level 4,                            zstdcli,                            4786961  silesia,                            level 5,                            zstdcli,                            4710226  silesia,                            level 6,                            zstdcli,                            4660044  silesia,                            level 7,                            zstdcli,                            4596282  silesia,                            level 9,                            zstdcli,                            4543910  silesia,                            level 13,                           zstdcli,                            4482121 -silesia,                            level 16,                           zstdcli,                            4377439 +silesia,                            level 16,                           zstdcli,                            4377437  silesia,                            level 19,                           zstdcli,                            4293310 -silesia,                            long distance mode,                 zstdcli,                            4853437 -silesia,                            multithreaded,                      zstdcli,                            4862425 -silesia,                            multithreaded long distance mode,   zstdcli,                            4853437 -silesia,                            small window log,                   zstdcli,                            7126434 +silesia,                            long distance mode,                 zstdcli,                            4839698 +silesia,                            multithreaded,                      zstdcli,                            4849539 +silesia,                            multithreaded long distance mode,   zstdcli,                            4839698 +silesia,                            small window log,                   zstdcli,                            7123892  silesia,                            small hash log,                     zstdcli,                            6554946  silesia,                            small chain log,                    zstdcli,                            4931141 -silesia,                            explicit params,                    zstdcli,                            4815380 -silesia,                            uncompressed literals,              zstdcli,                            5155472 -silesia,                            uncompressed literals optimal,      zstdcli,                            4325475 +silesia,                            explicit params,                    zstdcli,                            4797048 +silesia,                            uncompressed literals,              zstdcli,                            5128008 +silesia,                            uncompressed literals optimal,      zstdcli,                            4325482  silesia,                            huffman literals,                   zstdcli,                            5331158 -silesia,                            multithreaded with advanced params, zstdcli,                            5155472 +silesia,                            multithreaded with advanced params, zstdcli,                            5128008  silesia.tar,                        level -5,                           zstdcli,                            6738906  silesia.tar,                        level -3,                           zstdcli,                            6448409  silesia.tar,                        level -1,                           zstdcli,                            6186908 -silesia.tar,                        level 0,                            zstdcli,                            4875136 +silesia.tar,                        level 0,                            zstdcli,                            4861462  silesia.tar,                        level 1,                            zstdcli,                            5336255 -silesia.tar,                        level 3,                            zstdcli,                            4875136 -silesia.tar,                        level 4,                            zstdcli,                            4814531 -silesia.tar,                        level 5,                            zstdcli,                            4723284 -silesia.tar,                        level 6,                            zstdcli,                            4673591 -silesia.tar,                        level 7,                            zstdcli,                            4608342 -silesia.tar,                        level 9,                            zstdcli,                            4554700 -silesia.tar,                        level 13,                           zstdcli,                            4491706 -silesia.tar,                        level 16,                           zstdcli,                            4381281 -silesia.tar,                        level 19,                           zstdcli,                            4281518 -silesia.tar,                        no source size,                     zstdcli,                            4875132 -silesia.tar,                        long distance mode,                 zstdcli,                            4866975 -silesia.tar,                        multithreaded,                      zstdcli,                            4875136 -silesia.tar,                        multithreaded long distance mode,   zstdcli,                            4866975 -silesia.tar,                        small window log,                   zstdcli,                            7130434 +silesia.tar,                        level 3,                            zstdcli,                            4861462 +silesia.tar,                        level 4,                            zstdcli,                            4800482 +silesia.tar,                        level 5,                            zstdcli,                            4723312 +silesia.tar,                        level 6,                            zstdcli,                            4673616 +silesia.tar,                        level 7,                            zstdcli,                            4608346 +silesia.tar,                        level 9,                            zstdcli,                            4554702 +silesia.tar,                        level 13,                           zstdcli,                            4491710 +silesia.tar,                        level 16,                           zstdcli,                            4381269 +silesia.tar,                        level 19,                           zstdcli,                            4281555 +silesia.tar,                        no source size,                     zstdcli,                            4861458 +silesia.tar,                        long distance mode,                 zstdcli,                            4853140 +silesia.tar,                        multithreaded,                      zstdcli,                            4861462 +silesia.tar,                        multithreaded long distance mode,   zstdcli,                            4853140 +silesia.tar,                        small window log,                   zstdcli,                            7127964  silesia.tar,                        small hash log,                     zstdcli,                            6587841 -silesia.tar,                        small chain log,                    zstdcli,                            4943259 -silesia.tar,                        explicit params,                    zstdcli,                            4839202 -silesia.tar,                        uncompressed literals,              zstdcli,                            5158134 -silesia.tar,                        uncompressed literals optimal,      zstdcli,                            4321098 +silesia.tar,                        small chain log,                    zstdcli,                            4943269 +silesia.tar,                        explicit params,                    zstdcli,                            4822318 +silesia.tar,                        uncompressed literals,              zstdcli,                            5129548 +silesia.tar,                        uncompressed literals optimal,      zstdcli,                            4320914  silesia.tar,                        huffman literals,                   zstdcli,                            5347560 -silesia.tar,                        multithreaded with advanced params, zstdcli,                            5158134 +silesia.tar,                        multithreaded with advanced params, zstdcli,                            5129548  github,                             level -5,                           zstdcli,                            207285  github,                             level -5 with dict,                 zstdcli,                            48718  github,                             level -3,                           zstdcli,                            192643  github,                             level -3 with dict,                 zstdcli,                            47395  github,                             level -1,                           zstdcli,                            177568  github,                             level -1 with dict,                 zstdcli,                            45170 -github,                             level 0,                            zstdcli,                            138397 -github,                             level 0 with dict,                  zstdcli,                            43170 +github,                             level 0,                            zstdcli,                            138311 +github,                             level 0 with dict,                  zstdcli,                            43148  github,                             level 1,                            zstdcli,                            144450  github,                             level 1 with dict,                  zstdcli,                            43682 -github,                             level 3,                            zstdcli,                            138397 -github,                             level 3 with dict,                  zstdcli,                            43170 +github,                             level 3,                            zstdcli,                            138311 +github,                             level 3 with dict,                  zstdcli,                            43148  github,                             level 4,                            zstdcli,                            138144 -github,                             level 4 with dict,                  zstdcli,                            43306 +github,                             level 4 with dict,                  zstdcli,                            43251  github,                             level 5,                            zstdcli,                            137106  github,                             level 5 with dict,                  zstdcli,                            40938  github,                             level 6,                            zstdcli,                            137108 @@ -159,83 +159,83 @@ github,                             level 16,                           zstdcli,  github,                             level 16 with dict,                 zstdcli,                            39577  github,                             level 19,                           zstdcli,                            135717  github,                             level 19 with dict,                 zstdcli,                            39576 -github,                             long distance mode,                 zstdcli,                            138397 -github,                             multithreaded,                      zstdcli,                            138397 -github,                             multithreaded long distance mode,   zstdcli,                            138397 -github,                             small window log,                   zstdcli,                            138397 +github,                             long distance mode,                 zstdcli,                            138311 +github,                             multithreaded,                      zstdcli,                            138311 +github,                             multithreaded long distance mode,   zstdcli,                            138311 +github,                             small window log,                   zstdcli,                            138311  github,                             small hash log,                     zstdcli,                            137467  github,                             small chain log,                    zstdcli,                            138314  github,                             explicit params,                    zstdcli,                            136140 -github,                             uncompressed literals,              zstdcli,                            169004 +github,                             uncompressed literals,              zstdcli,                            167915  github,                             uncompressed literals optimal,      zstdcli,                            158824  github,                             huffman literals,                   zstdcli,                            144450 -github,                             multithreaded with advanced params, zstdcli,                            169004 +github,                             multithreaded with advanced params, zstdcli,                            167915  silesia,                            level -5,                           advanced one pass,                  6737567  silesia,                            level -3,                           advanced one pass,                  6444663  silesia,                            level -1,                           advanced one pass,                  6178442 -silesia,                            level 0,                            advanced one pass,                  4862377 +silesia,                            level 0,                            advanced one pass,                  4849491  silesia,                            level 1,                            advanced one pass,                  5313144 -silesia,                            level 3,                            advanced one pass,                  4862377 -silesia,                            level 4,                            advanced one pass,                  4800629 +silesia,                            level 3,                            advanced one pass,                  4849491 +silesia,                            level 4,                            advanced one pass,                  4786913  silesia,                            level 5,                            advanced one pass,                  4710178  silesia,                            level 6,                            advanced one pass,                  4659996  silesia,                            level 7,                            advanced one pass,                  4596234  silesia,                            level 9,                            advanced one pass,                  4543862  silesia,                            level 13,                           advanced one pass,                  4482073 -silesia,                            level 16,                           advanced one pass,                  4377391 +silesia,                            level 16,                           advanced one pass,                  4377389  silesia,                            level 19,                           advanced one pass,                  4293262 -silesia,                            no source size,                     advanced one pass,                  4862377 -silesia,                            long distance mode,                 advanced one pass,                  4853389 -silesia,                            multithreaded,                      advanced one pass,                  4862377 -silesia,                            multithreaded long distance mode,   advanced one pass,                  4853389 -silesia,                            small window log,                   advanced one pass,                  7126386 +silesia,                            no source size,                     advanced one pass,                  4849491 +silesia,                            long distance mode,                 advanced one pass,                  4839650 +silesia,                            multithreaded,                      advanced one pass,                  4849491 +silesia,                            multithreaded long distance mode,   advanced one pass,                  4839650 +silesia,                            small window log,                   advanced one pass,                  7123844  silesia,                            small hash log,                     advanced one pass,                  6554898  silesia,                            small chain log,                    advanced one pass,                  4931093 -silesia,                            explicit params,                    advanced one pass,                  4815369 -silesia,                            uncompressed literals,              advanced one pass,                  5155424 -silesia,                            uncompressed literals optimal,      advanced one pass,                  4325427 +silesia,                            explicit params,                    advanced one pass,                  4797035 +silesia,                            uncompressed literals,              advanced one pass,                  5127960 +silesia,                            uncompressed literals optimal,      advanced one pass,                  4325434  silesia,                            huffman literals,                   advanced one pass,                  5326210 -silesia,                            multithreaded with advanced params, advanced one pass,                  5155424 +silesia,                            multithreaded with advanced params, advanced one pass,                  5127960  silesia.tar,                        level -5,                           advanced one pass,                  6738558  silesia.tar,                        level -3,                           advanced one pass,                  6446362  silesia.tar,                        level -1,                           advanced one pass,                  6186038 -silesia.tar,                        level 0,                            advanced one pass,                  4875008 +silesia.tar,                        level 0,                            advanced one pass,                  4861374  silesia.tar,                        level 1,                            advanced one pass,                  5334825 -silesia.tar,                        level 3,                            advanced one pass,                  4875008 -silesia.tar,                        level 4,                            advanced one pass,                  4813507 -silesia.tar,                        level 5,                            advanced one pass,                  4722235 -silesia.tar,                        level 6,                            advanced one pass,                  4672194 -silesia.tar,                        level 7,                            advanced one pass,                  4606658 -silesia.tar,                        level 9,                            advanced one pass,                  4554098 -silesia.tar,                        level 13,                           advanced one pass,                  4491702 -silesia.tar,                        level 16,                           advanced one pass,                  4381277 -silesia.tar,                        level 19,                           advanced one pass,                  4281514 -silesia.tar,                        no source size,                     advanced one pass,                  4875008 -silesia.tar,                        long distance mode,                 advanced one pass,                  4861218 -silesia.tar,                        multithreaded,                      advanced one pass,                  4874631 -silesia.tar,                        multithreaded long distance mode,   advanced one pass,                  4860683 -silesia.tar,                        small window log,                   advanced one pass,                  7130394 +silesia.tar,                        level 3,                            advanced one pass,                  4861374 +silesia.tar,                        level 4,                            advanced one pass,                  4799583 +silesia.tar,                        level 5,                            advanced one pass,                  4722271 +silesia.tar,                        level 6,                            advanced one pass,                  4672231 +silesia.tar,                        level 7,                            advanced one pass,                  4606657 +silesia.tar,                        level 9,                            advanced one pass,                  4554099 +silesia.tar,                        level 13,                           advanced one pass,                  4491706 +silesia.tar,                        level 16,                           advanced one pass,                  4381265 +silesia.tar,                        level 19,                           advanced one pass,                  4281551 +silesia.tar,                        no source size,                     advanced one pass,                  4861374 +silesia.tar,                        long distance mode,                 advanced one pass,                  4848046 +silesia.tar,                        multithreaded,                      advanced one pass,                  4860726 +silesia.tar,                        multithreaded long distance mode,   advanced one pass,                  4847343 +silesia.tar,                        small window log,                   advanced one pass,                  7127924  silesia.tar,                        small hash log,                     advanced one pass,                  6587833 -silesia.tar,                        small chain log,                    advanced one pass,                  4943255 -silesia.tar,                        explicit params,                    advanced one pass,                  4829974 -silesia.tar,                        uncompressed literals,              advanced one pass,                  5157992 -silesia.tar,                        uncompressed literals optimal,      advanced one pass,                  4321094 +silesia.tar,                        small chain log,                    advanced one pass,                  4943266 +silesia.tar,                        explicit params,                    advanced one pass,                  4808543 +silesia.tar,                        uncompressed literals,              advanced one pass,                  5129447 +silesia.tar,                        uncompressed literals optimal,      advanced one pass,                  4320910  silesia.tar,                        huffman literals,                   advanced one pass,                  5347283 -silesia.tar,                        multithreaded with advanced params, advanced one pass,                  5158545 +silesia.tar,                        multithreaded with advanced params, advanced one pass,                  5129766  github,                             level -5,                           advanced one pass,                  205285  github,                             level -5 with dict,                 advanced one pass,                  46718  github,                             level -3,                           advanced one pass,                  190643  github,                             level -3 with dict,                 advanced one pass,                  45395  github,                             level -1,                           advanced one pass,                  175568  github,                             level -1 with dict,                 advanced one pass,                  43170 -github,                             level 0,                            advanced one pass,                  136397 -github,                             level 0 with dict,                  advanced one pass,                  41170 +github,                             level 0,                            advanced one pass,                  136311 +github,                             level 0 with dict,                  advanced one pass,                  41148  github,                             level 1,                            advanced one pass,                  142450  github,                             level 1 with dict,                  advanced one pass,                  41682 -github,                             level 3,                            advanced one pass,                  136397 -github,                             level 3 with dict,                  advanced one pass,                  41170 +github,                             level 3,                            advanced one pass,                  136311 +github,                             level 3 with dict,                  advanced one pass,                  41148  github,                             level 4,                            advanced one pass,                  136144 -github,                             level 4 with dict,                  advanced one pass,                  41306 +github,                             level 4 with dict,                  advanced one pass,                  41251  github,                             level 5,                            advanced one pass,                  135106  github,                             level 5 with dict,                  advanced one pass,                  38938  github,                             level 6,                            advanced one pass,                  135108 @@ -250,84 +250,84 @@ github,                             level 16,                           advanced  github,                             level 16 with dict,                 advanced one pass,                  37577  github,                             level 19,                           advanced one pass,                  133717  github,                             level 19 with dict,                 advanced one pass,                  37576 -github,                             no source size,                     advanced one pass,                  136397 -github,                             long distance mode,                 advanced one pass,                  136397 -github,                             multithreaded,                      advanced one pass,                  136397 -github,                             multithreaded long distance mode,   advanced one pass,                  136397 -github,                             small window log,                   advanced one pass,                  136397 +github,                             no source size,                     advanced one pass,                  136311 +github,                             long distance mode,                 advanced one pass,                  136311 +github,                             multithreaded,                      advanced one pass,                  136311 +github,                             multithreaded long distance mode,   advanced one pass,                  136311 +github,                             small window log,                   advanced one pass,                  136311  github,                             small hash log,                     advanced one pass,                  135467  github,                             small chain log,                    advanced one pass,                  136314  github,                             explicit params,                    advanced one pass,                  137670 -github,                             uncompressed literals,              advanced one pass,                  167004 +github,                             uncompressed literals,              advanced one pass,                  165915  github,                             uncompressed literals optimal,      advanced one pass,                  156824  github,                             huffman literals,                   advanced one pass,                  142450 -github,                             multithreaded with advanced params, advanced one pass,                  167004 +github,                             multithreaded with advanced params, advanced one pass,                  165915  silesia,                            level -5,                           advanced one pass small out,        6737567  silesia,                            level -3,                           advanced one pass small out,        6444663  silesia,                            level -1,                           advanced one pass small out,        6178442 -silesia,                            level 0,                            advanced one pass small out,        4862377 +silesia,                            level 0,                            advanced one pass small out,        4849491  silesia,                            level 1,                            advanced one pass small out,        5313144 -silesia,                            level 3,                            advanced one pass small out,        4862377 -silesia,                            level 4,                            advanced one pass small out,        4800629 +silesia,                            level 3,                            advanced one pass small out,        4849491 +silesia,                            level 4,                            advanced one pass small out,        4786913  silesia,                            level 5,                            advanced one pass small out,        4710178  silesia,                            level 6,                            advanced one pass small out,        4659996  silesia,                            level 7,                            advanced one pass small out,        4596234  silesia,                            level 9,                            advanced one pass small out,        4543862  silesia,                            level 13,                           advanced one pass small out,        4482073 -silesia,                            level 16,                           advanced one pass small out,        4377391 +silesia,                            level 16,                           advanced one pass small out,        4377389  silesia,                            level 19,                           advanced one pass small out,        4293262 -silesia,                            no source size,                     advanced one pass small out,        4862377 -silesia,                            long distance mode,                 advanced one pass small out,        4853389 -silesia,                            multithreaded,                      advanced one pass small out,        4862377 -silesia,                            multithreaded long distance mode,   advanced one pass small out,        4853389 -silesia,                            small window log,                   advanced one pass small out,        7126386 +silesia,                            no source size,                     advanced one pass small out,        4849491 +silesia,                            long distance mode,                 advanced one pass small out,        4839650 +silesia,                            multithreaded,                      advanced one pass small out,        4849491 +silesia,                            multithreaded long distance mode,   advanced one pass small out,        4839650 +silesia,                            small window log,                   advanced one pass small out,        7123844  silesia,                            small hash log,                     advanced one pass small out,        6554898  silesia,                            small chain log,                    advanced one pass small out,        4931093 -silesia,                            explicit params,                    advanced one pass small out,        4815369 -silesia,                            uncompressed literals,              advanced one pass small out,        5155424 -silesia,                            uncompressed literals optimal,      advanced one pass small out,        4325427 +silesia,                            explicit params,                    advanced one pass small out,        4797035 +silesia,                            uncompressed literals,              advanced one pass small out,        5127960 +silesia,                            uncompressed literals optimal,      advanced one pass small out,        4325434  silesia,                            huffman literals,                   advanced one pass small out,        5326210 -silesia,                            multithreaded with advanced params, advanced one pass small out,        5155424 +silesia,                            multithreaded with advanced params, advanced one pass small out,        5127960  silesia.tar,                        level -5,                           advanced one pass small out,        6738558  silesia.tar,                        level -3,                           advanced one pass small out,        6446362  silesia.tar,                        level -1,                           advanced one pass small out,        6186038 -silesia.tar,                        level 0,                            advanced one pass small out,        4875008 +silesia.tar,                        level 0,                            advanced one pass small out,        4861374  silesia.tar,                        level 1,                            advanced one pass small out,        5334825 -silesia.tar,                        level 3,                            advanced one pass small out,        4875008 -silesia.tar,                        level 4,                            advanced one pass small out,        4813507 -silesia.tar,                        level 5,                            advanced one pass small out,        4722235 -silesia.tar,                        level 6,                            advanced one pass small out,        4672194 -silesia.tar,                        level 7,                            advanced one pass small out,        4606658 -silesia.tar,                        level 9,                            advanced one pass small out,        4554098 -silesia.tar,                        level 13,                           advanced one pass small out,        4491702 -silesia.tar,                        level 16,                           advanced one pass small out,        4381277 -silesia.tar,                        level 19,                           advanced one pass small out,        4281514 -silesia.tar,                        no source size,                     advanced one pass small out,        4875008 -silesia.tar,                        long distance mode,                 advanced one pass small out,        4861218 -silesia.tar,                        multithreaded,                      advanced one pass small out,        4874631 -silesia.tar,                        multithreaded long distance mode,   advanced one pass small out,        4860683 -silesia.tar,                        small window log,                   advanced one pass small out,        7130394 +silesia.tar,                        level 3,                            advanced one pass small out,        4861374 +silesia.tar,                        level 4,                            advanced one pass small out,        4799583 +silesia.tar,                        level 5,                            advanced one pass small out,        4722271 +silesia.tar,                        level 6,                            advanced one pass small out,        4672231 +silesia.tar,                        level 7,                            advanced one pass small out,        4606657 +silesia.tar,                        level 9,                            advanced one pass small out,        4554099 +silesia.tar,                        level 13,                           advanced one pass small out,        4491706 +silesia.tar,                        level 16,                           advanced one pass small out,        4381265 +silesia.tar,                        level 19,                           advanced one pass small out,        4281551 +silesia.tar,                        no source size,                     advanced one pass small out,        4861374 +silesia.tar,                        long distance mode,                 advanced one pass small out,        4848046 +silesia.tar,                        multithreaded,                      advanced one pass small out,        4860726 +silesia.tar,                        multithreaded long distance mode,   advanced one pass small out,        4847343 +silesia.tar,                        small window log,                   advanced one pass small out,        7127924  silesia.tar,                        small hash log,                     advanced one pass small out,        6587833 -silesia.tar,                        small chain log,                    advanced one pass small out,        4943255 -silesia.tar,                        explicit params,                    advanced one pass small out,        4829974 -silesia.tar,                        uncompressed literals,              advanced one pass small out,        5157992 -silesia.tar,                        uncompressed literals optimal,      advanced one pass small out,        4321094 +silesia.tar,                        small chain log,                    advanced one pass small out,        4943266 +silesia.tar,                        explicit params,                    advanced one pass small out,        4808543 +silesia.tar,                        uncompressed literals,              advanced one pass small out,        5129447 +silesia.tar,                        uncompressed literals optimal,      advanced one pass small out,        4320910  silesia.tar,                        huffman literals,                   advanced one pass small out,        5347283 -silesia.tar,                        multithreaded with advanced params, advanced one pass small out,        5158545 +silesia.tar,                        multithreaded with advanced params, advanced one pass small out,        5129766  github,                             level -5,                           advanced one pass small out,        205285  github,                             level -5 with dict,                 advanced one pass small out,        46718  github,                             level -3,                           advanced one pass small out,        190643  github,                             level -3 with dict,                 advanced one pass small out,        45395  github,                             level -1,                           advanced one pass small out,        175568  github,                             level -1 with dict,                 advanced one pass small out,        43170 -github,                             level 0,                            advanced one pass small out,        136397 -github,                             level 0 with dict,                  advanced one pass small out,        41170 +github,                             level 0,                            advanced one pass small out,        136311 +github,                             level 0 with dict,                  advanced one pass small out,        41148  github,                             level 1,                            advanced one pass small out,        142450  github,                             level 1 with dict,                  advanced one pass small out,        41682 -github,                             level 3,                            advanced one pass small out,        136397 -github,                             level 3 with dict,                  advanced one pass small out,        41170 +github,                             level 3,                            advanced one pass small out,        136311 +github,                             level 3 with dict,                  advanced one pass small out,        41148  github,                             level 4,                            advanced one pass small out,        136144 -github,                             level 4 with dict,                  advanced one pass small out,        41306 +github,                             level 4 with dict,                  advanced one pass small out,        41251  github,                             level 5,                            advanced one pass small out,        135106  github,                             level 5 with dict,                  advanced one pass small out,        38938  github,                             level 6,                            advanced one pass small out,        135108 @@ -342,84 +342,84 @@ github,                             level 16,                           advanced  github,                             level 16 with dict,                 advanced one pass small out,        37577  github,                             level 19,                           advanced one pass small out,        133717  github,                             level 19 with dict,                 advanced one pass small out,        37576 -github,                             no source size,                     advanced one pass small out,        136397 -github,                             long distance mode,                 advanced one pass small out,        136397 -github,                             multithreaded,                      advanced one pass small out,        136397 -github,                             multithreaded long distance mode,   advanced one pass small out,        136397 -github,                             small window log,                   advanced one pass small out,        136397 +github,                             no source size,                     advanced one pass small out,        136311 +github,                             long distance mode,                 advanced one pass small out,        136311 +github,                             multithreaded,                      advanced one pass small out,        136311 +github,                             multithreaded long distance mode,   advanced one pass small out,        136311 +github,                             small window log,                   advanced one pass small out,        136311  github,                             small hash log,                     advanced one pass small out,        135467  github,                             small chain log,                    advanced one pass small out,        136314  github,                             explicit params,                    advanced one pass small out,        137670 -github,                             uncompressed literals,              advanced one pass small out,        167004 +github,                             uncompressed literals,              advanced one pass small out,        165915  github,                             uncompressed literals optimal,      advanced one pass small out,        156824  github,                             huffman literals,                   advanced one pass small out,        142450 -github,                             multithreaded with advanced params, advanced one pass small out,        167004 +github,                             multithreaded with advanced params, advanced one pass small out,        165915  silesia,                            level -5,                           advanced streaming,                 6882466  silesia,                            level -3,                           advanced streaming,                 6568358  silesia,                            level -1,                           advanced streaming,                 6183385 -silesia,                            level 0,                            advanced streaming,                 4862377 +silesia,                            level 0,                            advanced streaming,                 4849491  silesia,                            level 1,                            advanced streaming,                 5314109 -silesia,                            level 3,                            advanced streaming,                 4862377 -silesia,                            level 4,                            advanced streaming,                 4800629 +silesia,                            level 3,                            advanced streaming,                 4849491 +silesia,                            level 4,                            advanced streaming,                 4786913  silesia,                            level 5,                            advanced streaming,                 4710178  silesia,                            level 6,                            advanced streaming,                 4659996  silesia,                            level 7,                            advanced streaming,                 4596234  silesia,                            level 9,                            advanced streaming,                 4543862  silesia,                            level 13,                           advanced streaming,                 4482073 -silesia,                            level 16,                           advanced streaming,                 4377391 +silesia,                            level 16,                           advanced streaming,                 4377389  silesia,                            level 19,                           advanced streaming,                 4293262 -silesia,                            no source size,                     advanced streaming,                 4862341 -silesia,                            long distance mode,                 advanced streaming,                 4853389 -silesia,                            multithreaded,                      advanced streaming,                 4862377 -silesia,                            multithreaded long distance mode,   advanced streaming,                 4853389 -silesia,                            small window log,                   advanced streaming,                 7126389 +silesia,                            no source size,                     advanced streaming,                 4849455 +silesia,                            long distance mode,                 advanced streaming,                 4839650 +silesia,                            multithreaded,                      advanced streaming,                 4849491 +silesia,                            multithreaded long distance mode,   advanced streaming,                 4839650 +silesia,                            small window log,                   advanced streaming,                 7123846  silesia,                            small hash log,                     advanced streaming,                 6554898  silesia,                            small chain log,                    advanced streaming,                 4931093 -silesia,                            explicit params,                    advanced streaming,                 4815380 -silesia,                            uncompressed literals,              advanced streaming,                 5155424 -silesia,                            uncompressed literals optimal,      advanced streaming,                 4325427 +silesia,                            explicit params,                    advanced streaming,                 4797048 +silesia,                            uncompressed literals,              advanced streaming,                 5127960 +silesia,                            uncompressed literals optimal,      advanced streaming,                 4325434  silesia,                            huffman literals,                   advanced streaming,                 5331110 -silesia,                            multithreaded with advanced params, advanced streaming,                 5155424 +silesia,                            multithreaded with advanced params, advanced streaming,                 5127960  silesia.tar,                        level -5,                           advanced streaming,                 6982738  silesia.tar,                        level -3,                           advanced streaming,                 6641264  silesia.tar,                        level -1,                           advanced streaming,                 6190789 -silesia.tar,                        level 0,                            advanced streaming,                 4875010 +silesia.tar,                        level 0,                            advanced streaming,                 4861376  silesia.tar,                        level 1,                            advanced streaming,                 5336879 -silesia.tar,                        level 3,                            advanced streaming,                 4875010 -silesia.tar,                        level 4,                            advanced streaming,                 4813507 -silesia.tar,                        level 5,                            advanced streaming,                 4722240 -silesia.tar,                        level 6,                            advanced streaming,                 4672203 -silesia.tar,                        level 7,                            advanced streaming,                 4606658 -silesia.tar,                        level 9,                            advanced streaming,                 4554105 -silesia.tar,                        level 13,                           advanced streaming,                 4491703 -silesia.tar,                        level 16,                           advanced streaming,                 4381277 -silesia.tar,                        level 19,                           advanced streaming,                 4281514 -silesia.tar,                        no source size,                     advanced streaming,                 4875006 -silesia.tar,                        long distance mode,                 advanced streaming,                 4861218 -silesia.tar,                        multithreaded,                      advanced streaming,                 4875132 -silesia.tar,                        multithreaded long distance mode,   advanced streaming,                 4866971 -silesia.tar,                        small window log,                   advanced streaming,                 7130394 +silesia.tar,                        level 3,                            advanced streaming,                 4861376 +silesia.tar,                        level 4,                            advanced streaming,                 4799583 +silesia.tar,                        level 5,                            advanced streaming,                 4722276 +silesia.tar,                        level 6,                            advanced streaming,                 4672240 +silesia.tar,                        level 7,                            advanced streaming,                 4606657 +silesia.tar,                        level 9,                            advanced streaming,                 4554106 +silesia.tar,                        level 13,                           advanced streaming,                 4491707 +silesia.tar,                        level 16,                           advanced streaming,                 4381284 +silesia.tar,                        level 19,                           advanced streaming,                 4281511 +silesia.tar,                        no source size,                     advanced streaming,                 4861372 +silesia.tar,                        long distance mode,                 advanced streaming,                 4848046 +silesia.tar,                        multithreaded,                      advanced streaming,                 4861458 +silesia.tar,                        multithreaded long distance mode,   advanced streaming,                 4853136 +silesia.tar,                        small window log,                   advanced streaming,                 7127924  silesia.tar,                        small hash log,                     advanced streaming,                 6587834 -silesia.tar,                        small chain log,                    advanced streaming,                 4943260 -silesia.tar,                        explicit params,                    advanced streaming,                 4830002 -silesia.tar,                        uncompressed literals,              advanced streaming,                 5157995 -silesia.tar,                        uncompressed literals optimal,      advanced streaming,                 4321094 +silesia.tar,                        small chain log,                    advanced streaming,                 4943271 +silesia.tar,                        explicit params,                    advanced streaming,                 4808570 +silesia.tar,                        uncompressed literals,              advanced streaming,                 5129450 +silesia.tar,                        uncompressed literals optimal,      advanced streaming,                 4320841  silesia.tar,                        huffman literals,                   advanced streaming,                 5352306 -silesia.tar,                        multithreaded with advanced params, advanced streaming,                 5158130 +silesia.tar,                        multithreaded with advanced params, advanced streaming,                 5129544  github,                             level -5,                           advanced streaming,                 205285  github,                             level -5 with dict,                 advanced streaming,                 46718  github,                             level -3,                           advanced streaming,                 190643  github,                             level -3 with dict,                 advanced streaming,                 45395  github,                             level -1,                           advanced streaming,                 175568  github,                             level -1 with dict,                 advanced streaming,                 43170 -github,                             level 0,                            advanced streaming,                 136397 -github,                             level 0 with dict,                  advanced streaming,                 41170 +github,                             level 0,                            advanced streaming,                 136311 +github,                             level 0 with dict,                  advanced streaming,                 41148  github,                             level 1,                            advanced streaming,                 142450  github,                             level 1 with dict,                  advanced streaming,                 41682 -github,                             level 3,                            advanced streaming,                 136397 -github,                             level 3 with dict,                  advanced streaming,                 41170 +github,                             level 3,                            advanced streaming,                 136311 +github,                             level 3 with dict,                  advanced streaming,                 41148  github,                             level 4,                            advanced streaming,                 136144 -github,                             level 4 with dict,                  advanced streaming,                 41306 +github,                             level 4 with dict,                  advanced streaming,                 41251  github,                             level 5,                            advanced streaming,                 135106  github,                             level 5 with dict,                  advanced streaming,                 38938  github,                             level 6,                            advanced streaming,                 135108 @@ -434,33 +434,33 @@ github,                             level 16,                           advanced  github,                             level 16 with dict,                 advanced streaming,                 37577  github,                             level 19,                           advanced streaming,                 133717  github,                             level 19 with dict,                 advanced streaming,                 37576 -github,                             no source size,                     advanced streaming,                 136397 -github,                             long distance mode,                 advanced streaming,                 136397 -github,                             multithreaded,                      advanced streaming,                 136397 -github,                             multithreaded long distance mode,   advanced streaming,                 136397 -github,                             small window log,                   advanced streaming,                 136397 +github,                             no source size,                     advanced streaming,                 136311 +github,                             long distance mode,                 advanced streaming,                 136311 +github,                             multithreaded,                      advanced streaming,                 136311 +github,                             multithreaded long distance mode,   advanced streaming,                 136311 +github,                             small window log,                   advanced streaming,                 136311  github,                             small hash log,                     advanced streaming,                 135467  github,                             small chain log,                    advanced streaming,                 136314  github,                             explicit params,                    advanced streaming,                 137670 -github,                             uncompressed literals,              advanced streaming,                 167004 +github,                             uncompressed literals,              advanced streaming,                 165915  github,                             uncompressed literals optimal,      advanced streaming,                 156824  github,                             huffman literals,                   advanced streaming,                 142450 -github,                             multithreaded with advanced params, advanced streaming,                 167004 +github,                             multithreaded with advanced params, advanced streaming,                 165915  silesia,                            level -5,                           old streaming,                      6882466  silesia,                            level -3,                           old streaming,                      6568358  silesia,                            level -1,                           old streaming,                      6183385 -silesia,                            level 0,                            old streaming,                      4862377 +silesia,                            level 0,                            old streaming,                      4849491  silesia,                            level 1,                            old streaming,                      5314109 -silesia,                            level 3,                            old streaming,                      4862377 -silesia,                            level 4,                            old streaming,                      4800629 +silesia,                            level 3,                            old streaming,                      4849491 +silesia,                            level 4,                            old streaming,                      4786913  silesia,                            level 5,                            old streaming,                      4710178  silesia,                            level 6,                            old streaming,                      4659996  silesia,                            level 7,                            old streaming,                      4596234  silesia,                            level 9,                            old streaming,                      4543862  silesia,                            level 13,                           old streaming,                      4482073 -silesia,                            level 16,                           old streaming,                      4377391 +silesia,                            level 16,                           old streaming,                      4377389  silesia,                            level 19,                           old streaming,                      4293262 -silesia,                            no source size,                     old streaming,                      4862341 +silesia,                            no source size,                     old streaming,                      4849455  silesia,                            long distance mode,                 old streaming,                      12000408  silesia,                            multithreaded,                      old streaming,                      12000408  silesia,                            multithreaded long distance mode,   old streaming,                      12000408 @@ -468,25 +468,25 @@ silesia,                            small window log,                   old stre  silesia,                            small hash log,                     old streaming,                      12000408  silesia,                            small chain log,                    old streaming,                      12000408  silesia,                            explicit params,                    old streaming,                      12000408 -silesia,                            uncompressed literals,              old streaming,                      4862377 +silesia,                            uncompressed literals,              old streaming,                      4849491  silesia,                            uncompressed literals optimal,      old streaming,                      4293262  silesia,                            huffman literals,                   old streaming,                      6183385  silesia,                            multithreaded with advanced params, old streaming,                      12000408  silesia.tar,                        level -5,                           old streaming,                      6982738  silesia.tar,                        level -3,                           old streaming,                      6641264  silesia.tar,                        level -1,                           old streaming,                      6190789 -silesia.tar,                        level 0,                            old streaming,                      4875010 +silesia.tar,                        level 0,                            old streaming,                      4861376  silesia.tar,                        level 1,                            old streaming,                      5336879 -silesia.tar,                        level 3,                            old streaming,                      4875010 -silesia.tar,                        level 4,                            old streaming,                      4813507 -silesia.tar,                        level 5,                            old streaming,                      4722240 -silesia.tar,                        level 6,                            old streaming,                      4672203 -silesia.tar,                        level 7,                            old streaming,                      4606658 -silesia.tar,                        level 9,                            old streaming,                      4554105 -silesia.tar,                        level 13,                           old streaming,                      4491703 -silesia.tar,                        level 16,                           old streaming,                      4381277 -silesia.tar,                        level 19,                           old streaming,                      4281514 -silesia.tar,                        no source size,                     old streaming,                      4875006 +silesia.tar,                        level 3,                            old streaming,                      4861376 +silesia.tar,                        level 4,                            old streaming,                      4799583 +silesia.tar,                        level 5,                            old streaming,                      4722276 +silesia.tar,                        level 6,                            old streaming,                      4672240 +silesia.tar,                        level 7,                            old streaming,                      4606657 +silesia.tar,                        level 9,                            old streaming,                      4554106 +silesia.tar,                        level 13,                           old streaming,                      4491707 +silesia.tar,                        level 16,                           old streaming,                      4381284 +silesia.tar,                        level 19,                           old streaming,                      4281511 +silesia.tar,                        no source size,                     old streaming,                      4861372  silesia.tar,                        long distance mode,                 old streaming,                      12022046  silesia.tar,                        multithreaded,                      old streaming,                      12022046  silesia.tar,                        multithreaded long distance mode,   old streaming,                      12022046 @@ -494,8 +494,8 @@ silesia.tar,                        small window log,                   old stre  silesia.tar,                        small hash log,                     old streaming,                      12022046  silesia.tar,                        small chain log,                    old streaming,                      12022046  silesia.tar,                        explicit params,                    old streaming,                      12022046 -silesia.tar,                        uncompressed literals,              old streaming,                      4875010 -silesia.tar,                        uncompressed literals optimal,      old streaming,                      4281514 +silesia.tar,                        uncompressed literals,              old streaming,                      4861376 +silesia.tar,                        uncompressed literals optimal,      old streaming,                      4281511  silesia.tar,                        huffman literals,                   old streaming,                      6190789  silesia.tar,                        multithreaded with advanced params, old streaming,                      12022046  github,                             level -5,                           old streaming,                      205285 @@ -504,14 +504,14 @@ github,                             level -3,                           old stre  github,                             level -3 with dict,                 old streaming,                      45395  github,                             level -1,                           old streaming,                      175568  github,                             level -1 with dict,                 old streaming,                      43170 -github,                             level 0,                            old streaming,                      136397 -github,                             level 0 with dict,                  old streaming,                      41170 +github,                             level 0,                            old streaming,                      136311 +github,                             level 0 with dict,                  old streaming,                      41148  github,                             level 1,                            old streaming,                      142450  github,                             level 1 with dict,                  old streaming,                      41682 -github,                             level 3,                            old streaming,                      136397 -github,                             level 3 with dict,                  old streaming,                      41170 +github,                             level 3,                            old streaming,                      136311 +github,                             level 3 with dict,                  old streaming,                      41148  github,                             level 4,                            old streaming,                      136144 -github,                             level 4 with dict,                  old streaming,                      41306 +github,                             level 4 with dict,                  old streaming,                      41251  github,                             level 5,                            old streaming,                      135106  github,                             level 5 with dict,                  old streaming,                      38938  github,                             level 6,                            old streaming,                      135108 @@ -526,7 +526,7 @@ github,                             level 16,                           old stre  github,                             level 16 with dict,                 old streaming,                      37577  github,                             level 19,                           old streaming,                      133717  github,                             level 19 with dict,                 old streaming,                      37576 -github,                             no source size,                     old streaming,                      141003 +github,                             no source size,                     old streaming,                      140631  github,                             long distance mode,                 old streaming,                      412933  github,                             multithreaded,                      old streaming,                      412933  github,                             multithreaded long distance mode,   old streaming,                      412933 @@ -534,25 +534,25 @@ github,                             small window log,                   old stre  github,                             small hash log,                     old streaming,                      412933  github,                             small chain log,                    old streaming,                      412933  github,                             explicit params,                    old streaming,                      412933 -github,                             uncompressed literals,              old streaming,                      136397 +github,                             uncompressed literals,              old streaming,                      136311  github,                             uncompressed literals optimal,      old streaming,                      133717  github,                             huffman literals,                   old streaming,                      175568  github,                             multithreaded with advanced params, old streaming,                      412933  silesia,                            level -5,                           old streaming advanced,             6882466  silesia,                            level -3,                           old streaming advanced,             6568358  silesia,                            level -1,                           old streaming advanced,             6183385 -silesia,                            level 0,                            old streaming advanced,             4862377 +silesia,                            level 0,                            old streaming advanced,             4849491  silesia,                            level 1,                            old streaming advanced,             5314109 -silesia,                            level 3,                            old streaming advanced,             4862377 -silesia,                            level 4,                            old streaming advanced,             4800629 +silesia,                            level 3,                            old streaming advanced,             4849491 +silesia,                            level 4,                            old streaming advanced,             4786913  silesia,                            level 5,                            old streaming advanced,             4710178  silesia,                            level 6,                            old streaming advanced,             4659996  silesia,                            level 7,                            old streaming advanced,             4596234  silesia,                            level 9,                            old streaming advanced,             4543862  silesia,                            level 13,                           old streaming advanced,             4482073 -silesia,                            level 16,                           old streaming advanced,             4377391 +silesia,                            level 16,                           old streaming advanced,             4377389  silesia,                            level 19,                           old streaming advanced,             4293262 -silesia,                            no source size,                     old streaming advanced,             4862341 +silesia,                            no source size,                     old streaming advanced,             4849455  silesia,                            long distance mode,                 old streaming advanced,             12000408  silesia,                            multithreaded,                      old streaming advanced,             12000408  silesia,                            multithreaded long distance mode,   old streaming advanced,             12000408 @@ -560,25 +560,25 @@ silesia,                            small window log,                   old stre  silesia,                            small hash log,                     old streaming advanced,             12000408  silesia,                            small chain log,                    old streaming advanced,             12000408  silesia,                            explicit params,                    old streaming advanced,             12000408 -silesia,                            uncompressed literals,              old streaming advanced,             4862377 +silesia,                            uncompressed literals,              old streaming advanced,             4849491  silesia,                            uncompressed literals optimal,      old streaming advanced,             4293262  silesia,                            huffman literals,                   old streaming advanced,             6183385  silesia,                            multithreaded with advanced params, old streaming advanced,             12000408  silesia.tar,                        level -5,                           old streaming advanced,             6982738  silesia.tar,                        level -3,                           old streaming advanced,             6641264  silesia.tar,                        level -1,                           old streaming advanced,             6190789 -silesia.tar,                        level 0,                            old streaming advanced,             4875010 +silesia.tar,                        level 0,                            old streaming advanced,             4861376  silesia.tar,                        level 1,                            old streaming advanced,             5336879 -silesia.tar,                        level 3,                            old streaming advanced,             4875010 -silesia.tar,                        level 4,                            old streaming advanced,             4813507 -silesia.tar,                        level 5,                            old streaming advanced,             4722240 -silesia.tar,                        level 6,                            old streaming advanced,             4672203 -silesia.tar,                        level 7,                            old streaming advanced,             4606658 -silesia.tar,                        level 9,                            old streaming advanced,             4554105 -silesia.tar,                        level 13,                           old streaming advanced,             4491703 -silesia.tar,                        level 16,                           old streaming advanced,             4381277 -silesia.tar,                        level 19,                           old streaming advanced,             4281514 -silesia.tar,                        no source size,                     old streaming advanced,             4875006 +silesia.tar,                        level 3,                            old streaming advanced,             4861376 +silesia.tar,                        level 4,                            old streaming advanced,             4799583 +silesia.tar,                        level 5,                            old streaming advanced,             4722276 +silesia.tar,                        level 6,                            old streaming advanced,             4672240 +silesia.tar,                        level 7,                            old streaming advanced,             4606657 +silesia.tar,                        level 9,                            old streaming advanced,             4554106 +silesia.tar,                        level 13,                           old streaming advanced,             4491707 +silesia.tar,                        level 16,                           old streaming advanced,             4381284 +silesia.tar,                        level 19,                           old streaming advanced,             4281511 +silesia.tar,                        no source size,                     old streaming advanced,             4861372  silesia.tar,                        long distance mode,                 old streaming advanced,             12022046  silesia.tar,                        multithreaded,                      old streaming advanced,             12022046  silesia.tar,                        multithreaded long distance mode,   old streaming advanced,             12022046 @@ -586,8 +586,8 @@ silesia.tar,                        small window log,                   old stre  silesia.tar,                        small hash log,                     old streaming advanced,             12022046  silesia.tar,                        small chain log,                    old streaming advanced,             12022046  silesia.tar,                        explicit params,                    old streaming advanced,             12022046 -silesia.tar,                        uncompressed literals,              old streaming advanced,             4875010 -silesia.tar,                        uncompressed literals optimal,      old streaming advanced,             4281514 +silesia.tar,                        uncompressed literals,              old streaming advanced,             4861376 +silesia.tar,                        uncompressed literals optimal,      old streaming advanced,             4281511  silesia.tar,                        huffman literals,                   old streaming advanced,             6190789  silesia.tar,                        multithreaded with advanced params, old streaming advanced,             12022046  github,                             level -5,                           old streaming advanced,             205285 @@ -596,14 +596,14 @@ github,                             level -3,                           old stre  github,                             level -3 with dict,                 old streaming advanced,             45395  github,                             level -1,                           old streaming advanced,             175568  github,                             level -1 with dict,                 old streaming advanced,             43170 -github,                             level 0,                            old streaming advanced,             136397 -github,                             level 0 with dict,                  old streaming advanced,             41170 +github,                             level 0,                            old streaming advanced,             136311 +github,                             level 0 with dict,                  old streaming advanced,             41148  github,                             level 1,                            old streaming advanced,             142450  github,                             level 1 with dict,                  old streaming advanced,             41682 -github,                             level 3,                            old streaming advanced,             136397 -github,                             level 3 with dict,                  old streaming advanced,             41170 +github,                             level 3,                            old streaming advanced,             136311 +github,                             level 3 with dict,                  old streaming advanced,             41148  github,                             level 4,                            old streaming advanced,             136144 -github,                             level 4 with dict,                  old streaming advanced,             41306 +github,                             level 4 with dict,                  old streaming advanced,             41251  github,                             level 5,                            old streaming advanced,             135106  github,                             level 5 with dict,                  old streaming advanced,             38938  github,                             level 6,                            old streaming advanced,             135108 @@ -618,7 +618,7 @@ github,                             level 16,                           old stre  github,                             level 16 with dict,                 old streaming advanced,             37577  github,                             level 19,                           old streaming advanced,             133717  github,                             level 19 with dict,                 old streaming advanced,             37576 -github,                             no source size,                     old streaming advanced,             141003 +github,                             no source size,                     old streaming advanced,             140631  github,                             long distance mode,                 old streaming advanced,             412933  github,                             multithreaded,                      old streaming advanced,             412933  github,                             multithreaded long distance mode,   old streaming advanced,             412933 @@ -626,25 +626,25 @@ github,                             small window log,                   old stre  github,                             small hash log,                     old streaming advanced,             412933  github,                             small chain log,                    old streaming advanced,             412933  github,                             explicit params,                    old streaming advanced,             412933 -github,                             uncompressed literals,              old streaming advanced,             136397 +github,                             uncompressed literals,              old streaming advanced,             136311  github,                             uncompressed literals optimal,      old streaming advanced,             133717  github,                             huffman literals,                   old streaming advanced,             175568  github,                             multithreaded with advanced params, old streaming advanced,             412933  silesia,                            level -5,                           old streaming cdcit,                6882466  silesia,                            level -3,                           old streaming cdcit,                6568358  silesia,                            level -1,                           old streaming cdcit,                6183385 -silesia,                            level 0,                            old streaming cdcit,                4862377 +silesia,                            level 0,                            old streaming cdcit,                4849491  silesia,                            level 1,                            old streaming cdcit,                5314109 -silesia,                            level 3,                            old streaming cdcit,                4862377 -silesia,                            level 4,                            old streaming cdcit,                4800629 +silesia,                            level 3,                            old streaming cdcit,                4849491 +silesia,                            level 4,                            old streaming cdcit,                4786913  silesia,                            level 5,                            old streaming cdcit,                4710178  silesia,                            level 6,                            old streaming cdcit,                4659996  silesia,                            level 7,                            old streaming cdcit,                4596234  silesia,                            level 9,                            old streaming cdcit,                4543862  silesia,                            level 13,                           old streaming cdcit,                4482073 -silesia,                            level 16,                           old streaming cdcit,                4377391 +silesia,                            level 16,                           old streaming cdcit,                4377389  silesia,                            level 19,                           old streaming cdcit,                4293262 -silesia,                            no source size,                     old streaming cdcit,                4862341 +silesia,                            no source size,                     old streaming cdcit,                4849455  silesia,                            long distance mode,                 old streaming cdcit,                12000408  silesia,                            multithreaded,                      old streaming cdcit,                12000408  silesia,                            multithreaded long distance mode,   old streaming cdcit,                12000408 @@ -652,25 +652,25 @@ silesia,                            small window log,                   old stre  silesia,                            small hash log,                     old streaming cdcit,                12000408  silesia,                            small chain log,                    old streaming cdcit,                12000408  silesia,                            explicit params,                    old streaming cdcit,                12000408 -silesia,                            uncompressed literals,              old streaming cdcit,                4862377 +silesia,                            uncompressed literals,              old streaming cdcit,                4849491  silesia,                            uncompressed literals optimal,      old streaming cdcit,                4293262  silesia,                            huffman literals,                   old streaming cdcit,                6183385  silesia,                            multithreaded with advanced params, old streaming cdcit,                12000408  silesia.tar,                        level -5,                           old streaming cdcit,                6982738  silesia.tar,                        level -3,                           old streaming cdcit,                6641264  silesia.tar,                        level -1,                           old streaming cdcit,                6190789 -silesia.tar,                        level 0,                            old streaming cdcit,                4875010 +silesia.tar,                        level 0,                            old streaming cdcit,                4861376  silesia.tar,                        level 1,                            old streaming cdcit,                5336879 -silesia.tar,                        level 3,                            old streaming cdcit,                4875010 -silesia.tar,                        level 4,                            old streaming cdcit,                4813507 -silesia.tar,                        level 5,                            old streaming cdcit,                4722240 -silesia.tar,                        level 6,                            old streaming cdcit,                4672203 -silesia.tar,                        level 7,                            old streaming cdcit,                4606658 -silesia.tar,                        level 9,                            old streaming cdcit,                4554105 -silesia.tar,                        level 13,                           old streaming cdcit,                4491703 -silesia.tar,                        level 16,                           old streaming cdcit,                4381277 -silesia.tar,                        level 19,                           old streaming cdcit,                4281514 -silesia.tar,                        no source size,                     old streaming cdcit,                4875006 +silesia.tar,                        level 3,                            old streaming cdcit,                4861376 +silesia.tar,                        level 4,                            old streaming cdcit,                4799583 +silesia.tar,                        level 5,                            old streaming cdcit,                4722276 +silesia.tar,                        level 6,                            old streaming cdcit,                4672240 +silesia.tar,                        level 7,                            old streaming cdcit,                4606657 +silesia.tar,                        level 9,                            old streaming cdcit,                4554106 +silesia.tar,                        level 13,                           old streaming cdcit,                4491707 +silesia.tar,                        level 16,                           old streaming cdcit,                4381284 +silesia.tar,                        level 19,                           old streaming cdcit,                4281511 +silesia.tar,                        no source size,                     old streaming cdcit,                4861372  silesia.tar,                        long distance mode,                 old streaming cdcit,                12022046  silesia.tar,                        multithreaded,                      old streaming cdcit,                12022046  silesia.tar,                        multithreaded long distance mode,   old streaming cdcit,                12022046 @@ -678,8 +678,8 @@ silesia.tar,                        small window log,                   old stre  silesia.tar,                        small hash log,                     old streaming cdcit,                12022046  silesia.tar,                        small chain log,                    old streaming cdcit,                12022046  silesia.tar,                        explicit params,                    old streaming cdcit,                12022046 -silesia.tar,                        uncompressed literals,              old streaming cdcit,                4875010 -silesia.tar,                        uncompressed literals optimal,      old streaming cdcit,                4281514 +silesia.tar,                        uncompressed literals,              old streaming cdcit,                4861376 +silesia.tar,                        uncompressed literals optimal,      old streaming cdcit,                4281511  silesia.tar,                        huffman literals,                   old streaming cdcit,                6190789  silesia.tar,                        multithreaded with advanced params, old streaming cdcit,                12022046  github,                             level -5,                           old streaming cdcit,                205285 @@ -688,14 +688,14 @@ github,                             level -3,                           old stre  github,                             level -3 with dict,                 old streaming cdcit,                45395  github,                             level -1,                           old streaming cdcit,                175568  github,                             level -1 with dict,                 old streaming cdcit,                43170 -github,                             level 0,                            old streaming cdcit,                136397 -github,                             level 0 with dict,                  old streaming cdcit,                41170 +github,                             level 0,                            old streaming cdcit,                136311 +github,                             level 0 with dict,                  old streaming cdcit,                41148  github,                             level 1,                            old streaming cdcit,                142450  github,                             level 1 with dict,                  old streaming cdcit,                41682 -github,                             level 3,                            old streaming cdcit,                136397 -github,                             level 3 with dict,                  old streaming cdcit,                41170 +github,                             level 3,                            old streaming cdcit,                136311 +github,                             level 3 with dict,                  old streaming cdcit,                41148  github,                             level 4,                            old streaming cdcit,                136144 -github,                             level 4 with dict,                  old streaming cdcit,                41306 +github,                             level 4 with dict,                  old streaming cdcit,                41251  github,                             level 5,                            old streaming cdcit,                135106  github,                             level 5 with dict,                  old streaming cdcit,                38938  github,                             level 6,                            old streaming cdcit,                135108 @@ -710,7 +710,7 @@ github,                             level 16,                           old stre  github,                             level 16 with dict,                 old streaming cdcit,                37577  github,                             level 19,                           old streaming cdcit,                133717  github,                             level 19 with dict,                 old streaming cdcit,                37576 -github,                             no source size,                     old streaming cdcit,                141003 +github,                             no source size,                     old streaming cdcit,                140631  github,                             long distance mode,                 old streaming cdcit,                412933  github,                             multithreaded,                      old streaming cdcit,                412933  github,                             multithreaded long distance mode,   old streaming cdcit,                412933 @@ -718,25 +718,25 @@ github,                             small window log,                   old stre  github,                             small hash log,                     old streaming cdcit,                412933  github,                             small chain log,                    old streaming cdcit,                412933  github,                             explicit params,                    old streaming cdcit,                412933 -github,                             uncompressed literals,              old streaming cdcit,                136397 +github,                             uncompressed literals,              old streaming cdcit,                136311  github,                             uncompressed literals optimal,      old streaming cdcit,                133717  github,                             huffman literals,                   old streaming cdcit,                175568  github,                             multithreaded with advanced params, old streaming cdcit,                412933  silesia,                            level -5,                           old streaming advanced cdict,       6882466  silesia,                            level -3,                           old streaming advanced cdict,       6568358  silesia,                            level -1,                           old streaming advanced cdict,       6183385 -silesia,                            level 0,                            old streaming advanced cdict,       4862377 +silesia,                            level 0,                            old streaming advanced cdict,       4849491  silesia,                            level 1,                            old streaming advanced cdict,       5314109 -silesia,                            level 3,                            old streaming advanced cdict,       4862377 -silesia,                            level 4,                            old streaming advanced cdict,       4800629 +silesia,                            level 3,                            old streaming advanced cdict,       4849491 +silesia,                            level 4,                            old streaming advanced cdict,       4786913  silesia,                            level 5,                            old streaming advanced cdict,       4710178  silesia,                            level 6,                            old streaming advanced cdict,       4659996  silesia,                            level 7,                            old streaming advanced cdict,       4596234  silesia,                            level 9,                            old streaming advanced cdict,       4543862  silesia,                            level 13,                           old streaming advanced cdict,       4482073 -silesia,                            level 16,                           old streaming advanced cdict,       4377391 +silesia,                            level 16,                           old streaming advanced cdict,       4377389  silesia,                            level 19,                           old streaming advanced cdict,       4293262 -silesia,                            no source size,                     old streaming advanced cdict,       4862341 +silesia,                            no source size,                     old streaming advanced cdict,       4849455  silesia,                            long distance mode,                 old streaming advanced cdict,       12000408  silesia,                            multithreaded,                      old streaming advanced cdict,       12000408  silesia,                            multithreaded long distance mode,   old streaming advanced cdict,       12000408 @@ -744,25 +744,25 @@ silesia,                            small window log,                   old stre  silesia,                            small hash log,                     old streaming advanced cdict,       12000408  silesia,                            small chain log,                    old streaming advanced cdict,       12000408  silesia,                            explicit params,                    old streaming advanced cdict,       12000408 -silesia,                            uncompressed literals,              old streaming advanced cdict,       4862377 +silesia,                            uncompressed literals,              old streaming advanced cdict,       4849491  silesia,                            uncompressed literals optimal,      old streaming advanced cdict,       4293262  silesia,                            huffman literals,                   old streaming advanced cdict,       6183385  silesia,                            multithreaded with advanced params, old streaming advanced cdict,       12000408  silesia.tar,                        level -5,                           old streaming advanced cdict,       6982738  silesia.tar,                        level -3,                           old streaming advanced cdict,       6641264  silesia.tar,                        level -1,                           old streaming advanced cdict,       6190789 -silesia.tar,                        level 0,                            old streaming advanced cdict,       4875010 +silesia.tar,                        level 0,                            old streaming advanced cdict,       4861376  silesia.tar,                        level 1,                            old streaming advanced cdict,       5336879 -silesia.tar,                        level 3,                            old streaming advanced cdict,       4875010 -silesia.tar,                        level 4,                            old streaming advanced cdict,       4813507 -silesia.tar,                        level 5,                            old streaming advanced cdict,       4722240 -silesia.tar,                        level 6,                            old streaming advanced cdict,       4672203 -silesia.tar,                        level 7,                            old streaming advanced cdict,       4606658 -silesia.tar,                        level 9,                            old streaming advanced cdict,       4554105 -silesia.tar,                        level 13,                           old streaming advanced cdict,       4491703 -silesia.tar,                        level 16,                           old streaming advanced cdict,       4381277 -silesia.tar,                        level 19,                           old streaming advanced cdict,       4281514 -silesia.tar,                        no source size,                     old streaming advanced cdict,       4875006 +silesia.tar,                        level 3,                            old streaming advanced cdict,       4861376 +silesia.tar,                        level 4,                            old streaming advanced cdict,       4799583 +silesia.tar,                        level 5,                            old streaming advanced cdict,       4722276 +silesia.tar,                        level 6,                            old streaming advanced cdict,       4672240 +silesia.tar,                        level 7,                            old streaming advanced cdict,       4606657 +silesia.tar,                        level 9,                            old streaming advanced cdict,       4554106 +silesia.tar,                        level 13,                           old streaming advanced cdict,       4491707 +silesia.tar,                        level 16,                           old streaming advanced cdict,       4381284 +silesia.tar,                        level 19,                           old streaming advanced cdict,       4281511 +silesia.tar,                        no source size,                     old streaming advanced cdict,       4861372  silesia.tar,                        long distance mode,                 old streaming advanced cdict,       12022046  silesia.tar,                        multithreaded,                      old streaming advanced cdict,       12022046  silesia.tar,                        multithreaded long distance mode,   old streaming advanced cdict,       12022046 @@ -770,8 +770,8 @@ silesia.tar,                        small window log,                   old stre  silesia.tar,                        small hash log,                     old streaming advanced cdict,       12022046  silesia.tar,                        small chain log,                    old streaming advanced cdict,       12022046  silesia.tar,                        explicit params,                    old streaming advanced cdict,       12022046 -silesia.tar,                        uncompressed literals,              old streaming advanced cdict,       4875010 -silesia.tar,                        uncompressed literals optimal,      old streaming advanced cdict,       4281514 +silesia.tar,                        uncompressed literals,              old streaming advanced cdict,       4861376 +silesia.tar,                        uncompressed literals optimal,      old streaming advanced cdict,       4281511  silesia.tar,                        huffman literals,                   old streaming advanced cdict,       6190789  silesia.tar,                        multithreaded with advanced params, old streaming advanced cdict,       12022046  github,                             level -5,                           old streaming advanced cdict,       205285 @@ -780,14 +780,14 @@ github,                             level -3,                           old stre  github,                             level -3 with dict,                 old streaming advanced cdict,       45395  github,                             level -1,                           old streaming advanced cdict,       175568  github,                             level -1 with dict,                 old streaming advanced cdict,       43170 -github,                             level 0,                            old streaming advanced cdict,       136397 -github,                             level 0 with dict,                  old streaming advanced cdict,       41170 +github,                             level 0,                            old streaming advanced cdict,       136311 +github,                             level 0 with dict,                  old streaming advanced cdict,       41148  github,                             level 1,                            old streaming advanced cdict,       142450  github,                             level 1 with dict,                  old streaming advanced cdict,       41682 -github,                             level 3,                            old streaming advanced cdict,       136397 -github,                             level 3 with dict,                  old streaming advanced cdict,       41170 +github,                             level 3,                            old streaming advanced cdict,       136311 +github,                             level 3 with dict,                  old streaming advanced cdict,       41148  github,                             level 4,                            old streaming advanced cdict,       136144 -github,                             level 4 with dict,                  old streaming advanced cdict,       41306 +github,                             level 4 with dict,                  old streaming advanced cdict,       41251  github,                             level 5,                            old streaming advanced cdict,       135106  github,                             level 5 with dict,                  old streaming advanced cdict,       38938  github,                             level 6,                            old streaming advanced cdict,       135108 @@ -802,7 +802,7 @@ github,                             level 16,                           old stre  github,                             level 16 with dict,                 old streaming advanced cdict,       37577  github,                             level 19,                           old streaming advanced cdict,       133717  github,                             level 19 with dict,                 old streaming advanced cdict,       37576 -github,                             no source size,                     old streaming advanced cdict,       141003 +github,                             no source size,                     old streaming advanced cdict,       140631  github,                             long distance mode,                 old streaming advanced cdict,       412933  github,                             multithreaded,                      old streaming advanced cdict,       412933  github,                             multithreaded long distance mode,   old streaming advanced cdict,       412933 @@ -810,7 +810,7 @@ github,                             small window log,                   old stre  github,                             small hash log,                     old streaming advanced cdict,       412933  github,                             small chain log,                    old streaming advanced cdict,       412933  github,                             explicit params,                    old streaming advanced cdict,       412933 -github,                             uncompressed literals,              old streaming advanced cdict,       136397 +github,                             uncompressed literals,              old streaming advanced cdict,       136311  github,                             uncompressed literals optimal,      old streaming advanced cdict,       133717  github,                             huffman literals,                   old streaming advanced cdict,       175568  github,                             multithreaded with advanced params, old streaming advanced cdict,       412933 diff --git a/tests/zstreamtest.c b/tests/zstreamtest.c index 55c14ad5995f4..97d4e33e150ca 100644 --- a/tests/zstreamtest.c +++ b/tests/zstreamtest.c @@ -1184,6 +1184,58 @@ static int basicUnitTests(U32 seed, double compressibility)      }      DISPLAYLEVEL(3, "OK \n"); +    /* Small Sequence Section bug */ +    DISPLAYLEVEL(3, "test%3i : decompress blocks with small sequences section : ", testNb++); +    {   /* This test consists of 3 blocks. Each block has one sequence. +            The sequence has literal length of 10, match length of 10 and offset of 10. +            The sequence value and compression mode for the blocks are following: +            The order of values are ll, ml, of. +              - First block  : (10, 7, 13) (rle, rle, rle) +                 - size of sequences section: 6 bytes (1 byte for nbSeq, 1 byte for encoding mode, 3 bytes for rle, 1 byte bitstream) +              - Second block : (10, 7, 1) (repeat, repeat, rle) +                 - size of sequences section: 4 bytes (1 byte for nbSeq, 1 byte for encoding mode, 1 bytes for rle, 1 byte bitstream) +              - Third block  : (10, 7, 1) (repeat, repeat, repeat) +                 - size of sequences section: 3 bytes (1 byte for nbSeq, 1 byte for encoding mode, 1 byte bitstream) */ + +        unsigned char compressed[] = { +            0x28, 0xb5, 0x2f, 0xfd, 0x24, 0x3c, 0x35, 0x01, 0x00, 0xf0, 0x85, 0x08, +            0xc2, 0xc4, 0x70, 0xcf, 0xd7, 0xc0, 0x96, 0x7e, 0x4c, 0x6b, 0xa9, 0x8b, +            0xbc, 0xc5, 0xb6, 0xd9, 0x7f, 0x4c, 0xf1, 0x05, 0xa6, 0x54, 0xef, 0xac, +            0x69, 0x94, 0x89, 0x1c, 0x03, 0x44, 0x0a, 0x07, 0x00, 0xb4, 0x04, 0x80, +            0x40, 0x0a, 0xa4 +        }; +        unsigned int compressedSize = 51; +        unsigned char decompressed[] = { +            0x85, 0x08, 0xc2, 0xc4, 0x70, 0xcf, 0xd7, 0xc0, 0x96, 0x7e, 0x85, 0x08, +            0xc2, 0xc4, 0x70, 0xcf, 0xd7, 0xc0, 0x96, 0x7e, 0x4c, 0x6b, 0xa9, 0x8b, +            0xbc, 0xc5, 0xb6, 0xd9, 0x7f, 0x4c, 0x4c, 0x6b, 0xa9, 0x8b, 0xbc, 0xc5, +            0xb6, 0xd9, 0x7f, 0x4c, 0xf1, 0x05, 0xa6, 0x54, 0xef, 0xac, 0x69, 0x94, +            0x89, 0x1c, 0xf1, 0x05, 0xa6, 0x54, 0xef, 0xac, 0x69, 0x94, 0x89, 0x1c +        }; +        unsigned int decompressedSize = 60; + +        ZSTD_DStream* const zds = ZSTD_createDStream(); +        if (zds==NULL) goto _output_error; + +        CHECK_Z( ZSTD_initDStream(zds) ); +        inBuff.src = compressed; +        inBuff.size = compressedSize; +        inBuff.pos = 0; +        outBuff.dst = decodedBuffer; +        outBuff.size = CNBufferSize; +        outBuff.pos = 0; + +        CHECK(ZSTD_decompressStream(zds, &outBuff, &inBuff) != 0, +              "Decompress did not reach the end of frame"); +        CHECK(inBuff.pos != inBuff.size, "Decompress did not fully consume input"); +        CHECK(outBuff.pos != decompressedSize, "Decompressed size does not match"); +        CHECK(memcmp(outBuff.dst, decompressed, decompressedSize) != 0, +              "Decompressed data does not match"); + +        ZSTD_freeDStream(zds); +    } +    DISPLAYLEVEL(3, "OK \n"); +      DISPLAYLEVEL(3, "test%3i : dictionary + uncompressible block + reusing tables checks offset table validity: ", testNb++);      {   ZSTD_CDict* const cdict = ZSTD_createCDict_advanced(              dictionary.start, dictionary.filled, | 
