fix(bitmachine): fix frame data offsets send to tracker (fixes Execution reached a pruned branch)#362
Open
stringhandler wants to merge 2 commits intoBlockstreamResearch:masterfrom
Open
Conversation
…cker read iterator The tracker was receiving a bit iterator anchored at the frame's start rather than the current cursor position. When a `case` node executes inside another `case` or `drop`, the read frame cursor has already advanced past the start, so the tracker read stale bits and recorded the wrong branch. This caused `assertl`/`assertr` pruning to remove the wrong branch after execution. Adds a regression test covering the specific `comp (pair (injl (injr unit)) unit) (case (case unit unit) unit)` pattern that triggered the bug.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Fixes some bugs where the data sent from the bitmachine to trackers would not start at the current cursor, resulting in some random junk being seen by the tracker. This doesn't have an effect on full programs, but when pruning this seems to generate an incorrect pruning, as seen in #337.
The following code now prunes and runs correctly:
Whereas previously it would fail on
Execution failed: Execution reached a pruned branch: fd6503b9fd020b8d4ed75deb14cc05bbcb91da392ba4b675f2b2345dabb1cde5Some excerpts from StderrTracker:
I haven't tried it on @KyrylR 's specific SHRINCS test on that issue.
NOTE: I have based this off an older commit so I could test it with SimplicityHL, which doesn't compile with the latest
rust-simplicityNOTE: the unit test is written by Claude (Happy to remove it if needed)