L17 Mixed Q6 · Do our tests test anything

E27: exp, ln and SiLU on every float32 input, and a defect in our spec

QuestionIs the pinned exponential accurate on every possible input, and are the spec's safety guards correct?

Run by us; no unaffiliated reproduction

The test in one picture

Question, method, result and meaning, in plain words. The sourced detail is further down the page.

E27: exp, ln and SiLU on every float32 input, and a defect in our spec: the test explained in one pictureQuestion: Is the pinned exponential accurate on every possible input, and are the spec's safety guards correct? How we tested: 1. Evaluate exp, ln and SiLU on all 2^32 float32 bit patterns. 2. Compare against a float64 reference and run checks that need no reference. 3. Re-run on a second machine. What we found (Mixed): Within 1 ULP; one spec defect. All 3,257,925,634 inputs where both values are finite were within one ULP (max relative error 1.1921e-7); exp and ln were monotone with zero violations. The headline is a defect in our spec: the high guard (x > 88.0 returns infinity) clips 94,743 inputs whose true exp is finite. An erratum was filed. What it means: Exhaustive testing found a real defect in our own spec that sampling could not. The clipped range was entered 0 times in the instrumented decode, but other models and prompts were not ruled out.L17MIXEDE27: exp, ln and SiLU on every float32 input, and a defect in our spec1 · THE QUESTIONIs the pinnedexponentialaccurate on everypossible input,and are thespec's safetyguards correct?WHY IT MATTERSThe softmax inside everytransformer uses exp. Ifits guards are wrong thespec pins a wrong answerexactly.2 · HOW WE TESTED IT1Evaluate exp, ln and SiLU onall 2^32 float32 bitpatterns.2Compare against a float64reference and run checks thatneed no reference.3Re-run on a second machine.3 · WHAT WE FOUNDMIXEDWithin 1 ULP;one specdefectAll 3,257,925,634 inputs whereboth values are finite were withinone ULP (max relative error1.1921e-7); exp and ln weremonotone with zero violations. Theheadline is a defect in our spec:the high guard (x > 88.0 returnsinfinity) clips 94,743 inputswhose true exp is finite. Anerratum was filed.4 · WHAT IT MEANSExhaustive testingfound a real defectin our own spec thatsampling could not.The clipped range wasentered 0 times inthe instrumenteddecode, but othermodels and promptswere not ruled out.Like testing every light switch in a building: that is how the one wired backwards gets found.aefinityai.com/labs/e27-exp-ln-range/Run by us; no unaffiliated reproductionE27: exp, ln and SiLU on every float32 input, and a defect in our spec: the test explained in one pictureQuestion: Is the pinned exponential accurate on every possible input, and are the spec's safety guards correct? How we tested: 1. Evaluate exp, ln and SiLU on all 2^32 float32 bit patterns. 2. Compare against a float64 reference and run checks that need no reference. 3. Re-run on a second machine. What we found (Mixed): Within 1 ULP; one spec defect. All 3,257,925,634 inputs where both values are finite were within one ULP (max relative error 1.1921e-7); exp and ln were monotone with zero violations. The headline is a defect in our spec: the high guard (x > 88.0 returns infinity) clips 94,743 inputs whose true exp is finite. An erratum was filed. What it means: Exhaustive testing found a real defect in our own spec that sampling could not. The clipped range was entered 0 times in the instrumented decode, but other models and prompts were not ruled out.L17MIXEDE27: exp, ln and SiLU on everyfloat32 input, and a defect in ourspec1 · THE QUESTIONIs the pinned exponential accurateon every possible input, and arethe spec's safety guards correct?WHY IT MATTERSThe softmax inside every transformer usesexp. If its guards are wrong the spec pins awrong answer exactly.2 · HOW WE TESTED IT1Evaluate exp, ln and SiLU on all 2^32float32 bit patterns.2Compare against a float64 referenceand run checks that need no reference.3Re-run on a second machine.3 · WHAT WE FOUNDMIXEDWithin 1 ULP; onespec defectAll 3,257,925,634 inputs where both valuesare finite were within one ULP (maxrelative error 1.1921e-7); exp and ln weremonotone with zero violations. The headlineis a defect in our spec: the high guard (x> 88.0 returns infinity) clips 94,743inputs whose true exp is finite. An erratumwas filed.4 · WHAT IT MEANSExhaustive testing found a real defect inour own spec that sampling could not. Theclipped range was entered 0 times in theinstrumented decode, but other models andprompts were not ruled out.Like testing every light switch in a building:that is how the one wired backwards gets found.aefinityai.com/labs/e27-exp-ln-range/

