Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix bug related to minMatch in qzstd #77

Closed
wants to merge 1 commit into from
Closed

Conversation

embg
Copy link
Contributor

@embg embg commented Jan 20, 2023

When using ZSTD_compressSequences(), it's important to make sure that the input sequences do not have any matches shorter than ZSTD_c_minMatch. From the docs:

 *    - ZSTD_c_minMatch MUST be set as less than or equal to the smallest match generated by the match finder. It has a minimum value of ZSTD_MINMATCH_MIN.

Compression can fail if this condition is not satisfied, because zstd allocates memory for sequences using the assumption that all match lengths are >= ZSTD_c_minMatch.

For QAT, this means we need to ensure that ZSTD_c_minMatch is not greater than g_sess_params.lz4s_mini_match. That's what is accomplished by this PR.

Setting ZSTD_c_minMatch won't affect software fallback compression, because qzstd.c is using ZSTD_compressCCtx(), which ignores all parameter settings except for compression level.

@cfzhu
Copy link
Contributor

cfzhu commented Jan 30, 2023

Thanks for your patch, we will merge this patch in internal repo firstly and update to this repo when next release.

@cfzhu
Copy link
Contributor

cfzhu commented Mar 24, 2023

Update f0b2ef7

@cfzhu cfzhu closed this Mar 24, 2023
XingHongChenIntel added a commit that referenced this pull request Feb 8, 2024
QATAPP-26162: update missed copyright

Change-Id: I620a0cb9f819602c194ccaac2de8e79f5a94744a
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants