zstd/tests/regression
Nick Terrell 9d31c704d5 Don't shrink window log when streaming with a dictionary
Fixes #2442.

1. When creating a dictionary keep the same behavior as before.
   Assume the source size is 513 bytes when adjusting parameters.
2. When calling ZSTD_getCParams() or ZSTD_adjustCParams() keep
   the same behavior as before.
3. When attaching a dictionary keep the same behavior of ignoring
   the dictionary size. When streaming this will select the
   largest parameters and not adjust them down. But, the CDict
   will use the correctly sized parameters, which seems like the
   right tradeoff.
4. When not attaching a dictionary (either forced not to, or
   using a prefix dictionary) we select parameters based on the
   dictionary size + source size, and assume the source size is
   small, which is the same behavior as before. But, now we don't
   adjust the window log (and hash and chain log) down when the
   source size is unknown.

When the source size is unknown all cdicts should attach, except
when the user disables attaching, or `forceWindow` is used. This
means that when streaming with a CDict we end up in the good case
where we get small CDict parameters, and large source parameters.

TODO: Add a streaming + dictionary regression test case.
2021-01-04 15:54:09 -08:00
..
.gitignore updated compression results.csv 2018-12-12 20:30:09 -08:00
Makefile [license] Update year to 2021 2021-01-04 17:53:52 -05:00
README.md [regression] Add README explaining the test 2020-10-30 13:55:52 -07:00
config.c [test][regression] Add no source size with dictionary test 2021-01-04 15:54:09 -08:00
config.h [license] Update year to 2021 2021-01-04 17:53:52 -05:00
data.c [test][regression] Add no source size with dictionary test 2021-01-04 15:54:09 -08:00
data.h [license] Update year to 2021 2021-01-04 17:53:52 -05:00
levels.h [license] Update year to 2021 2021-01-04 17:53:52 -05:00
method.c [license] Update year to 2021 2021-01-04 17:53:52 -05:00
method.h [license] Update year to 2021 2021-01-04 17:53:52 -05:00
result.c [license] Update year to 2021 2021-01-04 17:53:52 -05:00
result.h [license] Update year to 2021 2021-01-04 17:53:52 -05:00
results.csv Don't shrink window log when streaming with a dictionary 2021-01-04 15:54:09 -08:00
test.c [license] Update year to 2021 2021-01-04 17:53:52 -05:00

README.md

Regression tests

The regression tests run zstd in many scenarios and ensures that the size of the compressed results doesn't change. This helps us ensure that we don't accidentally regress zstd's compression ratio.

These tests get run every night by CircleCI. If the job fails you can read the diff printed by the job to ensure the change isn't a regression. If all is well you can download the results.csv artifact and commit the new results. Or you can rebuild it yourself following the instructions below.

Rebuilding results.csv

From the root of the zstd repo run:

# Build the zstd binary
make clean
make -j zstd

# Build the regression test binary
cd tests/regression
make clean
make -j test

# Run the regression test
./test --cache data-cache --zstd ../../zstd --output results.csv

# Check results.csv to ensure the new results are okay
git diff

# Then submit the PR