The same picture, in words

Question
Is the pinned exponential accurate on every possible input, and are the spec's safety guards correct?
Why it matters
The softmax inside every transformer uses exp. If its guards are wrong the spec pins a wrong answer exactly.
How the test works
  1. Evaluate exp, ln and SiLU on all 2^32 float32 bit patterns.
  2. Compare against a float64 reference and run checks that need no reference.
  3. Re-run on a second machine.
What we found
Within 1 ULP; one spec defect. All 3,257,925,634 inputs where both values are finite were within one ULP (max relative error 1.1921e-7); exp and ln were monotone with zero violations. The headline is a defect in our spec: the high guard (x > 88.0 returns infinity) clips 94,743 inputs whose true exp is finite. An erratum was filed.
What it means
Exhaustive testing found a real defect in our own spec that sampling could not. The clipped range was entered 0 times in the instrumented decode, but other models and prompts were not ruled out.
Everyday comparison
Like testing every light switch in a building: that is how the one wired backwards gets found.
Where the facts come from

Share this picture: SVG · PNG (1200 x 630)

01Why it matters

The softmax inside every transformer uses exp. If its guards are wrong the spec pins a wrong answer exactly.

02Method, step by step

  1. Evaluate exp, ln and SiLU on all 2^32 float32 bit patterns.
  2. Compare against a float64 reference and run oracle-free monotonicity checks.
  3. Re-run on a second machine.

Method as recorded

Every one of the 2^32 f32 bit patterns evaluated for exp_pinned, ln_pinned and silu_pinned under the pinned environment (FTZ/DAZ, 8 worker threads) against a host glibc float64 oracle narrowed to f32 and flushed, plus oracle-free monotonicity checks. Run by us on one machine (an x86_64 VM); the same binary was re-run by us on a second machine (Celeron, no AVX2, same glibc) with a byte-identical log.

03Results, exact and sourced

  1. R1Every one of the 3,257,925,634 arguments where both the pinned exp and the oracle are finite is within one ULP (max relative error 1.1921e-7 = 2^-23), measured against a float64 oracle.

    Every one of the 3,257,925,634 arguments for which both `exp_pinned` and the oracle are finite is within **one ULP**.

    Verbatim source cis2-spec / E27_EXP_LN_RANGE.md
  2. R2Defect in our own spec: the high guard (x > 88.0 returns +Infinity) clips 94,743 arguments (0x42B00001 to 0x42B17217) whose true exp is finite and representable in f32. Behaviour is pinned as normative and unchanged; an erratum was filed.

    §6.2's high guard clips 94,743 values below the representable range

    Verbatim source cis2-spec / E27_EXP_LN_RANGE.md
  3. R3exp and ln were monotone over the whole finite domain (zero violations), an oracle-free check.

    exp monotone: violations=0

    Verbatim source cis2-spec / E27_EXP_LN_RANGE.md

04What it does NOT show

Correct rounding, a second compiler or libm, or that the defective range is reachable by other models or prompts (it was entered 0 times in the instrumented decode).

05Scope and caveats

  • Accuracy is against a float64 oracle (host glibc exp narrowed to f32), not correct rounding; where narrowing double-rounds the oracle itself may differ from the correctly rounded f32.
  • The headline is the guard defect, not the accuracy.
  • The source states the second-machine re-run used the same binary and same glibc, so it does not test a second compiler or libm.
  • The clip band was entered 0 times in an instrumented decode (one model, six ASCII prompts, at most 64 tokens); no claim that other models or prompts cannot reach it.
  • Two-ULP silu figure is for the function in isolation, not accumulated through an FFN.
  • The source says an earlier draft's FTZ reasoning about the silu discontinuity was wrong; E39 (CHANGELOG ERRATUM E-12) later corrected neighbouring FTZ reasoning.
  • Run by us; no unaffiliated reproduction.

06Outcome

Mixed

Some parts held, some did not, or we corrected ourselves.

07What we learned

The accuracy was the unremarkable part. Exhaustive testing found a real defect in our own spec that sampled tests could not, and we recorded it in the open.

08Check it yourself

Read the page (link above).