Skip to content

RISC-V needs more time for testsuite and has problems with NaN - #32446

Open
hrw wants to merge 2 commits into
matplotlib:mainfrom
hrw:fixes-for-riscv
Open

hrw wants to merge 2 commits into
matplotlib:mainfrom
hrw:fixes-for-riscv

Conversation

@hrw

@hrw hrw commented Oct 7, 2026

Copy link
Copy Markdown

PR summary

The current hardware for RISC-V architecture is quite slow. Matplotlib tests can be run with "CI=1" which multiplies timeouts by six but there are tests not covered by it. One of changes bumps such place from 60 to 300 seconds.

The other problem is NaN related as RISC-V has other approach to those.

AI Disclosure

LLM was used to analyse build log.

PR quality check

  • Use an expressive title, e.g. "Fix title font property precedence"
  • New and changed code is tested
  • [N/A] Plotting related features are demonstrated in an example
  • [N/A] New features and API changes have release notes
  • [N/A] Documentation complies with general and docstring guidelines

np.log10(0) produces -inf, and np.floor(-inf) is fine. But on riscv64
the intermediate NaN from the full expression evaluation triggers
"RuntimeWarning: invalid value encountered in floor". The existing
errstate only suppresses "divide" warnings but not "invalid".

This causes TestAsinhLocator tests and test_minorticks_toggle to fail
on riscv64.
@github-actions

github-actions Bot commented Oct 7, 2026

Copy link
Copy Markdown

Thank you for opening your first PR into Matplotlib!

If you have not heard from us in a week or so, please leave a new comment below and that should bring it to our attention. Most of our reviewers are volunteers and sometimes things fall through the cracks. We also ask that you please finish addressing any review comments on this PR and wait for it to be merged (or closed) before opening a new one, as it can be a valuable learning experience to go through the review process.

You can also join us on discourse chat for real-time discussion.

For details on testing, writing docs, and our review process, please see the developer guide.
Please let us know if (and how) you use AI, it will help us give you better feedback on your PR.

We strive to be a welcoming and open project. Please follow our Code of Conduct.

Comment thread lib/matplotlib/testing/__init__.py Outdated
@tacaswell

Copy link
Copy Markdown
Member

Thanks for working on this!

Comment thread lib/matplotlib/tests/test_backends_interactive.py Outdated
@hrw
hrw force-pushed the fixes-for-riscv branch 2 times, most recently from cfaed8c to e025e7f Compare October 21, 2026 16:40
The default 60-second timeout in subprocess_run_for_testing is too
short for riscv64, causing test_sphinxext and test_determinism_check
to fail with TimeoutExpired.

Increase the default by 6 for CI environments.
@hrw
hrw force-pushed the fixes-for-riscv branch from e025e7f to 4721966 Compare October 22, 2026 13:07
@hrw

hrw commented Oct 22, 2026

Copy link
Copy Markdown
Author

Changed approach a bit. There were two tests which timed out so both now use 'is CI' multiplier.

Comment on lines +194 to +196
timeout = 60
if is_ci_environment():
timeout *= 6

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

This can be condensed.

Suggested change
timeout = 60
if is_ci_environment():
timeout *= 6
timeout = 360 if is_ci_environment() else 60

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

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

It can. But it is done that way in other files so I kept the style.

Also it is not Perl to make everything one line.

Comment on lines +25 to +27
timeout = 60
if is_ci_environment():
timeout *= 6

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Suggested change
timeout = 60
if is_ci_environment():
timeout *= 6
timeout = 360 if is_ci_environment() else 60

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants