Skip to content

Round the displayed row at the learned precision as main's oracle does - #14

Merged
jwiegley merged 1 commit into
mainfrom
johnw/ellerman-review
Nov 7, 2026
Merged

jwiegley merged 1 commit into
mainfrom
johnw/ellerman-review

Conversation

@jwiegley

@jwiegley jwiegley commented Nov 7, 2026

Copy link
Copy Markdown
Member

Follow-up to #13. The row of a balance was displayed through cppRoundAt, the model of the printing rule of the C++ the series branch was bisimulated against (76b9dc2b2), whose binary route past 231 places prints the artifact digits of an MPFR quotient: the thirds of regress/amount-print-high-precision ended in ...3319914273 where the C++ of main (5f9855cef) divides exactly and the file pins the exact digits. The engines' flows held the exact rational on both sides; only the row rendering departed.

displayAmount now rounds through roundAt, as main's oracle does.

Witness: regress/amount-print-high-precision prints the four rows of main's oracle identically; the 35-file witness set of the previous commits still prints identically. The divergence scan over main's 4160-file regress corpus, run to completion against the build with the two preceding fixes, listed 37 files; every one but this file is a journal C++ rejects and main's oracle accepts silently (unbalanced transactions, missing includes, missing directive arguments, tilde or pattern errors), each rejected by the merged oracle with a reason naming its cause, as the C++ binary rejects it.

The row of a balance displayed an amount through `cppRoundAt`, the
model of the printing rule `stream_out_mpq` of the C++ that the
series branch was bisimulated against (src/amount.cc:208-245 at
76b9dc2b2), whose binary route past 231 places prints the artifact
digits of an MPFR quotient: the thirds of the journal of
regress/amount-print-high-precision ended in ...3319914273 and its
sevenths in ...142855705101, where the C++ of main (5f9855cef)
divides exactly, in integers, and prints ...333 and the period of
the sevenths instead, as that regress file pins and as main's oracle
(bbda5478's successor at bbd5478) prints by rounding at the learned
precision through `roundAt`. The engine's flows held the exact
rational `10/3` on both sides; only the row rendering departed.

`displayAmount` now rounds through `roundAt`, as main's oracle does,
and its docstring records the change with the witness. Witness:
regress/amount-print-high-precision prints the four rows of main's
oracle identically; the whole witness set of the previous commits
(35 files) still prints identically; the divergence scan over main's
4160-file regress corpus, run to completion against the build with
the two preceding fixes, listed 37 files, of which every one but this
file is a journal that C++ rejects and main's oracle accepts
silently: 14 files of unbalanced transactions, missing includes,
missing directive arguments, and tilde or pattern errors, and 22
coverage files of the same classes, each of which the C++ binary
rejects and the merged oracle rejects with a reason naming its cause,
while main's engine, which models none of these rejections, prints
balances or nothing. This file was the one journal of the scan that
C++ accepts and the merged oracle misrendered.

Co-Authored-By: GLM (Z.ai) via pi <noreply@z.ai>
Pi-Session: 01a163ec-1792677793
@jwiegley
jwiegley merged commit 368d027 into main Nov 7, 2026
3 checks passed
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