Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
22 changes: 12 additions & 10 deletions .claude/skills/project-pipeline/SKILL.md
Original file line number Diff line number Diff line change
Expand Up @@ -48,9 +48,19 @@ Filter items where `status == "Ready"`. Partition into `[Model]` and `[Rule]` bu
1. **Existing problems:** Call `list_problems` (MCP tool) to get all problems currently in the reduction graph.
2. **Pending rules:** From the full project board JSON, collect all `[Rule]` issues that are in "Ready" or "In Progress" status. Parse their source/target problem names (e.g., `[Rule] BinPacking to ILP` → source=BinPacking, target=ILP).

#### 0c. Score Each Issue
#### 0c. Check Eligibility

Score each Ready issue on three criteria. For `[Model]` issues, extract the problem name. For `[Rule]` issues, extract both source and target problem names.
**Rule issues require both source and target models to exist.** For each `[Rule]` issue, parse the source and target problem names (e.g., `[Rule] BinPacking to ILP` → source=BinPacking, target=ILP). Check that both appear in the `list_problems` output (existing models) OR in a `[Model]` issue in the current Ready/In Progress columns.

- If both models exist → **eligible**
- If a missing model has a `[Model]` issue in Ready → eligible only in `--all` mode (the Model will be processed first); in single-issue mode, **skip this Rule** and mark it `[blocked]`
- If a missing model has no `[Model]` issue at all → **ineligible**, mark it `[blocked]` with reason

All `[Model]` issues are always eligible (no dependency check needed).

#### 0d. Score Eligible Issues

Score only **eligible** issues on three criteria. For `[Model]` issues, extract the problem name. For `[Rule]` issues, extract both source and target problem names.

| Criterion | Weight | How to Assess |
|-----------|--------|---------------|
Expand All @@ -64,14 +74,6 @@ Score each Ready issue on three criteria. For `[Model]` issues, extract the prob

**Important for C2:** A problem that is merely a weighted/unweighted variant or a graph-subtype specialization of an existing problem scores **0** on C2, not 2. The goal is to add genuinely new problem types that expand the graph's reach.

#### 0d. Apply Hard Constraints

**Rule issues require both source and target models to exist.** For each `[Rule]` issue, check that both its source and target problem names appear in the `list_problems` output (existing models) OR in a `[Model]` issue in the current Ready/In Progress columns.

- If both models exist → eligible
- If a missing model has a `[Model]` issue in Ready → eligible only in `--all` mode (the Model will be processed first); in single-issue mode, **skip this Rule** and mark it `[blocked]`
- If a missing model has no `[Model]` issue at all → **ineligible**, mark it `[blocked]` with reason

#### 0e. Print Ranked List

Print all Ready issues with their scores for visibility (no confirmation needed). Blocked rules appear at the bottom with their reason:
Expand Down
17 changes: 17 additions & 0 deletions .claude/skills/review-pipeline/SKILL.md
Original file line number Diff line number Diff line change
Expand Up @@ -82,6 +82,22 @@ cd "$WORKTREE_DIR"

All subsequent steps run inside the worktree.

### 1a. Resolve Conflicts with Main

Check if the branch has merge conflicts with main:

```bash
git fetch origin main
git merge origin/main --no-edit
```

- If the merge succeeds cleanly: push the merge commit and continue.
- If there are conflicts:
1. Inspect the conflicting files with `git diff --name-only --diff-filter=U`.
2. Resolve conflicts (prefer the PR branch for new code, main for regenerated artifacts like JSON).
3. Stage resolved files, commit, and push.
- If conflicts are too complex to resolve automatically (e.g., overlapping logic changes in the same function): abort the merge (`git merge --abort`), leave the PR in review-agentic, and report: `PR #N has complex merge conflicts with main — needs manual resolution.` Then STOP processing this PR.

### 2. Fix Copilot Review Comments

