Skip to content

defk-vcx.5: exact float32 as a documented recipe, not a builtin - #83

Merged
DanielLuning merged 1 commit into
mainfrom
defk-vcx.5/f32-rounding-recipe
Oct 26, 2026
Merged

DanielLuning merged 1 commit into
mainfrom
defk-vcx.5/f32-rounding-recipe

Conversation

@DanielLuning

Copy link
Copy Markdown
Owner

What changed

The owner chose option 1 of defk-vcx.5: a recipe, no builtin. No catalog workload needs a builtin today.

  • docs/language.md: a new section "Exact float32 arithmetic" under Float arithmetic. It states the one-element [f32] scratch pattern, why it is exact for + - * / and sqrt (an f64 holds more than twice an f32's bits), that exp/log/pow are rounded twice, and that the write raises where f32 hardware gives inf. Two run-checked kernels (add32, dot32) show a tie and an f32 dot product. A row in "Unsupported, write this instead" for x :: f32 / <<y::float-32>> = <<x::float-32>>.
  • docs/guides/cheatsheet.cheatmd: one row in Common rewrites.
  • docs/performance.md 6.44: records the decision.
  • test/element_types_test.exs: kernel mul_add32 (with an agreement property) and a test of ties to even: 2^24 + 1, 2^24 + 3, the negative mirrors, two product ties, and subnormal ties, each checked in both modes and against an Elixir float32 reference.

Results

No measurement. The numbers in 6.44 are unchanged.

How it was checked

mix ci on an M-series Mac in the worktree: 2312 tests passed. (The first run failed the two known ReportTest.Full cache tests from the copied _build; after removing those cache files, everything passed.)

  • Touches a promised surface? No: docs and a unit test only, so no CHANGELOG.md entry.
  • Touches test/stability/? No.

The owner chose the recipe over a builtin: no catalog workload needs one.
docs/language.md gets an 'Exact float32 arithmetic' section and a rewrite
row, the cheatsheet a rewrite row, performance.md 6.44 the decision, and
element_types_test a mul_add32 kernel with ties to even, negative,
product and subnormal ties against an Elixir float32 reference.
DanielLuning pushed a commit that referenced this pull request Oct 26, 2026
…rktree ../defk-vcx.5). mix ci passed. Close after merge; then defk-vcx can close."
@DanielLuning
DanielLuning merged commit d4e45c7 into main Oct 26, 2026
2 checks passed
@DanielLuning
DanielLuning deleted the defk-vcx.5/f32-rounding-recipe branch October 26, 2026 10:21
DanielLuning pushed a commit that referenced this pull request Oct 26, 2026
…ed out by the owner (deferred). vcx.5 merged in PR #83 (d4e45c7)."
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