Skip to content

render-pipeline: siunitx pdflatex oracle (35/39; needs vendor/compiler re-pin from c93e58ca) - #168

Merged
jay3332 merged 1 commit into
mainfrom
agent/kabir-claude/siunitx-pipeline
Sep 13, 2026
Merged

jay3332 merged 1 commit into
mainfrom
agent/kabir-claude/siunitx-pipeline

Conversation

@GoKubar

@GoKubar GoKubar commented Sep 13, 2026

Copy link
Copy Markdown
Contributor

What

A test-only pdflatex oracle for siunitx in the render pipeline. The compiler half is #163; there are no render-pipeline source changes.

  • fixtures/siunitx: 39 fixtures covering \num formats (grouping, decimals, exponents, uncertainty, signs), every unit family, per-modes, \qty in text/math/display, lists and ranges, \sisetup and package options, \ang, µ and Ω, 10/11/12pt, bold/italic text and headings. reference/*.json comes from MacTeX pdflatex via oracle.py (oracle only; cargo never runs TeX). oracle.py reuses font-families' PDF reader and also keeps each segment's end position.
  • tests/siunitx_oracle.rs compares the display list glyph by glyph: text, Latin Modern design, page, x and baseline within 0.5 bp. Segments break at gaps, and pdflatex segments of one design are joined.

Dependency

Needs vendor/compiler re-pinned to agent/kabir-claude/siunitx c93e58c (#163). Against main's pin every fixture fails, because siunitx is unimplemented there.

Result (with that compiler copied into vendor locally, not committed)

35/39 exact; most within 0.006 bp, units within 0.43 bp. The 4 listed in PENDING are pipeline gaps, not siunitx:

  • 34 (justified paragraph): pdflatex stretches the \medmuskip glue around \times. Math-glue stretch in line justification is math-layout: TeX stretch/shrink on math glue and hpack-exact pack_to (display-math blocker 1 of #146) #148.
  • 37 (\ang minutes/seconds): \prime is drawn at Latin Modern Math's 2.169pt instead of cmsy7's 2.306pt.
  • 38 (power on a one-letter unit, e.g. K^{-1}): the pipeline has no upright fam0 Latin math character (\mathrm), so the unit is a box and its script sits 0.78 bp high.
  • 39 (siunitx in a \section): a formula whose span starts at a command is set at body size, not heading size. Headings with superscripted math also sit 1.66 bp high, including plain $3\times 10^{8}$.

With the re-pin, cargo test --release has no failures, and HW1, HW2 and the 9 real-world corpus documents are byte-identical in v2 JSON and PDF.

🤖 Generated with Claude Code

https://claude.ai/code/session_01Xd5Hmwh5GHNTiAmHUJ1MZu

… reasons)

39 fixtures (fixtures/siunitx/*.tex, references from MacTeX pdflatex by
oracle.py, test-only) compared glyph by glyph against the display list:
text, Latin Modern design, x and baseline within 0.5 bp. Covers \num
formats, every unit family, per-modes, \qty in text, math and display,
lists, ranges, \sisetup, package options, \ang, 10/11/12pt, bold text
and headings.

Needs vendor/compiler re-pinned to agent/kabir-claude/siunitx c93e58c
(crates/compiler/src/siunitx.rs); against main's pin the fixtures fail.

Pending, pipeline gaps rather than siunitx: 34 math-glue stretch in
justified lines (#148), 37 \prime metrics (Latin Modern Math instead of
cmsy7), 38 script on a one-letter unit (no upright fam0 Latin math
character), 39 heading math size and baseline.

Implementation-Agent: Claude Opus 5 (subagent kabir-claude siunitx, mac-m5pro-kabir)
Commit-Executor: Claude Code direct Git
Co-Authored-By: Claude Opus 5 <[email protected]>
Claude-Session: https://claude.ai/code/session_01Xd5Hmwh5GHNTiAmHUJ1MZu
GoKubar added a commit that referenced this pull request Sep 13, 2026
No conflicts: #168 is an oracle and its fixtures, with no pipeline source
changes. The compiler side it needs (siunitx) came in with #159 in stage 1,
so the vendored compiler already satisfies it.

One change was needed. #168 carries a `PENDING` list of fixtures that must
*still* differ from pdfLaTeX, each naming the work it waits on, so the entry
is removed when that work lands. `39-heading.tex` waited on heading math --
"the pipeline sets a `$...$` formula in \section at the heading size but an
Inline::Math whose span starts at a command at the body size". That landed on
this branch with #151, so the fixture now matches and the test failed with
"39-heading.tex now matches: remove it from PENDING", exactly as designed.
Removed; the oracle passes.

siunitx is now 36/39 exact against the committed MacTeX references, up from
the 35/39 the PR reports. The three still pending are unrelated to siunitx
and name their own dependencies: 34-paragraph (math glue stretch in line
justification, PR #148), 37-ang-minutes (`\prime` drawn from Latin Modern
Math at 2.169pt where pdfLaTeX's cmsy7 prime is 2.306pt), 38-power-on-letter
(no upright fam0 Latin math character, so a power on a one-letter unit sits
0.78 bp high).

`cargo test --release` in render-pipeline: the same 11 known failures, no
more. Zero font diagnostics on every gate.

Implementation-Agent: Claude Opus 5 (subagent kabir-claude integration, nixos-pc-kabir)
Commit-Executor: Claude Code direct Git
Co-Authored-By: Claude Opus 5 <[email protected]>
Claude-Session: https://claude.ai/code/session_01Xd5Hmwh5GHNTiAmHUJ1MZu
GoKubar added a commit that referenced this pull request Sep 13, 2026
…#167 #168), and why #162 needs a lane

Records this session in the merge log: the oracle-harness bug that was
falsifying gate numbers for every lane, the parallel silent-skip in
`cargo test`, the four stage-3 merges with the techniques each needed, and
the measured reason #162 is a reconstruction rather than a merge.

Also records the control that separates pre-existing failures from this
session's work: eight of the eleven render-pipeline failures reproduce on
unmerged origin/main in this worktree, and the other three have no baseline
on a non-MacTeX host. page_frame_oracle, which the previous session's list
did not mention, is measured here as pre-existing.

Implementation-Agent: Claude Opus 5 (subagent kabir-claude integration, nixos-pc-kabir)
Commit-Executor: Claude Code direct Git
Co-Authored-By: Claude Opus 5 <[email protected]>
Claude-Session: https://claude.ai/code/session_01Xd5Hmwh5GHNTiAmHUJ1MZu
@jay3332
jay3332 merged commit 186ce0c into main Sep 13, 2026
12 of 18 checks passed
@GoKubar
GoKubar deleted the agent/kabir-claude/siunitx-pipeline branch September 13, 2026 18:12
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.

2 participants