Repository navigation
WIP: BibTeX engine (KC-108 r2, paused) - #97
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
This was referenced Sep 13, 2026
Merged
Contributor
Author
|
Resumed and finished in #100 (oracle now 99/99 |
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.
WIP and paused by the coordinator. This supersedes #91 and changes only
crates/bibtex-bst/**.Done (commit 3157147)
src/engine.rs,bst.rs,bib.rs,exec.rs,names.rs): a port ofbibtex.web0.99e plus TeX Live'sbibtex.ch. The code comments cite section numbers. It covers:.auxreading, including\@input,\citation{*}and all the error messages..bstparsing, with the same error recovery as BibTeX.format.name$,change.case$,purify$andwidth$..bibparsing:@string,@preamble,#concatenation, crossref withmin_crossrefs, and duplicate or missing entries..bblline breaking, and the.blgmessages, history line and usage statistics.eof/eolnbehaviour: CR counts as a line end, so CRLF yields an extra blank line. This was checked against the oracle.src/lib.rs):run(aux, &dyn FileSource, &Options) -> Output {bbl, blg, history, err_count}DirSourceOutput::diagnostics()/warnings()Session, which reuses the cached result when every file the last run looked up still has the same hash.tests/oracle/generate.pyruns MacTeXbibtex(BibTeX 0.99e, TeX Live 2026) and is the only thing that does..bibfiles,\@input, missing style or bib,.auxerrors, crossref min/nested/case, tricky.bibsyntax, CRLF and CR-only files, and two original test styles (builtins.bst,badstyle.bst).tests/data/cases/and expected output intests/data/expected/.tests/oracle.rsnever runsbibtex.Oracle status (measured at 3157147)
.bblbyte-identical: 95/95..blgidentical, ignoring only the banner, theCapacity:line and the statistics block: 89/95..blgbyte-identical: 89/95.badstyle,builtins-*) all first differ at a web2c log line the engine does not emit yet:Reallocated singl_function (elt_size=4) to 100 items from 50.Not done / exact resume steps
git fetch origin && git checkout agent/kabir-claude/bibtex-r2BIB_XRETALLOClog lines (Reallocated %s (elt_size=%ld) to %ld items from %ld., written to the log only), as specified inbibtex.ch:singl_function: starts at 50 and grows by 50. It is local to eachscan_fn_defcall, and the check runs after the item is stored, whensingle_ptr == space([188]).wiz_functions: starts at 3000 and grows by 3000 at §200.field_info: starts at 5000. It grows tototal + 5000whentotal > max([226]/[265]).cite_list,type_list,entry_exists,cite_info: start at 750 and grow by 750 ([138]).bib_list,bib_file,s_preamble: start at 20 and grow by 20 ([123]/[242]).lit_stack,lit_stk_type: start at 50 and grow by 50 ([307]).glb_str_ptr,global_strs,glb_str_end: start at 10 and grow by 10 ([216]).global_strshaselt_size = glob_str_size + 1.str_pool: starts at 65000 and grows by 65000 ([53]). Simulatepool_ptras the permanent pool characters plus the temporary strings on the literal stack, and check it at eachstr_roomsite.buffer_overflow[46]). Thecopy_charmessageField filled up at N, reallocating.comes with it ([251]).boolean,alpha_fileandstk_type. Confirm them with new oracle cases (planned: 800 entries, 760 explicit cites, 22 bib files with preambles, a capacity-stressing style, and a field over 20000 characters).python3 crates/bibtex-bst/tests/oracle/generate.py.CARGO_BUILD_JOBS=3 ORACLE_VERBOSE=1 cargo test --manifest-path crates/bibtex-bst/Cargo.toml --test oracle -- --nocaptureSessionAPI. WriteCONTRACT.md: the adoption plan forcrates/compilerandcrates/bibliography, where a.bstfallback replaces the hard-coded plain/unsrt/alpha styles.macro_name_locis not found.format.name$input.🤖 Generated with Claude Code
https://claude.ai/code/session_01Xd5Hmwh5GHNTiAmHUJ1MZu