Copilot review is guaranteed to exist (verified in Step 0). Fetch the comments:
Expand Down Expand Up @@ -210,3 +226,4 @@ Completed: 2/2 | All moved to In Review
| Not checking out the right branch | Use `gh pr view` to get the exact branch name |
| Worktree left behind on failure | Always clean up with `git worktree remove` in Step 5 |
| Working in main checkout | All work happens in `.worktrees/` — never modify the main checkout |
| Skipping merge with main | Always merge origin/main in Step 1a to catch conflicts before fixing comments |
4 changes: 2 additions & 2 deletions docs/paper/reductions.typ
Original file line number Diff line number Diff line change
Expand Up @@ -385,7 +385,7 @@ caption: [The house graph with max cut $S = {v_0, v_3}$ (blue) vs $overline(S) =
Given an undirected graph $G = (V, E)$ with $|V| = n$ (even), find a partition of $V$ into two disjoint sets $A$ and $B$ with $|A| = |B| = n slash 2$ that minimizes the number of edges crossing the partition:
$ "cut"(A, B) = |{(u, v) in E : u in A, v in B}|. $
][
Graph Partitioning is a core NP-hard problem arising in VLSI design, parallel computing, and scientific simulation, where balanced workload distribution with minimal communication is essential. Closely related to Max-Cut (which _maximizes_ rather than _minimizes_ the cut) and to the Ising Spin Glass model. NP-completeness was proved by Garey, Johnson and Stockmeyer (1976). Arora, Rao and Vazirani (2009) gave an $O(sqrt(log n))$-approximation algorithm. Standard partitioning tools include METIS, KaHIP, and Scotch.
Graph Partitioning is a core NP-hard problem arising in VLSI design, parallel computing, and scientific simulation, where balanced workload distribution with minimal communication is essential. Closely related to Max-Cut (which _maximizes_ rather than _minimizes_ the cut) and to the Ising Spin Glass model. NP-completeness was proved by Garey, Johnson and Stockmeyer @garey1976. Arora, Rao and Vazirani @arora2009 gave an $O(sqrt(log n))$-approximation algorithm. The best known unconditional exact algorithm is brute-force enumeration of all $binom(n, n slash 2) = O^*(2^n)$ balanced partitions; no faster worst-case algorithm is known. Cygan et al. @cygan2014 showed that Minimum Bisection is fixed-parameter tractable in $O(2^(O(k^3)) dot n^3 log^3 n)$ time parameterized by bisection width $k$. Standard partitioning tools include METIS, KaHIP, and Scotch.

*Example.* Consider the graph $G$ with $n = 6$ vertices and 9 edges: $(v_0, v_1)$, $(v_0, v_2)$, $(v_1, v_2)$, $(v_1, v_3)$, $(v_2, v_3)$, $(v_2, v_4)$, $(v_3, v_4)$, $(v_3, v_5)$, $(v_4, v_5)$. The optimal balanced partition is $A = {v_0, v_1, v_2}$, $B = {v_3, v_4, v_5}$, with cut value 3: the crossing edges are $(v_1, v_3)$, $(v_2, v_3)$, $(v_2, v_4)$. All other balanced partitions yield a cut of at least 3.

Expand Down Expand Up @@ -1198,7 +1198,7 @@ where $P$ is a penalty weight large enough that any constraint violation costs m
Source config: #ksat_ss_sol.source_config #h(1em) Target config: #ksat_ss_sol.target_config
],
)[
Classical Karp reduction @karp1972 using base-10 digit encoding. Each integer has $(n + m)$ digits, where the first $n$ positions correspond to variables and the last $m$ to clauses. For variable $x_i$, two integers $y_i, z_i$ encode positive and negative literal occurrences. For clause $C_j$, slack integers $g_j, h_j$ pad the clause digit to exactly 4. Since each clause has at most 3 literals and slacks add at most 2, no digit exceeds 5, so no carries occur.
Base-10 digit encoding reduction following Sipser @sipser2012[Thm 7.56] and CLRS @cormen2022[§34.5.5]. (Karp @karp1972 established SubsetSum NP-completeness via Exact Cover; this direct 3-SAT construction is a later textbook formulation.) Each integer has $(n + m)$ digits, where the first $n$ positions correspond to variables and the last $m$ to clauses. For variable $x_i$, two integers $y_i, z_i$ encode positive and negative literal occurrences. For clause $C_j$, slack integers $g_j, h_j$ pad the clause digit to exactly 4. Since each clause has at most 3 literals and slacks add at most 2, no digit exceeds 5, so no carries occur.
][
_Construction._ Given a 3-CNF formula $phi$ with $n$ variables and $m$ clauses, create $2n + 2m$ integers in $(n+m)$-digit base-10 representation:

Expand Down
50 changes: 50 additions & 0 deletions docs/paper/references.bib
Original file line number Diff line number Diff line change
Expand Up @@ -387,3 +387,53 @@ @article{ibarra1975
year = {1975},
doi = {10.1145/321906.321909}
}

@book{sipser2012,
author = {Michael Sipser},
title = {Introduction to the Theory of Computation},
edition = {3rd},
publisher = {Cengage Learning},
year = {2012}
}

@book{cormen2022,
author = {Thomas H. Cormen and Charles E. Leiserson and Ronald L. Rivest and Clifford Stein},
title = {Introduction to Algorithms},
edition = {4th},
publisher = {MIT Press},
year = {2022}
}

@article{garey1976,
author = {Michael R. Garey and David S. Johnson and Larry Stockmeyer},
title = {Some Simplified NP-Complete Graph Problems},
journal = {Theoretical Computer Science},
volume = {1},
number = {3},
pages = {237--267},
year = {1976},
doi = {10.1016/0304-3975(76)90059-1}
}

@article{arora2009,
author = {Sanjeev Arora and Satish Rao and Umesh Vazirani},
title = {Expander Flows, Geometric Embeddings and Graph Partitioning},
journal = {Journal of the ACM},
volume = {56},
number = {2},
pages = {1--37},
year = {2009},
doi = {10.1145/1502793.1502794}
}

@article{cygan2014,
author = {Marek Cygan and Daniel Lokshtanov and Marcin Pilipczuk and Micha{\l} Pilipczuk and Saket Saurabh},
title = {Minimum Bisection Is Fixed Parameter Tractable},
journal = {SIAM Journal on Computing},
volume = {48},
number = {2},
pages = {417--450},
year = {2019},
note = {Conference version: STOC 2014},
doi = {10.1137/140990255}
}
11 changes: 11 additions & 0 deletions docs/src/reductions/problem_schemas.json
Original file line number Diff line number Diff line change
Expand Up @@ -110,6 +110,17 @@
}
]
},
{
"name": "GraphPartitioning",
"description": "Find minimum cut balanced bisection of a graph",
"fields": [
{
"name": "graph",
"type_name": "G",
"description": "The undirected graph G=(V,E)"
}
]
},
{
"name": "ILP",
"description": "Optimize linear objective subject to linear constraints",
Expand Down
Loading
Loading