-
Notifications
You must be signed in to change notification settings - Fork 48
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
[data types] Enforce type checking #710
Conversation
45de9e0
to
8f6227e
Compare
8f6227e
to
9849b96
Compare
The test failure seems unrelated. |
can you clarify this? your numbered list only goes up to 5 I think I'm most worried about
mainly based around the discussion about whether you can have one-bit number types (like a 1 bit unsigned integer vs a 1 bit twos-compliment signed integer). I forget: do we allow these? Even if we don't: there were some convincing arguments made in their favor. In this world: a one-bit unsigned integer is basically the same as |
I'm confused about this. My technical confusion is that you deleted the unit test but you didn't delete the testing function. Did you mean to delete both? Philosophically: the |
Sorry, 4 and 5 (reinterpreting essentially) which is related to your 1-bit concern below. Should we allow the free reinterpretation of an unisgned int to a signed int under the assumption the developer know's what they're doing? In the classical case perhaps we don't care about the value in the register and just want to reuse the "variable" / qubits for something else so assume things will be appropriately cleared before use.
We do allow the one bit integers as you described. I think this comparison is related more generally to the point above about integers. My sense is we shouldn't be too strict to avoid adding a bunch of Cast boilerplate, but I could be convinced. |
I deleted the test because the error raised was from the type check in process soquets. I wasn't sure what the right way to bypass that check was and was unsure if the function was useful elsewhere? Given your comment it seems like the correct way to test this method would be to not use the BloqBuilder or maybe the test is now redundant? |
Ah, I understand now. The other unit tests for the testing functions (head spin) use the helper function
|
@mpharrigan is this good to go? |
The type checking raised a bug in the THC bloq with register mismatch which is a good sign. I fixed that too (although, still not entirely satisfied with our grouping for Select and Prepare #549)
The check in process soquets checks both the type and the register size. The register size was not being checked before so this sort of deprecates the assert_connections_compatible check (I deleted that unit test).
The current type consistency is a bit sketchy:
Maybe 5 and 6 should go away and we should add casts (#725)? This runs the risk of making the code more verbose.