\begin{lemma}[Safe threshold-bounded digit retry]
Let a byte slice decompose as a list of decimal digit bytes followed by a
tail whose first byte, if any, is not a decimal digit.  Starting from an
unsigned accumulator at most \(10^{19}-1\), the extracted
\texttt{try\_parse\_19digits} returns normally.  Its returned slice is a
remaining digit suffix followed by the same tail, every byte in that suffix
is a decimal digit, the suffix is no longer than the original digit list,
and the original digit list is the consumed prefix followed by that suffix.
The returned accumulator is the ordinary base-ten fold of the consumed
prefix from the initial accumulator and is at most
\(10^{19}-1\).  If that accumulator is below \(10^{18}\), the remaining
digit suffix is empty.  If the initial accumulator is zero and the returned
accumulator is at least \(10^{18}\), at least 19 original digits were
consumed.
\end{lemma}
\begin{proof}
Unfold the loop in
\noderef{num_imp_dec2flt_parse_try_parse_19digits}.  Use the current slice
length as a decreasing measure.  At each loop head write the current slice
as a remaining digit list followed by the fixed tail, and maintain that this
list is no longer than the original digit list and that the accumulator is at
most \(10^{19}-1\).  Also maintain a consumed prefix whose concatenation
with the remaining list is the original digit list and whose base-ten fold
from the initial value is the current accumulator.

If the accumulator is already at least the constant \(10^{18}\) from
\noderef{num_imp_dec2flt_parse_MIN_19DIGIT_INT}, the loop stops without
changing either component.  Otherwise, an empty remaining digit list puts
the loop at either the empty tail or its first nondigit.  The exact split in
\noderef{ModelSliceSplitFirst} therefore stops normally at the fixed tail.
In the other case the next byte is between 48 and 57.  Wrapping subtraction
by 48 consequently has its ordinary value in \([0,9]\), so the digit test
continues.  Since the old accumulator is below \(10^{18}\), the checked
update is at most
\(10(10^{18}-1)+9=10^{19}-1<2^{64}\).  The byte-to-\texttt{u64} cast,
multiplication, and addition all succeed, and removing the head byte strictly
decreases the measure while preserving the suffix decomposition.

The well-founded loop therefore terminates normally with the stated suffix
and bound.  At a terminal state whose accumulator is still below
\(10^{18}\), neither the threshold branch nor a remaining digit can have
caused termination; hence the remaining digit list is empty.  This proves
the low-result clause.  Finally, an induction on a consumed list of \(k\)
decimal digits bounds its base-ten fold from zero strictly below \(10^k\):
the next digit is at most nine, so the next accumulator is less than ten
times the previous upper endpoint.  Thus a result at least \(10^{18}\)
cannot have consumed fewer than 19 digits.  The prefix/suffix partition then
gives the asserted sharp remaining-length bound.
\end{proof}
