Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

The CPU_USAGE diagnostic frequently reports NaN on Mac OS #12628

Closed
inodentry opened this issue Mar 21, 2024 · 3 comments · Fixed by #12633
Closed

The CPU_USAGE diagnostic frequently reports NaN on Mac OS #12628

inodentry opened this issue Mar 21, 2024 · 3 comments · Fixed by #12633
Labels
A-Diagnostics Logging, crash handling, error reporting and performance analysis C-Bug An unexpected or incorrect behavior D-Trivial Nice and easy! A great choice to get started with Bevy O-MacOS Specific to the MacOS (Apple) desktop operating system

Comments

@inodentry
Copy link
Contributor

Bevy version

Bevy 0.13

Relevant system information

SystemInfo { os: "MacOS 14.3.1 ", kernel: "23.3.0", cpu: "Apple M1 Pro", core_count: "10", memory: "32.0 GiB" }

What you did

Read the value of the SystemInformationDiagnosticsPlugin::CPU_USAGE diagnostic.

What went wrong

If I read the latest value(), it occasionally returns NaN. There are often sane values on most frame updates, but they are interspersed with lots of frequent NaNs.

If I read the smoothed() value, it shows NaN all the time. (due to presence of NaNs amongst measured values)

Additional information

This issue is Mac OS specific. On Linux and Windows, there are no NaNs and the values are always sane.

@inodentry inodentry added C-Bug An unexpected or incorrect behavior O-MacOS Specific to the MacOS (Apple) desktop operating system A-Diagnostics Logging, crash handling, error reporting and performance analysis labels Mar 21, 2024
@alice-i-cecile
Copy link
Member

We should omit NaN values when computing smoothed diagnostics. However we should also report the NaNs upstream to sysinfo: I checked https://github.com/GuillaumeGomez/sysinfo/issues?q=is%3Aissue+is%3Aopen+macos and could not find a prior report.

@alice-i-cecile alice-i-cecile added the D-Trivial Nice and easy! A great choice to get started with Bevy label Mar 21, 2024
@Brezak
Copy link
Contributor

Brezak commented Mar 21, 2024

Do we want to store NaNs at all?

@alice-i-cecile
Copy link
Member

Storing these is useful information for the developer: if something goes wrong, I'd rather have "we couldn't get this data" in my logs, rather than a mysterious gap. We just need to be robust to them in our methods.

github-merge-queue bot pushed a commit that referenced this issue Mar 21, 2024
# Objective

Fixes #12628.

## Solution

Added several check for NaN values in `add_measurement`.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
A-Diagnostics Logging, crash handling, error reporting and performance analysis C-Bug An unexpected or incorrect behavior D-Trivial Nice and easy! A great choice to get started with Bevy O-MacOS Specific to the MacOS (Apple) desktop operating system
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants