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

mulsign_neg for floating point types ends up calling drjit-core's jitc_var_not which expects int or bool types #325

Open
tazlarv opened this issue Jan 9, 2025 · 0 comments

Comments

@tazlarv
Copy link

tazlarv commented Jan 9, 2025

Implementation of mulsign_neg was changed recently in 8d7346e - for floating point types it now calls detail::andnot_ which deeper down in the call stack ends up calling drjit-core's jitc_var_not. This method starts with jitc_var_check<IsIntOrBool>("jit_var_not", a0); check which fails on type mismatch (float vs IsIntOrBool) resulting in exception being raised in debug builds (type checks are in !defined(NDEBUG) block).

Either jitc_var_not can in addition to int and bool types also handle floating point types and therefore the type check should be adjusted (e.g., something like IsArithmeticOrBool?) or it can not and then higher level functions like mulsign_neg should not use it when handling floating point types. I have not observed any practical issues on release (with type checks skipped) yet, but if mulsign_neg implementation would have to be adjusted, then additionally also copysign_neg (changed in the same commit) exhibits the same problem.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant