Skip to content

refactor(parser): delete quiet_after_invalid_tokens - #3070

Merged
robcohen merged 1 commit into
mainfrom
fix/delete-quiet-after-invalid-tokens
Nov 28, 2026
Merged

robcohen merged 1 commit into
mainfrom
fix/delete-quiet-after-invalid-tokens

Conversation

@robcohen

Copy link
Copy Markdown
Member

What

Deletes convert.rs's quiet_after_invalid_tokens (#2872), the hand-modeled pass that dropped every error after a line's first invalid token. Three things now cover what it did:

Also deleted: the pass's header_grammar_reaches and indented_grammar_reaches helpers and their unit tests. Comments that named the pass are reworded.

Why stacked

This PR is stacked on #3067, which is stacked on #3065. Deleted on main alone, the pass's removal measured:

  • parity unchanged;
  • the BOM matrix 7 rows worse without the overlay;
  • with the overlay, messages drift to unexpected trailing tokens after posting amount (in 3 corpus files and in the surface-agreement cases), because drop_errors_inside_a_line_error then dropped the token's own error.

On top of #3067, nothing changes.

Gates

  • No output change: parity is 122,378 of 123,394 inputs, with no re-pin; the BOM matrix, STRICT_BASELINE and the parser suite pass.
  • Other suites: workspace clippy with -D warnings is clean; the validate, loader, lsp, wasm and rustledger tests pass.

Caches

WASM cache v155. The loader cache is unchanged.

🤖 Generated with Claude Code

@robcohen
robcohen requested a review from a team as a code owner November 27, 2026 15:19
@robcohen
robcohen force-pushed the fix/drop-line-error-pass branch 2 times, most recently from 5949eb0 to bcbcba2 Compare November 27, 2026 21:58
Base automatically changed from fix/drop-line-error-pass to main November 27, 2026 22:21
convert.rs's hand-modeled pass that dropped every error after a line's
first invalid token (#2872) is redundant now: the error oracle's
reconciler holds each line's errors to beancount's, the bom-in-account
overlay keeps the one-BOM-per-line rule the pass also applied, and with
drop_errors_inside_a_line_error gone the token's own error is the one
the reconciler keeps and names. The pass, its two header/indented
grammar-reach helpers and their tests are deleted.

No output changes: parity 122,378 of 123,394, the BOM matrix, the
corpus baselines and the parser suite are unchanged. WASM cache v155.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
@robcohen
robcohen force-pushed the fix/delete-quiet-after-invalid-tokens branch from d764537 to e160680 Compare November 27, 2026 23:40
@github-actions

Copy link
Copy Markdown
Contributor

📊 Benchmark Results

Shape rustledger beancount Speedup RSS (rledger / beancount)
simple 54.7ms ± 0.8ms 660.4ms ± 3.5ms 12.1x 45.1 MB / 51.0 MB
investment 80.7ms ± 0.7ms 2453.2ms ± 18.8ms 30.4x 47.0 MB / 59.0 MB
fifo 79.7ms ± 0.9ms 13434.0ms ± 46.0ms 168.6x 49.0 MB / 58.8 MB

vs base, measured in this run

Shape base this PR Change RSS base → PR
simple 54.4ms ± 0.6ms 54.7ms ± 0.8ms +0.4% ✅ within noise 45.1 MB → 45.1 MB (-0.0%)
investment 80.8ms ± 1.0ms 80.7ms ± 0.7ms -0.2% ✅ within noise 47.3 MB → 47.0 MB (-0.7%)
fifo 79.9ms ± 0.7ms 79.7ms ± 0.9ms -0.2% ✅ within noise 49.1 MB → 49.0 MB (-0.1%)

A difference counts only when it clears the combined spread of the two measurements, per shape (2σ: simple 0.5ms, investment 0.6ms, fifo 0.5ms), and is at least 5%.
10,000 transactions per shape · 20 runs, 3 warmup · hyperfine

What do these numbers mean?
  • simple — Two-posting transfers, one currency. The historical workload — keep as the floor, not as the benchmark.
  • investment — Cost specs, per-unit prices and lot reductions. Exercises booking and inventory, which simple leaves at 0.3%.
  • fifo — Bare {} reductions against a FIFO account — how FIFO sells are normally written. The other four shapes reach the ordered-selection path twice in 2k transactions between them, so it was effectively unprofiled until it turned out to be quadratic (plan_ordered scans every lot per reduction: FIFO ledgers are quadratic (8.8s at 20k transactions) #2083).
  • vs base: the PR and the base-branch commit it is built on, built and measured in the same job
  • RSS: peak resident set size, a single sample — reported without a verdict because there is no spread to test it against
  • A shape with no beancount column is one bean-check reports errors on; it is timed for rledger only

@codecov

codecov Bot commented Nov 27, 2026

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.

📢 Thoughts on this report? Let us know!

@github-actions

Copy link
Copy Markdown
Contributor

✅ Compatibility Test Results

Metric Result
Check Compatibility 100%
BQL Compatibility 100% (raw 93%, 179 masked)
Full AST Match 100%
Total Files 828
What's tested
  • Check: Exit codes and error counts match bean-check
  • BQL: Query results match bean-query
    The headline is the EFFECTIVE rate, after pairs where beanquery
    itself is wrong are masked. raw is the same run with nothing
    masked. A widening gap means the registry grew, not that rledger
    changed.
  • Files: ~800 test files downloaded from 10+ beancount repositories

Full results available in workflow artifacts

@robcohen
robcohen merged commit 8926e16 into main Nov 28, 2026
65 of 66 checks passed
@robcohen
robcohen deleted the fix/delete-quiet-after-invalid-tokens branch November 28, 2026 00:02
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