-
Notifications
You must be signed in to change notification settings - Fork 8
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
feat: Add llvm codegen for collections.static_array #2003
base: main
Are you sure you want to change the base?
Conversation
Codecov ReportAttention: Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## main #2003 +/- ##
==========================================
+ Coverage 83.73% 83.82% +0.08%
==========================================
Files 209 210 +1
Lines 39266 39645 +379
Branches 35937 36315 +378
==========================================
+ Hits 32879 33232 +353
+ Misses 4541 4537 -4
- Partials 1846 1876 +30
Flags with carried forward coverage won't be shown. Click here to find out more. ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
I've deleted some old unusued snapshots (via |
check_emission!(hugr, llvm_ctx); | ||
} | ||
|
||
#[rstest] |
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.
Do we handle zero-length static arrays? Can we add a test to prove it?
#[case(1, StaticArrayValue::try_new("b", float64_type(), (0..10).map(|x| ConstF64::new(x as f64).into())).unwrap())] | ||
#[case(2, StaticArrayValue::try_new("c", bool_t(), (0..10).map(|x| Value::from_bool(x % 2 == 0))).unwrap())] | ||
#[case(3, StaticArrayValue::try_new("d", option_type(usize_t()).into(), (0..10).map(|x| Value::some([ConstUsize::new(x)]))).unwrap())] | ||
fn static_array_const_codegen( |
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.
This and the following test fail when I run
cargo test --all-features --workspace
with the error
thread 'extension::collections::static_array::test::static_array_const_codegen::case_1' panicked at hugr-llvm/src/emit/test.rs:177:48:
Parent node Node(1) has extensions [arithmetic.conversions, arithmetic.float, arithmetic.float.types, arithmetic.int, arithmetic.int.types, collections.array, collections.list, logic, prelude] that are too restrictive for child node Node(4), they must include child extensions [collections.static_array, prelude]
I guess we need to annotate them so that they don't run with the extension_inference
feature?
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.
Nope, I will fix it so that it works
}); | ||
assert_eq!(expected, exec_ctx.exec_hugr_u64(hugr, "main")); | ||
} | ||
} |
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.
Maybe a test with arrays of arrays would also be good.
Co-authored-by: Alec Edgington <54802828+cqc-alec@users.noreply.github.com>
Co-authored-by: Alec Edgington <54802828+cqc-alec@users.noreply.github.com>
…g/static-arrays-llvm
…static-arrays-llvm
This PR contains breaking changes to the public Rust API. cargo-semver-checks summary
|
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.
LGTM, but this is now breaking -- are we OK with that?
The PR that I merged in is breaking, and we are OK with that because we have not released the breaking apis. |
No description provided.