-
Notifications
You must be signed in to change notification settings - Fork 343
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 asserts and build buster in debug build. #930
Fix asserts and build buster in debug build. #930
Conversation
- Fixed assert() in Tests/FileSystemModel_Test.cpp that broke the debug build. - Fixed asserts in Engine/EffectInstanceRenderRoI.cpp so that they are only checked if tiling is supported. The assert was accidentally applied to all cases when the code was refactored by NatronGitHub#918 - Updated Linux CI to build and test release AND debug builds. This should help avoid such issues from sneaking in going forward.
- Added helper functions to reduce redundant code, improve readability, and help clarify intent. - Added getSplitPath() and cleanPath() to FileSystemModel to make it easier to test and extend this functionality. - Added unit tests for some FileSystemModel functions to document existing behavior and make it easier to see how behavior changes with bug fixes. - Deleted unused code.
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.
Can we remove the function clipIfOverlaps() from the natron code?
if (frameArgs->tilesSupported && !roi.clipIfOverlaps(downscaledImageBoundsNc)) { | ||
return eRenderRoIRetCodeOk; | ||
if (frameArgs->tilesSupported) { | ||
if (!roi.clipIfOverlaps(downscaledImageBoundsNc)) { |
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.
Could we avoid side effects in conditions, and either have a const function overlaps(), and do the clip outside of the condition?
I think this clipIfOverlaps() function should be removed from the code, because it is used as a test at many places but also has a dangerous and misleading side effect.
No one expects a condition to modify the variable being tested. See c++ core guideline es.40 https://isocpp.github.io/CppCoreGuidelines/CppCoreGuidelines#es40-avoid-complicated-expressions
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.
I take your point and have some ideas on how to rework the clipIfOverlap() call sites so they don't need this type of function in a conditional. Can I defer those changes to a follow-up PR? I'd like to land this and #929 so that Windows and debug builds start working again.
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.
Friendly ping. I'd like to land this and #929 so the CI builds start working again. I'm happy to follow up with clipIfOverlap() fixes once the build and tests have been restored.
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.
LGTM
Thank you!
This change removes the return value for clipIfOverlaps() and updates all callers. This was done to address a comment made in NatronGitHub#930 (comment) - Removed return value from RectI::clipIfOverlaps() and RectD::clipIfOverlaps() - Introduced clip() that updates a RectI or RectD with the intersection of itself and another rectangle. - Reworked several clipIfOverlaps() callers to use clip() or intersect() instead of clipIfOverlaps().
This change removes the return value for clipIfOverlaps() and updates all callers. This was done to address a comment made in NatronGitHub#930 (comment) - Removed return value from RectI::clipIfOverlaps() and RectD::clipIfOverlaps() - Introduced clip() that updates a RectI or RectD with the intersection of itself and another rectangle. - Reworked several clipIfOverlaps() callers to use clip() or intersect() instead of clipIfOverlaps().
This change removes the return value for clipIfOverlaps() and updates all callers. This was done to address a comment made in NatronGitHub#930 (comment) - Removed return value from RectI::clipIfOverlaps() and RectD::clipIfOverlaps() - Introduced clip() that updates a RectI or RectD with the intersection of itself and another rectangle. - Reworked several clipIfOverlaps() callers to use clip() or intersect() instead of clipIfOverlaps().
This change removes the return value for clipIfOverlaps() and updates all callers. This was done to address a comment made in NatronGitHub#930 (comment) - Removed return value from RectI::clipIfOverlaps() and RectD::clipIfOverlaps() - Introduced clip() that updates a RectI or RectD with the intersection of itself and another rectangle. - Reworked several clipIfOverlaps() callers to use clip() or intersect() instead of clipIfOverlaps().
This change removes the return value for clipIfOverlaps() and updates all callers. This was done to address a comment made in NatronGitHub#930 (comment) - Removed return value from RectI::clipIfOverlaps() and RectD::clipIfOverlaps() - Introduced clip() that updates a RectI or RectD with the intersection of itself and another rectangle. - Reworked several clipIfOverlaps() callers to use clip() or intersect() instead of clipIfOverlaps().
This change removes the return value for clipIfOverlaps() and updates all callers. This was done to address a comment made in NatronGitHub#930 (comment) - Removed return value from RectI::clipIfOverlaps() and RectD::clipIfOverlaps() - Introduced clip() that updates a RectI or RectD with the intersection of itself and another rectangle. - Reworked several clipIfOverlaps() callers to use clip() or intersect() instead of clipIfOverlaps().
This change removes the return value for clipIfOverlaps() and updates all callers. This was done to address a comment made in NatronGitHub#930 (comment) - Removed return value from RectI::clipIfOverlaps() and RectD::clipIfOverlaps() - Introduced clip() that updates a RectI or RectD with the intersection of itself and another rectangle. - Reworked several clipIfOverlaps() callers to use clip() or intersect() instead of clipIfOverlaps().
This change removes the return value for clipIfOverlaps() and updates all callers. This was done to address a comment made in #930 (comment) - Removed return value from RectI::clipIfOverlaps() and RectD::clipIfOverlaps() - Introduced clip() that updates a RectI or RectD with the intersection of itself and another rectangle. - Reworked several clipIfOverlaps() callers to use clip() or intersect() instead of clipIfOverlaps().
Thanks for submitting a pull request! Please provide enough information so that others can review your pull request. Additionally, make sure you've done all of these things:
PR Description
What type of PR is this? (Check one of the boxes below)
What does this pull request do?
It fixes some assert() issues in debug builds that were introduced by #901 and #918 . It also updates the Tests GitHub Action so that it also runs a Linux debug build and runs the test for that build.
Have you tested your changes (if applicable)? If so, how?
I've verified locally on Linux that debug builds work and pass their tests. I've also verified the GitHub action builds the debug and release builds on Linux. (https://github.com/acolwell/Natron/actions/runs/6552600450/job/17796244295) Currently the windows build is failing because #929 has not been approved and committed yet.