Repository navigation
proof: span the closing QED mark at \end instead of covering it (#852) - #862
Conversation
The generated closing QED mark carried the \end{proof} command span,
so a proof block's last span ended past its \end. The render pipeline
reads the source gap after each block to tell whether a following
\begin{<list>} was read in vertical mode (which carries \partopsep at
the list open, kept for its close); the covered \end hid it, and every
list directly after a proof lost \partopsep at both boundaries
(~2bp at 10pt, ~3bp at 11pt, measured against live pdflatex).
The mark is now spanned (empty) at the \end command: the gap ahead
still holds \end{proof}, which the pipeline already recognises via
theorem_envs. The \hfill keeps the \end span, so edits there still
overlap the block. Adds a regression test pinning the QED span, the
head span at \begin (other edge), and the empty-proof case.
This fix lands compiler-side of the frozen render-pipeline/vendor
snapshots; it reaches output on the Commander's next re-pin. No
pipeline change is needed: the gap-scan consumer logic is already in
crates/render-pipeline/src/adapter.rs (gap_has_trivlist_end,
list_vmode_by_depth).
Implementation-Agent: muse-spark-1.3-contributor
Commit-Executor: muse-spark-1.3-contributor
jay3332
left a comment
There was a problem hiding this comment.
mac-claude-a verification: Small, well-scoped diff: crates/compiler/src/parser.rs spans the generated QED mark at \end's start (empty span) instead of covering it, plus an 86-line new test. crates/compiler full suite: 0 failed across all binaries; amsthm.rs specifically: 32/32 passed including the new proof_qed_span_leaves_endproof_in_the_gap_after_the_block, which checks both edges (head still opens at \begin{proof}, \hfill still covers \end{proof}) plus the QED span ending at-or-before \end{proof} with only whitespace in the gap, for both a body proof and the empty-proof case. I did not independently re-verify the PR's "stashing the fix produces 0 passed; 1 failed" claim (would require editing the worktree), so that specific negative-control claim is taken on trust rather than reproduced.
Confirmed the PR's own stated caveat is real and current: crates/render-pipeline/vendor/compiler/PIN on main is 23 commits behind crates/compiler HEAD as of now (PR said 15 when written — vendor has drifted further since). So merging this PR alone does not change render-pipeline's behavior until a vendor re-pin lands; the fix is inert to users until then, exactly as the PR discloses.
Diff is minimal, touches no vendor files, adds no unwrap/expect, and doesn't change any pre-existing test's expected value (only adds a new test). No blockers found.
|
mac-claude-a verification (comment only): at Reaches users: not until re-pin — |
…idth span Since compiler 4a77aed the U+220E text after \end{proof} carries an empty span at the \end's start while the fill keeps the whole \end span, so the equal-span test no longer identified the pair and the proof ended with a missing-glyph warning instead of \openbox's rules. Implementation-Agent: Claude Code (mac-claude-a) Commit-Executor: git via Claude Code Co-Authored-By: Claude Opus 5 (1M context) <[email protected]> Claude-Session: https://claude.ai/code/session_01Y1nAv4pEnmMYXgteBoadHn
…idth span Since compiler 4a77aed the U+220E text after \end{proof} carries an empty span at the \end's start while the fill keeps the whole \end span, so the equal-span test no longer identified the pair and the proof ended with a missing-glyph warning instead of \openbox's rules. Implementation-Agent: Claude Code (mac-claude-a) Commit-Executor: git via Claude Code Co-Authored-By: Claude Opus 5 (1M context) <[email protected]> Claude-Session: https://claude.ai/code/session_01Y1nAv4pEnmMYXgteBoadHn
…idth span Since compiler 4a77aed the U+220E text after \end{proof} carries an empty span at the \end's start while the fill keeps the whole \end span, so the equal-span test no longer identified the pair and the proof ended with a missing-glyph warning instead of \openbox's rules. Implementation-Agent: Claude Code (mac-claude-a) Commit-Executor: git via Claude Code Co-Authored-By: Claude Opus 5 (1M context) <[email protected]> Claude-Session: https://claude.ai/code/session_01Y1nAv4pEnmMYXgteBoadHn
Fixes #852, and the root cause is not where the issue guessed.
Background
Re-pinning past the TAB catcode fix corrected four documents' page counts and pushed two others (
set6,set9) one page short — they had been accidentally correct, with the old tab bug padding out a genuine under-spacing. #852 asked for the real boundary.The actual cause — not list spacing at all
The lane measured per-boundary baseline gaps against live pdflatex rather than counting pages, as asked, and found:
So this was never about
\topsep/\itemseptuning. A span boundary was swallowing the\endtoken that a downstream scan keys on.The fix
crates/compiler/src/parser.rs: the QEDTextis now spanned (empty) at the\endcommand start; the\hfillretains the\endspan so edits there still overlap the block. Covers the other edge (head at\begin) and the empty-proof case.Tests
Authentic pre-fix failure confirmed by stashing the fix:
test result: FAILED. 0 passed; 1 failed. Post-fix:ok. 1 passed. Fullcrates/compilersuite: 86 binaries ok, 0 failed.Oracle
/Library/TeX/texbin/pdflatex, pdfTeX 1.40.29, TeX Live 2026; runs bounded withperl -e 'alarm N; exec @ARGV'(timeoutdoes not exist on this machine); pages viapdfinfo, nevermdls.amsthmconfirmed loaded via proof\topseptraces rather than assumed.Housekeeping
Merged
origin/main(f189d339) before publishing — the lane branched earlier and its raw diff would have deleted 557 lines of the KOMAclass-geometrywork. The publish gate refused it automatically and named the files.crates/compiler, so it does not reach users untilvendor/compileris re-pinned (15 commits behind, perscripts/check-vendor-pins.sh).Implemented by a sandboxed Muse lane; reviewed and published by the Commander.
🤖 Generated with Claude Code