-
Notifications
You must be signed in to change notification settings - Fork 121
Fix nsga2 bug #438
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 nsga2 bug #438
Conversation
Codecov ReportAll modified and coverable lines are covered by tests ✅
Additional details and impacted files@@ Coverage Diff @@
## main #438 +/- ##
===========================================
+ Coverage 75.18% 85.97% +10.78%
===========================================
Files 22 22
Lines 3313 3315 +2
===========================================
+ Hits 2491 2850 +359
+ Misses 822 465 -357 ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
|
Looks like the segfault is showing up again |
|
Pushed some changes and updated the original post, but seems that some tests are still possibly flaky.. |
marcomangano
left a comment
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 for the fixes. I think we could merge this and see if the failures still show up as we work on #435 . Fine with skipping Windows tests if they turn out to be the problem.
|
Bump @eirikurj |
eirikurj
left a comment
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.
Looks good, see my one comment for now.
| a2[i] = temp; | ||
| } | ||
| for (i=0; i<global.popsize; i+=4) | ||
| for (i=0; i<global.popsize-4; i+=4) |
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.
Allowing any popsize the previous implementation does look like a bug indeed, and it will run past, e.g., popsize=5 will try to run through 4,5,6,7 so out of bounds. However, the current patch I think is not fully sufficient though since depending on popsize it might skip the last four e.g., popsize=8, or if popsize=4 it will just not run at all. I think the better solution is the one you suggested that is enforcing popsize in increments of four. This requires the least amount of code changes and avoids these corner cases. If we want to allow any popsize, then this logic and code needs to be improved further. In its current state though, we will need to skip some regardless, which makes allocating a larger popsize useless and not worth it.
I think we should revert this and just enforce popsize % 4 == 0 as this will also catch the popsize<4 case. I can push some changes. Feel free to change or update as needed.
|
@eirikurj agree with what you said, change looks good. Since I can't approve my own PR please approve/merge. Thanks! |
Purpose
Closes #340 (hopefully)...
Summary of changes:
-ivia testflo causes the tests to pass locally. I did take a quick look with Valgrind but it seems that the C code is just super messy and I guess I'm not surprised it's not reentrant.-i. If this keeps happening we can choose to disable those tests again I suppose..Expected time until merged
Type of change
Testing
Checklist
flake8andblackto make sure the Python code adheres to PEP-8 and is consistently formattedfprettifyor C/C++ code withclang-formatas applicable