Repository navigation
Conversation
…h copy
`apps/mac/scripts/texmf-acceptance.sh` counted missing-metric diagnostics with
a hand-written `MISSING_CODES='tfm_missing|required_metrics_unavailable|
font_unavailable'`. typeset.rs also emits `ec_metrics_unavailable` (:634),
`font_outline_substituted` (:616) and `math_font_unavailable` (:757), none of
them in that list -- so a run emitting only those printed "0 missing-metric
diagnostics = ok". That is the acceptance gate for whether the *shipped* app
finds its bundled font metrics, and it could not fail for three of the seven
ways it can go wrong.
This was the third hand-maintained copy of the list, after faces-acceptance.py
(six codes) and tools/visual-oracle/fontenv.py (a different six, because it
asks a different question). So rather than fixing the third copy:
crates/render-pipeline/src/fontdiag.rs is now the single source of truth. Each
code carries two flags, because the harnesses genuinely ask two questions:
substitution the document did not get a face or metrics it asked for --
what the font-discovery and packaging gates count.
geometry_void positions are no longer pdflatex's reference geometry -- what
the position oracles must refuse to score.
`font_outline_substituted` is exactly why one flag was not enough: the outline
differs but the metrics, and so the positions, are still the reference ones.
`flashtex-render --font-diagnostics json` writes
crates/render-pipeline/supported/font-diagnostics.json, following the
supported-latex.json idiom. scripts/font_diagnostics.py reads it, and all three
consumers now derive their list from it -- shell via `--format regex`, Python
via `codes(view)`. Each fails loudly if it cannot read the manifest: a gate that
cannot state its own criteria must stop, not count zero.
crates/render-pipeline/tests/fontdiag.rs is the gate that makes it a real source
of truth. Beyond checking the generated file is current, it scans src/ for every
`Diagnostic::warning|error|note("code"` literal (truncating each file at its
trailing `#[cfg(test)]`, so unit-test fixtures are not mistaken for emissions)
and fails if any emitted code is classified in neither table. A new code now
forces a decision instead of silently landing outside every gate.
The `removed:` sub-test is also fixed, and this one is new. It deleted
ec-lmr10.tfm and asserted `n > 0` plus `grep ec-lmr10.tfm`. Measured on an
intact tree: the intact run ALREADY emits `ec_metrics_unavailable` whose message
reads "... ec-lmr10.tfm used", so the grep half never discriminated; and once
that code correctly counts as missing, `n > 0` holds without the deletion too --
the widened list would have turned this into another check that cannot fail. It
is now differential: the deletion must produce a `tfm_missing` naming
ec-lmr10.tfm that the intact env-direct run does not. Measured on Linux, that is
exactly what the deletion produces and the intact run does not.
faces-acceptance.py gains `math_metrics_opentype` (its copy omitted it);
fontenv.py's two sets are unchanged in content, only in provenance.
NOTE FOR REVIEW: texmf-acceptance.sh and faces-acceptance.py are macOS-only
(sandbox-exec/ditto/shasum) and were not executed here. Widening the counted set
can make a bundle that previously passed now fail. That is the gate working, but
it needs a Mac run to confirm what the real bundle emits.
Demonstrated failing:
* injecting `Diagnostic::warning("lm_math_subset_missing", ...)` into typeset.rs
fails every_emitted_code_is_classified, naming the code and its file.
* editing the checked-in JSON fails generated_json_is_current.
* flipping ec_metrics_unavailable back out of the substitution set -- the
original bug -- fails the_two_views_are_what_the_gates_need.
* against a compile_result carrying ec_metrics_unavailable +
font_outline_substituted + math_font_unavailable, the old three-code list
counts 0 ("ok"); the derived list counts 3 (FAIL).
* the new differential removed: check rejects both "deletion produced no new
evidence" and "the intact bundle already reports it", where the old shape
said ok for all three cases.
Co-Authored-By: Claude Opus 5 <[email protected]>
Claude-Session: https://claude.ai/code/session_01Xd5Hmwh5GHNTiAmHUJ1MZu
…agnostics # Conflicts: # crates/render-pipeline/src/bin/flashtex-render.rs
float_footnote_unplaced and table_limitation are new on main since this PR was written; classified both as non-font (layout/color limitations, not font-discovery failures) and regenerated font-diagnostics.json. Implementation-Agent: daniel-muse-lead
d-q222
added a commit
that referenced
this pull request
Sep 16, 2026
Contributor
Author
|
Closed under the old-engine freeze (DESIGN.md D13): this is old-path feature or hand-port work, and the old engine retires at the P5 switch-over. The branch is kept; reopen it if it turns out to be a critical user-facing fix. — kabir-claude (Commander), nightly review 2026-09-30 |
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.
Closes the audit's #2 (issue #2, comment 5657695144), and fixes a related check found while doing it.
The hole
apps/mac/scripts/texmf-acceptance.sh:143counted missing-metric diagnostics with a hand-written list:MISSING_CODES='tfm_missing|required_metrics_unavailable|font_unavailable'typeset.rsalso emitsec_metrics_unavailable(:634),font_outline_substituted(:616) andmath_font_unavailable(:757). A run emitting only those printed "0 missing-metric diagnostics = ok" — on the acceptance gate for whether the shipped app finds its bundled font metrics.This was the third hand-maintained copy, after
faces-acceptance.py(six codes) andtools/visual-oracle/fontenv.py(a different six). So rather than fixing the third copy and waiting for a fourth:One source of truth, two questions
crates/render-pipeline/src/fontdiag.rsis now the table. Each code carries two flags, because the harnesses genuinely ask different questions — this is why the three copies disagreed rather than merely drifted:substitutiongeometry_voidfont_outline_substitutedis exactly why one flag was not enough: the outline differs but the metrics — and so the positions — are still the reference ones.flashtex-render --font-diagnostics jsonwritescrates/render-pipeline/supported/font-diagnostics.json, following the existingsupported-latex.jsonidiom.scripts/font_diagnostics.pyreads it; all three consumers derive from it (shell via--format regex, Python viacodes(view)). Each fails loudly if it cannot read the manifest — a gate that cannot state its own criteria must stop, not count zero.The gate that makes it real
crates/render-pipeline/tests/fontdiag.rsdoes more than check the generated file is current. It scanssrc/for everyDiagnostic::warning|error|note("code"literal (truncating each file at its trailing#[cfg(test)], so unit-test fixtures are not mistaken for emissions) and fails if any emitted code is classified in neither table. A new code now forces a decision instead of silently landing outside every gate. It caught one of my own mistakes while I was writing it.Bonus: the
removed:sub-test could not fail eitherThe audit asked whether
removed:(deleteec-lmr10.tfm, expectn>0) was passing incidentally. Measured on an intact tree, the answer is more interesting than the guess:ec_metrics_unavailablewhose message reads "… ec-lmr10.tfm used" — so thegrep -q 'ec-lmr10.tfm'half never discriminated.tfm_missingnamingec-lmr10.tfm, which the intact run does not produce. Under the old list that madengo 0→1, so the sub-test was sound — the audit's guess that it "fails for the wrong reason" was wrong.ec_metrics_unavailablecorrectly counts,n > 0holds without the deletion. My widening would have turned this into another check that cannot fail.So it is now differential: the deletion must produce a
tfm_missingnamingec-lmr10.tfmthat the intactenv-directrun does not.texmf-acceptance.shandfaces-acceptance.pyare macOS-only (sandbox-exec/ditto/shasum) and were not executed here. Widening the counted set can make a bundle that previously passed now fail. That is the gate working, not a regression — but someone needs to run it on a Mac to see what the real bundle emits. My Linux probe suggestsec_metrics_unavailablemay fire on theenv-directroute; if it does, that is a real packaging gap this gate was previously scoring as clean.faces-acceptance.pyalso gainsmath_metrics_opentype(its copy omitted it).fontenv.py's two sets are unchanged in content, only in provenance.Demonstrated failing
Diagnostic::warning("lm_math_subset_missing", …)added to typeset.rsevery_emitted_code_is_classifiedFAILS, naming the code and its filegenerated_json_is_currentFAILSec_metrics_unavailableflipped back out of the substitution set (the original bug)the_two_views_are_what_the_gates_needFAILSAgainst a
compile_resultcarryingec_metrics_unavailable+font_outline_substituted+math_font_unavailable:And the new differential
removed:check, where the old shape saidokfor all three rows:🤖 Generated with Claude Code
https://claude.ai/code/session_01Xd5Hmwh5GHNTiAmHUJ1MZu