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

Fix infinite looping in msvc builds in fragment test function #71811

Merged
merged 1 commit into from
Feb 17, 2024

Conversation

kevingranade
Copy link
Member

Summary

None

Purpose of change

My debug code in #71585 introduced a divide by zero, resulting in infinite fragmentation density.
It seems the msvc std::poisson_distribution constructor doesn't like infinite values.

Describe the solution

Floor the range passed to shrapnel_calc() by the debug code at 1 so it can't divide by zero.

Describe alternatives you've considered

Remove the debug code I guess?

Testing

I can't reproduce locally, so see if this fixes the infinite loop in the MSVC build.

Additional context

REALLY MSVC? REALLY?

My debug code in #71585 introduced a divide by zero, resulting in infinite fragmentation density.
It seems the msvc std::poisson_distribution constructor doesn't like infinite values.
@github-actions github-actions bot added Code: Tests Measurement, self-control, statistics, balancing. [C++] Changes (can be) made in C++. Previously named `Code` astyled astyled PR, label is assigned by github actions json-styled JSON lint passed, label assigned by github actions labels Feb 17, 2024
@akrieger akrieger merged commit a9a1120 into master Feb 17, 2024
27 checks passed
@github-actions github-actions bot added the BasicBuildPassed This PR builds correctly, label assigned by github actions label Feb 17, 2024
@kevingranade kevingranade deleted the kevingranade-poissons-revenge branch March 4, 2024 18:22
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
astyled astyled PR, label is assigned by github actions BasicBuildPassed This PR builds correctly, label assigned by github actions [C++] Changes (can be) made in C++. Previously named `Code` Code: Tests Measurement, self-control, statistics, balancing. json-styled JSON lint passed, label assigned by github actions
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants