Skip to content

Vendors the uxid conformance corpus and runs every case - #8

Merged
johnnyt merged 1 commit into
mainfrom
uxjv-baj-vendor-corpus
Oct 21, 2026
Merged

johnnyt merged 1 commit into
mainfrom
uxjv-baj-vendor-corpus

Conversation

@johnnyt

@johnnyt johnnyt commented Oct 21, 2026

Copy link
Copy Markdown
Member

What

Vendors the uxid-ex conformance corpus at the v2.10.0 tag and runs every case under the gate. Bead: uxjv-baj.

  • conformance/ holds the case files (encode.json, deterministic.json, decode.json, invalid.json, monotonic.json), manifest.json, README.md and schema/, each copied byte for byte from the tag. The reference's source/ generator scripts are not copied, as in the released ports.
  • conformance/SOURCE.json records the repo, the tag, the commit and the corpus hash.
  • .gitattributes marks conformance/** as -text so no line-ending conversion touches the vendored bytes. Spotless is configured for Java sources only and does not read conformance/.
  • CorpusHashTest recomputes the corpus hash by the corpus README's rule (the case files' bytes concatenated in the manifest's order) and each case_count (the lines of its file), and fails on a mismatch. It also checks that SOURCE.json and the manifest agree, that the manifest lists exactly the files the runner runs, and that the case files carry no carriage return.
  • CorpusRunnerTest is one parameterised test per case file (encode, deterministic, decode, invalid, monotonic), one invocation per line, named by the case id, with no skip list. Decode cases run at both ends of the decoder clock window the corpus README gives; monotonic cases replay their draws through DrawSource.
  • A case is read strictly (Fields): a key the runner does not know fails it, a missing key fails it, and a null prefix reads as no prefix. CorpusStrictnessTest pins those rules with synthetic lines, and a wrong answer fails rather than being skipped.
  • The four earlier test classes that held hand-copied corpus rows (DecodeCorpusTest, DeterministicCorpusTest, GenerateCorpusTest, MonotonicCorpusTest) are removed: the runner covers exactly the same cases, including the decode, generate and monotonic refusals they held. The targeted tests that pin behaviour the corpus does not (DecodeClockTest, MonotonicTest, UxidDecodeTest, UxidDeterministicTest, UxidGenerateTest, UxidValidityTest and the rest) stay.
  • CLAUDE.md now states that the corpus is vendored (it described it as arriving later).

No library source changes and no public API changes. No changelog fragment: tests, tooling and docs take none.

Provenance

  • The JSON reader is a small strict one in the test sources (Json, Fields) rather than a test-scope dependency, so pom.xml is unchanged and the jar stays dependency-free. It refuses duplicate keys, non-integer numbers and trailing text. Decided by the conductor under a standing consent, 2026-10-21.
  • The generation refusal order is not identical to the reference in every combination (the builder refuses an out-of-range time at the setter where the reference truncates). The corpus does not fix that order, so the runner does not rely on one and no text here claims reference-identical order.
  • Every corpus case passes with no skip.

Verification

  • mise run gate green on the committed tree: format check, compile with Error Prone, the tests (the corpus tests included), JaCoCo at the 90 percent bar, and the jars.
  • The vendored files compare byte-equal to the copies vendored in uxid-rs at the same tag.
  • Each new test carries a sabotage note in the in-name form, from a mutation that was applied, run and restored byte-equal.

The corpus is the arbiter of conformance, so the port now carries it
and the gate runs it. conformance/ holds the uxid-ex corpus at v2.10.0
(the case files, manifest.json, the schemas and README.md, byte for
byte; the generator sources are not copied), with SOURCE.json recording
the repo, tag, commit and corpus hash. .gitattributes keeps its line
endings as committed.

CorpusHashTest recomputes the corpus hash and each case count by the
corpus README's rule and fails on a mismatch. CorpusRunnerTest runs one
parameterised test per case file over every case, with no skip list. A
case is read strictly: a key the runner does not know, or a missing
one, fails it, and a null prefix reads as no prefix. The JSON reader is
a small one in the test sources, so the library and the pom gain no
dependency.

The hand-copied corpus rows in the four earlier corpus test classes are
removed: the runner covers exactly the same cases, including the decode
refusals, generate refusals and monotonic refusals they held. The
targeted tests that pin behaviour the corpus does not stay.

Refs: uxjv-baj
@johnnyt
johnnyt merged commit 7c2acf1 into main Oct 21, 2026
4 checks passed
@johnnyt
johnnyt deleted the uxjv-baj-vendor-corpus branch October 21, 2026 23:08
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.

1 participant