Skip to content

render-pipeline: paint \hrulefill and \dotfill leaders (#319), on top of #451 - #414

Merged
GoKubar merged 8 commits into
mainfrom
agent/daniel-parent/fill-leaders
Sep 14, 2026
Merged

GoKubar merged 8 commits into
mainfrom
agent/daniel-parent/fill-leaders

Conversation

@d-q222

@d-q222 d-q222 commented Sep 14, 2026 •

Copy link
Copy Markdown
Contributor

daniel-parent (Codex luna-max lane GH-319-LEADERS, reviewed by daniel-parent). Fixes #319: \hrulefill and \dotfill now paint their leaders. No longer stacked: #402 was superseded, and #451 (the vendor re-pin) merged. This branch merges current main and adds only the leader ink that #451 deliberately left unpainted.

What changes (on top of #451)

Evidence

Tests (b4ba7cde, merged with main)

  • --test fill_leaders: ok. 4 passed
  • render-pipeline --lib: ok. 137 passed; 0 failed; 2 ignored
  • The other leader and HFill tests are ok.
  • --test uline fails 2 tests in debug builds on clean main too: a par-leading debug_assert at adapter.rs:1086, reported on FT-003: dispatch to mac-claude-a — acknowledgement required #2. Release-mode gates pass, and it's unrelated to this diff.

Overlap check

🤖 Generated with Claude Code

https://claude.ai/code/session_012c9XLkHjePPGBuarrmE2mz

…ine::HFill leader, Diagnostic fields)

Re-pinning vendor/compiler past #320 and #389 (needed for #329 and the #277
labels/notes/help forwarding) breaks render-pipeline in five places: two
`Inline::HFill { span }` patterns (#320 added `leader`) and three struct
literals of the compiler `Diagnostic` in display.rs's forwarding test (#389 added
labels/notes/help). Both fixes are version-agnostic: `Inline::HFill { span, .. }`
and building the test diagnostics with `Diagnostic::error` then setting
`code`/`suggestion`. No behaviour change.

cargo test -p render-pipeline --lib: 107/0 against the current vendor pin
(e44d591) AND against a temporary, uncommitted copy of main's crates/compiler
in vendor/.

Implementation-Agent: Claude Code (daniel-parent, mac-m5pro-dq222)
Commit-Executor: Claude Code (daniel-parent)
Claude-Session: https://claude.ai/code/session_012c9XLkHjePPGBuarrmE2mz
What changed:
- Preserve compiler FillLeader on adapter HFill items and include it in adapter and incremental cache hashes.
- Add the minimal Inline::Underline fallback required by the current temporary compiler re-pin; it preserves content while the pipeline has no underline paint record.
- Temporary vendor/compiler re-pin is required for the passing check and is intentionally not committed.

What ran:
- CARGO_TARGET_DIR=/Users/dqi26/flashtex/target-leaders cargo check --manifest-path crates/render-pipeline/Cargo.toml (passed; existing warnings only).
- TeX Live 2026 pdflatex oracle: A=7.50002pt, B=7.08336pt, fill/rule width=185.41663pt, rule=0.4pt high/0pt deep; dot box=4.40002pt, period=2.77779pt, 42 boxes, leftover=0.6156pt split=0.3078pt, first/last origins=1.11891pt/181.51991pt.

Next step: retain leader records through typesetting and paint rule/dot display items.
Open questions: dot placement must be checked against the same TeX measurements.
Requires temporary re-pin of crates/render-pipeline/vendor/compiler before build/test.

Implementation-Agent: Codex GPT-5
Commit-Executor: local git
Lane-Owner: daniel-parent (mac-m5pro-dq222)
What changed:
- Added the fill_leaders integration reproduction and the first Rule/Dots display paint path.
- Added recursive BoxRec coverage for the new temporary compiler re-pin.

What was run:
- CARGO_TARGET_DIR=/Users/dqi26/flashtex/target-leaders cargo test --manifest-path crates/render-pipeline/Cargo.toml --test fill_leaders -- --nocapture
- Result: test result: FAILED. 2 passed; 2 failed; 0 ignored; 0 measured; 0 filtered out; finished in 0.02s
- Passing tests: leader_inside_text_keeps_both_sides, plain_hfill_has_no_leader_paint. Failing assertions: rule width 170.41700402617454pt vs 185.41663pt; dot text 36 periods vs 42.
- pdflatex TeX Live 2026 oracle: rule height/depth 0.4pt/0.0pt, rule/glue width 185.41663pt; dot glyph width 2.77779pt; leader box width 4.40002pt; 42 boxes; leftover 0.6156pt split 0.3078pt; first/last dot origins 1.11891pt/181.51991pt from glue start.
- The run uses the temporary compiler re-pin; vendor was verified clean immediately before commit and then re-synced.

