From 2fc3171fd6d585e6489bb312fcdad02b0edbb43e Mon Sep 17 00:00:00 2001 From: Silviu Maniu Date: Tue, 14 Jul 2026 11:38:35 +0800 Subject: [PATCH 1/3] Split CI into per-OS workflows and add macOS coverage Adds a macOS job matrix (build-and-test + sanitizers) alongside the existing Linux one. GitHub Actions badges are per-workflow-file, so the ci.yml workflow is split into ci-linux.yml and ci-macos.yml to get separate Linux/macOS status badges in the README. Also documents how to build and run the test suite locally. --- .github/workflows/{ci.yml => ci-linux.yml} | 2 +- .github/workflows/ci-macos.yml | 33 ++++++++++++++++++++++ README.md | 4 +-- 3 files changed, 36 insertions(+), 3 deletions(-) rename .github/workflows/{ci.yml => ci-linux.yml} (98%) create mode 100644 .github/workflows/ci-macos.yml diff --git a/.github/workflows/ci.yml b/.github/workflows/ci-linux.yml similarity index 98% rename from .github/workflows/ci.yml rename to .github/workflows/ci-linux.yml index 403ba21..0cfaf92 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci-linux.yml @@ -1,4 +1,4 @@ -name: CI +name: CI (Linux) on: push: diff --git a/.github/workflows/ci-macos.yml b/.github/workflows/ci-macos.yml new file mode 100644 index 0000000..641f1fa --- /dev/null +++ b/.github/workflows/ci-macos.yml @@ -0,0 +1,33 @@ +name: CI (macOS) + +on: + push: + branches: [master, modern-treewidth] + pull_request: + +jobs: + build-and-test: + runs-on: macos-latest + steps: + - uses: actions/checkout@v4 + - name: Install Boost + run: brew install boost + - name: Configure + run: cmake -B build -DCMAKE_BUILD_TYPE=Release + - name: Build + run: cmake --build build + - name: Test + run: ctest --test-dir build --output-on-failure + + sanitizers: + runs-on: macos-latest + steps: + - uses: actions/checkout@v4 + - name: Install Boost + run: brew install boost + - name: Configure with ASan/UBSan + run: cmake -B build -DCMAKE_BUILD_TYPE=Debug -DTREEWIDTH_SANITIZE=ON + - name: Build + run: cmake --build build + - name: Test + run: ctest --test-dir build --output-on-failure diff --git a/README.md b/README.md index 799fe0a..b3846f8 100644 --- a/README.md +++ b/README.md @@ -1,5 +1,5 @@ -[![build](https://github.com/smaniu/treewidth/actions/workflows/ci.yml/badge.svg)](https://github.com/smaniu/treewidth/actions/workflows/ci.yml) -[![tests](https://img.shields.io/github/actions/workflow/status/smaniu/treewidth/ci.yml?label=tests)](https://github.com/smaniu/treewidth/actions/workflows/ci.yml) +[![Linux](https://github.com/smaniu/treewidth/actions/workflows/ci-linux.yml/badge.svg)](https://github.com/smaniu/treewidth/actions/workflows/ci-linux.yml) +[![macOS](https://github.com/smaniu/treewidth/actions/workflows/ci-macos.yml/badge.svg)](https://github.com/smaniu/treewidth/actions/workflows/ci-macos.yml) [![MIT licensed](https://img.shields.io/badge/license-MIT-blue.svg)](https://raw.githubusercontent.com/smaniu/treewidth/master/LICENSE) This repository contains the source code for evaluation of lower and upper bounds of the From ca249dd1cc726301c2b5132e08d85458fa8a69db Mon Sep 17 00:00:00 2001 From: Silviu Maniu Date: Tue, 14 Jul 2026 11:38:36 +0800 Subject: [PATCH 2/3] clarified number of vertices in a grid --- tests/test_upper.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tests/test_upper.cpp b/tests/test_upper.cpp index 0d9ac3d..4a66254 100644 --- a/tests/test_upper.cpp +++ b/tests/test_upper.cpp @@ -26,7 +26,7 @@ TEST_CASE("upper bound is exact on structured graphs (min-degree)") { { DegreePermutationStrategy s; REQUIRE(upper_tw(cycle(3), s) == 2); } } -TEST_CASE("upper bound never exceeds n-1") { +TEST_CASE("upper bound never exceeds N-1 (N = number of nodes)") { for (unsigned long n = 2; n <= 8; n++) { DegreePermutationStrategy s; REQUIRE(upper_tw(grid(n, 3), s) <= 3 * n - 1); From 0f7debd19f471b79ced49ef75c11f8acad3f0951 Mon Sep 17 00:00:00 2001 From: Silviu Maniu Date: Tue, 14 Jul 2026 11:38:36 +0800 Subject: [PATCH 3/3] suggestions from copilot: remove claude.md, clarify vertices --- tests/graph_builders.h | 2 +- tests/test_lower.cpp | 2 +- tests/test_upper.cpp | 4 ++-- 3 files changed, 4 insertions(+), 4 deletions(-) diff --git a/tests/graph_builders.h b/tests/graph_builders.h index b982dff..49e494b 100644 --- a/tests/graph_builders.h +++ b/tests/graph_builders.h @@ -40,7 +40,7 @@ inline Graph grid(unsigned long rows, unsigned long cols) { return g; } -// Two triangles sharing vertex 2 — matches the CLI baseline graph whose +// Three triangles attached via vertex 2 — matches the CLI baseline graph whose // per-method treewidth values are pinned as goldens. inline Graph sample_two_triangles() { Graph g; diff --git a/tests/test_lower.cpp b/tests/test_lower.cpp index 1447498..bd73c94 100644 --- a/tests/test_lower.cpp +++ b/tests/test_lower.cpp @@ -13,7 +13,7 @@ // Delta2D queries get_neighbours() for an already-removed node (assertion in a // debug build, SIGSEGV under NDEBUG), and LBN/LBN+ drive the known-buggy CE // contraction and the isolated-node get_neighbours UB. These paths are covered -// once those bugs are fixed. See CLAUDE.md. +// once those bugs are fixed. static unsigned long upper_tw(Graph g) { DegreePermutationStrategy s; diff --git a/tests/test_upper.cpp b/tests/test_upper.cpp index 4a66254..f17c852 100644 --- a/tests/test_upper.cpp +++ b/tests/test_upper.cpp @@ -34,8 +34,8 @@ TEST_CASE("upper bound never exceeds N-1 (N = number of nodes)") { } // Golden treewidth values (first line of the .dec output) pinned per method on -// the CLI baseline graph. Method 3 (MCS) pins current *buggy* behavior on -// purpose, as a regression anchor — see CLAUDE.md. +// the CLI baseline graph. Method 3 (MCS) pins current known-buggy behavior on +// purpose, as a regression anchor. TEST_CASE("golden treewidth per method on the sample graph") { { DegreePermutationStrategy s; REQUIRE(upper_tw(sample_two_triangles(), s) == 2); } { FillInPermutationStrategy s; REQUIRE(upper_tw(sample_two_triangles(), s) == 2); }