-
Notifications
You must be signed in to change notification settings - Fork 13
TypeInferenceUnification error when unpacking two pairs #114
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
TypeInferenceUnification error when unpacking two pairs #114
Comments
Interesting. I couldn't reproduce the error on the Simfony IDE, but that website is running an older version. I will try the latest version next. |
Ok thanks! I'm using this cli tool, in case it might be handy: cargo install --git https://github.com/keep-starknet-strange/stark-symphony --rev d552969f2c64ce9fa80dc6a45bab17a4f6204bc9 simfony-cli Then to build & run: simfony run main.simf
simfony build main.simf --output-format simpl |
I could reproduce the error using your This bug might be related to issues on Windows (BlockstreamResearch/rust-simplicity#274) or issues with values (BlockstreamResearch/rust-simplicity#275). I am debugging and I will publish a new version of Simfony once I'm done. I will include a unit test with your program to prevent future regression. |
I think this might fix it in rust-simplicity -- it fixes a regression I found in the padded bit iterator of diff --git a/src/value.rs b/src/value.rs
index 3aea277..0d58f81 100644
--- a/src/value.rs
+++ b/src/value.rs
@@ -358,10 +358,10 @@ impl Value {
let total_width = cmp::max(inner.ty.bit_width(), right.bit_width());
let (concat, concat_offset) = product(
- Some((&inner.inner, inner.bit_offset)),
- inner.ty.bit_width(),
None,
total_width - inner.ty.bit_width(),
+ Some((&inner.inner, inner.bit_offset)),
+ inner.ty.bit_width(),
);
let (new_inner, new_bit_offset) = right_shift_1(&concat, concat_offset, false);
Self { |
I feel we should merge the change into the upstream repo, so I can update simfony. See BlockstreamResearch/rust-simplicity#281 |
Yep, for sure! Was just posting the code here because I had to run, this was a somewhat-related open tab, and I didn't want to lose track of it. Thanks for opening the PR for me. |
4b83c05 fix: Sum value regression (Christian Lewe) Pull request description: Fixes #275 I tried the fix [that was recommended](BlockstreamResearch/simfony#114 (comment)) on the Simfony crate and it made all examples pass. ACKs for top commit: apoelstra: ACK 4b83c05; successfully ran local tests Tree-SHA512: aa6710bd7ab1333bc17cec8a57297ca5c455904dea5bab59c01ac3fe37f9109dbd2d231e567e7510513dc2c9a2935f12dbd93a4a9e2d2aa29964a7d4727a86fb
Reopening since it's apparently not fixed. |
As far as Simfony is concerned, the bug is fixed. There is a passing unit test for this in the library. @m-kus please reconfirm or correct me if I'm wrong. |
@uncomputable there seems to be two related problems disguising as one, let's close this issue and I'll create a new one if that works better I created #117 to showcase the remaining problem (tbh I'm not fully sure it's on the Simfony side) and new issue #118 |
Thanks -- let's move to the other issue. |
0a974f1 ci: Run tests on other platforms (Christian Lewe) fb4a1d3 test: Check type error (Christian Lewe) 0dd62d2 feat: Support Apple silicon in flake (Christian Lewe) c4832fe fix: Prune test programs (Christian Lewe) 826351c chore: Keep elements::Locktime prefix (Christian Lewe) 854db1a chore: Use bundled hex crate (Christian Lewe) b3565e1 chore: Update rust-simplicity (Christian Lewe) c8e2565 chore: Bump MSRV to 1.78.0 (Christian Lewe) Pull request description: Update rust-simplicity to the latest version. This brings support for Mac and optimizations of the internal representation of Simplicity values. CI is enabled for Mac. Fixes #114 ACKs for top commit: apoelstra: ACK 0a974f1; successfully ran local tests Tree-SHA512: 50fabfa67e5539d552cd18435690aa23a4791e1188adb378853291c3c661253c4bdd48506e8603d9ecc4e20d73ace50f3a7dff81ed3317661aee35b68114b14a
I get
TypeInferenceUnification
error when trying to run the following program:This does not reproduce in BitMachine (I suppose because it does not run type checking?) but only when using https://github.com/BlockstreamResearch/rust-simplicity/blob/33b043f9a153f0d7be82dee8fbd61179ad63b888/simplicity-sys/src/tests/mod.rs#L113 (which calls the same code as Elements node under the hood).
When I'm trying to disassemble I get:
Error: failed to decode program: failed to apply bound
1to existing bound
2^64 × (2^64 × (2^64 × (2^64 × (2^64 × (2^64 × (2^64 × (2^64 × (2^64 × (2^64 × (2^64 × (2^64 × (2^64 × (2^64 × (2^64 × (2^64 × (2^64 × (2^64 × (2^64 × (2^64 × (2^64 × (2^64 × (2^64 × (2^64 × (2^64 × (2^64 × (2^64 × (2^64 × (2^64 × (2^64 × (2^64 × (2^64 × (2^64 × (2^64 × (2^64 × (2^64 × (2^64 × (2^64 × (2^64 × (2^64 × (2^64 × (2^64 × (2^64 × (2^64 × (2^64 × (2^64 × (2^64 × (2^64 × (2^64 × (2^64 × (2^64 × (2^64 × (2^64 × (2^64 × (2^64 × (2^64 × (2^64 × (2^64 × (2^64 × (2^64 × (2^64 × (2^64 × (2^64 × (... × ...))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))): comp combinator: left target = right source
The text was updated successfully, but these errors were encountered: