Repository navigation
ledgermill 0.1.3
Added
loadreads several Beancount files, and hledger files together with Beancount files, in one call.
Each Beancount file is its own ledger (includeis still refused) and all the hledger
files together are one.transactions(),postings()andprices()are merged by date, then by
the position of the item's file in the list;check()lists each ledger's findings by the position
of their file;at_cost()andvalue()are answered per ledger and line up withtransactions();
holdings()adds the rows of the same account and commodity. Theseveral-beancount-filesand
mixed-formatsrefusals are gone. A set of one ledger answers as before. See
spec/beancount/several-files.md.- Harness: sets of several ledgers are compared with the reference. The reference runs per
ledger (bean-checkandbean-queryon each Beancount file,hledgeron all the hledger files
together) and the harness merges the results by the rule of the note with an implementation of its
own; the wasm loaded with the whole set must give the same transactions,postings(),prices(),
at_cost(),value()andholdings()(rows of one account and commodity added by value) and the
same first error.compare.tshas 40 such sets (theseveral-filesprobes in every order, the
rejected and the refused ones, Plainledger's own journals);fuzz.ts --multiwrites random sets
(60 per push, 5,000 in the release gate); the summary has amulti-ledgerline. See
harness/README.md, "Several ledgers".
Fixed
- A Beancount currency of one capital letter glued to the next character (
{2 X},1 X,,X;,Xat
the end of a CRLF line or of the file) was accepted; bean-check saysInvalid token: 'X}'.
It is now aparse-erroron the line of the letter, the line bean-check gives. A letter followed by a
space, a tab or the end of the line, or by more currency characters (X1,X.B), is read as before.
fuzz.ts --beancountnow addsXto three journals in ten (seed 411, 1,000 journals: 0 fail; of 300,
79 useX, 49 accepted by bean-check, 25 refused on theX). - A Beancount date or time written with digits other than 0-9 (
٢٠٢٦-01-02,time: ١:٢٣) made the
parser panic, a crash in a browser or an app. It is now aparse-erroron its line, the
line bean-check gives, andformat()returns the file unchanged. The fix is in our parser fork
(ledgermill-beancount-parser0.16.4).fuzz.ts --beancountnow puts such a digit in one journal
in five. - hledger: in a transaction with a balance assignment, the postings are now taken in order of their
own dates (date:tag or[DATE]). A posting dated before the transaction comes before its
assignments and undated postings, wherever it is written, as hledger does. It used to be taken in
the order written, socheck()could report a different first failing assertion from hledger's
(fuzz--multi 500 908, case 289; 0.1.2 did the same). The block itself stays at the
transaction's date. Seespec/hledger/assignment-processing.md. - Beancount
format(): an account is now read with the character classesbean-formatuses. It
starts with an uppercase letter, a later component with an uppercase letter or a decimal digit
(5,٣,3), and components go on with letters, decimal digits and-. A posting on an
account with another kind of number in it (Assets:L²,Assets:LⅫ) used to be aligned and could
move the column of the whole file; it is now kept as written, asbean-formatdoes (fuzz
--beancount 500 905and909). Seespec/beancount/format.md, "Which characters". - The check for a glued one-letter currency (above) made a Beancount load about 15% slower than in
0.1.2 on the bench ledger. It now reads each line once: on a Pixel 7 Pro,load()and
transactions()on 10,000 transactions take a median of 505 ms, against 491 ms for 0.1.2 (12
runs each, alternated).
Release gate
From the release-gate workflow on commit ea9e776 (run 41521006303, 2026-11-02), CI on the same
commit (run 41513527166), and the owner's own runs.
- Random hledger journals (5,000): 0 mismatches (2,308 that hledger accepts; the rest rejected by
both, 43 skipped, allconversion-postings) - Random Beancount journals (5,000): 0 mismatches (3,735 that bean-check accepts)
- Random price networks (5,000): 0 mismatches
- Random Beancount journals with pairs priced both ways (5,000): 0 mismatches
- Random sets of several ledgers (5,000, new in this gate): 0 mismatches (2,259 sets the reference
accepts; 63 skipped, allconversion-postings) - Corpus comparison: 12,582 pass, 0 fail, 47 skip
- Desktop bench against 0.1.2 from npm (CI runner, 10,000 transactions): every operation within
0.78–1.07× of 0.1.2 (the 0.78 is Beancountprices, at 0.12 ms; the 1.07 is Beancountformat,
452 to 483 ms); load+transactions 95.9 ms (hledger), 138.0 ms (Beancount); start 20.6 ms - Stress test, 100,000 transactions: ok, no crash (peak wasm memory 930 MB hledger, 549 MB Beancount)
- Similarity check score: max 0.089 (JPlag against rustledger 0.24.0; fail at 0.15), 0 fail,
8 warn; copydetect max 0.275 (information only) - Real journals: pass (21 pass, 0 fail)
- Device targets: not met (Beancount load+transactions on a Pixel 7 Pro: median 505 ms over 12 runs,
worst of 3 above 500 ms in 3 of 4 rounds; 0.1.2 on the same phone, alternated: median 491 ms, also
above 500 ms in 3 of 4 rounds). Every other target met: hledger load+transactions worst 312 ms,
start 19 ms, value 61 ms, holdings 36 ms, memory 48.2 MB hledger and 43.4 MB Beancount