Skip to content

WIP: makeindex engine (KC-109, paused) - #94

Closed
GoKubar wants to merge 1 commit into
mainfrom
agent/kabir-claude/makeindex
Closed

GoKubar wants to merge 1 commit into
mainfrom
agent/kabir-claude/makeindex

Conversation

@GoKubar

@GoKubar GoKubar commented Sep 13, 2026

Copy link
Copy Markdown
Contributor

Paused for usage pacing. This is work in progress: not compiled yet, and no oracle fixtures have been generated or run.

Overlap check

No overlap found. There is no makeindex, imakeidx, glossary or xindy code or branch on origin, and no assignment mentions \makeindex, theindex or \printindex. crates/project-index is the IDE citation index, which is unrelated. The compiler only lists index in crates/compiler/src/vocabulary.rs. The earlier agent/kabir-claude/makeindex attempt had pushed nothing.

Done (commit b8dc94c, only crates/makeindex/**)

  • engine.rs: line-by-line port of makeindex 2.18. Covers scanid.c (.idx scanning, keys, pages, error texts), sortid.c and qsort.c (exact qqsort, so duplicate marking and the "N comparisons" count in the .ilg match), and genind.c (items, ranges, merging, wrapping, headings, warnings, -p).
  • style.rs: every .ist attribute with its scanst.h default, plus the scan_sty and process_precedence port including style error messages.
  • ctype.rs: models how headings depend on the locale, which I checked against MacTeX with probes. Sorting and the first heading use the C ctype. Later headings use the environment ctype: DarwinUtf8 treats bytes as Latin-1 (0xFF uppercases to 0x78, 0xB5 to 0x9C).
  • lib.rs: the Job/run API, a CommandLine parser and Fatal errors. session.rs adds IndexSession, which caches the style scan, skips re-runs when the .idx is unchanged, and reports ind_changed.
  • tools/gen_fixtures.py: generates about 70 hand-written cases plus about 25 from TeX Live texk/makeindexk/tests. Cases cover syntax, quote and escape, sorting with -l, -g, numbers, symbols, case and UTF-8/Latin-1, ranges, -r, encaps, composite and roman pages, many .ist styles, -p modes, errors, multiple files, CRLF and random stress. tests/oracle.rs compares .ind and .ilg byte for byte and never runs TeX.

Not done

  • Compile and fix, generate fixtures, reach byte-identical results.
  • writer.rs: .idx writer semantics from latex.ltx lines 17710-17724 (\@wrindex, \@sanitize at line 1778, \protected@write at line 9547) and imakeidx \index[name]. Needs at least 10 pdflatex documents as fixtures.
  • theindex.rs: data for article/report/book theindex (\@idxitem hangindent 40pt, subitem 20pt, subsubitem 30pt, \indexspace 10pt plus 5pt minus 3pt, columnsep 35pt) and the imakeidx multicols prologue.
  • CONTRACT.md.

Oracle status

0 of N. Nothing has run yet.

Resume steps

  1. cd crates/makeindex && export CARGO_BUILD_JOBS=3 && cargo build, then fix compile errors.
  2. Fetch TeX Live test data. Download texk/makeindexk/tests/* from the TeX-Live/texlive-source trunk into a temp dir (the list is in TL in the generator).
  3. python3 tools/gen_fixtures.py --texlive-tests <dir>, which runs MacTeX makeindex with LC_ALL=en_US.UTF-8 or C.
  4. cargo test --test oracle, then iterate until all fixtures match byte for byte.
  5. Write writer.rs with its pdflatex fixtures, then theindex.rs and CONTRACT.md.

🤖 Generated with Claude Code

https://claude.ai/code/session_01Xd5Hmwh5GHNTiAmHUJ1MZu

…paused)

Work in progress, not yet compiled or run against fixtures. Adds the new
crates/makeindex crate: a port of makeindex 2.18 (scanid.c, sortid.c +
qsort.c, genind.c, scanst.c) with the .ilg transcript, the ctype locale
model for headings, an in-process Job/run API, IndexSession, the
oracle fixture generator (tools/gen_fixtures.py, ~90 cases) and the
byte-comparison test harness. writer.rs and theindex.rs are stubs.

Implementation-Agent: Claude Opus 5 (subagent kabir-claude KC-109, 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

GoKubar commented Sep 15, 2026

Copy link
Copy Markdown
Contributor Author

Closing as a stale paused draft. Its own description says "Paused for usage pacing... not compiled yet, and no oracle fixtures have been generated or run"; last touched 2026-09-13, no comments, no dependents, and crates/makeindex is not on main. Nothing is lost: the branch agent/kabir-claude/makeindex holds the work, and the crate is self-contained, so resuming means reopening this PR rather than rebuilding. Closing so the open list reflects work actually in flight.

@GoKubar GoKubar closed this Sep 15, 2026
@GoKubar
GoKubar deleted the agent/kabir-claude/makeindex branch September 16, 2026 04:18
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.

1 participant