-
Notifications
You must be signed in to change notification settings - Fork 242
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
Use variant-specific registry domains #1362
base: master
Are you sure you want to change the base?
Conversation
Previously, we could easily segfault when performing a vcall if an object was previously created with another variant. For example, a `spectral_polarized` BSDF and an `rgb` BSDF.
5ef6a7d
to
f2be908
Compare
This ended up being a fair bit more complicated that I expected, because now that the domain name depends on the But because If we find a simpler solution (either to the original issue or any of the implementation steps of this PR), I would be all for it. |
f2be908
to
139e607
Compare
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 agree that we should have some kind of a safety net for this issue.
Your suggested implementation seems fine. Changing the Domain
is what makes the most sense, in my opinion.
Could you change the macros to be prefixed with MI_
instead of MTS_
.
Also the CI is currently failing due to the variant_str
declaration being non-constexpr. I believe that you should be able to fix that with a std::array
again.
139e607
to
e265b06
Compare
Thanks for having a look @njroussel! I updated the macros to use I tried another implementation of the constexpr string concatenation (using more |
CI fails look like:
|
+ static_assert that our domain name override is detected to avoid bad surprises.
53c69f4
to
d4063dc
Compare
Using fewer intermediate Edit: CI is green! |
Hi @njroussel, Does the current state of this PR (+ the smaller one on the DrJit side: mitsuba-renderer/drjit#307) look good to you? |
Description
Previously, we could easily segfault when performing a vcall if an object was previously created with another variant. For example, a
spectral_polarized
BSDF and anrgb
BSDF.Other than fixing the case below, I don't think this change could hurt since we never need or want instances from different variants to participate in the same vcalls (?).
Testing
Checklist
cuda_*
andllvm_*
variants. If you can't test this, please leave below