-
Notifications
You must be signed in to change notification settings - Fork 373
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
Make recent run-layer optimizations optional, and fix init ops-related false positive #1672
Make recent run-layer optimizations optional, and fix init ops-related false positive #1672
Conversation
… false positive Signed-off-by: Chris Hellmuth <chellmuth@gmail.com>
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, good catch, I also missed noticing that the init_ops might interact poorly with your prior change
Is the new |
@@ -1024,6 +1024,7 @@ ShadingSystemImpl::ShadingSystemImpl(RendererServices* renderer, | |||
, m_opt_middleman(true) | |||
, m_opt_texture_handle(true) | |||
, m_opt_seed_bblock_aliases(true) | |||
, m_opt_useparam(false) |
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.
Will then be enabled by default once confidence in its correctness is established?
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.
Right. Chris is reverting most of the original change, and also putting this option in that defaults off but will allow it to be turned on selectively (after it's re-introduced, hopefully fixed) while we're gaining confidence, then will eventually be switched to default on (with ability to turn it off if anything fishy happens).
* Don't insert redundant run layer calls inside a basic block (AcademySoftwareFoundation#1665) * Apply recent run layer call optimization to batched execution (AcademySoftwareFoundation#1669) * Do-over: Make recent run-layer optimizations optional, and fix init ops-related false positive (AcademySoftwareFoundation#1672) * fix for ReParameterization corner case (AcademySoftwareFoundation#1670) * RendererServices API for letting get_texture_handle consider colorspace (AcademySoftwareFoundation#1641) * Set up ray types for testrender (AcademySoftwareFoundation#1648) * testrender: Don't use the cached background map on the first bounce (AcademySoftwareFoundation#1649) * Switch lockgeom to interpolated and interactive (AcademySoftwareFoundation#1662) * Add type information for needed attributes. (AcademySoftwareFoundation#1650) Note that this bump to 1.13.3.x is only for Arnold at this point, and not yet for the platforms, so to make CI go faster I have rigged .spdev.yaml to only build the sparnold versions at this time. Also updated ABI dump files. See merge request spi/dev/3rd-party/osl-feedstock!47
Description
My initial implementation of the run layer check optimizations didn’t account for the fact that init ops for symbols have their llvm code generated before we build basic blocks from the OSL IR.
This caused the code to be wrong in two ways: 1) the set of known run layer calls was being reset between instances too late in the pipeline, so a useparam inside an init op would actually be checking the previously compiled layer’s set, and 2) even when reset earlier, it assumed valid basic block ids existed for the init ops when they did not.
So, if a layer had a useparam inside one of its init ops that generally matched the same code location as a useparam in the previously compiled layer, the run layer check could be incorrectly omitted.
I’ve updated the code so that the default optimization behavior is reverted to the way it was before #1665, and added a new option
opt_useparam
that can be turned on to enable a fixed, restricted version of the optimization that only applies to code in the main section.Tests
I'm working on a test that properly triggers the issue.
Checklist: