Skip to content

Conversation

@Jokeren
Copy link
Contributor

@Jokeren Jokeren commented Nov 1, 2025

No description provided.

@Jokeren Jokeren linked an issue Nov 1, 2025 that may be closed by this pull request
@Jokeren Jokeren marked this pull request as ready for review November 4, 2025 17:22
Copy link

@chatgpt-codex-connector chatgpt-codex-connector bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Comment on lines +173 to +200
DenseSet<VirtualBlock> exitVirtualBlocks;
while (!virtualBlockList.empty()) {
VirtualBlock &virtualBlock = virtualBlockList.front();
virtualBlockList.pop_front();
// Evaluate the transfer function for this block starting from the cached
// input state.
auto inputBlockInfo = inputBlockInfoMap[virtualBlock];
SmallVector<VirtualBlock> successors;
Block::iterator startIt = virtualBlock.second.isValid()
? std::next(virtualBlock.second)
: virtualBlock.first->begin();
for (Operation &op : llvm::make_range(startIt, virtualBlock.first->end())) {
if (op.hasTrait<OpTrait::IsTerminator>() ||
isa<RegionBranchOpInterface>(op)) {
visitTerminator(&op, successors);
break;
}
if (auto recordOp = dyn_cast<RecordOp>(&op)) {
auto scopeId = opToIdMap.lookup(recordOp);
if (recordOp.getIsStart()) {
inputBlockInfo.insert(scopeId);
} else {
inputBlockInfo.erase(scopeId);
}
}
}
if (successors.empty()) {
exitVirtualBlocks.insert(virtualBlock);

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P1 Badge Report scopes left open when exiting the function

The reachability stage tracks exit blocks in exitVirtualBlocks (lines ~173‑200) but never inspects the active scope set when those blocks are reached. As written, the loop only diagnoses mismatched proton.record operations inside individual blocks (lines ~216‑243); it never emits a diagnostic if a scope is still active when control leaves the function. This means a scope that starts before a conditional and only ends on one branch will silently pass analysis even though the other branch exits with the scope open, leading to inconsistent instrumentation at runtime.

Useful? React with 👍 / 👎.

@fywkevin fywkevin merged commit 781273a into main Nov 4, 2025
9 checks passed
@fywkevin fywkevin deleted the keren/proton-scope branch November 4, 2025 19:32
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Proton's ScopeIdAllocation::run verification is too limiting

3 participants