Skip to content

log builtin silently clamps inputs below 1e-10 to ln(1e-10) #1041

Description

@InauguralPhysicist

Found by phugoid rung 0 (blind-critic round 15; ledgered as phugoid GAPS.md G3).

Verified on v0.41.0:

print of (log of 1e-15)   # -23.025850929940457
print of (log of 1e-10)   # -23.025850929940457  (identical — clamped)
print of (log of 2e-10)   # -22.33270374938051   (correct)

Presumably the finite-by-construction design (no -inf), but the clamp is a SILENT plateau: phugoid's exponential-decay estimator fit log-domain samples that had decayed through the clamp range and returned a confidently wrong answer — measured 4-14% error inside a written 2% tolerance — because a relative sample floor admitted clamped samples. Any consumer doing likelihoods, entropies, or decay fits in log space hits the same plateau with no signal.

Questions for the runtime:

  1. Is ln(1e-10) the intended floor, and is it documented anywhere? docs/BUILTINS.md doesn't mention it.
  2. If it stays, a doc note (and possibly a lint hint for log-of-possibly-tiny) would have saved the hunt.

phugoid's local mitigation (absolute 1e-9 sample floors in both log-domain estimators + an amplitude-0.001 regression row) is in InauguralSystems/phugoid — measure.eigs and GAPS.md G3.

Co-authored during the phugoid rung-0 build loop.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions