System.Numerics.Decimal128 — .NET 11 GA, build 26529.118

Decimal128 by Miguel: high-performance IEEE 754-2019 decimal128 in software

Fifth in a series — one report per release candidate through GA. Previous editions: preview 7, build 26366.102, preview 7, build 26376.106, RC 1, build 26401.101, RC 1, build 26411.119 (all frozen as published).

Author stance: independent, self-appointed decimal128 specialist. Not affiliated with the .NET team. Findings are anchored to IEEE 754-2019 and GDAS (Cowlishaw) and cross-checked with an independent implementation that uses BID implementation (decimal128-csharp-bid) plus Intel libbid.


1. Framing

This edition reviews the type as it shipped: .NET 11 GA, SDK 11.0.100, runtime 11.0.0, released 2026-11-10. The build is stamped rtm.26529.118 (2026-10-29), which is the token in this page’s name.

The previous edition predicted that nothing would move before GA. That was wrong, and the way it was wrong is worth stating plainly. Two changes reached release/11.0 after the 26411.119 build, both through backports that are about correctness rather than speed, and between them they close one finding, shrink another, and cut the cost of the type’s slowest paths by a factor of three to five. Neither touches API surface. The two findings that were always out of reach for this release — rounding attributes and status flags — are exactly where they were.

2. Executive Summary

  • The near-1 logarithm finding is fixed. Log(1 + 1e-28) was wrong by 2.8 × 10²² ulp on RC 1 and is correctly rounded on GA; every near-1 Log, Log10 and LogP1 probe I ran now comes back within half an ulp (section 5.7).
  • Recommended-function accuracy improved by a factor of five. On the same harness and corpus, value divergences in the clause 9.2 functions fell from 324 on RC 1 to 62 on GA, and every remaining numeric miss is exactly one ulp. Correct rounding is recommended, not required, so this row stays open — but it is now a last-place question, not an accuracy one (section 5.6). One vector regressed: a RootN that RC 1 rounded correctly is one ulp off on GA.
  • The conformance sweep is green: 66,641 vectors run, 66,641 pass, 0 fail, 0 undecided (section 5). The harness has grown since the last edition, so I re-ran RC 1 on today’s harness as the comparison: 66,414 run, 0 fail.
  • The wide paths are 3–5× faster. Far-quantum add/sub fell from ~700–740 ns to ~227 ns, extra-wide multiply from 710 to 227 ns, and FMA from 1.9–2.3 µs to 0.46–0.55 µs, all on arm64. The cause is a rewritten digit-drop helper that now strips up to 19 digits per long division instead of one (section 7). Thirty-four of the fifty-two cells did not move at all (geomean 1.003), which is what makes the eighteen that did readable.
  • What did not change: exact and power-of-ten divide still run ~93–109 ns, 8–17× libbid, because the trailing-zero strip in divide is still one digit per iteration; and after the speedup, far-quantum add/sub is still 23–26× libbid.
  • The verdict for what shipped: numerically correct within the subset it implements, and not a conforming IEEE 754 implementation — rounding-direction attributes (clause 4.3) and status flags (clause 7) are still absent (sections 5.1, 5.2, 9).

3. Scope & Methodology

  • Version under test: .NET 11 GA, SDK 11.0.100, runtime 11.0.0, build rtm.26529.118. The SDK’s stamped commit is dotnet/dotnet VMR 297acf93; the corresponding dotnet/runtime source is deae2e32, resolved through the VMR’s source manifest. The previous edition’s build mapped to runtime 067d74c2, and every source observation in this edition is a diff between those two runtime commits.
  • Harness — grown since the last edition, so the comparison was re-run. Between the 26411.119 edition and this one the conformance harness gained vectors, notably Intel’s transcendental vectors and a family of near-1 cases for LogP1/Log2P1/Log10P1 and ExpM1/Exp10M1. That makes this edition’s totals incomparable with the 54,820 the last edition reported. Rather than compare across harnesses, I ran today’s harness against both RC 1 26411.119 and GA; every RC 1 → GA delta in section 5 is from that pair of runs.
  • Comparison cohort — unchanged: System.Numerics.Decimal128 (system under test), Intel libbid, and decimal128-csharp-bid — my own C# implementation, BID128-native in memory. All three compute directly on the IEEE 754 BID128 encoding. The port column is a methodology-disclosed comparison, not the subject of this review; where a number is needed as an external yardstick, use the libbid column.
  • arm64 only. The x86-64 machine was not available to re-measure on the GA SDK. Rather than set a GA arm64 table next to an RC 1 x86-64 one under a single heading, this edition omits x86-64 entirely. The 26411.119 edition remains the most recent x86-64 reading; the M3’s day-scale repeatability is what earlier editions leaned on to interpret x86-64 movement, so arm64 alone is the half of the pair that stands on its own.
  • Benchmark pairing: arm64 run Rcsbid12, measuring the Decimal128 and port columns in the same session with one process per cell; the comparison point is Rcsbid10, the run behind the previous edition. libbid is the standing C arm.
  • The port engine moved this edition. Previous editions held decimal128-csharp-bid at 64e891a; this run uses 680fd6f (github.com/migueldecimal128/decimal128-csharp-bid). That changes some port-column numbers (most visibly FMA) and has no bearing on the Decimal128 column, which is measured in its own processes. Build-over-build statements in this edition are about the Decimal128 column alone.

