diff --git a/doc/zstd_manual.html b/doc/zstd_manual.html index 04951071b..b1674bd42 100644 --- a/doc/zstd_manual.html +++ b/doc/zstd_manual.html @@ -461,12 +461,12 @@ size_t ZSTD_sizeof_DDict(const ZSTD_DDict* ddict); * Larger values improve collision resolution but decrease compression speed. * The maximum value is ZSTD_LDM_BUCKETSIZELOG_MAX. * Special: value 0 means "use default value" (default: 3). */ - ZSTD_p_ldmHashEveryLog=164, /* Frequency of inserting/looking up entries into the LDM hash table. + ZSTD_p_ldmHashRateLog=164, /* Frequency of inserting/looking up entries into the LDM hash table. * Must be clamped between 0 and (ZSTD_WINDOWLOG_MAX - ZSTD_HASHLOG_MIN). * Default is MAX(0, (windowLog - ldmHashLog)), optimizing hash table usage. * Larger values improve compression speed. * Deviating far from default value will likely result in a compression ratio decrease. - * Special: value 0 means "automatically determine hashEveryLog". */ + * Special: value 0 means "automatically determine hashRateLog". */ /* frame parameters */ ZSTD_p_contentSizeFlag=200, /* Content size will be written into frame header _whenever known_ (default:1) diff --git a/lib/compress/zstd_compress.c b/lib/compress/zstd_compress.c index 566b8927b..fbbecc8f5 100644 --- a/lib/compress/zstd_compress.c +++ b/lib/compress/zstd_compress.c @@ -330,9 +330,9 @@ ZSTD_bounds ZSTD_cParam_getBounds(ZSTD_cParameter param) bounds.upperBound = ZSTD_LDM_BUCKETSIZELOG_MAX; return bounds; - case ZSTD_p_ldmHashEveryLog: - bounds.lowerBound = ZSTD_LDM_HASHEVERYLOG_MIN; - bounds.upperBound = ZSTD_LDM_HASHEVERYLOG_MAX; + case ZSTD_p_ldmHashRateLog: + bounds.lowerBound = ZSTD_LDM_HASHRATELOG_MIN; + bounds.upperBound = ZSTD_LDM_HASHRATELOG_MAX; return bounds; /* experimental parameters */ @@ -397,7 +397,7 @@ static int ZSTD_isUpdateAuthorized(ZSTD_cParameter param) case ZSTD_p_ldmHashLog: case ZSTD_p_ldmMinMatch: case ZSTD_p_ldmBucketSizeLog: - case ZSTD_p_ldmHashEveryLog: + case ZSTD_p_ldmHashRateLog: case ZSTD_p_forceAttachDict: default: return 0; @@ -461,7 +461,7 @@ size_t ZSTD_CCtx_setParameter(ZSTD_CCtx* cctx, ZSTD_cParameter param, int value) case ZSTD_p_ldmHashLog: case ZSTD_p_ldmMinMatch: case ZSTD_p_ldmBucketSizeLog: - case ZSTD_p_ldmHashEveryLog: + case ZSTD_p_ldmHashRateLog: if (cctx->cdict) return ERROR(stage_wrong); return ZSTD_CCtxParam_setParameter(&cctx->requestedParams, param, value); @@ -610,11 +610,11 @@ size_t ZSTD_CCtxParam_setParameter(ZSTD_CCtx_params* CCtxParams, CCtxParams->ldmParams.bucketSizeLog = value; return CCtxParams->ldmParams.bucketSizeLog; - case ZSTD_p_ldmHashEveryLog : + case ZSTD_p_ldmHashRateLog : if (value > ZSTD_WINDOWLOG_MAX - ZSTD_HASHLOG_MIN) return ERROR(parameter_outOfBound); - CCtxParams->ldmParams.hashEveryLog = value; - return CCtxParams->ldmParams.hashEveryLog; + CCtxParams->ldmParams.hashRateLog = value; + return CCtxParams->ldmParams.hashRateLog; default: return ERROR(parameter_unsupported); } @@ -711,8 +711,8 @@ size_t ZSTD_CCtxParam_getParameter( case ZSTD_p_ldmBucketSizeLog : *value = CCtxParams->ldmParams.bucketSizeLog; break; - case ZSTD_p_ldmHashEveryLog : - *value = CCtxParams->ldmParams.hashEveryLog; + case ZSTD_p_ldmHashRateLog : + *value = CCtxParams->ldmParams.hashRateLog; break; default: return ERROR(parameter_unsupported); } @@ -1119,7 +1119,7 @@ static U32 ZSTD_equivalentLdmParams(ldmParams_t ldmParams1, ldmParams1.hashLog == ldmParams2.hashLog && ldmParams1.bucketSizeLog == ldmParams2.bucketSizeLog && ldmParams1.minMatchLength == ldmParams2.minMatchLength && - ldmParams1.hashEveryLog == ldmParams2.hashEveryLog); + ldmParams1.hashRateLog == ldmParams2.hashRateLog); } typedef enum { ZSTDb_not_buffered, ZSTDb_buffered } ZSTD_buffered_policy_e; @@ -1317,7 +1317,7 @@ static size_t ZSTD_resetCCtx_internal(ZSTD_CCtx* zc, /* Adjust long distance matching parameters */ ZSTD_ldm_adjustParameters(¶ms.ldmParams, ¶ms.cParams); assert(params.ldmParams.hashLog >= params.ldmParams.bucketSizeLog); - assert(params.ldmParams.hashEveryLog < 32); + assert(params.ldmParams.hashRateLog < 32); zc->ldmState.hashPower = ZSTD_rollingHash_primePower(params.ldmParams.minMatchLength); } diff --git a/lib/compress/zstd_compress_internal.h b/lib/compress/zstd_compress_internal.h index 608efd5a0..680bd9148 100644 --- a/lib/compress/zstd_compress_internal.h +++ b/lib/compress/zstd_compress_internal.h @@ -161,7 +161,7 @@ typedef struct { U32 hashLog; /* Log size of hashTable */ U32 bucketSizeLog; /* Log bucket size for collision resolution, at most 8 */ U32 minMatchLength; /* Minimum match length */ - U32 hashEveryLog; /* Log number of entries to skip */ + U32 hashRateLog; /* Log number of entries to skip */ U32 windowLog; /* Window log for the LDM */ } ldmParams_t; diff --git a/lib/compress/zstd_ldm.c b/lib/compress/zstd_ldm.c index 050423b5e..e98006809 100644 --- a/lib/compress/zstd_ldm.c +++ b/lib/compress/zstd_ldm.c @@ -37,8 +37,8 @@ void ZSTD_ldm_adjustParameters(ldmParams_t* params, params->hashLog = MAX(ZSTD_HASHLOG_MIN, params->windowLog - LDM_HASH_RLOG); assert(params->hashLog <= ZSTD_HASHLOG_MAX); } - if (params->hashEveryLog == 0) { - params->hashEveryLog = params->windowLog < params->hashLog + if (params->hashRateLog == 0) { + params->hashRateLog = params->windowLog < params->hashLog ? 0 : params->windowLog - params->hashLog; } @@ -119,20 +119,20 @@ static void ZSTD_ldm_insertEntry(ldmState_t* ldmState, * * Gets the small hash, checksum, and tag from the rollingHash. * - * If the tag matches (1 << ldmParams.hashEveryLog)-1, then + * If the tag matches (1 << ldmParams.hashRateLog)-1, then * creates an ldmEntry from the offset, and inserts it into the hash table. * * hBits is the length of the small hash, which is the most significant hBits * of rollingHash. The checksum is the next 32 most significant bits, followed - * by ldmParams.hashEveryLog bits that make up the tag. */ + * by ldmParams.hashRateLog bits that make up the tag. */ static void ZSTD_ldm_makeEntryAndInsertByTag(ldmState_t* ldmState, U64 const rollingHash, U32 const hBits, U32 const offset, ldmParams_t const ldmParams) { - U32 const tag = ZSTD_ldm_getTag(rollingHash, hBits, ldmParams.hashEveryLog); - U32 const tagMask = ((U32)1 << ldmParams.hashEveryLog) - 1; + U32 const tag = ZSTD_ldm_getTag(rollingHash, hBits, ldmParams.hashRateLog); + U32 const tagMask = ((U32)1 << ldmParams.hashRateLog) - 1; if (tag == tagMask) { U32 const hash = ZSTD_ldm_getSmallHash(rollingHash, hBits); U32 const checksum = ZSTD_ldm_getChecksum(rollingHash, hBits); @@ -247,8 +247,8 @@ static size_t ZSTD_ldm_generateSequences_internal( U64 const hashPower = ldmState->hashPower; U32 const hBits = params->hashLog - params->bucketSizeLog; U32 const ldmBucketSize = 1U << params->bucketSizeLog; - U32 const hashEveryLog = params->hashEveryLog; - U32 const ldmTagMask = (1U << params->hashEveryLog) - 1; + U32 const hashRateLog = params->hashRateLog; + U32 const ldmTagMask = (1U << params->hashRateLog) - 1; /* Prefix and extDict parameters */ U32 const dictLimit = ldmState->window.dictLimit; U32 const lowestIndex = extDict ? ldmState->window.lowLimit : dictLimit; @@ -283,7 +283,7 @@ static size_t ZSTD_ldm_generateSequences_internal( lastHashed = ip; /* Do not insert and do not look for a match */ - if (ZSTD_ldm_getTag(rollingHash, hBits, hashEveryLog) != ldmTagMask) { + if (ZSTD_ldm_getTag(rollingHash, hBits, hashRateLog) != ldmTagMask) { ip++; continue; } diff --git a/lib/compress/zstd_ldm.h b/lib/compress/zstd_ldm.h index 99644f49b..a47846128 100644 --- a/lib/compress/zstd_ldm.h +++ b/lib/compress/zstd_ldm.h @@ -87,7 +87,7 @@ size_t ZSTD_ldm_getTableSize(ldmParams_t params); size_t ZSTD_ldm_getMaxNbSeq(ldmParams_t params, size_t maxChunkSize); /** ZSTD_ldm_adjustParameters() : - * If the params->hashEveryLog is not set, set it to its default value based on + * If the params->hashRateLog is not set, set it to its default value based on * windowLog and params->hashLog. * * Ensures that params->bucketSizeLog is <= params->hashLog (setting it to diff --git a/lib/compress/zstdmt_compress.c b/lib/compress/zstdmt_compress.c index 477c20883..465ab1e44 100644 --- a/lib/compress/zstdmt_compress.c +++ b/lib/compress/zstdmt_compress.c @@ -467,7 +467,7 @@ static int ZSTDMT_serialState_reset(serialState_t* serialState, ZSTDMT_seqPool* DEBUGLOG(4, "LDM window size = %u KB", (1U << params.cParams.windowLog) >> 10); ZSTD_ldm_adjustParameters(¶ms.ldmParams, ¶ms.cParams); assert(params.ldmParams.hashLog >= params.ldmParams.bucketSizeLog); - assert(params.ldmParams.hashEveryLog < 32); + assert(params.ldmParams.hashRateLog < 32); serialState->ldmState.hashPower = ZSTD_rollingHash_primePower(params.ldmParams.minMatchLength); } else { diff --git a/lib/zstd.h b/lib/zstd.h index 492b7fddd..6d75d8ea6 100644 --- a/lib/zstd.h +++ b/lib/zstd.h @@ -555,12 +555,12 @@ typedef enum { * Larger values improve collision resolution but decrease compression speed. * The maximum value is ZSTD_LDM_BUCKETSIZELOG_MAX. * Special: value 0 means "use default value" (default: 3). */ - ZSTD_p_ldmHashEveryLog=164, /* Frequency of inserting/looking up entries into the LDM hash table. + ZSTD_p_ldmHashRateLog=164, /* Frequency of inserting/looking up entries into the LDM hash table. * Must be clamped between 0 and (ZSTD_WINDOWLOG_MAX - ZSTD_HASHLOG_MIN). * Default is MAX(0, (windowLog - ldmHashLog)), optimizing hash table usage. * Larger values improve compression speed. * Deviating far from default value will likely result in a compression ratio decrease. - * Special: value 0 means "automatically determine hashEveryLog". */ + * Special: value 0 means "automatically determine hashRateLog". */ /* frame parameters */ ZSTD_p_contentSizeFlag=200, /* Content size will be written into frame header _whenever known_ (default:1) @@ -926,8 +926,8 @@ ZSTDLIB_API size_t ZSTD_decompress_generic(ZSTD_DCtx* dctx, #define ZSTD_LDM_MINMATCH_MAX 4096 #define ZSTD_LDM_BUCKETSIZELOG_MIN 1 #define ZSTD_LDM_BUCKETSIZELOG_MAX 8 -#define ZSTD_LDM_HASHEVERYLOG_MIN 0 -#define ZSTD_LDM_HASHEVERYLOG_MAX (ZSTD_WINDOWLOG_MAX - ZSTD_HASHLOG_MIN) +#define ZSTD_LDM_HASHRATELOG_MIN 0 +#define ZSTD_LDM_HASHRATELOG_MAX (ZSTD_WINDOWLOG_MAX - ZSTD_HASHLOG_MIN) /* internal */ #define ZSTD_HASHLOG3_MAX 17 diff --git a/programs/benchzstd.c b/programs/benchzstd.c index 1bed0f3b2..f14e3ea0a 100644 --- a/programs/benchzstd.c +++ b/programs/benchzstd.c @@ -133,7 +133,7 @@ BMK_advancedParams_t BMK_initAdvancedParams(void) { 0, /* ldmMinMatch */ 0, /* ldmHashLog */ 0, /* ldmBuckSizeLog */ - 0 /* ldmHashEveryLog */ + 0 /* ldmHashRateLog */ }; return res; } @@ -171,7 +171,7 @@ static void BMK_initCCtx(ZSTD_CCtx* ctx, ZSTD_CCtx_setParameter(ctx, ZSTD_p_ldmMinMatch, adv->ldmMinMatch); ZSTD_CCtx_setParameter(ctx, ZSTD_p_ldmHashLog, adv->ldmHashLog); ZSTD_CCtx_setParameter(ctx, ZSTD_p_ldmBucketSizeLog, adv->ldmBucketSizeLog); - ZSTD_CCtx_setParameter(ctx, ZSTD_p_ldmHashEveryLog, adv->ldmHashEveryLog); + ZSTD_CCtx_setParameter(ctx, ZSTD_p_ldmHashRateLog, adv->ldmHashRateLog); ZSTD_CCtx_setParameter(ctx, ZSTD_p_windowLog, comprParams->windowLog); ZSTD_CCtx_setParameter(ctx, ZSTD_p_hashLog, comprParams->hashLog); ZSTD_CCtx_setParameter(ctx, ZSTD_p_chainLog, comprParams->chainLog); diff --git a/programs/benchzstd.h b/programs/benchzstd.h index 9860adf16..3a8b893e7 100644 --- a/programs/benchzstd.h +++ b/programs/benchzstd.h @@ -115,7 +115,7 @@ typedef struct { unsigned ldmMinMatch; /* below: parameters for long distance matching, see zstd.1.md */ unsigned ldmHashLog; unsigned ldmBucketSizeLog; - unsigned ldmHashEveryLog; + unsigned ldmHashRateLog; } BMK_advancedParams_t; /* returns default parameters used by nonAdvanced functions */ diff --git a/programs/fileio.c b/programs/fileio.c index b8b1538e6..efb9fb62b 100644 --- a/programs/fileio.c +++ b/programs/fileio.c @@ -346,9 +346,9 @@ void FIO_setLdmBucketSizeLog(unsigned ldmBucketSizeLog) { g_ldmBucketSizeLog = ldmBucketSizeLog; } -static U32 g_ldmHashEveryLog = FIO_LDM_PARAM_NOTSET; -void FIO_setLdmHashEveryLog(unsigned ldmHashEveryLog) { - g_ldmHashEveryLog = ldmHashEveryLog; +static U32 g_ldmHashRateLog = FIO_LDM_PARAM_NOTSET; +void FIO_setLdmHashRateLog(unsigned ldmHashRateLog) { + g_ldmHashRateLog = ldmHashRateLog; } @@ -541,8 +541,8 @@ static cRess_t FIO_createCResources(const char* dictFileName, int cLevel, if (g_ldmBucketSizeLog != FIO_LDM_PARAM_NOTSET) { CHECK( ZSTD_CCtx_setParameter(ress.cctx, ZSTD_p_ldmBucketSizeLog, g_ldmBucketSizeLog) ); } - if (g_ldmHashEveryLog != FIO_LDM_PARAM_NOTSET) { - CHECK( ZSTD_CCtx_setParameter(ress.cctx, ZSTD_p_ldmHashEveryLog, g_ldmHashEveryLog) ); + if (g_ldmHashRateLog != FIO_LDM_PARAM_NOTSET) { + CHECK( ZSTD_CCtx_setParameter(ress.cctx, ZSTD_p_ldmHashRateLog, g_ldmHashRateLog) ); } /* compression parameters */ CHECK( ZSTD_CCtx_setParameter(ress.cctx, ZSTD_p_windowLog, comprParams.windowLog) ); diff --git a/programs/fileio.h b/programs/fileio.h index 8edb7dfe8..7e1b1cd76 100644 --- a/programs/fileio.h +++ b/programs/fileio.h @@ -56,7 +56,7 @@ void FIO_setChecksumFlag(unsigned checksumFlag); void FIO_setDictIDFlag(unsigned dictIDFlag); void FIO_setLdmBucketSizeLog(unsigned ldmBucketSizeLog); void FIO_setLdmFlag(unsigned ldmFlag); -void FIO_setLdmHashEveryLog(unsigned ldmHashEveryLog); +void FIO_setLdmHashRateLog(unsigned ldmHashRateLog); void FIO_setLdmHashLog(unsigned ldmHashLog); void FIO_setLdmMinMatch(unsigned ldmMinMatch); void FIO_setMemLimit(unsigned memLimit); diff --git a/programs/zstd.1 b/programs/zstd.1 index 1406309f6..c6ae2c380 100644 --- a/programs/zstd.1 +++ b/programs/zstd.1 @@ -431,7 +431,7 @@ Larger bucket sizes improve collision resolution but decrease compression speed\ The minimum \fIlblog\fR is 0 and the maximum is 8 (default: 3)\. . .TP -\fBldmHashEveryLog\fR=\fIlhevery\fR, \fBlhevery\fR=\fIlhevery\fR +\fBldmHashRateLog\fR=\fIlhrlog\fR, \fBlhrlog\fR=\fIlhrlog\fR Specify the frequency of inserting entries into the long distance matching hash table\. . .IP diff --git a/programs/zstd.1.md b/programs/zstd.1.md index 5df668bc9..f6a6e2bd1 100644 --- a/programs/zstd.1.md +++ b/programs/zstd.1.md @@ -450,7 +450,7 @@ The list of available _options_: The minimum _lblog_ is 0 and the maximum is 8 (default: 3). -- `ldmHashEveryLog`=_lhevery_, `lhevery`=_lhevery_: +- `ldmHashRateLog`=_lhrlog_, `lhrlog`=_lhrlog_: Specify the frequency of inserting entries into the long distance matching hash table. diff --git a/programs/zstdcli.c b/programs/zstdcli.c index 83a24f76c..71f0f4d7a 100644 --- a/programs/zstdcli.c +++ b/programs/zstdcli.c @@ -81,7 +81,7 @@ static const unsigned g_defaultMaxWindowLog = 27; static U32 g_overlapLog = OVERLAP_LOG_DEFAULT; static U32 g_ldmHashLog = 0; static U32 g_ldmMinMatch = 0; -static U32 g_ldmHashEveryLog = LDM_PARAM_DEFAULT; +static U32 g_ldmHashRateLog = LDM_PARAM_DEFAULT; static U32 g_ldmBucketSizeLog = LDM_PARAM_DEFAULT; @@ -410,7 +410,7 @@ static unsigned parseCompressionParameters(const char* stringPtr, ZSTD_compressi if (longCommandWArg(&stringPtr, "ldmHashLog=") || longCommandWArg(&stringPtr, "lhlog=")) { g_ldmHashLog = readU32FromChar(&stringPtr); if (stringPtr[0]==',') { stringPtr++; continue; } else break; } if (longCommandWArg(&stringPtr, "ldmMinMatch=") || longCommandWArg(&stringPtr, "lmml=")) { g_ldmMinMatch = readU32FromChar(&stringPtr); if (stringPtr[0]==',') { stringPtr++; continue; } else break; } if (longCommandWArg(&stringPtr, "ldmBucketSizeLog=") || longCommandWArg(&stringPtr, "lblog=")) { g_ldmBucketSizeLog = readU32FromChar(&stringPtr); if (stringPtr[0]==',') { stringPtr++; continue; } else break; } - if (longCommandWArg(&stringPtr, "ldmHashEveryLog=") || longCommandWArg(&stringPtr, "lhevery=")) { g_ldmHashEveryLog = readU32FromChar(&stringPtr); if (stringPtr[0]==',') { stringPtr++; continue; } else break; } + if (longCommandWArg(&stringPtr, "ldmHashRateLog=") || longCommandWArg(&stringPtr, "lhrlog=")) { g_ldmHashRateLog = readU32FromChar(&stringPtr); if (stringPtr[0]==',') { stringPtr++; continue; } else break; } DISPLAYLEVEL(4, "invalid compression parameter \n"); return 0; } @@ -940,8 +940,8 @@ int main(int argCount, const char* argv[]) if (g_ldmBucketSizeLog != LDM_PARAM_DEFAULT) { benchParams.ldmBucketSizeLog = g_ldmBucketSizeLog; } - if (g_ldmHashEveryLog != LDM_PARAM_DEFAULT) { - benchParams.ldmHashEveryLog = g_ldmHashEveryLog; + if (g_ldmHashRateLog != LDM_PARAM_DEFAULT) { + benchParams.ldmHashRateLog = g_ldmHashRateLog; } if (cLevel > ZSTD_maxCLevel()) cLevel = ZSTD_maxCLevel(); @@ -1051,7 +1051,7 @@ int main(int argCount, const char* argv[]) FIO_setLdmHashLog(g_ldmHashLog); FIO_setLdmMinMatch(g_ldmMinMatch); if (g_ldmBucketSizeLog != LDM_PARAM_DEFAULT) FIO_setLdmBucketSizeLog(g_ldmBucketSizeLog); - if (g_ldmHashEveryLog != LDM_PARAM_DEFAULT) FIO_setLdmHashEveryLog(g_ldmHashEveryLog); + if (g_ldmHashRateLog != LDM_PARAM_DEFAULT) FIO_setLdmHashRateLog(g_ldmHashRateLog); FIO_setAdaptiveMode(adapt); FIO_setAdaptMin(adaptMin); FIO_setAdaptMax(adaptMax); diff --git a/tests/fuzz/zstd_helpers.c b/tests/fuzz/zstd_helpers.c index b6891845a..665ffbb01 100644 --- a/tests/fuzz/zstd_helpers.c +++ b/tests/fuzz/zstd_helpers.c @@ -79,6 +79,6 @@ void FUZZ_setRandomParameters(ZSTD_CCtx *cctx, size_t srcSize, uint32_t *state) ZSTD_LDM_MINMATCH_MAX, state); setRand(cctx, ZSTD_p_ldmBucketSizeLog, 0, ZSTD_LDM_BUCKETSIZELOG_MAX, state); - setRand(cctx, ZSTD_p_ldmHashEveryLog, 0, - ZSTD_WINDOWLOG_MAX - ZSTD_HASHLOG_MIN, state); + setRand(cctx, ZSTD_p_ldmHashRateLog, ZSTD_LDM_HASHRATELOG_MIN, + ZSTD_LDM_HASHRATELOG_MAX, state); } diff --git a/tests/playTests.sh b/tests/playTests.sh index 695cb546e..456bef5c2 100755 --- a/tests/playTests.sh +++ b/tests/playTests.sh @@ -242,8 +242,8 @@ roundTripTest -g512K roundTripTest -g512K " --zstd=mml=3,tlen=48,strat=6" roundTripTest -g512K " --zstd=strat=6,wlog=23,clog=23,hlog=22,slog=6" roundTripTest -g512K " --zstd=windowLog=23,chainLog=23,hashLog=22,searchLog=6,minMatch=3,targetLength=48,strategy=6" -roundTripTest -g512K " --single-thread --long --zstd=ldmHashLog=20,ldmMinMatch=64,ldmBucketSizeLog=1,ldmHashEveryLog=7" -roundTripTest -g512K " --single-thread --long --zstd=lhlog=20,lmml=64,lblog=1,lhevery=7" +roundTripTest -g512K " --single-thread --long --zstd=ldmHashLog=20,ldmMinMatch=64,ldmBucketSizeLog=1,ldmHashRateLog=7" +roundTripTest -g512K " --single-thread --long --zstd=lhlog=20,lmml=64,lblog=1,lhrlog=7" roundTripTest -g512K 19 diff --git a/tests/zstreamtest.c b/tests/zstreamtest.c index 793a6b411..8aad171f7 100644 --- a/tests/zstreamtest.c +++ b/tests/zstreamtest.c @@ -1878,8 +1878,8 @@ static int fuzzerTests_newAPI(U32 seed, U32 nbTests, unsigned startTest, if (FUZ_rand(&lseed) & 1) CHECK_Z( setCCtxParameter(zc, cctxParams, ZSTD_p_enableLongDistanceMatching, FUZ_rand(&lseed) & 63, opaqueAPI) ); if (FUZ_rand(&lseed) & 3) CHECK_Z( setCCtxParameter(zc, cctxParams, ZSTD_p_ldmHashLog, FUZ_randomClampedLength(&lseed, ZSTD_HASHLOG_MIN, 23), opaqueAPI) ); if (FUZ_rand(&lseed) & 3) CHECK_Z( setCCtxParameter(zc, cctxParams, ZSTD_p_ldmMinMatch, FUZ_randomClampedLength(&lseed, ZSTD_LDM_MINMATCH_MIN, ZSTD_LDM_MINMATCH_MAX), opaqueAPI) ); - if (FUZ_rand(&lseed) & 3) CHECK_Z( setCCtxParameter(zc, cctxParams, ZSTD_p_ldmBucketSizeLog, FUZ_randomClampedLength(&lseed, 0, ZSTD_LDM_BUCKETSIZELOG_MAX), opaqueAPI) ); - if (FUZ_rand(&lseed) & 3) CHECK_Z( setCCtxParameter(zc, cctxParams, ZSTD_p_ldmHashEveryLog, FUZ_randomClampedLength(&lseed, 0, ZSTD_WINDOWLOG_MAX - ZSTD_HASHLOG_MIN), opaqueAPI) ); + if (FUZ_rand(&lseed) & 3) CHECK_Z( setCCtxParameter(zc, cctxParams, ZSTD_p_ldmBucketSizeLog, FUZ_randomClampedLength(&lseed, ZSTD_LDM_BUCKETSIZELOG_MIN, ZSTD_LDM_BUCKETSIZELOG_MAX), opaqueAPI) ); + if (FUZ_rand(&lseed) & 3) CHECK_Z( setCCtxParameter(zc, cctxParams, ZSTD_p_ldmHashRateLog, FUZ_randomClampedLength(&lseed, ZSTD_LDM_HASHRATELOG_MIN, ZSTD_LDM_HASHRATELOG_MAX), opaqueAPI) ); } /* mess with frame parameters */