Merge pull request #16895 from bboreham/noinline-kahan

[BUGFIX] PromQL: Noinline kahanSumInc, to reduce numerical errors
This commit is contained in:
Bryan Boreham 2025-07-28 15:55:19 +01:00 committed by GitHub
commit e9cf792c47
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -1188,6 +1188,9 @@ func funcTimestamp(vectorVals []Vector, _ Matrix, _ parser.Expressions, enh *Eva
return enh.Out, nil
}
// We get incorrect results if this function is inlined; see https://github.com/prometheus/prometheus/issues/16714.
//
//go:noinline
func kahanSumInc(inc, sum, c float64) (newSum, newC float64) {
t := sum + inc
switch {