4. What They Got Right

Re-verified on the shipped build: numerically correct required arithmetic, canonical BID encoding, honest subnormals, truly fused FusedMultiplyAdd, correctly-rounded Sqrt, real cohort ordering in TotalOrderIeee754Comparer, and a ToString that preserves the quantum. Three findings this series raised were fixed inside the release window, and a fourth — the near-1 logarithm — was fixed between RC 1 and GA. All four hold on the shipped build.

One correction to earlier editions: they listed RootN as correctly rounded. The corpus has since grown to include results that sit just past a rounding midpoint, and on those RC 1 was already one ulp off in two cases; GA adds a third (section 5.6). RootN is faithfully rounded, not correctly rounded.

5. IEEE 754 Compliance — prior findings retested

# Finding (clause) 26366.102 26376.106 26380.103 26401.101 26411.119 GA 26529.118
5.1 Rounding attributes / double-rounding (4.3, 5.1) ❌ ❌ ❌ ❌ ❌ UNCHANGED
5.2 Status flags absent (7) ❌ ❌ ❌ ❌ ❌ UNCHANGED
5.3 Quantum-preserving ToString / string conversion (5.12) ❌ ❌ ❌ ✅ FIXED STANDS STANDS
5.4 fusedMultiplyAdd (5.4.1) ❌ ✅ FIXED ✅ STANDS STANDS STANDS STANDS
5.5 totalOrder (5.10) ❌ ⚠️ partial ✅ FIXED STANDS STANDS STANDS
5.6 Clause 9.2 ops faithful, not correctly rounded — ⚠️ ⚠️ ⚠️ ⚠️ ⚠️ UNCHANGED (improved)
5.7 Log/Log10 catastrophic loss near 1 — ❌ ❌ ❌ ❌ ✅ FIXED

Every row was re-run against the shipped build. On today’s harness:

  RC 1 26411.119 GA 26529.118
vectors run 66,414 66,641
fail / undecided 0 / 0 0 / 0
clause 9.2 value divergences 324 62
clause 9.2 quantum divergences (value correct) 471 506
min/max cohort choices (permitted) 158 158
exponent-padding spellings (1E+07) 303 303
negative canonical NaN 8 8

The 227 extra vectors that run on GA are clause 9.2 cases that RC 1 got wrong and GA gets right; the 35 extra quantum divergences are cases where GA now returns the correct value as a different cohort member, which this harness records rather than fails. Everything outside clause 9.2 reproduces exactly.

5.1 Rounding — UNCHANGED

Arithmetic rounds tiesToEven only; there is no rounding-attribute surface; composing a directed result out of already-rounded arithmetic double-rounds. Clause 4.3 requires all five attributes for a decimal format. This was always a long-horizon item, and it shipped as expected.

5.2 Flags — UNCHANGED

No status-flag surface; clause 7 requires one. A caller cannot detect that a result was rounded, overflowed or was invalid, and the harness still runs value-only. Shipped as expected.

5.3 String conversion, 5.4 fusedMultiplyAdd, 5.5 totalOrder — STAND FIXED

All three re-verified on the shipped build with the same evidence as the previous edition: the quantum is recovered on every string vector (with the 303 permitted 1E+07 padding spellings recorded), FMA rounds once across the FMA vectors bit-exact, and the total-order corpus passes through TotalOrderIeee754Comparer.

The change behind this row is dotnet/runtime #133949, a backport of #133921 (“Improve IEEE decimal transcendental accuracy”), which landed on release/11.0 in September. Its description cites a public report of Asin/Acos losing accuracy near ±1 and goes on to fix related defects in logarithms, power functions and exponentials across all three decimal formats.

The effect on this harness, RC 1 → GA, for the operations it covers:

operation RC 1 value divergences GA value divergences
LogP1 140 17
Log10P1 86 0
Log2P1 42 0
Log10 11 0
Log 1 0
ExpM1 28 28
Exp10M1 11 11
RootN 2 3
PowN, Exp10 3 3
total 324 62

