9d31c704d5
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. |
||
---|---|---|
.. | ||
.gitignore | ||
Makefile | ||
README.md | ||
config.c | ||
config.h | ||
data.c | ||
data.h | ||
levels.h | ||
method.c | ||
method.h | ||
result.c | ||
result.h | ||
results.csv | ||
test.c |
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