Skip to content

Fix #1100: SetSplitting to NAESatisfiability - #1109

Open
isPANN wants to merge 6 commits into
1075-growth-domainfrom
issue-1100
Open

Fix #1100: SetSplitting to NAESatisfiability#1109
isPANN wants to merge 6 commits into
1075-growth-domainfrom
issue-1100

Conversation

@isPANN

Copy link
Copy Markdown
Collaborator

Summary

Implement the direct witness-preserving reduction from Set Splitting to Not-All-Equal Satisfiability, including verification, tests, canonical example data, and paper documentation.

Fixes#1100

@codecov

codecovBot commented Aug 2, 2026

Copy link
Copy Markdown

Codecov Report

❌ Patch coverage is 97.57748% with 111 lines in your changes missing coverage. Please review.
✅ Project coverage is 97.94%. Comparing base (cb54ea0) to head (fcff546).

Files with missing linesPatch %Lines
src/rules/graph.rs94.81%29 Missing ⚠️
src/unit_tests/growth.rs96.01%25 Missing ⚠️
src/unit_tests/rules/pareto.rs98.22%22 Missing ⚠️
src/growth.rs98.22%11 Missing ⚠️
src/solvers/registry.rs95.73%9 Missing ⚠️
src/solvers/ilp/solver.rs86.20%4 Missing ⚠️
src/rules/pareto.rs97.95%3 Missing ⚠️
src/unit_tests/solvers/brute_force.rs83.33%3 Missing ⚠️
src/unit_tests/solvers/registry.rs98.70%3 Missing ⚠️
src/solvers/resolver.rs98.71%1 Missing ⚠️
... and 1 more
Additional details and impacted files
@@ Coverage Diff @@## main #1109 +/- ##
==========================================
- Coverage 98.00% 97.94% -0.07% 
==========================================
Files 1044 1051 +7 Lines 107366 110605 +3239 ==========================================
+ Hits 105228 108327 +3099 - Misses 2138 2278 +140 

☔ View full report in Codecov by Harness.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

@isPANN
isPANN changed the base branch from main to 1075-growth-domainAugust 2, 2026 06:09
@isPANN

Copy link
Copy Markdown
CollaboratorAuthor

Implementation Summary

Changes

  • Added the direct witness-preserving SetSplitting -> NAESatisfiability reduction with deterministic first-occurrence deduplication, positive one-indexed literals, identity extraction, and declared size overhead.
  • Added focused closed-loop, structure, duplicate, infeasible, empty-family, unused-variable, and canonical-example tests.
  • Registered the rule and canonical example, and documented the construction and proof in the Typst paper.
  • Updated the known dominated-rule expectation because the new path makes the existing direct SetSplitting -> ILP edge asymptotically dominated.

Deviations from Plan

  • The full test suite exposed the expected new dominated-rule relationship, so its semantic allow-list was updated.
  • The PR base was changed from main to 1075-growth-domain, whose tip is the requested starting commit a9067297, keeping the PR scoped to this issue.

Open Questions

  • None.

Verification

  • Mathematical constructor: 282,166 checks.
  • Independent adversary: 347,100 checks.
  • Cross-comparison: 6,944 instances / 205,592 assignments, zero disagreements.
  • make test, make clippy, make fmt-check, and make paper pass.

@isPANN

Copy link
Copy Markdown
CollaboratorAuthor

Agentic Review Report

Structural Check

Structural Review: rule SetSplitting → NAESatisfiability

Structural Completeness

#CheckStatus
1Rule file existsPASS — src/rules/setsplitting_naesatisfiability.rs
2#[reduction(...)] macro presentPASS — declares all three target-size overhead fields
3ReductionResult impl presentPASS
4ReduceTo<NAESatisfiability> impl presentPASS
5#[cfg(test)] and test path link presentPASS
6Test file existsPASS — src/unit_tests/rules/setsplitting_naesatisfiability.rs
7Closed-loop test presentPASS — includes the canonical satisfiable instance plus repeated-element and empty-family cases
8Registered in rules/mod.rsPASS
9Canonical rule example registeredPASS — module-local example spec is aggregated by canonical_rule_example_specs()
10Example-db lookup tests existPASS — generic database coverage, uniqueness, and solution-consistency tests pass
11Paper reduction-rule entry presentPASS
12Blacklisted generated files absentPASS — none occur in a9067297..f59e9a9c

Build Status

  • make test: PASS — 5,437 library tests, 75 integration tests, 330 CLI tests, 17 symbolic CLI tests, 26 macro tests, and all doctests passed
  • make clippy: PASS — cargo clippy --all-targets --features ilp-highs -- -D warnings
  • Working tree remained clean after verification

