Skip to content

Refactor path search around Pareto fronts - #1123

Open
isPANN wants to merge 3 commits into
1075-growth-domainfrom
codex/pareto-best-path-contract
Open

Refactor path search around Pareto fronts#1123
isPANN wants to merge 3 commits into
1075-growth-domainfrom
codex/pareto-best-path-contract

Conversation

@isPANN

@isPANN isPANN commented Aug 7, 2026

Copy link
Copy Markdown
Collaborator

Why

The previous path contract collapsed named ProblemSize components into a scalar total, treated symbolic analysis failure as an orderable growth result, and exposed implicit single-route winners through cost functions, top-level path output, and automatic reduction routing. That could discard incomparable measured vectors, recommend an unanalyzable route, and execute an arbitrary representative from a Pareto front.

Contract replacement

  • Symbolic search excludes Growth::Unknown routes from the Pareto front while returning each excluded route with its fields and analysis-failure reason.
  • Search completeness and symbolic analysis coverage are reported separately. Complete all-Unknown searches return NoAnalyzablePath; incomplete bounded searches remain explicitly incomplete.
  • Measured search compares terminal ProblemSize vectors componentwise, removes dominated vectors, preserves incomparable vectors, and deterministically deduplicates only equal vectors by hops and stable path order.
  • ProblemSize::total(), scalar cost/ranking APIs, and sum-based default budgets are deleted.
  • Measured budgets are named per-field limits validated against registered size fields and checked after each constructed intermediate problem is measured. A legal field absent on one node is not fabricated.
  • CLI, MCP, examples, callers, and docs now consume Pareto fronts explicitly. reduce requires one explicit continuous route; there is no top-level recommendation or automatic target routing.

Verification

  • Added an independent fixed-seed oracle over 2-7 node graphs: simple-path enumeration plus an independent terminal componentwise filter is compared with production Pareto search.
  • Added negative controls for incomparable, dominated, and equal measured vectors; Unknown exclusion and all-Unknown failure; known, unknown, and node-missing budget fields; post-construction budget enforcement; incomplete Unknown-only observations; and discontinuous explicit routes.
  • CARGO_BUILD_JOBS=1 cargo test -p problemreductions --lib rules::graph::pareto_tests:: -- --test-threads=1 (32 passed)
  • CARGO_BUILD_JOBS=1 cargo test -p problemreductions --lib rules::graph::tests:: -- --test-threads=1 (61 passed)
  • CARGO_BUILD_JOBS=1 cargo test -p problemreductions --lib test_reduction_graph:: -- --test-threads=1 (49 passed)
  • Focused CLI/MCP front, reduce, solve-bundle, extract, route-continuity, and inspect tests passed single-threaded.
  • Core clippy passed with -D warnings; CLI clippy passed with the existing tool_router dead-code warning.
  • cargo fmt --all -- --check and git diff --check passed.

Tests were intentionally focused; no heavyweight workspace coverage or large path enumeration was run. Builds used CARGO_BUILD_JOBS=1 and tests used one thread.

Explicitly not implemented

This PR does not provide a scalar recommendation, weights/priorities/constraint-based route selection, a compatibility or deprecated winner API, memory/byte estimates, worker isolation, allocation metadata, or new resource fields. Callers must choose a Pareto-front route explicitly.

This is a stacked PR based on 1075-growth-domain; it must not be merged independently of that base.

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.

1 participant