Next step:
- Diagnose the 15pt line-width loss, then replace the reproduction assertions with the final geometry and base-item compatibility checks.

Open questions:
- Whether the loss is paragraph indentation or an unintended source-space glue.

Implementation-Agent: Codex GPT-5
Commit-Executor: local git
Lane-Owner: daniel-parent (mac-m5pro-dq222)
What changed:
- Matched the pipeline fixture to a 200pt article 10pt box with parindent 0pt, matching the pdflatex oracle.
- Added an exact serialized page-item baseline from the unmodified #402 control for plain \hfill.

What was run:
- CARGO_TARGET_DIR=/Users/dqi26/flashtex/target-leaders cargo test --manifest-path crates/render-pipeline/Cargo.toml --test fill_leaders -- --nocapture
- Result: test result: ok. 4 passed; 0 failed; 0 ignored; 0 measured; finished in 0.02s.
- #402 control: CARGO_TARGET_DIR=/Users/dqi26/flashtex/target-leaders/control cargo test --manifest-path crates/render-pipeline/Cargo.toml --test fill_probe -- --nocapture
- Result: test result: ok. 1 passed; 0 failed; 0 ignored; 0 measured; finished in 0.02s; the control page item list was captured before adding it to the test.
- The checks use the temporary compiler re-pin; vendor was verified clean immediately before commit and then re-synced.

Next step:
- Run the full render-pipeline suite against the temporary re-pin and classify any failures.

Open questions:
- None for the focused leader geometry; full-suite integration remains.

Implementation-Agent: Codex GPT-5
Commit-Executor: local git
Lane-Owner: daniel-parent (mac-m5pro-dq222)
What changed:
- Checkpoint only; the implementation and tests are in 11727e1, 025256c, and 4518430.
- The temporary vendor/compiler source was restored clean for the commit check and re-synced afterward; no vendor files are committed.

What was run:
- CARGO_TARGET_DIR=/Users/dqi26/flashtex/target-leaders cargo test --manifest-path crates/render-pipeline/Cargo.toml
- Unit result: test result: ok. 107 passed; 0 failed; 0 ignored; 0 measured; 0 filtered out; finished in 0.07s
- fill_leaders result: test result: ok. 4 passed; 0 failed; 0 ignored; 0 measured; 0 filtered out; finished in 0.04s
- Incremental result: test result: ok. 1 passed; 0 failed; 1 ignored; 0 measured; 0 filtered out; finished in 375.53s
- Doc-test result: test result: ok. 0 passed; 0 failed; 0 ignored; 0 measured; 0 filtered out; finished in 0.00s
- All other cargo test binaries reported `test result: ok`; no failures.
- The full command used the temporary compiler re-pin required by this lane.

Next step:
- Parent reviews and pushes this lane; no network is available here.

Open questions:
- The current top-level compiler also exposes Inline::Underline, so the pipeline contains a minimal content-preserving fallback needed for the temporary re-pin; it does not paint underline geometry.

Implementation-Agent: Codex GPT-5
Commit-Executor: local git
Lane-Owner: daniel-parent (mac-m5pro-dq222)
Removed the Inline::Underline arms Codex had added to adapter.rs (inline_span,
the items_cached hash with tag 18, and the items_from_inlines_styled content
arm). #329 (agent/daniel-parent/uline-gh312) already handles Underline there
and paints the rule; keeping both would conflict and duplicate. Against the
re-pinned vendor, the three matches need a wildcard until #329 lands, so
merge order is #402 -> re-pin + #329 -> this branch, which then drops the
wildcards in favour of #329's arms.

Tests (Codex, alternate CARGO_TARGET_DIR, dirty re-pinned vendor):
fill_leaders `test result: ok. 4 passed; 0 failed`; lib `test result: ok. 107 passed; 0 failed`.

Implementation-Agent: codex gpt-5.6-luna (max), wildcard comments by daniel-parent
Commit-Executor: daniel-parent (Claude Code), direct git (Codex sandbox could not write .git on resume)
Lane-Owner: daniel-parent (mac-m5pro-dq222)

Claude-Session: https://claude.ai/code/session_012c9XLkHjePPGBuarrmE2mz
@d-q222
d-q222 changed the base branch from agent/daniel-parent/repin-readiness to main September 14, 2026 16:57
@d-q222

d-q222 commented Sep 14, 2026

Copy link
Copy Markdown
Contributor Author

Retargeted to main so this can't auto-close when #402's branch is deleted after its squash merge (that's what happened to #310). Until #402 merges, the diff also shows #402's two small adapter/display hunks.

What changed:
- Merged origin/main while preserving #451 HFill leavevmode and trailing kern handling, Underline and Diagnostic integration, current-main listings/Lap support, and the faa7d48 vendor pin.
- Carried FillLeader through Item::HFill and incremental hashing, then painted a 0.4pt hrulefill rule and centered dotfill glyph boxes after line breaking.
- Removed the unsupported_inline warning for painted leaders; the plain hfill item list remains unchanged.

What was run:
CARGO_TARGET_DIR=/Users/dqi26/flashtex/target-leaders cargo test --manifest-path crates/render-pipeline/Cargo.toml --test fill_leaders
test result: ok. 4 passed; 0 failed; 0 ignored; 0 measured; 0 filtered out; finished in 0.02s
CARGO_TARGET_DIR=/Users/dqi26/flashtex/target-leaders cargo test --manifest-path crates/render-pipeline/Cargo.toml --lib
test result: ok. 137 passed; 0 failed; 2 ignored; 0 measured; 0 filtered out; finished in 0.10s
CARGO_TARGET_DIR=/Users/dqi26/flashtex/target-leaders cargo test --manifest-path crates/render-pipeline/Cargo.toml --test heading_macros
test result: ok. 4 passed; 0 failed; 0 ignored; 0 measured; 0 filtered out; finished in 0.10s
CARGO_TARGET_DIR=/Users/dqi26/flashtex/target-leaders cargo test --manifest-path crates/compiler/Cargo.toml --test rule_fills
test result: ok. 5 passed; 0 failed; 0 ignored; 0 measured; 0 filtered out; finished in 0.01s
CARGO_TARGET_DIR=/Users/dqi26/flashtex/target-leaders cargo test --manifest-path crates/render-pipeline/Cargo.toml --test uline
test result: FAILED. 0 passed; 2 failed; 0 ignored; 0 measured; 0 filtered out; finished in 0.01s
Visual oracle: min-hrulefill 18/18 aligned, max |dx| 0.554bp, 0 reflowed; enumitem-worksheet 3 pages, 0 errors and 5 warnings.
The vendored rule_fills target is blocked by its existing edit_latency_bench.rs fixture include path; vendor was not modified.

Next step:
- Push agent/daniel-parent/fill-leaders; if network remains unavailable, the lane owner pushes it.

Implementation-Agent: codex gpt-5.6-luna (max)
Commit-Executor: codex (this session)
Lane-Owner: daniel-parent (mac-m5pro-dq222)
What changed:
- Merged current origin/main while preserving #451 HFill leavevmode and trailing kern handling, Underline and Diagnostic integration, current-main listings/Lap support, and the faa7d48 vendor pin.
- Carried FillLeader through Item::HFill and incremental hashing, then painted a 0.4pt hrulefill rule and centered dotfill glyph boxes after line breaking.
- Removed the unsupported_inline warning for painted leaders; the plain hfill item list remains unchanged.

What was run:
CARGO_TARGET_DIR=/Users/dqi26/flashtex/target-leaders cargo test --manifest-path crates/render-pipeline/Cargo.toml --test fill_leaders
test result: ok. 4 passed; 0 failed; 0 ignored; 0 measured; 0 filtered out; finished in 0.03s
CARGO_TARGET_DIR=/Users/dqi26/flashtex/target-leaders cargo test --manifest-path crates/render-pipeline/Cargo.toml --lib
test result: ok. 137 passed; 0 failed; 2 ignored; 0 measured; 0 filtered out; finished in 0.11s
CARGO_TARGET_DIR=/Users/dqi26/flashtex/target-leaders cargo test --manifest-path crates/render-pipeline/Cargo.toml --test heading_macros
test result: ok. 4 passed; 0 failed; 0 ignored; 0 measured; 0 filtered out; finished in 0.10s
CARGO_TARGET_DIR=/Users/dqi26/flashtex/target-leaders cargo test --manifest-path crates/compiler/Cargo.toml --test rule_fills
test result: ok. 5 passed; 0 failed; 0 ignored; 0 measured; 0 filtered out; finished in 0.01s
CARGO_TARGET_DIR=/Users/dqi26/flashtex/target-leaders cargo test --manifest-path crates/render-pipeline/Cargo.toml --test uline
test result: FAILED. 0 passed; 2 failed; 0 ignored; 0 measured; 0 filtered out; finished in 0.01s
Visual oracle: min-hrulefill 18/18 aligned, max |dx| 0.554bp, 0 reflowed; enumitem-worksheet 3 pages, 0 errors and 5 warnings.
The vendored rule_fills target is blocked by its existing edit_latency_bench.rs fixture include path; vendor was not modified.

Next step:
- Push agent/daniel-parent/fill-leaders; if network remains unavailable, the lane owner pushes it.

Implementation-Agent: codex gpt-5.6-luna (max)
Commit-Executor: codex (this session)
Lane-Owner: daniel-parent (mac-m5pro-dq222)
@d-q222 d-q222 changed the title render-pipeline: paint \hrulefill and \dotfill leaders, pdflatex-matched (#319; after re-pin) render-pipeline: paint \hrulefill and \dotfill leaders (#319), on top of #451 Sep 14, 2026
@GoKubar

GoKubar commented Sep 14, 2026

Copy link
Copy Markdown
Contributor

Integration lane check (linux-primary), answering the question of whether this overlaps #451 or completes it:

It completes #451; it does not duplicate it.

#451 landed the glue and deliberately left the leader ink unpainted, saying so in a typed unsupported_inline warning and explaining why in adapter.rs:

"the resolved width of one glue is not reported by flashtex-paragraph-layout (only Line::ratio, Line::set_width and box positions), so painting them is its own change rather than a re-pin's"

This PR is exactly that change:

  • removes the Inline::HFill arm from unsupported_inlines (the warning retires because the thing it warned about now happens);
  • threads the leader through the item model — Item::HFill { fill } becomes Item::HFill { fill, leader } — into a new BoxRec::Leader;
  • solves the blocker vendor: re-pin render-pipeline's compiler mirror to main faa7d484, and catch the pipeline up to it #451 named, deriving the resolved glue width after line breaking via line_stretch_order / line_glue_width from Line::ratio and the glue order;
  • paints real ink in append_leaders — display::Item::Rule for \hrulefill, glyph dots via dots_item for \dotfill.

Its merge-base diff against current main is clean — 6 files, no vendor/*, no apps/mac/ — and it merges without conflict.

Not merged today because it is still marked draft. I am treating draft as the author's not-ready signal rather than overriding it. If that is just a leftover flag, mark it ready and it should go straight in.

@d-q222
d-q222 marked this pull request as ready for review September 14, 2026 22:36
@d-q222

d-q222 commented Sep 14, 2026

Copy link
Copy Markdown
Contributor Author

daniel-parent: ready. Thanks for the integration check; draft was just the leftover flag while my own review ran.

The independent review raised two points:

  1. "Dots should align to the outer box (\leaders), not centre in the glue": rejected. latex.ltx:644-647 defines \dotfill as \leavevmode\cleaders\hb@[email protected]{\hss.\hss}\hfill\kern\z@. \cleaders centres, so the pdflatex-pinned first-dot offset of 1.11891 pt is correct. My review brief wrongly said "like \leaders". (\hrulefill is \leaders\hrule, where alignment is moot for a rule.)
  2. Dots ignore inline font style: accepted as a known limitation, with a follow-up. {\Large A\dotfill B} shapes the dots in the paragraph's default font and size (typeset.rs:2090-2110), so the dot glyph and the 0.44 em pitch should follow the current style. It only shows with a styled \dotfill, and the rules are unaffected. I'll take it as a small follow-up lane after this merges.

The review otherwise confirmed:

@GoKubar
GoKubar merged commit 62a2a12 into main Sep 14, 2026
21 checks passed
@GoKubar
GoKubar deleted the agent/daniel-parent/fill-leaders branch September 16, 2026 04:16
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.

compiler: \hrulefill and \dotfill are unsupported (rule/dot leaders in an \hfill)

2 participants