Semantic Review

  • Reduction construction: OK — each universe element becomes one variable, and each source subset becomes one positive-literal NAE clause after first-occurrence deduplication.
  • Manual trace: OK — subsets [0,1], [1,2,3], and [0,2,3] emit [1,2], [2,3,4], and [1,3,4]; assignment [0,1,0,1] satisfies both representations.
  • Duplicate handling: OK — iterator-order filtering through HashSet::insert preserves first occurrence, and removing duplicates cannot change which colors occur.
  • Repeated-only subset: OK — [u,u,…] maps to (x_u,x_u), which is NAE-unsatisfiable exactly when the source constraint is unsplittable.
  • Empty family and unused elements: OK.
  • Solution extraction: OK — source and target dimensions are both universe_size, so identity extraction is correct.
  • Correctness preservation: OK — source validity and target NAE validity are pointwise equivalent.
  • Overhead accuracy: OK — num_vars = n, num_clauses = m, and literal count sum_j max(2, |D_j|) <= (n+1)m.
  • Example quality: OK — complete source/target JSON and a valid identical witness pair.
  • Paper statement and proof: OK — construction, both directions, repeated-only NO case, overhead, extraction, and tutorial example are sound.
  • Diff scope: OK — exactly five issue-scoped files relative to stacked base a9067297.

Issue Compliance

#CheckStatus
1Source/target match issueOK
2Reduction algorithm matchesOK
3Solution extraction matchesOK
4Correctness preservedOK
5Overhead expressions matchOK
6Example matchesOK

Summary

  • 12/12 structural checks passed
  • 6/6 issue-compliance checks passed
  • No structural FAIL or ISSUE findings

Quality Check

Quality Review

Design Principles

  • DRY: OK — concise reduction and identity extraction with no duplicated logic.
  • KISS: OK — direct mapping without unnecessary abstraction or branching.
  • HC/LC: OK — construction, extraction, registration, tests, and example data remain appropriately localized.

Test Quality

  • Naive test detection: ISSUE
    • The sole general closed-loop test uses a satisfiable four-element instance (src/unit_tests/rules/setsplitting_naesatisfiability.rs:7-21), below the review rubric's 5+ variable expectation. The only infeasible case is the special all-repeated-subset encoding (src/unit_tests/rules/setsplitting_naesatisfiability.rs:66-76). There is no ordinary unsatisfiable set family, such as the three two-element subsets of a triangle, or a ≥5-element closed-loop case exercising brute-force equivalence.

Issues

Critical (Must Fix)

None.

Important (Should Fix)

  • Add a ≥5-element closed-loop case and a non-degenerate unsatisfiable Set Splitting family to verify satisfiability preservation beyond the canonical happy path.

Minor (Nice to Have)

None.

Summary

  • Important — reduction semantics are tested closed-loop only on one satisfiable four-element instance; ordinary infeasibility and a 5+ element instance are missing.

Agentic Feature Tests

Feature:SetSplitting → NAESatisfiability
Mode: Blind-style downstream CLI verification, ephemeral profile
Use case: Discover the reduction, create and solve the canonical source instance, reduce it, and solve/evaluate the NAE-SAT result.
Verdict: Pass
Critical issues: 0

AreaResultEvidence
DiscoverabilityPasspred list includes both models; pred show SetSplitting lists the outgoing rule; pred show NAESatisfiability lists it as incoming.
Canonical source creationPassGeneral and rule-specific pred create --example forms produced valid problem JSON.
Source solvingPassDefault ILP-path solving and brute force both returned Or(true) with valid splittings.
ReductionPasspred reduce produced an exact SetSplitting → NAESatisfiability bundle.
Target solvingPassBundle solving returned a NAE-SAT witness and correctly extracted the identical source splitting.
EvaluationPassThe same assignment evaluated to Or(true) for source and target.
DocumentationPassREADME, CLI guide, and paper commands were sufficient to derive the workflow.

Commands Exercised

pred list
pred show SetSplitting
pred show NAESatisfiability
pred create --example SetSplitting -o set-splitting.json
pred solve set-splitting.json
pred solve set-splitting.json --solver brute-force
pred reduce set-splitting.json --to NAESatisfiability -o bundle.json
pred solve bundle.json
pred create --example SetSplitting --to NAESatisfiability -o rule-source.json
pred reduce rule-source.json --to NAESatisfiability -o rule-bundle.json
pred solve rule-bundle.json --solver brute-force
pred evaluate <source> --config 0,1,0,0,1,1
pred evaluate <target> --config 0,1,0,0,1,1

Findings

No confirmed feature, CLI, or documentation defects. A temporary artifact-directory lock caused by concurrent review jobs was classified as test-environment contention, not a product defect.


Generated by review-pipeline

- add a five-element satisfiable closed-loop test
- add a non-degenerate infeasible odd-cycle test
Sign up for freeto 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.

[Rule] SetSplitting to NAESatisfiability

1 participant

@isPANN