[Formal][Property Annotation] Annotate path--single-sent-fork-output#713
Draft
Basmet0 wants to merge 10 commits intoEPFL-LAP:mainfrom
Draft
[Formal][Property Annotation] Annotate path--single-sent-fork-output#713Basmet0 wants to merge 10 commits intoEPFL-LAP:mainfrom
Basmet0 wants to merge 10 commits intoEPFL-LAP:mainfrom
Conversation
Jiahui17
reviewed
Jan 29, 2026
Comment on lines
+316
to
+317
| std::vector<std::string> names{}; | ||
| std::vector<unsigned> outputs{}; |
Member
There was a problem hiding this comment.
Store the ops instead of names (extract the names just right before dumping them to json
Makes more sense to have an internal data structure for holding the path we need, something like:
// Stored in detail namespace since they are internal data structures for implementing algorithms
namespace detail {
/// Add the documentation here
struct BufferLessPathNode {
Operation op;
Value val;
};
};
Comment on lines
+287
to
+309
| LogicalResult | ||
| HandshakeAnnotatePropertiesPass::annotatePathSingleForkSentIterate( | ||
| const std::unordered_set<std::string> &visitedSet, | ||
| const std::vector<std::string> &prevForks, | ||
| const std::vector<unsigned> &prevIdxs, Operation &curOp, | ||
| bool annotateIdxs) { | ||
| for (auto [i, res] : llvm::enumerate(curOp.getResults())) { | ||
| std::vector<unsigned> nextIdxs = prevIdxs; | ||
| if (annotateIdxs) { | ||
| nextIdxs.push_back(i); | ||
| if (failed(annotatePathSingleForkSentPushProperty(prevForks, nextIdxs))) { | ||
| return failure(); | ||
| } | ||
| } | ||
| for (auto *op : res.getUsers()) { | ||
| if (failed(annotatePathSingleForkSentDecide(visitedSet, prevForks, | ||
| nextIdxs, *op))) { | ||
| return failure(); | ||
| } | ||
| } | ||
| } | ||
| return success(); | ||
| } |
Member
There was a problem hiding this comment.
This could be inline into the code below (path enumeration algorithm shouldn't be split in half)
Comment on lines
+260
to
+285
| LogicalResult HandshakeAnnotatePropertiesPass::annotatePathSingleForkSentDecide( | ||
| std::unordered_set<std::string> visitedSet, | ||
| const std::vector<std::string> &prevForks, | ||
| const std::vector<unsigned> &prevIdxs, Operation &curOp) { | ||
|
|
||
| // If this operation has been visited, there is nothing to do | ||
| std::string id = getUniqueName(&curOp).str(); | ||
| if (auto iter = visitedSet.find(id); iter != visitedSet.end()) { | ||
| return success(); | ||
| } | ||
| visitedSet.insert(id); | ||
|
|
||
| // Found a slot, which marks the end of this path | ||
| if (auto bufOp = dyn_cast<handshake::BufferLikeOpInterface>(curOp)) { | ||
| return success(); | ||
| } | ||
|
|
||
| if (auto forkOp = dyn_cast<handshake::EagerForkLikeOpInterface>(curOp)) { | ||
| auto nextForks = prevForks; | ||
| nextForks.push_back(id); | ||
| return annotatePathSingleForkSentIterate(visitedSet, nextForks, prevIdxs, | ||
| curOp, true); | ||
| } | ||
| return annotatePathSingleForkSentIterate(visitedSet, prevForks, prevIdxs, | ||
| curOp, false); | ||
| } |
Member
There was a problem hiding this comment.
Also could be inlined (so we have a full picture of the algorithm
Comment on lines
+34
to
+35
| if (s == "PSSFO") | ||
| return FormalProperty::TYPE::PSSFO; |
Member
There was a problem hiding this comment.
Could you expand all the acronyms? Very hard to read
added 9 commits
February 5, 2026 14:14
added example for what invariant2 looks like in smv
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.
The following invariant is annotated during the HandshakeAnnotateProperties pass: Along a path without any slots, only a single fork output along that path can be in the
sentstate.Approach: Start a path at a fork, follow it forwards using DFS and annotate the path at each fork.