Skip to content

flashtex build: re-pin vendor/pdf and report failed on output write failure (#779) - #785

Merged
d-q222 merged 2 commits into
mainfrom
fix/cli-color-vendor-pdf
Sep 17, 2026
Merged

d-q222 merged 2 commits into
mainfrom
fix/cli-color-vendor-pdf

Conversation

@d-q222

@d-q222 d-q222 commented Sep 17, 2026

Copy link
Copy Markdown
Contributor

Fixes #779.

Problem

With a colour like \textcolor[rgb]{0.1,0.4,0.8}, flashtex build wrote no PDF but still printed ok and exited 0.

There were two causes:

  1. Stale vendored writer. render-pipeline/vendor/pdf was an old snapshot whose exact writer rejected those colour components. Main's crates/pdf already handles them.
  2. Status ignored write failures. The CLI never downgraded its status when an output write failed.

Changes

  • dfab5fd: re-pins vendor/pdf from git archive origin/main:crates/pdf. Apart from PIN, it is byte-identical to main's crate. The VENDORING.md row is updated.

  • 837298e: build now sets the status to failed when the PDF or --v2 write fails, so exit code 1, the stderr summary and the --json status all say failed. It adds three tests:

    • a_pdf_write_failure_is_not_reported_as_ok
    • a_v2_write_failure_is_not_reported_as_ok, where the PDF still writes but the --v2 write fails
    • an rgb \textcolor regression in xcolor_oracle.rs

    Both CLI tests fail with the main.rs change reverted and pass with it.

Perf digests

Only the export.pdf digest changed. It was re-recorded for four cases with merge_digests.py --case: math-sheet, ps-calculus, twelvept-plain and math-heavy. The layout digests are unchanged.

The PDF writer's bytes changed with the re-pin. Rasters of the three fixture cases are identical at 100 dpi. math-heavy is a generated case and wasn't rasterised.

Review

Fresh read-only Codex review (gpt-5.6-luna, max effort), run twice:

  • First pass: changes required. The CLI test assertions were too loose.
  • Second pass, after tightening: approve, no material findings.

Attribution

  • Implemented by daniel-parent (Claude Opus 5, Commander session).
  • Reviewed by Codex gpt-5.6-luna.

🤖 Generated with Claude Code

d-q222 and others added 2 commits September 17, 2026 00:51
The vendored pdf snapshot predated the exact writer's colour-space
fixes, so flashtex build still rejected rgb colour components that
main's crates/pdf accepts. Copied with git archive origin/main:crates/pdf;
identical to main except PIN.

Implementation-Agent: daniel-parent (Claude Opus 5, Commander session)
Commit-Executor: daniel-parent
Co-authored-by: Claude Opus 5 <[email protected]>
Claude-Session: https://claude.ai/code/session_012c9XLkHjePPGBuarrmE2mz
A render that succeeded but whose PDF or --v2 write failed printed ok
and exited 0. The status is now failed, so the summary line, --json and
exit code 1 agree with what is on disk. Regression tests cover a PDF
write failure, a --v2-only write failure, and the rgb \textcolor case.

Perf digests re-recorded for math-sheet, ps-calculus, twelvept-plain and
math-heavy (export.pdf only): the PDF writer bytes changed with the
re-pin; rasters of the three fixture cases are identical at 100 dpi.

Reviewed: fresh read-only Codex gpt-5.6-luna max, APPROVE after test
tightening (exit 1, failed status in summary and JSON).

Implementation-Agent: daniel-parent (Claude Opus 5, Commander session)
Commit-Executor: daniel-parent
Co-authored-by: Claude Opus 5 <[email protected]>
Claude-Session: https://claude.ai/code/session_012c9XLkHjePPGBuarrmE2mz
@d-q222
d-q222 merged commit f0cc73e into main Sep 17, 2026
21 of 22 checks passed
ItsAkilesh pushed a commit to ItsAkilesh/flashtex that referenced this pull request Sep 18, 2026
…twelvept-plain in CI

twelvept-plain: all digests moved with flash-tex#741 (df95d75), which fixed
adjacent-list \addvspace (max, not sum; vertical mode after
\@endparenv), verified by the pdflatex oracle tests in
render-pipeline/tests/adjacent_list_skips.rs. Bisected: the baseline
matched through flash-tex#719 and flipped at flash-tex#741. CI never caught it because
the case was not in perf.yml's list; it is the only fixture with
adjacent same-level lists, so it is added.

tikz-heavy: export.pdf now succeeds after flash-tex#785's vendor/pdf re-pin (gs
support for pgf constant alpha); qpdf --check clean, real vector paths.
The baseline gains that digest (the gate never flags a digest missing
from the baseline).

Full-corpus gate: OUTPUT CHANGED on exactly the 10 twelvept-plain
digests before; OK (549 metrics, no output change) after.

Implementation-Agent: claude-opus-5 subagent of daniel-parent
Commit-Executor: daniel-parent
Co-authored-by: Claude Opus 5 <[email protected]>
Claude-Session: https://claude.ai/code/session_012c9XLkHjePPGBuarrmE2mz
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.

flashtex build: an rgb colour like \textcolor[rgb]{0.1,0.4,0.8} writes no PDF, yet reports ok

1 participant