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

No pattern found for opcode Fadd: Xxr #87

Open
belm0 opened this issue Jul 4, 2022 · 2 comments
Open

No pattern found for opcode Fadd: Xxr #87

belm0 opened this issue Jul 4, 2022 · 2 comments
Labels
sp-correctness static python correctness staticpython static python issues

Comments

@belm0
Copy link
Contributor

belm0 commented Jul 4, 2022

$ docker run -v $PWD:/vol -it --rm ghcr.io/facebookincubator/cinder-runtime:cinder-3.8 -X jit -m compiler --static vol/autogen_bug.py
JIT: /cinder/src/Jit/codegen/autogen.cpp:143 -- assertion failed: func != nullptr
No pattern found for opcode Fadd: Xxr
from __static__ import box, double, inline

@inline
def foo(a: double, b: double) -> double:
    return b - a

def main():
    c: double = 0.
    for _ in range(10):
        c += foo(.4, .97)
    print('done', box(c))

if __name__ == '__main__':
    main()

The problem goes away if @inline is removed.

See in seen in cinder-3.8.6c2de94

@belm0
Copy link
Contributor Author

belm0 commented Jul 4, 2022

workaround is to explicitly cast the float literals to double:

c += foo(double(.4), double(.97))

it's surprising to have @inline change the conventions of implicit conversion of the args

@carljm
Copy link
Contributor

carljm commented Jul 12, 2022

Yes, inlining definitely shouldn't have that effect, this is just a bug where the JIT is missing support for some float operations, it looks like. Float support is unfortunately not super well baked still (we don't use it much in prod), but we should be able to to get around to fixing this at some point, thanks for the report!

@carljm carljm added staticpython static python issues sp-correctness static python correctness labels Jul 12, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
sp-correctness static python correctness staticpython static python issues
Projects
None yet
Development

No branches or pull requests

2 participants