Repository navigation
Conversation
…(rebuild of #159 on main) #159 has never landed: integrator-12 aborted it (`equation_counter`/`figure_counter` fields that would desync from `self.counters` after #155), and integrator-13 merged it only onto the unmerged integration branch. `origin/main` still has no pseudocode support at all, which is what actually blocks #162. This rebuilds it against main's current compiler. - New `crate::algorithmic`: the package model read from the source bytes (algorithmic.sty, algorithm.sty, algorithmicx.sty, algpseudocode.sty, float.sty). `setup()` reads package options, keyword renames, `\algorithmicindent`, `\alglinenumber`, `\algsetup`, `\floatname` and `\item[..]` label commands; `scan()` finds `algorithm` floats and bare `algorithmic` environments; `parse_algorithmic()` turns each statement into a `Line` (item kind, line counter, block depth, bold-keyword/source/comment pieces). - `parser/algorithmic.rs`: `\begin{algorithmic}` becomes one flush-left paragraph per statement; `algorithm`/`algorithm*` behave like `figure` with `Algorithm N` captions; `\algnewcommand`/`\algrenewcommand`/`\algsetup`/`\floatname` are consumed. - Expansion pass declares the keyword macros as host commands, so `\renewcommand{\algorithmicrequire}` is no longer "Command undefined". - Inventory regenerated (`supported-latex.json`, `coverage.md`, `docs/user/compiler.md`). Reconciled against main rather than merged: - The float counter is a private `P::algorithm_counter`, not an `xref::Counters` entry: it is algorithm.sty's own `\newfloat` counter, not a class body counter. #159's `equation_counter`/`figure_counter` fields are gone; main's `self.counters.step("figure")` path is untouched. - `\caption` dispatches on the enclosing environment: `algorithm`/`algorithm*` first, then main's existing figure branch unchanged. - `parser/algorithmic.rs` builds `Block::Styled` with #147's `lists`/`line_break_before`. - `package_matches_layout` gains the four pseudocode packages. `crates/compiler`: `cargo test --release` green, 0 failed (including the HW1/HW2 gates and the regenerated supported-LaTeX drift gate). `cargo fmt`/`cargo clippy` are not installed on this host and were not run. Implementation-Agent: engine-engineer (algorithm-floats lane, NixOS PC) Commit-Executor: claude-code Co-Authored-By: Claude Opus 5 <[email protected]> Claude-Session: https://claude.ai/code/session_01Xd5Hmwh5GHNTiAmHUJ1MZu
…arker was dropped)
algorithmicx.sty 579 sets `\Comment{..}` as `\hfill\(\triangleright\) #1`. The
compiler had no `\triangleright`, so the math parser reported it, the render
pipeline's `math_symbol` helper saw a non-empty diagnostic list and returned
`None`, and the marker vanished from the page with nothing painted. Found by
rebuilding #162's oracle on the float-body harness, which — unlike #162's own,
which excused any non-alphanumeric reference word without a match — requires a
glyph for it.
fontmath.ltx declares both as `\mathbin` in the `letters` family (cmmi10 "2F and
"2E, 0.5 em each), so they are Bin here and bound to the pinned Latin Modern Math
resource like `\triangle`/`\bigtriangledown`. Advances 858/858 read from the
pinned font program (`tests/lm_math_binding.rs` re-reads it and agrees).
Known residual, not fixed here and not this crate's to fix: pdfLaTeX draws these
from cmmi10 at 0.5 em where Latin Modern Math is 0.858 em, so the marker lands
3.56 bp left of the reference. That is the same class of gap the module header
already documents for `\mathbb`/`\setminus`, and it belongs to the math-font
metrics lane (the `\varnothing`/`\mathcal` machinery). Painting it slightly wide
is strictly better than dropping it.
`crates/compiler`: `cargo test --release --no-fail-fast`: 448 passed, 0 failed.
`ADVANCES.len()` and the supported-LaTeX inventory are updated for the two new
symbols.
Implementation-Agent: engine-engineer (algorithm-floats lane, NixOS PC)
Commit-Executor: claude-code
Co-Authored-By: Claude Opus 5 <[email protected]>
Claude-Session: https://claude.ai/code/session_01Xd5Hmwh5GHNTiAmHUJ1MZu
This was referenced Sep 13, 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.
Pseudocode in the compiler:
algorithmfloats (algorithm.sty on float.sty),algorithmic, andalgpseudocode/algorithmicx. A rebuild of #159 on current main, not a merge of its branch.Why this exists
#159 has never landed anywhere near
main:equation_counter/figure_counterfields onPthat would desync fromself.countersafter compiler: \numberwithin, \counterwithin and subequations on one counter table (display-math blocker 2 of #146) #155 moved those intoxref::Counters;agent/kabir-claude/integration-2026-09-13b, which is still unmerged.So
origin/main's compiler has no pseudocode support at all. That — not the float model — is what actually blocks #162, and it is fixable on main today, independent of everything else.What lands
crate::algorithmic— a pure model read from the source bytes, citing the package lines (algorithmic.sty, algorithm.sty, algorithmicx.sty, algpseudocode.sty, float.sty).setup(text): package options (plain/ruled/boxed, section resets, float name via\DeclareOption*,noend), keyword renames,\algorithmicindent,\alglinenumber,\algsetup,\floatname, and\item[..]label commands.scan(text, doc, setup):algorithmfloats (placement, caption/label/size/algorithmic items, hmode) and barealgorithmicenvironments.parse_algorithmic: each statement becomes aLine— item kind, line counter and printed-number flag, block depth, algpseudocode's\hskip\ALG@tlm, and the pieces (bold keywords, control spaces, source spans for conditions/text/comments, small-caps\textproc/\Call).parser/algorithmic.rs—\begin{algorithmic}becomes one flush-left paragraph per statement;algorithm/algorithm*behave likefigurewithAlgorithm Ncaptions;\algnewcommand/\algrenewcommand/\algsetup/\floatnameare consumed.\renewcommand{\algorithmicrequire}is no longer "Command undefined".supported-latex.json,coverage.md,docs/user/compiler.md).Reconciled against main rather than merged
equation_counter/figure_counter/algorithm_counterfieldsP::algorithm_counter— algorithm.sty's own\newfloatcounter is not a class body counter, so it does not belong inxref::Counters; main'sself.counters.step("figure")path is untouched\captionalgorithm/algorithm*first, then main's existing figure branch unchangedBlock::Styledlists: self.list_frames.clone()andline_break_before: Nonepackage_matches_layoutgainsalgorithm/algorithmic/algpseudocode/algorithmicxSecond commit:
\triangleright/\triangleleftFound while rebuilding #162's oracle. algorithmicx sets
\Comment{..}as\hfill\(\triangleright\) #1; the compiler had no such symbol, so the pipeline'smath_symbolhelper saw a diagnostic, returnedNone, and the marker was painted nowhere at all. #162's own harness excused this (it allowed any non-alphanumeric reference word to go unmatched); the float-body harness this lane uses does not.fontmath.ltx declares both
\mathbinin thelettersfamily (cmmi10"2F/"2E, 0.5 em), so they are Bin and bound to the pinned Latin Modern Math resource like\triangle. Advances 858/858 read from the pinned font program.Known residual, left for the math-font metrics lane: pdfLaTeX draws them from cmmi10 at 0.5 em where Latin Modern Math is 0.858 em, so the marker lands 3.56 bp left. Painting it slightly wide beats dropping it; this is the same class of gap the module header already documents for
\mathbb/\setminus.Gates
crates/compiler,cargo test --release --no-fail-fast: 448 passed, 0 failed, including the HW1/HW2 gates, the amsmath/amssymb/tabular corpus gates and the regenerated supported-LaTeX drift gate.cargo fmt/cargo clippyare not installed on this host and were not run.Follow-on
The render-pipeline side is #195 (rebuild of #162 on the post-#135 float model). It reads
flashtex_compiler::algorithmic, socrates/render-pipeline/vendor/compilerneeds re-pinning to a compiler carrying this PR — please add it to the re-pin queue. No vendor file is edited here.🤖 Generated with Claude Code
https://claude.ai/code/session_01Xd5Hmwh5GHNTiAmHUJ1MZu