All 60 numeric divergences that remain on GA are exactly one ulp. The other two are PowN(sNaN, 0) returning 1, which is the same signaling-NaN question carried from earlier editions and not an accuracy defect. The pull request says plainly that it does “not promise universal correct rounding”, and the result matches that: this is now a faithfully-rounded implementation with occasional last-place misses, which is what clause 9.2 permits.

One regression: RootN(0.9999999999994237, 6) is correctly rounded on RC 1 and one ulp high on GA. The exact result is …9937.49999…, just below a rounding midpoint, which is the kind of case the new code was not tuned for.

The exact-result cohort observation is unchanged — exact results still come back as the full-precision cohort member where GDAS prescribes the ideal exponent (PowN(3, 2) is 9.000000000000000000000000000000000, not 9).

5.7 Log near 1 — FIXED

This finding has been open since the 26376.106 edition. Its worked example, and the rest of the near-1 probes I ran, checked against 120-digit references:

call RC 1 error GA error
Log(1 + 1e-28) 2.8 × 10²² ulp correctly rounded
Log(1 + 1e-33) 1.1 × 10²⁸ ulp correctly rounded
Log(1 − 1e-30) 3.2 × 10²⁴ ulp correctly rounded
Log10(1 + 1e-32) 2.1 × 10²⁷ ulp 0.11 ulp
Log10(0.9999999) 151 ulp 0.35 ulp
LogP1(−1 + 1e-34) 5.2 × 10²⁷ ulp 0.31 ulp
Log10P1(−0.999999) 2 ulp (misses exact −6) exact

The LogP1(x − 1) workaround that earlier editions recommended is no longer needed. The LogP1 losses near −1 in the last three rows had been measured on RC 1 but not yet published in this series; they are fixed by the same change.

5.8 RootN (own-bug disclosure) — resolved on my side

Earlier editions disclosed that my own implementations were 1–2 ulp off on RootN with negative n, where Microsoft’s were right. That bug was fixed in my ports on 2026-11-10.

6. Permitted & Intentional Divergences — unchanged

Non-canonical propagation through the clause 5.5.2 re-encoding operations (permitted), the min/max cohort-member choice (158 cases, permitted per the clause 9.6 NOTE), and the negative canonical NaN (implementation-defined) all reproduce exactly, at identical counts on RC 1 and GA.

7. Performance

On arm64, RC 1 26411.119 (Rcsbid10) → GA (Rcsbid12), Decimal128 column only:

cells count geomean range
moved by more than 10% 18 0.39 0.22–0.90
did not 34 1.003 0.92–1.08
all 52 0.722 0.22–1.08

The 34 unmoved cells are the control. A geomean of 1.003 across everything the change did not touch says the machine and the measurement are where they were on 2026-08-12, so the 18 that moved are the runtime.

What changed in the code. When a result carries more digits than the format holds, the excess low digits have to be removed before rounding. On RC 1 that was done one digit at a time: each digit was a separate long division of the 256-bit intermediate by ten, four 128-bit divides apiece. GA replaces it with a helper that removes up to 19 digits per long division (WideDropLowDigits, WideDigitCount and DropDigits all route through it). Dropping 34 digits went from roughly 136 hardware divides to roughly 8. This arrived inside dotnet/runtime #132578, a correctness change to DegreesToRadians/RadiansToDegrees, not as a performance change in its own right.

That explains the pattern of movement exactly. The cells that drop many digits got the full benefit, the cells that drop a few got some, and everything else did not move:

cell (P-gen unless noted) RC 1 ns GA ns speedup GA ÷ libbid
add/sub FQ 702–744 227–230 3.1–3.3× 23–26×
add/sub FQ (P-max) 1,385–1,388 306–333 4.2–4.5× 37–40×
mul XP 710 227 3.1× 5.0×
mul XP (P-max) 1,270 294 4.3× 5.2×
fma FN 1,896 462 4.1× 5.3×
fma FF 2,267 546 4.2× 9.5×
add/sub OQ 93–98 86–88 1.05–1.13× 5.3–6.6×
add/sub OQ (P-max) 174–177 140–146 1.2–1.3× —

The ratio to libbid makes the remaining distance clear. Extra-wide multiply and near FMA are now around 5× libbid, which is the range the rest of the type’s slow cells occupy. Far-quantum add/sub is still 23–26× libbid, because what remains in that path is still hardware 128-bit division, where libbid multiplies by precomputed reciprocals. The GA source still carries Microsoft’s own comment naming reciprocal-multiply tables as “a possible future performance optimization.” FMA’s FF-costs-more-than-FN inversion survives at a smaller amplitude (546 vs 462 ns).

What did not change. Exact-quotient and power-of-ten divide (ET, PT) still cost ~93 ns on the general profile and ~103–109 ns on the financial one, against libbid’s 6–12. The trailing-zero strip in divide is a separate loop from the one GA rewrote, and on GA it still removes one digit per DivRem by ten. It is the same shape of fix.

