Skip to content

Fix execute-notebooks CI break by aligning MTA pybind bindings with current svf-lib APIs#65

Merged
yuleisui merged 3 commits into
mainfrom
copilot/fix-execute-notebooks-job-again
Jul 23, 2026
Merged

Fix execute-notebooks CI break by aligning MTA pybind bindings with current svf-lib APIs#65
yuleisui merged 3 commits into
mainfrom
copilot/fix-execute-notebooks-job-again

Conversation

Copilot AI commented Jul 23, 2026

Copy link
Copy Markdown
Contributor

execute-notebooks was failing before notebook execution because wheel build broke in pybind/MTA.cpp against current svf-lib headers. The binding code referenced removed/changed MTA APIs (detect and templated analyze methods) and failed to compile/link.

  • API compatibility: MTA.detect

    • Restored Python-facing MTA.detect() by adding a PublicMTA::detect() wrapper that forwards to reportRaces().
  • Templated analyze bindings (MHP, LockAnalysis)

    • Replaced direct method-pointer bindings (&Class::analyze) with explicit lambda adapters.
    • Lambdas now call templated analyze(ICFG*, CallGraph*) using graph objects derived from TCT/PTA, matching current upstream signatures.
  • Scope

    • Change is isolated to pybind/MTA.cpp; no workflow, notebook, or unrelated binding changes.
.def("analyze", [](MHP& self) {
    TCT* tct = self.getTCT();
    self.analyze(
        tct->getPTA()->getICFG(),
        static_cast<CallGraph*>(tct->getThreadCallGraph())
    );
}, "Analyze entry")

Copilot AI changed the title [WIP] Fix failing GitHub Actions job execute-notebooks Fix execute-notebooks CI break by aligning MTA pybind bindings with current svf-lib APIs Jul 23, 2026
Copilot AI requested a review from yuleisui July 23, 2026 06:11
@yuleisui
yuleisui marked this pull request as ready for review July 23, 2026 06:30
Copilot AI review requested due to automatic review settings July 23, 2026 06:30
@yuleisui
yuleisui merged commit 9451bed into main Jul 23, 2026
2 checks passed

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

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 to reportRaces() and bind it as MTA.detect().
  • Replace direct &Class::analyze bindings for MHP and LockAnalysis with lambda adapters calling the templated analyze(ICFG*, CallGraph*).
  • Rename the Python typing stub method LockAnalysis.isProtectedByCommandLock to isProtectedByCommonLock to 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 thread pybind/MTA.cpp
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")
Comment thread pysvf/pysvf.pyi
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: ...
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.

3 participants