From e213380547c91fb7816a6ee2209f079eb507f855 Mon Sep 17 00:00:00 2001 From: "copilot-swe-agent[bot]" <198982749+Copilot@users.noreply.github.com> Date: Thu, 23 Jul 2026 06:00:55 +0000 Subject: [PATCH 1/3] Initial plan From 776f13978a0a4e10a0b2ad973139b02a56d2b0c9 Mon Sep 17 00:00:00 2001 From: "copilot-swe-agent[bot]" <198982749+Copilot@users.noreply.github.com> Date: Thu, 23 Jul 2026 06:11:09 +0000 Subject: [PATCH 2/3] Fix MTA pybind API mismatch for notebook CI build --- pybind/MTA.cpp | 13 ++++++++++--- 1 file changed, 10 insertions(+), 3 deletions(-) diff --git a/pybind/MTA.cpp b/pybind/MTA.cpp index 1500574..b5c52cd 100644 --- a/pybind/MTA.cpp +++ b/pybind/MTA.cpp @@ -22,6 +22,7 @@ void bind_multi_thread_analysis(py::module& m) { public: using MTA::MTA; using MTA::runOnModule; + void detect() { reportRaces(); } }; py::class_>(m, "MTA", "Multi-Thread Analysis class") @@ -38,7 +39,10 @@ void bind_multi_thread_analysis(py::module& m) { }), py::arg("tct"), "Initialize MHP analysis", py::keep_alive<1, 2>()) - .def("analyze", &MHP::analyze, "Analyze entry") + .def("analyze", [](MHP& self) { + TCT* tct = self.getTCT(); + self.analyze(tct->getPTA()->getICFG(), static_cast(tct->getThreadCallGraph())); + }, "Analyze entry") .def("mayHappenInParallelInst", &MHP::mayHappenInParallelInst, py::arg("node1"), py::arg("node2"), "Check if two ICFG nodes may happen in parallel"); @@ -46,10 +50,13 @@ void bind_multi_thread_analysis(py::module& m) { py::class_>(m, "LockAnalysis", "Lock Set Analysis class") .def(py::init([](std::shared_ptr tct){ return std::make_shared(tct.get()); - ;}) + }) , py::arg("tct"), "Initialize Lock Set analysis", py::keep_alive<1, 2>()) - .def("analyze", &LockAnalysis::analyze, "Analysis entry") + .def("analyze", [](LockAnalysis& self) { + TCT* tct = self.getTCT(); + self.analyze(tct->getPTA()->getICFG(), static_cast(tct->getThreadCallGraph())); + }, "Analysis entry") .def("isProtectedByCommandLock", &LockAnalysis::isProtectedByCommonLock, py::arg("node1"), py::arg("node2"), "Check if two ICFG nodes are protected by common locks"); From b710a6eb232bb97720d026165b8cd6b7cd73ca1b Mon Sep 17 00:00:00 2001 From: "copilot-swe-agent[bot]" <198982749+Copilot@users.noreply.github.com> Date: Thu, 23 Jul 2026 06:18:50 +0000 Subject: [PATCH 3/3] Fix typo: isProtectedByCommandLock -> isProtectedByCommonLock --- pybind/MTA.cpp | 2 +- pysvf/pysvf.pyi | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/pybind/MTA.cpp b/pybind/MTA.cpp index b5c52cd..0d64ef0 100644 --- a/pybind/MTA.cpp +++ b/pybind/MTA.cpp @@ -57,7 +57,7 @@ void bind_multi_thread_analysis(py::module& m) { TCT* tct = self.getTCT(); self.analyze(tct->getPTA()->getICFG(), static_cast(tct->getThreadCallGraph())); }, "Analysis entry") - .def("isProtectedByCommandLock", &LockAnalysis::isProtectedByCommonLock, + .def("isProtectedByCommonLock", &LockAnalysis::isProtectedByCommonLock, py::arg("node1"), py::arg("node2"), "Check if two ICFG nodes are protected by common locks"); diff --git a/pysvf/pysvf.pyi b/pysvf/pysvf.pyi index dafc5ee..f4ae35e 100644 --- a/pysvf/pysvf.pyi +++ b/pysvf/pysvf.pyi @@ -2076,4 +2076,4 @@ class MHP: class LockAnalysis: 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: ...