Repository navigation
measurement: harness project_root, real metrics dirs, readable page counts - #344
Merged
GoKubar merged 1 commit intoSep 14, 2026
Merged
Conversation
…irs and a readable page count
The parity harnesses were measuring themselves in five places. None of this
changes committed expected data; all of it changes what the harnesses report.
1. No `project_root` in the compile request (`rank.py`, `run.py`). The document
snapshots carry text only, so every `\includegraphics` came back as the hard
error "no project root was supplied with the request, so image files cannot
be read" -- a property of the harness, not of the engine. Five of the 22
corpus fixtures hit it, and they are five of the six page-count mismatches.
2. `--v2` never carried image items. `flashtex-render` hardcoded
`Wire { images: false }` for its `--v2` side output, so even a graphic that
resolved left no image item in the display list the PDF route reads. Added
an opt-in `--images` flag (off by default, so existing callers' `--v2` bytes
are unchanged) and the matching `display-list-v2-images` capability in both
harnesses' requests.
3. `flashtex-pdf-exact from-v2` was called without `--project-root`, so the
exporter could not read the image bytes it was told about.
4. `--tfm-dirs` defaulted to `texmf/fonts/tfm/public/lm` *alone*, dropping the
bundled `jknappen/ec` (256 files, `ectt*` included) and
`public/amsfonts/symbols`. Measured on this corpus, that default produces
102 `ec_metrics_unavailable` diagnostics across 16 of 22 fixtures and drags
`|dx| <= 0.5 bp` from 73.1% down to 61.5% -- 11.6 points of "engine miss"
that was the harness's own font configuration. Both harnesses now derive the
metrics roots with `fontenv.tfm_dirs_for` (new `fontenv.resolve_dirs`:
explicit flag > exported variable > derivation).
5. `pdf_page_count` scanned raw bytes for `/Type /Page`, which finds nothing in
an object-stream PDF -- i.e. in every reference pdfTeX has written since
object compression became the default. It returned None for 21 of 22
references, so `rank.py`'s page-count comparison was vacuous. It now asks
`pdftext`, which already parses xref streams and the page tree, and keeps
the byte scan as the fallback.
Also: `rank.py` now fails loudly on font diagnostics the way `run.py` already
did; reports `within_0_5_x` / `within_0_5_y` separately (the combined figure
hid that horizontal placement is far better than vertical); pins `payload.date`
like `run.py`; and no longer labels every report
"origin/agent/mac-render-pipeline/unified @ 9aaec57" regardless of which
binary ran. `run.sh` defaults to this checkout's own render build for the same
reason.
Measured with flashtex-render sha256
8f635baf61a93af91e1e50ce72508e0e37e071f1abff799cc838b7f5e85f57ec (built from
this tree). Gates: amsmath corpus 59/59 within 0.5 bp; HW1 and HW2 both 3
pages, 0 errors, 0 overfull; `cargo test --release` on crates/render-pipeline
all green including tabular_oracle 106/106; both harness unittest suites green;
`git status` clean apart from these four files. No pixel comparison was
possible on this host: neither pdftoppm nor Ghostscript is installed.
Implementation-Agent: Claude Opus 5 (linux-primary parity-measurement lane)
Commit-Executor: Claude Opus 5 via Claude Code (Cursor quota not used)
Co-Authored-By: Claude Opus 5 <[email protected]>
Co-authored-by: GoKubar <[email protected]>
Claude-Session: https://claude.ai/code/session_01Xd5Hmwh5GHNTiAmHUJ1MZu
This was referenced Sep 14, 2026
GoKubar
marked this pull request as ready for review
September 14, 2026 10:10
d-q222
added a commit
that referenced
this pull request
Sep 14, 2026
…s and set diagnostics: false in flashtex-render's Wire Conflict in crates/render-pipeline/src/bin/flashtex-render.rs: main (#344) made --v2 honour --images; this branch added the Wire.diagnostics field. Resolved as Wire { images: self.images, device_color, diagnostics: false }. lib 97/0, compiler_diagnostic_forward 2/0, display_list_delta 3/0, cli_e2e 4/0. Claude-Session: https://claude.ai/code/session_012c9XLkHjePPGBuarrmE2mz
GoKubar
deleted the
agent/linux-parity-measurement/harness-project-root
branch
September 16, 2026 04:17
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 this is
Measurement-infrastructure only. Five bugs in
tools/visual-oracle/rank.pyandtools/real-world-corpus/run.pythat made the parity numbers describe theharness rather than the engine, plus one opt-in flag on
flashtex-rendertheyneed. No committed expected data is touched (
fixtures/,tests/,refs/are untouched;
git statusis clean apart from the five files in this diff).The five harness bugs
project_rootin the compile request\includegraphicsreturned the hard error "no project root was supplied with the request, so image files cannot be read" — 5 of 22 fixtures, and 5 of the 6 page-count mismatchesflashtex-renderhardcodedWire { images: false }for--v2flashtex-pdf-exact from-v2called without--project-root--tfm-dirsdefaulted topublic/lmalonejknappen/ec(256.tfm,ectt*included) andamsfonts/symbols: 102ec_metrics_unavailableacross 16 of 22 fixtures, and|dx| ≤ 0.5 bpfalls from 73.1% → 61.5%pdf_page_countbyte-scanned for/Type /Pagerank.py's page comparison was vacuousAlso here:
rank.pynow fails loudly on font diagnostics the wayrun.pyalready did; it reports
within_0_5_x/within_0_5_yseparately; it pinspayload.date; and neither it norrun.shlabels a reportorigin/agent/mac-render-pipeline/unified @ 9aaec57aregardless of whichbinary actually ran.
--imagesonflashtex-renderis off by default, so every existingcaller's
--v2bytes are unchanged.Proof that the request fix works
Same binary, same document, a scratch fixture holding a real 120×80 PNG:
All three parts of the chain are needed; only C actually puts the image on the
page.
What this does not fix
Supplying
project_rootdoes not make the corpus's five image fixtures render,because the corpus contains no image files at all — deliberately. Four
fixtures use graphicx
draftand two use the package'sdemooption, both ofwhich pdflatex resolves without reading any file. The engine honours neither
(
draftisGKey::Unsupported;demois a package optionrender-pipelinenever sees), so after this PR the diagnostic changes from blaming the harness
to naming the real gap:
Oracle measurements for whoever picks that up (pdfTeX 3.141592653-2.6-1.40.27,
\linewidth360 pt):demo: natural 150 pt × 100 pt; height stays 100 pt whatever the requestedwidth (
width=\linewidth→ 360 × 100,draft,width=0.6\textwidth→ 216.0022 × 100).draftwith a missing file: natural size 1 in × 1 in, aspect preserved(
draft,width=0.8\linewidth→ 288.0011 × 288.07976); a LaTeX warning, notan error, and the box carries a frame and the filename in
\ttfamily.Verification
flashtex-rendersha2568f635baf61a93af91e1e50ce72508e0e37e071f1abff799cc838b7f5e85f57ec, built from this tree.cargo test --releaseoncrates/render-pipeline: all green,tabular_oracle106/106.python3 -m unitteston bothtools/visual-oracle(8) andtools/real-world-corpus(6): green.pdftoppmnor Ghostscript is installed, so nothing here is a raster claim.🤖 Generated with Claude Code
https://claude.ai/code/session_01Xd5Hmwh5GHNTiAmHUJ1MZu