[Interp] Multi-trace interpreter#186
Merged
Nikil-Shyamsunder merged 3 commits intomainfrom Feb 15, 2026
Merged
Conversation
ngernest
approved these changes
Feb 15, 2026
Contributor
ngernest
left a comment
There was a problem hiding this comment.
Great idea -- thanks for implementing this, looks good!
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.
PR Summary
This change adds multi-trace execution support to the interpreter. If we merge this, then update the monitor PR #181 to reflect this syntax (very minor change), we can then do round trip testing where the interpreter
.txfile and.fstfile can go into the monitor, and the monitor-produces.outfile of transactions can go straight back into the interpreter, and we can even check if thefsts generated by the interpreter on the monitor executed transactions are equivalent to thefstgenerated by the interpreter on the original.txfile modulo DontCares!In
interp/src/main.rs, the interpreter now parses a.txfile as multiple traces and runs them one by one in full isolation (fresh scheduler/interpreter state per trace).mainonly prints a per-trace status line (Trace N executed successfully!orTrace N execution failed.), and detailed errors still come from the existing diagnostic path (Scheduler::execute_todos-> diagnostic emitter). If--fstis provided, output filenames are suffixed by trace index (_0,_1, ...). The process still exits with failure if any trace fails.In
protocols/src/transactions.pest, the grammar explicitly supports a file as a sequence of trace blocks:Example multi-trace test:
protocols/tests/adders/adder_d1/add_multitrace.txObserved output:
protocols/tests/adders/adder_d1/add_multitrace.outIt's a little unfortunate that the "Trace 1 execution failed." message comes at the end and not at the beginnign (before the error), but to change this would require significant code changes to the routing of the diagnostics that I don't think is worth changing (especially given a rewrite of that error handling part of the codebase is warranted sometime in the future).