-
Notifications
You must be signed in to change notification settings - Fork 3
test: Add integration tests lowering guppy programs #35
Conversation
528ef43
to
c98c979
Compare
Ahh, I need to fix CI to have python with guppylang in path for the tests. |
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.
Looks good to me 👍
The only thing I'm not sure about is if we should actually store the lowered Guppy examples as golden values. This only works if the node order outputted by Guppy is deterministic. AFAIK this is currently the case, but not sure if we want to guarantee that?
src/custom/float.rs
Outdated
let ty: FloatType<'c> = context | ||
.llvm_type(&k.get_type())? | ||
.try_into() | ||
.map_err(|_| anyhow!("Failed to get type of ConstF64 as FloatType"))?; |
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.
Can this error actually happen?
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 don't see how, you prefer unwrap
?
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.
Yes 👍
I think guppy node order should be deterministic, but it should also be unspecified. I.e. compiling the same program twice is guaranteed to give the same result, but it may change arbitrarily between guppy versions. I think it is worth some effort to ensure guppy is deterministic. There is certainly a lot of literature on the benefits of deterministic compilation and reproducible builds, and I would assume that the same arguments would apply to guppy. I agree that these golden tests are fragile and that when they break it will not be guppy's fault. On the other hand, for now they are convenient, allow by-hand inspection of codegen in github, and I can't think of a better way to test that compiling guppy works. Are you ok with leaving them in for now, and replacing them when they become too annoying, or when we come up with a better solution? Maybe execution tests. |
Fair enough. If we make that a Guppy requirement, we should probably verify it for all Guppy integration tests?
Yes, happy to merge the PR as is 👍 |
Co-authored-by: Mark Koch <48097969+mark-koch@users.noreply.github.com>
c8fc106
to
dc87ebd
Compare
## 🤖 New release * `hugr-llvm`: 0.1.0 <details><summary><i><b>Changelog</b></i></summary><p> <blockquote> ## [0.1.0](https://github.com/CQCL/hugr-llvm/releases/tag/v0.1.0) - 2024-07-10 ### Bug Fixes - Syntax error - sum type tag elision logic reversed - [**breaking**] Allow Const and FuncDecl as children of Modules, Dataflow Parents, and CFG nodes ([#46](#46)) ### Documentation - fix bad grammar ([#34](#34)) ### New Features - Emission for Call nodes - Support values - add `get_extern_func` ([#28](#28)) - lower CFGs ([#26](#26)) - Add initial codegen extension for `prelude` ([#29](#29)) - [**breaking**] `Namer` optionally appends node index to mangled names. ([#32](#32)) - Implement lowerings for ieq,ilt_s,sub in int codegen extension ([#33](#33)) - Add initial `float` extension ([#31](#31)) - Emit more int comparison operators ([#47](#47)) ### Refactor - clean up fat.rs ([#38](#38)) ### Testing - add a test for sum type tags - Add integration tests lowering guppy programs ([#35](#35)) </blockquote> </p></details> --- This PR was generated with [release-plz](https://github.com/MarcoIeni/release-plz/). --------- Co-authored-by: Douglas Wilson <douglas.wilson@quantinuum.com>
No description provided.