Skip to content

docs(fast-math): correct float_algebraic flag set (drop afn)#5100

Merged
proggeramlug merged 1 commit into
mainfrom
fix/fast-math-doc-afn
Jun 13, 2026
Merged

docs(fast-math): correct float_algebraic flag set (drop afn)#5100
proggeramlug merged 1 commit into
mainfrom
fix/fast-math-doc-afn

Conversation

@proggeramlug

@proggeramlug proggeramlug commented Jun 13, 2026

Copy link
Copy Markdown
Contributor

What

The --fast-math reference page claimed Rust nightly's #![feature(float_algebraic)] enables reassoc + contract + nsz + arcp + afn. That's wrong — Rust's algebraic float operations enable reassoc + nsz + arcp + contract but never afn. afn (approximate functions) would let LLVM substitute lower-precision math intrinsics, which the algebraic intrinsics deliberately do not permit.

Why

Reported by @saethlin reviewing commit cdc9bce (2026-05-06):

This is wrong, algebraic floats do not and never have enabled afn.

The error was never fixed and was still live on main.

Change

  • Drop + afn from the float_algebraic description in docs/src/cli/fast-math.md.
  • Apply the same code-span fix to the matching msgid/msgstr across docs/po/messages.pot and every docs/po/*.po translation (the flag list is verbatim in every language).

The standalone afn bullet — which correctly describes a flag Perry does not enable — is unchanged, and the page's "Perry's --fast-math is strictly more conservative" conclusion still holds (Perry only enables reassoc + contract).

Generated docs/book/** HTML is a build artifact (not git-tracked) and regenerates on the next mdbook build.

Summary by CodeRabbit

  • Documentation
    • Updated fast-math documentation to reflect revised Rust nightly feature flag support. The documented enabled flags are now reassoc + contract + nsz + arcp. Translations updated accordingly.

@coderabbitai

coderabbitai Bot commented Jun 13, 2026

Copy link
Copy Markdown

Review Change Stack

Caution

Review failed

The pull request is closed.

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro Plus

Run ID: 097de004-97aa-4e9b-8c99-26d9a5b27916

📥 Commits

Reviewing files that changed from the base of the PR and between e7d4ec4 and 2761072.

📒 Files selected for processing (12)
  • docs/po/de.po
  • docs/po/es.po
  • docs/po/fr.po
  • docs/po/id.po
  • docs/po/it.po
  • docs/po/ja.po
  • docs/po/ko.po
  • docs/po/messages.pot
  • docs/po/th.po
  • docs/po/vi.po
  • docs/po/zh-CN.po
  • docs/src/cli/fast-math.md

📝 Walkthrough

Walkthrough

This PR updates documentation references to Rust nightly float_algebraic feature flags by removing + afn from the feature list. The source documentation in fast-math.md is corrected, the translation template is synchronized, and all ten language-specific translation files are updated to match.

Changes

Fast-Math Documentation Correction

Layer / File(s) Summary
Source documentation and translation template
docs/src/cli/fast-math.md, docs/po/messages.pot
Removes + afn from the documented Rust nightly float_algebraic feature list in the primary source and updates the translation template to match.
Language translation synchronization
docs/po/de.po, docs/po/es.po, docs/po/fr.po, docs/po/id.po, docs/po/it.po, docs/po/ja.po, docs/po/ko.po, docs/po/th.po, docs/po/vi.po, docs/po/zh-CN.po
All ten language translation files are updated to reflect the corrected feature list, removing + afn from feature descriptions and adjusting translations to match the updated source.

Estimated code review effort

🎯 1 (Trivial) | ⏱️ ~3 minutes

Poem

🐰 A feature flag flies away,
Translations hop and hop in play,
From German words to Thai so clear,
The docs now match, synchronized cheer!
Eleven files, one small tweak—
Perfect harmony we seek! 🌟

🚥 Pre-merge checks | ✅ 4 | ❌ 1

❌ Failed checks (1 warning)

Check name Status Explanation Resolution
Description check ⚠️ Warning The PR description provides a comprehensive explanation of the issue (incorrect claim about afn), why it matters, and what changed. However, it omits required template sections like Summary, Changes (bullet list), Related issue, and Test plan. Add missing template sections: structured Summary and Changes bullets, Related issue reference, and completed Test plan with checkboxes marked. Include the Checklist section to confirm version/metadata constraints were followed.
✅ Passed checks (4 passed)
Check name Status Explanation
Title check ✅ Passed The title accurately summarizes the main change: correcting documentation for the float_algebraic flag set by removing the incorrect afn flag.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch fix/fast-math-doc-afn

Comment @coderabbitai help to get the list of available commands and usage tips.

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 2

🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

Inline comments:
In `@CLAUDE.md`:
- Line 11: Revert the accidental version bump in both files: in CLAUDE.md (lines
11-11) change the "**Current Version:**" line back to "0.5.1164", and in
Cargo.toml (lines 204-204) revert the [workspace.package] version field back to
"0.5.1164" (undo the edit that changed the version to 0.5.1165); no other
changes are needed—the maintainer will update both at merge time.

In `@docs/po/th.po`:
- Around line 51030-51038: Ensure all expected PO files
(docs/po/{de,es,fr,id,it,ja,ko,th,vi,zh-CN}.po) and docs/po/messages.pot are
present and synchronized; scan every docs/po/*.po and docs/po/messages.pot for
any residual "+ afn" fragments in entries related to "float_algebraic" and
remove them; confirm Cargo.toml is bumped to 0.5.1165 and CHANGELOG.md contains
the "## v0.5.1165" entry, and then update CLAUDE.md to show "Current Version:
0.5.1165" (or explicitly mark that updating CLAUDE.md is left to the maintainer)
so all metadata/version references are consistent.
🪄 Autofix (Beta)

Fix all unresolved CodeRabbit comments on this PR:

  • Push a commit to this branch (recommended)
  • Create a new PR with the fixes

ℹ️ Review info
⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro Plus

Run ID: 06b89f55-e652-4f46-8611-6abe0fa2481a

📥 Commits

Reviewing files that changed from the base of the PR and between 3c0675c and e7d4ec4.

📒 Files selected for processing (15)
  • CHANGELOG.md
  • CLAUDE.md
  • Cargo.toml
  • docs/po/de.po
  • docs/po/es.po
  • docs/po/fr.po
  • docs/po/id.po
  • docs/po/it.po
  • docs/po/ja.po
  • docs/po/ko.po
  • docs/po/messages.pot
  • docs/po/th.po
  • docs/po/vi.po
  • docs/po/zh-CN.po
  • docs/src/cli/fast-math.md

Comment thread CLAUDE.md Outdated
Perry is a native TypeScript compiler written in Rust that compiles TypeScript source code directly to native executables. It uses SWC for TypeScript parsing and LLVM for code generation.

**Current Version:** 0.5.1164
**Current Version:** 0.5.1165

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

⚠️ Potential issue | 🟠 Major | ⚖️ Poor tradeoff

Version metadata in both files should be updated by maintainer at merge time, not by external contributor.

Both CLAUDE.md and Cargo.toml contain version bumps that should be applied only by the maintainer when the PR is merged. Per the workflow explicitly documented in CLAUDE.md (lines 44–46), external contributor PRs must not modify [workspace.package] version in Cargo.toml or the **Current Version:** line in CLAUDE.md. This policy prevents patch-version collisions that occur when multiple commits land on main while a PR is in review.

  • CLAUDE.md#L11: Revert the **Current Version:** update to 0.5.1164.
  • Cargo.toml#L204: Revert the version field to "0.5.1164".

The maintainer will bump both to 0.5.1165 at merge time.

📍 Affects 2 files
  • CLAUDE.md#L11-L11 (this comment)
  • Cargo.toml#L204-L204
🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@CLAUDE.md` at line 11, Revert the accidental version bump in both files: in
CLAUDE.md (lines 11-11) change the "**Current Version:**" line back to
"0.5.1164", and in Cargo.toml (lines 204-204) revert the [workspace.package]
version field back to "0.5.1164" (undo the edit that changed the version to
0.5.1165); no other changes are needed—the maintainer will update both at merge
time.

Sources: Coding guidelines, Learnings

Comment thread docs/po/th.po
Rust's #![feature(float_algebraic)] enables reassoc + nsz + arcp +
contract but never afn. The --fast-math reference page wrongly listed
afn in that set. Reported by @saethlin on commit cdc9bce.

Fixes the source page plus the matching msgid/msgstr across the .pot
and every translation. The standalone afn bullet (a flag Perry does
not enable) and the 'strictly more conservative' conclusion are
unchanged.
@proggeramlug proggeramlug force-pushed the fix/fast-math-doc-afn branch from e7d4ec4 to 2761072 Compare June 13, 2026 20:21
@proggeramlug proggeramlug merged commit 2438277 into main Jun 13, 2026
12 of 13 checks passed
@proggeramlug proggeramlug deleted the fix/fast-math-doc-afn branch June 13, 2026 20:22
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