test: golden-dictionaries dict interop coverage#4
Merged
Conversation
Drive zstd's vendored golden-dictionaries corpus across the FFM/JNI boundary, mirroring zstd's own regression pairing (the dictionary against golden-compression/http): - java compress with dict -> zstd-jni decode with same dict - zstd-jni compress with dict -> java decode with same dict - dict id rides with the frame (ZstdFrame.dictId == dict.id, non-zero) Parameterized over the corpus, submodule-gated like the sibling suites, so shallow clones still build. Covers http-dict-missing-symbols, the adversarial dictionary that omits symbols the entropy tables expect. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
This was referenced Jun 26, 2026
dfa1
added a commit
that referenced
this pull request
Jun 26, 2026
…tinels (#22) Follow-ups from the code-quality inspection: - Thread-safety docs (#2): document the four streams as not thread-safe (confine to one thread) and the two digested dictionaries as immutable and safe to share across threads. - Null validation (#3): fail fast with a named NullPointerException on public byte[]/dictionary/sample/stream arguments instead of an opaque NPE deep in native code. requireNative now also rejects null, covering every MemorySegment entry point. - Sentinel DRY (#4): one definition of CONTENTSIZE_UNKNOWN/_ERROR in Zstd, reused by ZstdFrame and ZstdFrameHeader (drops a duplicate and the CONTENT_SIZE_ERROR naming drift). Co-authored-by: Claude Opus 4.8 <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What
Extends
GoldenCorpusTestwith aGoldenDictionariesnested suite driving zstd's vendoredthird_party/zstd/tests/golden-dictionaries/corpus across the FFM/JNI boundary.zstd's own
playTests.shpairs each golden dictionary withgolden-compression/httpand asserts a dict round-trip survives. We do the same, both directions:ZstdFrame.dictId(frame)equalsdict.id()and is non-zeroParameterized over the corpus (currently
http-dict-missing-symbols— the adversarial dictionary that omits symbols the entropy tables expect, id1386686301). Submodule-gated like the sibling suites, so shallow clones still build.Test
./mvnw -pl integration-tests -am test -Dtest=GoldenCorpusTest— 18 tests green (3 new), checkstyle clean.🤖 Generated with Claude Code