Skip to content

Fix finite floating-point average overflow - #5

Merged
bytetroll merged 1 commit into
codex/core-v1from
codex/finite-averages
Oct 21, 2026
Merged

bytetroll merged 1 commit into
codex/core-v1from
codex/finite-averages

Conversation

@bytetroll

Copy link
Copy Markdown
Contributor

average_f64([1e308, 1e308]) returned infinity because the intermediate sum overflowed. Finite inputs now use two compensated subtotals and return a finite mean within the input range, preserving subnormal values and tested cancellation residuals. The input is unchanged; empty and nonfinite behavior and sum_f64 retain their existing contracts.

Adds paired Ny/Matrix regressions, installed-SDK coverage, a public averaging reference and the F32 findings update. Severe cancellation remains approximate; the documentation includes a concrete remaining precision limit and makes no correct-rounding guarantee.

Validation at commit 65a0b60:

  • All 441 repository tests passed with no skips or failures.
  • A fresh SDK built from clean committed source passed 848 installed-consumer executions across 53 fixtures, using source and binary libraries.
  • The new fixtures pass all six routes plus standalone assembler/linker pipelines; the frozen baseline fails at the original overflow case.
  • An arithmetic-model audit against exact rational means covered 28,578 finite arrays; both documentation examples and the documented precision limit were checked through both frontends and all six routes.

Stacked on #3 to keep this review limited to the averaging fix.

@bytetroll
bytetroll marked this pull request as ready for review October 21, 2026 18:11
@bytetroll
bytetroll merged commit c8ea1a4 into codex/core-v1 Oct 21, 2026
9 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant