Fix execute-notebooks CI break by aligning MTA pybind bindings with current svf-lib APIs#65
Merged
Merged
Conversation
Copilot
AI
changed the title
[WIP] Fix failing GitHub Actions job execute-notebooks
Fix Jul 23, 2026
execute-notebooks CI break by aligning MTA pybind bindings with current svf-lib APIs
yuleisui
marked this pull request as ready for review
July 23, 2026 06:30
There was a problem hiding this comment.
Pull request overview
This PR updates the SVF-Python multi-thread analysis (MTA) pybind bindings to compile against current svf-lib APIs, restoring the MTA.detect() Python entrypoint and adapting MHP / LockAnalysis bindings to templated analyze(ICFG*, CallGraph*) signatures.
Changes:
- Add
PublicMTA::detect()wrapper that forwards toreportRaces()and bind it asMTA.detect(). - Replace direct
&Class::analyzebindings forMHPandLockAnalysiswith lambda adapters calling the templatedanalyze(ICFG*, CallGraph*). - Rename the Python typing stub method
LockAnalysis.isProtectedByCommandLocktoisProtectedByCommonLockto match the bound API.
Reviewed changes
Copilot reviewed 2 out of 2 changed files in this pull request and generated 2 comments.
| File | Description |
|---|---|
pybind/MTA.cpp |
Adds an MTA.detect() wrapper and switches MHP/LockAnalysis analyze() bindings to lambda adapters compatible with current svf-lib. |
pysvf/pysvf.pyi |
Updates the exposed typing stub to reflect the renamed LockAnalysis.isProtectedByCommonLock API. |
Comments suppressed due to low confidence (1)
pybind/MTA.cpp:59
- The new analyze() lambda forwards tct->getThreadCallGraph() without checking for null. If the thread call graph hasn’t been built yet, this will pass nullptr into the SVF analyze() overload and may crash. Consider mirroring the existing null check used in the TCT.getThreadCallGraph binding.
.def("analyze", [](LockAnalysis& self) {
TCT* tct = self.getTCT();
self.analyze(tct->getPTA()->getICFG(), static_cast<CallGraph*>(tct->getThreadCallGraph()));
}, "Analysis entry")
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
Comment on lines
+42
to
+45
| .def("analyze", [](MHP& self) { | ||
| TCT* tct = self.getTCT(); | ||
| self.analyze(tct->getPTA()->getICFG(), static_cast<CallGraph*>(tct->getThreadCallGraph())); | ||
| }, "Analyze entry") |
| def __init__(self, tct: 'TCT') -> None: ... | ||
| def analyze(self) -> None: ... | ||
| def isProtectedByCommandLock(self, icfg_node_id1: int, icfg_node_id2: int) -> bool: ... | ||
| def isProtectedByCommonLock(self, icfg_node_id1: int, icfg_node_id2: int) -> bool: ... |
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.
execute-notebookswas failing before notebook execution because wheel build broke inpybind/MTA.cppagainst currentsvf-libheaders. The binding code referenced removed/changed MTA APIs (detectand templatedanalyzemethods) and failed to compile/link.API compatibility:
MTA.detectMTA.detect()by adding aPublicMTA::detect()wrapper that forwards toreportRaces().Templated analyze bindings (
MHP,LockAnalysis)&Class::analyze) with explicit lambda adapters.analyze(ICFG*, CallGraph*)using graph objects derived fromTCT/PTA, matching current upstream signatures.Scope
pybind/MTA.cpp; no workflow, notebook, or unrelated binding changes.