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

GenSim Type Inference Failure due to Constants #221

Closed
GeorgeR227 opened this issue Mar 27, 2024 · 3 comments
Closed

GenSim Type Inference Failure due to Constants #221

GeorgeR227 opened this issue Mar 27, 2024 · 3 comments
Assignees

Comments

@GeorgeR227
Copy link
Collaborator

Running the physics in the canonical heat transfer model here: https://algebraicjulia.github.io/Decapodes.jl/dev/canon/#Decapodes.Canon.Physics.:heat_transfer, will fail to compile due to an unmatched hodge star. This occurs due to a type inference failure.

The reason for this happening is that gensim will replace constants and parameters with infer types, for various reasons, and then run an infer/resolve cycle. However since this functionality was added in gensim, several rules have come out dealing with constants. Thus if a user were to run an infer/resolve cycle themselves and then use gensim, this will compile.

Best solution here would be to add a infer/resolve cycle before the types are changed to use to constant typing rules.

@GeorgeR227 GeorgeR227 self-assigned this Mar 27, 2024
@lukem12345
Copy link
Member

I agree with that solution (hopefully, a one-liner call to infer and resolve). No big refactoring should be done for now, unless the timetable for GAT refactoring is delayed.

@GeorgeR227
Copy link
Collaborator Author

At least on this physics, I've tested that change and it seems to work fine. Fortunately, refactoring has to be done now anyways to allow for switching between CPU/CUDA code generation.

@lukem12345
Copy link
Member

Ok. Feel free to make a tiny PR that fixes this issue, and open a new issue for general refactoring. Or more particular issues as convenient.

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

2 participants