7.1 P-fin (financial profile)

Unchanged in substance: on the compact traffic that dominates financial workloads — add/sub MIX, compact and wide multiply — Decimal128 runs ahead of Intel’s libbid. Divide is where the gap remains, and ET/PT are the bulk of it.

Realistic financial mix (P-fin) — M3 Pro (arm64):

op cat Decimal128 (.NET 11) libbid C decimal128-csharp-bid
add MIX 8.96 10.39 3.19
sub MIX 9.18 11.71 3.51
mul CP 8.66 24.62 2.68
mul WP 28.11 34.03 20.07
div CD 59.71 36.26 26.52
div WD 50.76 39.92 34.74
div ET 103.16 6.35 6.41
div PT 108.53 6.36 5.30

7.2 Add (P-gen, sign-split)

Add (P-gen, sign-split) — M3 Pro (arm64):

op cat Decimal128 (.NET 11) libbid C decimal128-csharp-bid
add SQss 11.09 8.15 1.37
add SQos 12.42 8.48 3.78
add NQss 13.52 8.57 6.46
add NQos 13.88 9.39 7.09
add MQss 14.95 8.97 8.56
add MQos 14.25 8.33 12.59
add OQss 88.26 13.35 17.66
add OQos 86.03 15.22 27.57
add FQss 226.52 8.61 10.25
add FQos 229.55 8.74 12.94

7.3 Subtract (P-gen, sign-split)

Subtract (P-gen, sign-split) — M3 Pro (arm64):

op cat Decimal128 (.NET 11) libbid C decimal128-csharp-bid
sub SQss 12.57 8.87 2.13
sub SQos 11.31 9.07 1.43
sub NQss 14.24 10.70 7.48
sub NQos 13.65 8.85 6.06
sub MQss 14.67 9.45 13.10
sub MQos 14.97 9.14 8.51
sub OQss 86.97 16.42 28.19
sub OQos 86.62 14.31 17.92
sub FQss 226.49 9.74 12.90
sub FQos 226.61 9.03 9.65

7.4 Multiply (P-gen)

Multiply (P-gen) — M3 Pro (arm64):

op cat Decimal128 (.NET 11) libbid C decimal128-csharp-bid
mul CP 8.92 24.33 2.72
mul WP 30.14 34.83 19.48
mul XP 227.39 45.16 52.77

7.5 Divide (P-gen)

Divide (P-gen) — M3 Pro (arm64):

op cat Decimal128 (.NET 11) libbid C decimal128-csharp-bid
div CD 55.80 37.59 28.68
div WD 53.70 37.36 40.05
div XD 110.50 38.86 38.60
div ET 92.82 11.94 7.25
div PT 92.76 11.50 5.75

7.6 FMA

FMA — M3 Pro (arm64):

op cat Decimal128 (.NET 11) libbid C decimal128-csharp-bid
fma FN 462.45 86.90 69.76
fma FF 546.29 57.75 85.20

8. Recommendations

8.1 Servicing (11.0.x) — internal, API-neutral

Both items below change no API surface. Whether either qualifies for servicing is Microsoft’s call; if not, they belong to .NET 12.

  1. The RootN regression (section 5.6) — one vector, one ulp, but a step backwards from RC 1 on a function that was previously right there.
  2. The divide trailing-zero strip (section 7). GA already shows the fix shape: strip by the largest single-pass power of ten instead of by ten, the same change that took 3–5× out of the wide paths. Exact and power-of-ten quotients are the cheapest results mathematically, and they cost more than every add, subtract and multiply cell outside the far-quantum and extra-wide bands.

8.2 .NET 12 — required, and now deferred past GA

Unchanged. Rounding-direction attributes (clause 4.3) and status flags (clause 7) are required by IEEE 754-2019 and absent from the shipped type; both are API surface and both need design review. MultiplyAddEstimate shipped alongside FusedMultiplyAdd, so the API-hygiene question from earlier editions is now a documentation one.

9. Conclusion

The previous edition said the next one worth writing would cover a build where something moved. GA is that build, and the movement is real: one finding closed, the recommended functions brought to within one ulp across the whole corpus, and the type’s worst performance cells cut by three to five times — all without an API change, and all arriving through correctness work rather than tuning.

None of that changes the conformance verdict, because none of it could. What shipped on 2026-11-10 is numerically correct within the subset it implements, and not a conforming IEEE 754 implementation: four of five rounding attributes missing (clause 4.3), no status-flag surface (clause 7). Every finding this series raised that could be fixed before GA was fixed, and the near-1 logarithm was fixed later than I expected. What remains is .NET 12’s conversation.