-
Notifications
You must be signed in to change notification settings - Fork 18
feat: Add unsafe array take and put operations #1165
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
base: main
Are you sure you want to change the base?
Conversation
Codecov Report❌ Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## main #1165 +/- ##
=======================================
Coverage 92.78% 92.78%
=======================================
Files 119 119
Lines 10944 10952 +8
=======================================
+ Hits 10154 10162 +8
Misses 790 790 ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
ss2165
left a comment
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 like
take_unsafe and return_unsafe
| class ArraySetitemCompiler(ArrayCompiler): | ||
| """Compiler for the `array.__setitem__` function.""" | ||
|
|
||
| def __init__(self, elem_first: bool = False): |
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.
please document the kwarg
|
This is waiting on an updated implementation using borrow array, which requires a "check" HUGR operation CQCL/hugr#2569 |
|
My main comment is that this makes the analysis for borrow-return "squashing" substantially harder (and/or less effective). See CQCL/tket2#1159 . Doesn't mean we can't do this, but we may want to hold off. UPDATE: I've reduced scope of that squashing meaning that it is now "safe" even given this PR, although CQCL/tket2#1176 would still be useful (not essential). |
I'm reluctant to add this, but this should remove the need for people to use option-arrays.
Questions:
puta good name?_unsafesuffix?