Repository navigation
fix(parser): hold parse errors to beancount's grammar by default - #3062
Merged
Merged
Conversation
robcohen
force-pushed
the
feat/lalr-oracle-on
branch
from
November 27, 2026 07:21
d08b724 to
a2acccc
Compare
This was referenced Nov 27, 2026
robcohen
force-pushed
the
feat/lalr-error-oracle
branch
from
November 27, 2026 10:45
3b97161 to
cb67c38
Compare
Turn the error oracle on (RLEDGER_ERROR_ORACLE=0 turns it off), and fix what turning it on exposed: - replay beancount's pushed-tag and pushed-key counts over the statements its grammar builds, so a poptag/popmeta its recovery builds mid-line still reports its tag or key as never pushed; - of several rledger errors on the one token beancount rejects, the tightest keeps its message; rledger's order among errors starting together is kept; - a parse rledger found an error in never comes out clean. Four tests whose counts were the hand model's misses now pin bean-check's; the BOM matrix, its exceptions and worse-than-main lists, and the parity manifest are re-pinned. Parity: 120,099 of 123,394 inputs match beancount 3.2.3 where 119,192 did, none lost; BOM matrix 13,349 rows where 12,917. WASM cache v148; the loader cache is unchanged. Co-Authored-By: Claude Opus 5.5 <[email protected]>
robcohen
force-pushed
the
feat/lalr-oracle-on
branch
from
November 27, 2026 11:35
a2acccc to
02039dd
Compare
Contributor
📊 Benchmark Results
vs base, measured in this run
A difference counts only when it clears the combined spread of the two measurements, per shape (2σ: What do these numbers mean?
|
Contributor
✅ Compatibility Test Results
What's tested
Full results available in workflow artifacts |
Codecov Report❌ Patch coverage is
📢 Thoughts on this report? Let us know! |
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.
Based on main (#3061 merged).
What
This turns the parser's error oracle on by default (
RLEDGER_ERROR_ORACLE=0turns it off, for comparison), and fixes what turning it on exposed.poptag/popmetain the middle of a line rledger fails (2024-01-03 2024-01-04 poptag #t, or$then\t1poptag #t), and its builder then reports the tag as never pushed. The oracle now replays the pushed-tag and pushed-key counts over the statements its grammar builds and emits a slot there. Tests cover it, including a linear-time shape.STRICT_BASELINEhash changed while every count stayed the same.Tests whose expectations moved
Each was checked against bean-check 3.2.3. In every case the new count is beancount's, and the old one was the hand model's miss.
bison_recovery_model::test_parse_date_on_an_indented_line_does_not_end_the_recoveryoption "title" "x"in a txn body, then a postingbom_account_and_tag_recovery::test_parse_bom_account_no_longer_stands_in_for_a_missed_errorAssets:A ~$ <BOM><BOM>Assets:B -$/% $x …indented_star_line::test_parse_star_after_bom_is_reported<BOM><BOM>* h xopen_booking_method_failed_line::…keeps_its_errorhhafteropen … "XYZ"The BOM matrix is re-pinned with
BOM_MATRIX_UPDATE=1 BOM_MATRIX_RELABEL=1:knowngoes from 519 rows to 88.worse_than_mainlines are no longer worse and are removed.RELABEL.test_cause_*unit tests pinned rows that now match beancount. They keep pinning each rule's conditions on the old counts, set explicitly.test_check_row_excepts_only_listed_exception_linesnow needs 5 distinct causes instead of 10, because the other causes' rows match now.Measurements
--checkpasses, 0 regressions, 1,100 pins move to match)STRICT_BASELINEcorpus testsParser, loader, LSP, WASM and CLI test suites pass with the oracle on, and so does workspace clippy.
What remains
These are the next PRs:
quiet_bison_recoveryand the phantom recursion,accepts(),model_stray_cr_lines/stray_cr_analog, the convert.rs quieting passes,BcLexerand the logos patches that depend on it. Each deletion is gated on parity--check, the BOM matrix,STRICT_BASELINEand the parser suite.🤖 Generated with Claude Code