Judge every producer's output with every reader on the machine: cmd/judges - #27
Merged
Merged
Conversation
…udges html2pdf carried, in its nested corpus module, a harness that runs every PDF reader present on the machine — qpdf, poppler, MuPDF, Ghostscript, pdfium, pdf.js and Quartz — over a set of PDFs and says whether they agree: pages, text without its whitespace, and how far each render is from poppler's on the first, middle and last page at 96 dpi, with a pairwise consensus so no reader is privileged. It is generic — render, ops and gotex need exactly it — and this repository is where go-pdfkit is judged by implementations that are not its own, so it lands here, as cmd/judges, with the marker-preserving Markdown writer it uses (internal/mdreport) and the two pdf.js scripts under judges/. Same flags, same judges, same sampling, same table. Split along this repository's seams: a thin main.go over run(args, out, errOut), and every shell-out through one runCmd variable, so the whole harness — every judge, every refusal, the hang — runs at 100% on a machine that has none of the binaries. Four things are decided on purpose rather than carried over: -pdfs is required rather than defaulting to html2pdf's out/ layout; the report heading no longer names html2pdf; a judge that passes -timeout is reported as hung, by tool, rather than as "signal: killed" or the first warning it printed before it was killed; and a results file that could not be written is an error rather than a silence. Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
The re-render on the full sample replaced the verdict without timing it, so the record said poppler took 0 ms on every multi-page document. Co-Authored-By: Claude Fable 5.1 <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.
html2pdf carries, in its nested
corpusmodule, a harness that runs every PDF reader present on the machine over a set of PDFs and says whether they agree. It is generic —render,opsandgotexneed exactly it — and this repository is where go-pdfkit is judged by implementations that are not its own. So it lands here ascmd/judges, with the marker-preserving Markdown writer it uses (internal/mdreport) and the two pdf.js node scripts underjudges/.Same flags (
-pdfs,-out,-report,-results,-pdfium/PDFIUM_TEST,-nodedir,-timeout), same seven judges (qpdf--check; poppler as the reference viapdfinfo/pdftoppm/pdftotext;mutool;gs;pdfium_testwith its UTF-32LE--txt; pdf.js under node; Quartz viasips, page 1, composited over white), same sampling (first/middle/last page at 96 dpi, 400 px thumbnails, grey threshold 48/255), same per-judge worst-Δ vs poppler and pairwise consensus, sameJUDGES.mdtable with the⚠n/❌conventions. The doc comments keep their reasoning.Split along this repository's seams: a thin
main.gooverrun(args, out, errOut) int, and every shell-out through onerunCmdvariable (pluslookPath), so the whole harness — every judge, every refusal, the hang — is exercised at 100% on a runner that has none of the binaries. The pure parts (UTF-32LE decoder, pdfium progress filter, grey-thumbnail differ, consensus score, report writer,mdreport) are unit-tested directly.Changed on purpose
-pdfsis required rather than defaulting to html2pdf'sout/*.pdf,out/bench/*.pdflayout.-timeoutis reported ashung: <tool> did not finish within 3m0s, by tool, rather than assignal: killedor the first warning it printed before it was killed — the deadline is read off the context, asinternal/popplerdoes.mswas 0 on every multi-page document (the re-render on the full sample replaced the verdict without timing it); it is now the time of both runs.judges/package.jsonloses npm-init noise (main, a failingtestscript, emptykeywords/author) and carries the repository's licence; the lock is consistent andnpm ciaccepts it.Proof: run over html2pdf's
corpus/out/*.pdf, all seven judges present, 41 sThe figures match html2pdf's own
corpus/JUDGES.mdfor the same documents (e.g. mupdf Δ4.0% p1, gs Δ11.9% p1 on the Go article), and pdfium — which that report lacked — is judged alongside.🤖 Generated with Claude Code