ADR-004: Maintain a versioned, provenance-checked PDF corpus #316
SteveTheKiller
announced in
Announcements
Replies: 0 comments
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
Status: Accepted
Date: 2026-08-31
Decider: Steve the Killer
Context
PDF software encounters far more variation than a focused unit-test suite can represent. Real files combine damaged structures, unusual fonts, forms, signatures, annotations, layers, color profiles, large pages, old features, and valid but uncommon feature combinations. A change can pass its direct test while breaking a document family that was never represented in that test.
KillerPDF needs evidence that a release can open and save a broad set of PDFs safely, as well as a way to tell whether a result changed because of the application, the input set, or the test environment. A file that is private, unlicensed for redistribution, or deliberately malformed still has value for local testing, but cannot be treated as a public release asset.
The KillerPDF Corpus exists to turn that work into a repeatable release gate. It provides common inputs for KillerPDF and other PDF tools, keeps the provenance of each file visible, and records baselines that later versions can compare without relying on memory or ad hoc spot checks.
Decision
Maintain The KillerPDF Corpus as a separately versioned, provenance-checked test collection and use it as a release gate for KillerPDF and KillerPdf.Engine changes that affect opening, saving, editing, importing, or document preservation.
The corpus has three deliberate lanes:
Every corpus version records each input's relative path, byte count, source, and SHA-256 digest. Sources are pinned to an upstream revision or dated release, files are deduplicated by digest, and exclusions are recorded rather than silently discarded. The corpus accepts only files with useful coverage and clear provenance and redistribution terms.
A benchmark warms each collection, runs the selected collection five measured times, keeps output outside the input tree, and records detailed and summary CSV results. Published baselines identify the exact executable hash, corpus version, collection selection, outcome counts, elapsed times, and test environment. Outcome categories distinguish a successful save, an intentional skip or refusal, and an operation that entered the save path but failed. The damaged-file gate also records crashes and timeouts separately.
Options considered
Rely on unit and feature tests only
Unit tests are fast and precise, but their fixtures necessarily model known cases. They cannot demonstrate that a change preserves behavior across the wide range of real, historical, malformed, and standards-oriented PDFs that users supply.
Keep an unversioned maintainer folder for manual spot checks
This can find problems during development, but it does not provide stable inputs, provenance, public reproduction, comparable totals, or a dependable release record. Its results cannot distinguish a code change from a changed set of files.
Publish every useful test file
This would make the largest visible collection, but it would violate the redistribution terms of some valuable official test suites and issue-attachment archives. It also mixes ordinary compatibility work with intentionally hostile inputs.
Maintain a versioned public corpus with documented local-only overlays
This gives users and contributors a reproducible public baseline while retaining valuable restricted coverage on the maintainer workstation. It makes licensing, provenance, and expected failure boundaries explicit. This is the selected option.
Consequences
Implementation requirements
All reactions