Skip to content

[VFDLIBM-33] State the contract of functions of two arguments in the docs - #127

Merged
MaxGekk merged 1 commit into
mainfrom
contract-docs
Nov 21, 2026
Merged

MaxGekk merged 1 commit into
mainfrom
contract-docs

Conversation

@MaxGekk

@MaxGekk MaxGekk commented Nov 21, 2026

Copy link
Copy Markdown
Contributor

Purpose

Part of #33. atan2 is in the nightly and the next release, and the docs state the contract as raw bits on every lane, which is false on atan2's lane of two NaNs with different bits. The wording is the owner's to amend: each edited sentence is short, so it is easy to change. Docs and Javadoc only; no code.

What changed

The three drafts quoted in #115 are applied: the contract sentence in AGENTS.md ("Releases"; CLAUDE.md is its symlink), one CHANGELOG.md line under Unreleased / Changed (a clarification of the contract that changes no result and asks a client for nothing; the file's rules put what a user reads under Added, Changed or Fixed), and "a raw-operator row (SqrtBenchmark) may take the *Benchmark name" in AGENTS.md's benchmark bullet. Every statement of the contract was grepped for in AGENTS.md, CHANGELOG.md, README.md, PLAN.md, PROOFS.md, SKILLS.md, VFdlibm's Javadoc, bench/, dev/ and pom.xml:

  • AGENTS.md: the opening line, "Bit identity" (a function of two arguments is compared by PairBits), "Same result, proven", the harness line (Oracle, PairBits), the arm sentence (every arm gives the same bits; on a two-NaN lane, one of the declared candidates), the contract sentence (exception with OPERANDS for atan2 and pow, MAGNITUDES for hypot; unary functions keep raw bits, NaN payloads included), and "each lane still meets that contract".
  • CHANGELOG.md: the header sentence gets the exception, and the one new line above. The per-function Added lines are true as they are (the atan2 line already states the exception).
  • README.md: the headline and the Status paragraph (the exception is atan2's, unreleased; no released function has a two-NaN lane), the property sentence, and the nightly sentence, which said every night sweeps all high words: a function of two arguments is swept one argument a night, the two alternating by default (pair-passes). The "Bit identity" bullet already had the exception; "for hypot, also with the sign bit cleared" now reads "the same".
  • PLAN.md: the goal, step 2 of "How it grows", the rule that every lane stays bit-identical, and "The contract". The "what it holds" line is about the five unary ports and is true as it is.
  • PROOFS.md: the first sentence. VFdlibm's Javadoc: the class exception names a function of two arguments (atan2) and its candidate.
  • SKILLS.md, bench/: no statement of the contract. Left as they are: pom.xml's description ("bit-identical to java.lang.StrictMath", the artifact's tagline) and dev/jar-check.sh's messages ("gets StrictMath's bits"), whose consumer already applies the pair rule; the owner can decide on either.
  • The Nightly Javadoc nits are already fixed on main.

How it was tested

Docs only. The unchanged suite compiles (the Javadoc edit) and ProofsTest, ProofFilesTest, NightlyTest and PairHarnessTest pass. No line this PR adds is over 100 columns.

Compatibility

None: no code and no result changes.

AI tooling

Generated-by: Claude Code (Fable 5.2)

…docs

Generated-by: Claude Code (Fable 5.2)
@MaxGekk
MaxGekk merged commit f68aea8 into main Nov 21, 2026
14 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