Skip to content

Avoid Display panic for unbounded tracked precision - #10

Open
ValentinHirschi wants to merge 1 commit into
symbolica-dev:mainfrom
ValentinHirschi:codex/epf-exact-display
Open

ValentinHirschi wants to merge 1 commit into
symbolica-dev:mainfrom
ValentinHirschi:codex/epf-exact-display

Conversation

@ValentinHirschi

Copy link
Copy Markdown
Contributor

Formatting a valid ErrorPropagatingFloat::new_with_accuracy(1.0, f64::INFINITY) currently panics with “Formatting argument out of range”: Display casts the unbounded reported precision to usize and uses it as a formatting precision. The same failure affects multiprecision values.

Delegate unbounded reported precision to the wrapped value’s native Display implementation, preserving caller formatting flags. Finite-precision and zero formatting retain their existing behavior. This changes formatting only; error propagation and arithmetic are unchanged. Unbounded reported precision is not treated as a certificate of exact arithmetic.

Validation:

  • The new fixed/multiprecision regression groups fail on unmodified main and pass with this change; finite-error and zero controls pass on both.
  • Native GMP/MPFR: 174 library, 14 existing API, and 3 new test groups passed.
  • Portable Malachite/Astro: 151 library, 14 existing API, and 3 new test groups passed.
  • Targeted formatting checks passed. Strict Clippy remains blocked by the same 131 findings on unchanged main; the error output was compared exactly. No unrelated lint changes are included.

Based directly on current upstream main a8a8fcb8941752e265e3c4fa507c02a3f06bb70e; independent of the pending tracking-range changes in #9.

@chatgpt-codex-connector

Copy link
Copy Markdown

You have reached your Codex usage limits for code reviews. You can see your limits in the Codex usage dashboard.

@CLAassistant

Copy link
Copy Markdown

CLA assistant check
Thank you for your submission! We really appreciate it. Like many open source projects, we ask that you sign our Contributor License Agreement before we can accept your contribution.
You have signed the CLA already but the status is still pending? Let us recheck it.

@ValentinHirschi

Copy link
Copy Markdown
Contributor Author

@benruijl could you review this narrow Display fix? Native and portable owner tests pass. GitHub denied formal reviewer assignment for my account, so I am requesting review here.

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.

2 participants