Skip to content

Exact symbolic growth, unified reduction size contracts, and deterministic solver backends - #1137

Draft
isPANN wants to merge 11 commits into
mainfrom
codex/1083-clean
Draft

Exact symbolic growth, unified reduction size contracts, and deterministic solver backends#1137
isPANN wants to merge 11 commits into
mainfrom
codex/1083-clean

Conversation

@isPANN

@isPANN isPANN commented Aug 14, 2026

Copy link
Copy Markdown
Collaborator

Closes #1075, #1078, #1076, #788, and #1090.

Supersedes #1083 with a clean, function-oriented history built from the final code tree against main.

Summary

Exact symbolic reduction contracts

  • Adds a shared exact expression core with integer and rational arithmetic.
  • Adds conservative symbolic Big-O analysis for exponential, polynomial, logarithmic, factorial, and multivariable expressions.
  • Represents each known Big-O result as a deterministic antichain of incomparable growth terms; unsupported expressions retain explicit failure reasons.
  • Limits antichains to 32 terms and reports an explicit analysis failure on overflow instead of silently replacing the result with an approximate envelope.
  • Introduces one rule-owned size relation per reduction, with exact, upper-bound, and explicitly unavailable fields.
  • Composes rule size formulas across a path, then projects only the final target size parameters to Big-O for the default symbolic Pareto cost model.
  • Symbolic comparison ranks those Big-O forms directly; exact versus upper-bound rule provenance does not create separate comparison behavior and does not claim instance-wise dominance.
  • Enforces strict solution-extraction and numeric boundary contracts.
  • Keeps path enumeration deterministic and reports symbolic and measured path sizes without coupling size algebra to route selection.

Registry-owned models and deterministic solving

  • Moves construction schemas, validation, random generation, serialization, and variant metadata into the model registry.
  • Registers customized and fixed reduction-to-ILP solver workflows by exact source variant.
  • Selects backends deterministically and distinguishes solved, value-only, and infeasible outcomes from execution failures.

CLI and MCP

  • Uses the same registry contract for creation, inspection, solving, reduction paths, and size reporting.
  • Keeps CLI and MCP outputs consistent and covers error paths and saved-route round trips.
  • Adds pareto (default) and all path selection. max_paths limits selected output after comparison rather than limiting the candidate set, accepts at most 999, and rejects larger requests explicitly.
  • Keeps the path JSON envelope minimal: paths plus the necessary truncated flag.

Required reduction removal

Output-layer max_paths semantics require concrete Pareto selection to execute every simple candidate path before limiting the selected output. This exposed the registered route:

MaximumIndependentSet
→ MinimumVertexCover
→ MinimumFeedbackArcSet
→ MaximumLikelihoodRanking
→ ILP
→ QUBO

Review showed that MinimumFeedbackArcSet → MaximumLikelihoodRanking cannot be made total and correct over the currently declared model domains. The classical linear-order equivalence assumes nonnegative arc weights, while the source accepts arbitrary i32 weights. The source graph may also contain parallel arcs and self-loops, but the target is one i32 matrix entry per ordered vertex pair: parallel weights must be aggregated, self-loops have no ranking representation, and pairwise weight differences can exceed i32. The previous implementation additionally overwrote parallel arcs.

The registry has no conditional rule preconditions, and the target model cannot represent every valid source instance. A local formula change would therefore preserve an unsound registered edge. The rule implementation, registration, tests, canonical example, and paper entry are removed instead. Complete path selection continues through the remaining valid routes and its tests pass.

This deletion is required for the reduction algorithm change: retaining the rule either rejects valid source instances or silently changes their objective.

Build and documentation

  • Updates the paper, user documentation, and maintainer workflows for the final contracts.
  • Uses the required HiGHS backend and verifies macOS ARM64, Windows x86_64, and RISC-V builds.

Commit structure

  1. Unified symbolic reduction, registry, and solver compile-time contracts.
  2. Registry-driven CLI and MCP workflows.
  3. End-to-end reduction examples and integration coverage.
  4. Documentation and maintainer workflows.
  5. Cross-platform build verification.
  6. Solver outcome cleanup and removal of the unsound reduction.
  7. Direct Big-O Pareto comparison with explicit antichain overflow.

Quality review

  • Checked DRY, KISS, cohesion/coupling, CLI/MCP HCI, and semantic test coverage.
  • Verified that discarded compatibility and symbolic precision designs do not remain in the implementation.
  • Re-reviewed symbolic comparison as a cost-model ordering rather than a proof of instance-wise dominance.

Verification

  • make check
  • make mcp-test
  • python3 scripts/test_pipeline_checks.py
  • Each code-bearing commit compiled independently in a detached worktree.

Polynomial upper-bound propagation

  • Replaces the previous rejection of non-monotone downstream formulas when an intermediate size is only upper-bounded.
  • Fully normalizes supported downstream polynomials, combines like monomials, removes non-positive coefficient terms, and only then substitutes intermediate upper bounds. This is sound for non-negative size parameters because the retained positive-coefficient polynomial is a pointwise upper bound.
  • Preserves direct substitution for exact intermediate sizes. For example, m <= n^2 followed by k = 10 - m composes to k <= 10, while exact m = 4 still evaluates to k = 6; graph complementation normalizes v(v - 1)/2 - e to the propagated upper bound v^2/2.
  • Non-polynomial downstream formulas still fail explicitly rather than receiving an unsound substitution.

isPANN added 5 commits August 14, 2026 19:39
Introduce exact symbolic expressions, rule-owned size relations, strict extraction and numeric contracts, model-owned construction metadata, and deterministic solver selection as one compile-time contract. Migrate directly from the main-branch APIs without recording discarded intermediate designs.
Use the unified registry for creation, inspection, deterministic solver selection, reduction paths, and size reporting. Keep CLI and MCP outputs consistent and cover their user-facing error paths and round trips.
Update executable examples and integration scenarios for the final size, extraction, and registry contracts, including source-relative path assertions and exact variant handling.
Align design, CLI, MCP, paper, and maintainer workflow documentation with exact expressions, rule-owned size relations, registry-owned construction, and deterministic solver dispatch.
Use the required HiGHS backend, keep benchmark-only dependencies out of ordinary builds, add portable stack handling, and exercise macOS ARM64, Windows x86_64, and RISC-V targets in CI.
@codecov

codecov Bot commented Aug 14, 2026

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 97.30%. Comparing base (cb54ea0) to head (183b876).

Additional details and impacted files
@@            Coverage Diff             @@
##             main    #1137      +/-   ##
==========================================
- Coverage   98.00%   97.30%   -0.71%     
==========================================
  Files        1044     1051       +7     
  Lines      107366   115531    +8165     
==========================================
+ Hits       105228   112413    +7185     
- Misses       2138     3118     +980     

☔ 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.

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.

Add growth domain (src/growth.rs): growth terms, antichain, symbolic dominance

1 participant