One exact Solidity reference for every operation, so that no test takes its expected value from the implementation.
Today the exact maths is split across LibTestExactDecimal, LibDecimalFloatSlow, LibTranscendentalOracle and per-test helpers. Some are exact (mulParts, the add rule, cmpScaled, maximize, overflows); some replay the implementation (divParts/invParts precision #374, mulSlow #362, invSlow #361). Each re-derives the rounding rule.
Target: LibExactFloat (test-only).
Sequencing: the open test-audit PRs (#389 to #403) already move individual tests onto LibTestExactDecimal. Land those, then consolidate them into this library. Don't do it in parallel, because they all touch the same file.
One exact Solidity reference for every operation, so that no test takes its expected value from the implementation.
Today the exact maths is split across
LibTestExactDecimal,LibDecimalFloatSlow,LibTranscendentalOracleand per-test helpers. Some are exact (mulParts, the add rule,cmpScaled,maximize,overflows); some replay the implementation (divParts/invPartsprecision #374,mulSlow#362,invSlow#361). Each re-derives the rounding rule.Target:
LibExactFloat(test-only).addPartsalready does. log10/pow10/pow return a high-precision oracle value with its own proven bound.packRuleapplies the documented packing (closest Float not exceeding the magnitude, packLossy: round toward zero to the closest representable Float #333) and the documented error choice (Oracle error choices follow implementation intermediates, not a documented rule #343).*Slowreplays.reference.rs, big ints) and Python (decimal) references stay as independent second and third opinions.Sequencing: the open test-audit PRs (#389 to #403) already move individual tests onto
LibTestExactDecimal. Land those, then consolidate them into this library. Don't do it in parallel, because they all touch the same file.