docs(adr): ADR 005 reconciles question 13 to two exceptions (improvise-l2b8)
Codex P2 on be9de2ee: the K cutoff is the second exception to exact-iff-fits; <=K grouped read is not one. Flags the override as a reading.
Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01VdfEGXA7aJ6ftMsCc9PJze
This commit is contained in:
committed by
Edward Langley
parent
be9de2eecd
commit
1aa4537f62
@@ -198,8 +198,10 @@ Clause 12 defines the one number language this uses.
|
||||
> "(b)"
|
||||
|
||||
Decided: **(b)**. The bound applies to the **stored** result, and every intermediate
|
||||
inside one formula evaluation is unbounded up to the ceiling. The ceiling is the one
|
||||
exception, and it is now sized to the grouped read (question 13).
|
||||
inside one formula evaluation is unbounded up to the ceiling. The ceiling is the first
|
||||
of two exceptions to "exact iff it fits", sized to the grouped read (question 13). The
|
||||
second, added by revision 7, is the K = 32 cutoff on a `SUM` (question 13, "The K
|
||||
cutoff").
|
||||
|
||||
**14. The numeric crate's name.**
|
||||
> "this is fine"
|
||||
@@ -1312,7 +1314,7 @@ pub enum Num {
|
||||
fits. So a `None` widens that step to a bigint rational and the **stored** result is
|
||||
tested against the `i128` bound: exact iff it fits, else the correctly rounded f64 of
|
||||
the exact fraction, which is `Inexact`. It is deterministic. Past question 13's
|
||||
ceiling, the intermediate demotes (the one stated exception).
|
||||
ceiling, the intermediate demotes (the first of the two stated exceptions).
|
||||
|
||||
Revision 3 cited `Ratio<i128>::to_f64` agreeing with `BigRational`'s conversion. That
|
||||
was **circular**: both share `num-rational`'s one `ratio_to_f64` routine. The review
|
||||
@@ -1747,8 +1749,9 @@ open. Nothing is renumbered.
|
||||
exceptions: the ceiling below, and a `SUM` of more than K = 32 non-decimal
|
||||
denominator groups, which reads inexact by question 16 whatever its value.)
|
||||
|
||||
**The rule has one exception, and it is stated rather than hedged** (revision 5,
|
||||
the review of `87ae21ca`):
|
||||
**The rule has two exceptions, and they are stated rather than hedged** (the ceiling
|
||||
from revision 5, the review of `87ae21ca`; the K cutoff from revision 7, Codex on
|
||||
`be9de2ee`):
|
||||
- **The ceiling.** Widening carries a size ceiling so that a pathological
|
||||
expression cannot grow a bigint without limit. It must be at least
|
||||
K·127 + 256 bits, so that the grouped read (below) never reaches it: 4,320 bits
|
||||
@@ -1758,10 +1761,20 @@ open. Nothing is renumbered.
|
||||
large. Past it, the
|
||||
intermediate demotes, and by contagion the stored result is inexact **even when
|
||||
the exact result would fit**. That is spelling-dependent, so distributivity fails
|
||||
past the ceiling. It is the one exception to "exact iff it fits", and no ledger
|
||||
past the ceiling. It is the first exception to "exact iff it fits", and no ledger
|
||||
reaches it. `POW` checks its result size **before** computing (clause 5), so the
|
||||
ceiling is never reached by allocating first.
|
||||
- **Not an exception: the grouped read.** Revision 4 described the grouped sum's
|
||||
- **The K cutoff, which does override representability.** A `SUM` holding more than
|
||||
K = 32 non-decimal denominator groups reads the inexact f64 accumulator, so its
|
||||
stored result is inexact **even when the exact total would fit** the bound. That
|
||||
is the second exception. It is a policy about the read's cost (question 16), not
|
||||
about whether the value is representable, and it is the consequence of the user's
|
||||
K = 32. **Flagged reading (revision 7):** the user decided K = 32 on question 16's
|
||||
text, which says "Above it the read is the inexact f64 accumulator", and answered
|
||||
question 10 (a) with "at most K groups". No "What the user decided" item says in
|
||||
terms that the cutoff overrides representability. That sentence is the ADR's
|
||||
reading of those two answers, so approval confirms it.
|
||||
- **Not an exception: the grouped read at K groups or fewer.** Revision 4 described the grouped sum's
|
||||
read as checked `i128`, and that can overflow in an lcm step while the reduced
|
||||
result fits. Under (b) the read is widened like any intermediate (clause 8, "How
|
||||
wide, generically"), so it is exact iff its result fits.
|
||||
|
||||
Reference in New Issue
Block a user