FAILURE MAP
← Case archive

FA-58152 / Double-entry ledger accounting / Member archive

Cost pool allocation entry: remainder tie-break · case 02

The spare cent goes to the last of several equally entitled centers.

Member previewVariant 2 · 3 implementations · 7 checks per implementation

Case contract

x = {'amount': signed cents, 'weights': [[center, non-negative weight]] (some positive), 'source': account}. The pool magnitude is split across positive-weight centers by the largest remainder method: floor shares, then one extra cent to the largest remainders, ties to the earlier-listed center. A non-negative amount credits the source and debits centers; a negative amount (reversal) debits the source and credits centers, all amounts positive. Return lines [[source, side, magnitude]] + [[center, side, share]] for nonzero shares in listing order.

Why this case matters

Ledger software must keep debits equal to credits and apply normal-balance, period and cutoff rules exactly; small sign or boundary slips silently misstate financial statements.

One recorded failure

Sample boundary fixture

This sample comes from the broken implementation of a controlled reproducer.

Boundary fixtureActualExpectedOutcome
regression: remainder tie-break[["pool", "C", 3], ["fin", "D", 1], ["ops", "D", 2]][["pool", "C", 3], ["fin", "D", 2], ["ops", "D", 1]]Failed

MEMBER ARCHIVE

The complete case is available to members.

This record includes three runnable implementations, regression fixtures, execution results, and source hashes.

Member access is invitation-based. Sign in with your invited account to inspect the sources.

Sign in to the archive ↗