-
Notifications
You must be signed in to change notification settings - Fork 0
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
Crash on long-running Simnet sessions #78
Comments
/cc @hugocaillard |
@fariedt, thank you for opening this issue! We’re aware of it. This occurs in the By the way, what’s your use case for |
Thanks @BowTiedRadone . |
@BowTiedRadone @fariedt i think i spoke too soon. It just crashed. I am on Ubuntu 22.04.5 LTS, node v20.16.0 and commit
or maybe i didn't apply the patch correctly. |
Thank you for the update, @hassan-truscova! As mentioned earlier, this issue will continue occurring due to the behavior of |
Thanks everyone for the feedback! These reports are incredibly helpful for understanding usage patterns and We'll monitor the upstream clarinet-sdk issue, but I must admit that the crash may not be our most pressing concern. The run counts being used (1.8M+) are much higher than what's typically practical for stateful/property-based/invariant testing. We should probably adjust
IME, here's why such long runs aren't usually worthwhile:
That said, thanks for pushing the limits! It helps us understand where things break. (In fact, #80, and others to come while we'll be monitoring hirosystems/clarinet#1636.) |
After yesterday's research, here's an update on this issue: What’s Happening:
Thanks to these changes, generator-level crashes that caused unhandled errors have been resolved. Our part is now complete, and we await a resolution to the upstream issue. |
Now that #80 is merged, you can run as many iterations as clarinet-sdk supports. The limit is essentially determined by clarinet-sdk (tracked in hirosystems/clarinet#1636). Given the discussion above and hirosystems/clarinet#1636, there are no actions left on our end. I’m closing this. The issue remains searchable and can be reopened if needed. Thanks for your feedback—looking forward to more use cases! ❤️ |
@fariedt @moodmosaic @BowTiedRadone In order to mitigate this issue, we could try to improve the memory usage of the Simnet (this is not a priority for us right now). A more ideal solutions would be to write the fuzzer in Rust directly. With the current architecture, rendezvous will always suffer from this problem. |
This presents at least three significant challenges, despite my appeal from Haskell/Hedgehog background and the initial exploration with Clarity VM in #19:
The sensible path forward is maintaining the current implementation. Rust may sound technically superior but such rewrite costs outweigh the benefits, especially given the existing battle-tested tooling. That said, a Rust implementation might be beneficial for other scenarios, such as providing built-in fuzzing support directly from clarinet as discussed in hirosystems/clarinet#398 (comment).
Yes 👍 In reference to running 1.8M+ tests, as noted in #78 (comment), it's more effective to split the runs into multiple sessions with different seeds. |
@moodmosaic @BowTiedRadone @hugocaillard Thanks a lot for actively solving the issue, i really appreciate it. As for what @moodmosaic said,
I agree that the additional cycles are better spent on advanced techniques or exploration rather than trying to get lucky in breaking the invariant. In some cases, the fuzzer might not be able to break it, hence, it doesn't make sense to waste compute. Since you mentioned coverage, i assume Rendezvous will also have coverage guidance at some point, right? Anyway, i will pull the changes and start the example again. In case anything breaks, i will report. Thanks again :) |
@hassan-truscova, that'd be great. I'm not fully sure if that's a Clarinet feature or something from the Clarinet SDK. @hugocaillard, do we have coverage support for (Clarity) code in the Clarinet SDK? That link throws a 404. |
@moodmosaic Yes you can get the coverage |
yes it's possible for you to get the the coverage. It's not well documented since it's internal stuff (not meant to be used by end users) but it's definitely doable |
@hugocaillard any example usage? |
@moodmosaic And the lcov file is written when the test is ended, it's happening in the vitest-environement-clarinet package, here You can get it to work in rendezvous as well with the |
I think beyond a certain point you'll end up needing formal verification. |
@mali-tintash: perhaps we could apply formal verification in Clarity through property/invariant checking. Are there existing tools for this? @jcnelson @obycode might find this relevant alongside the static analysis work for stacks-core#5360. |
@moodmosaic @hugocaillard apologies for the delayed update. I understand the previous comments but just want to post an update. It seems, it is still crashing. The time it took to crash is also written at the end.
I am on |
@mali-tintash i don't understand the context. secondly, as pointed out by @moodmosaic here, are there any existing tools for formal verification in Stacks ecosystem or for Clarity? i was checking online recently and also had a short informative discussion with @moodmosaic , it seems apparently there are no formal verification tools for Clarity/Stacks chain. I started a discussion thread recently to ask for formal verification tools for Clarity. so far there are no responses, or maybe soon someone will respond as holidays come to an end. I won't clutter this thread with formal verification discussion. If you know some tools or want to talk about it, please join the discussion thread. |
@hassan-truscova, re: #78 (comment) Yes, that's correct. If someone wants to run rendezvous 24/7—which shouldn't really—they'll hit the 4 GB cap. |
This is with node v22.11.0 on macOS 15.2, against commit #a1467ddf5591696ddac70e79860d16be8dbf690b (master branch).
Long-running tests crash after about 1.8 million invariant tests. I ran into this with a small contract I was testing, and verified that it occurs with the example code. Output:
I can share my log file, but there doesn't appear to be anything interesting or unusual in it. It's about 4.5 MB, compressed.
The text was updated successfully, but these errors were encountered: