GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

  • Sign in
  • ActionsCI/CD and automation
  • CodespacesCloud development environments
  • All Features
  • Documentation
  • Training
  • Certifications
  • Build with Copilot
  • Customize Copilot
  • Integrations
  • Trending repos
  • GitHub Sponsors
  • Developer articles
  • Enterprises

This view

  • Original page
  • New address

GeezerVison is showing github.com — Now passing test_math from 3.13.2 with some caveat by hbina · Pull Request #5610 · RustPython/RustPython

Conversation

@hbina

@hbina hbina commented Mar 15, 2025 •
edited
Loading

Uh oh!

There was an error while loading. Please reload this page.

Copy link
Copy Markdown
Contributor

There are incompatibilities in the implementation of fma from libc vs musl.

I have added the tests that shows the differences here,

#[test]
fn fma_negative_zero() {
    let tiny = 1e-300;
    assert!(libm::fma(tiny, tiny, 0.0).is_sign_positive());
    // TODO: RUSTPYTHON incompatibility between fma inside libc and musl
    // assert!(libm::fma(tiny, -tiny, 0.0).is_sign_negative());
    assert!(libm::fma(-tiny, -tiny, 0.0).is_sign_positive());
    // TODO: RUSTPYTHON incompatibility between fma inside libc and musl
    // assert!(libm::fma(-tiny, tiny, 0.0).is_sign_negative());
    assert!(libm::fma(tiny, tiny, -0.0).is_sign_positive());
    assert!(libm::fma(tiny, -tiny, -0.0).is_sign_negative());
    assert!(libm::fma(-tiny, -tiny, -0.0).is_sign_positive());
    assert!(libm::fma(-tiny, tiny, -0.0).is_sign_negative());
}

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

youknowone reacted with thumbs up emoji
All reactions
  • 👍 1 reaction
@hbina
hbina force-pushed the hbina-fix-py313-test-math branch 2 times, most recently from 4dd3ff8 to 594a330 Compare March 23, 2025 13:42
youknowone
youknowone reviewed Mar 24, 2025
View reviewed changes
Comment thread Lib/test/test_math.py Resolved

Uh oh!

There was an error while loading. Please reload this page.

@youknowone

youknowone commented Mar 24, 2025

Copy link
Copy Markdown
Member

I am a bit confused by the libc vs musl situation. Which version fits to CPython behavior? Does CPython follow musl implementation?
libm's README says it is a port of musl implementaiton. So if we follow the libm implementation, is it compatible to CPython?

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@hbina

hbina commented Mar 30, 2025

Copy link
Copy Markdown
Contributor Author

CPython uses the system's libm, so on most system its probably going to be libc's libm. Meanwhile, the Rust's libm is based on musl's libm.

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

youknowone
youknowone requested changes Mar 31, 2025
View reviewed changes
Comment thread Lib/test/test_math.py Resolved

Uh oh!

There was an error while loading. Please reload this page.

Comment thread stdlib/src/math.rs Resolved

Uh oh!

There was an error while loading. Please reload this page.

Comment thread stdlib/src/math.rs Resolved

Uh oh!

There was an error while loading. Please reload this page.

Comment thread stdlib/src/math.rs Resolved

Uh oh!

There was an error while loading. Please reload this page.

@hbina
hbina force-pushed the hbina-fix-py313-test-math branch from ee05a75 to 7191aae Compare April 1, 2025 09:53
@hbina
Update test_math from CPython 3.13.2
af42192
Implemnted fma in math module.
@hbina
hbina force-pushed the hbina-fix-py313-test-math branch from 7191aae to af42192 Compare April 5, 2025 03:17
@youknowone youknowone changed the title Now passing test_math from 3.12.2 with some caveat Now passing test_math from 3.13.2 with some caveat Apr 5, 2025
youknowone
youknowone approved these changes Apr 5, 2025
View reviewed changes

@youknowone youknowone left a comment

Copy link
Copy Markdown
Member

There was a problem hiding this comment.

Choose a reason for hiding this comment

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

Thanks!

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

All reactions
@youknowone
youknowone merged commit d800a6b into RustPython:main Apr 5, 2025
@hbina
hbina deleted the hbina-fix-py313-test-math branch April 5, 2025 08:08
Shakil582 pushed a commit to Shakil582/RustPython that referenced this pull request Apr 6, 2025
@hbina @Shakil582
Update test_math from CPython 3.13.2 (RustPython#5610)
67936dd
Implemnted fma in math module.
@youknowone youknowone mentioned this pull request Dec 4, 2025
Update Python libraries and tests from Python 3.13 #5529
Closed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Reviewers

@youknowone youknowone youknowone approved these changes

Uh oh!

There was an error while loading. Please reload this page.

Assignees

No one assigned

Labels

None yet

Projects

None yet

Milestone

No milestone

Development

Successfully merging this pull request may close these issues.

Uh oh!

There was an error while loading. Please reload this page.

2 participants

@hbina @youknowone
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
You are visitor 01402503 — GeezerVison does not store the pages you look up.
Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required.