Skip to content

feat(nc): PMOO/LUDB bound via good_lp for tree-shaped multiplexing (v0.9.3 NC #2)#203

Open
avrabe wants to merge 1 commit intomainfrom
feat/v0.9.3-a2-pmoo-ludb
Open

feat(nc): PMOO/LUDB bound via good_lp for tree-shaped multiplexing (v0.9.3 NC #2)#203
avrabe wants to merge 1 commit intomainfrom
feat/v0.9.3-a2-pmoo-ludb

Conversation

@avrabe
Copy link
Copy Markdown
Contributor

@avrabe avrabe commented May 3, 2026

Summary

Closes the external reviewer's NC top-5 #2 — the credibility gap with RTaW-Pegase.

  • Adds spar-network::pmoo with ludb_bound(tagged, competing, services) — PMOO / Bisti-LUDB ("Linear Upper Delay Bound") path on top of the existing closed-form NC primitives. Set up as an LP via good_lp with the HiGHS backend already vendored for the deployment solver.
  • Wires an opt-in pmoo_or_sfa dispatch into WcttAnalysis for tree-shaped flows (one tagged + ≥ 2 competing flows on contiguous sub-paths of the tagged tandem, all hops FIFO/Priority). On LP infeasibility (Σ ρ ≥ R_h) we silently fall back to the v0.9.2 SFA chain — bound never worsens.
  • New --pmoo CLI flag on spar analyze (default off → byte-identical to v0.9.2).
  • New WcttPmooBound Info diagnostic reports method (=ludb), PMOO delay, SFA delay for comparison, tightening %, and LP solve time.

Numerical comparison (in-tree fixtures)

Topology PMOO SFA Tightening
3-hop tandem / 3 competing flows on hop 0 98_571_429 ps 135_843_430 ps 27.4 %
Zonal 5-source aggregation (one switch, 5 cross-flows) 159_000_000 ps 208_488_000 ps 23.7 %

Larger fan-ins reach the 30-60 % tightening reported in Bondorf et al. and the Bisti-LUDB papers; the in-tree fixtures are deliberately small for unit-test runtime.

Tests

  • 10 new unit tests in spar-network/src/pmoo.rs — baseline (single-hop, no competing → PMOO ≡ SFA), 2-hop / 1 competing (PMOO ≤ SFA), 3-hop / 3 competing (PMOO ≪ SFA, ≥ 5 % tightening asserted), LP infeasibility (Err(LpError::Infeasible) for SFA fallback), validation errors (empty path, out-of-range, non-contiguous), model-size and solve-time reporting, single-flow tandem (pay-burst-once), zonal 5-source reference.
  • 2 new round-trip tests in spar-analysis/src/wctt.rspmoo_flag_off_emits_no_pmoo_diagnostic (default = byte-identical to v0.9.2) and pmoo_flag_on_emits_pmoo_diagnostic_for_eligible_streams (≥ 1 WcttPmooBound with method=ludb).

Test plan

  • cargo build --workspace clean
  • cargo test -p spar-network clean — 87 tests (was 77; +10 PMOO)
  • cargo test -p spar-analysis clean — 851 tests (was 849; +2 round-trip)
  • cargo test --workspace clean — no regressions
  • cargo clippy --workspace --all-targets -- -D warnings clean
  • cargo fmt --all -- --check clean
  • rivet validate PASS

Artifacts

  • REQ-NETWORK-014 in artifacts/requirements.yaml
  • TEST-NC-PMOO in artifacts/verification.yaml (links: satisfies REQ-NETWORK-014)

Out of scope (per task brief)

  • Default WCTT behaviour unchanged — SFA stays the default.
  • Piecewise-affine α (sibling A1) — kept entirely in pmoo.rs, no edits to curves.rs.
  • No version bump.

🤖 Generated with Claude Code

…0.9.3 NC tightness #2)

Closes the external reviewer's NC top-5 #2 (credibility gap with
RTaW-Pegase): adds an opt-in Pay-Multiplexing-Only-Once / Bisti-LUDB
("Linear Upper Delay Bound") path in `spar-network::pmoo` that the
WCTT pass invokes when the topology is tree-shaped (one tagged flow,
≥ 2 competing flows on contiguous sub-paths of the tagged tandem,
all hops FIFO/Priority).

The LP is set up via `good_lp` with the HiGHS backend already vendored
for the deployment solver. On the canonical zonal/automotive
multiplexing pattern (one switch, many sources to one sink) the bound
is 23-27% tighter than today's per-hop SFA chain on the in-tree
fixtures, with 30-60% reported in the literature for larger fan-ins.
On LP infeasibility (`Σ ρ ≥ R_h` at any hop) the WCTT pass silently
falls back to the existing SFA chain — bound never worsens.

Numerical comparison from the in-tree fixtures:
  3-hop / 3-competing:  PMOO =  98_571_429 ps   SFA = 135_843_430 ps   tightening = 27.4%
  Zonal 5-source:        PMOO = 159_000_000 ps   SFA = 208_488_000 ps   tightening = 23.7%

API surface in `spar-network::pmoo`:
  - `TaggedFlow { alpha, path }`, `CompetingFlow { alpha, path }`
  - `PmooBound { delay_ps, model_size, solve_time_us }`
  - `LpError::{Infeasible, OutOfRange, EmptyPath, NonContiguous, SolverFailed}`
  - `ludb_bound(tagged, competing, services) -> Result<PmooBound, LpError>`

Wiring:
  - `WcttAnalysis` becomes a configurable struct with `pmoo: bool`
    (default `false` → byte-identical to v0.9.2). `WcttAnalysis::with_pmoo()`
    enables the opt-in path.
  - New `pmoo_or_sfa(stream, all_streams, switch_type, service_for_bus)`
    helper in wctt.rs validates eligibility (all-FIFO chain, ≥ 2
    competitors, contiguous sub-paths) and dispatches to `ludb_bound`.
  - New `WcttPmooBound` Info diagnostic reports method=ludb, PMOO
    delay, SFA delay for comparison, tightening %, and LP solve time.
  - New `--pmoo` CLI flag on `spar analyze` opts in. `AnalysisRunner::
    register_all_except_wctt()` lets the CLI swap in the
    PMOO-configured `WcttAnalysis` without duplicating the SFA pass.

Tests:
  - 10 new unit tests in `spar-network/src/pmoo.rs`: single-hop /
    no-competing baseline (PMOO ≡ SFA), 2-hop tandem 1 competing flow
    (PMOO ≤ SFA), 3-hop / 3-competing (PMOO ≪ SFA, ≥ 5% tightening
    asserted), LP infeasibility, validation errors, model-size and
    solve-time reporting, single-flow tandem reduces to pay-burst-once,
    canonical zonal 5-source reference comparison.
  - 2 new round-trip tests in `spar-analysis/src/wctt.rs`:
    `pmoo_flag_off_emits_no_pmoo_diagnostic` (default v0.9.2 byte-
    identical), `pmoo_flag_on_emits_pmoo_diagnostic_for_eligible_streams`
    (≥ 1 `WcttPmooBound` with method=ludb).

Quality gates:
  - cargo build --workspace: clean
  - cargo test --workspace: 851 spar-analysis tests pass (was 849;
    +2 round-trip), 87 spar-network tests pass (was 77; +10 PMOO),
    no regressions
  - cargo clippy --workspace --all-targets -- -D warnings: clean
  - cargo fmt --all -- --check: clean
  - rivet validate: PASS

Artifacts:
  - REQ-NETWORK-014 in artifacts/requirements.yaml
  - TEST-NC-PMOO in artifacts/verification.yaml (links: satisfies
    REQ-NETWORK-014)

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
@codecov
Copy link
Copy Markdown

codecov Bot commented May 4, 2026

Codecov Report

❌ Patch coverage is 85.41667% with 84 lines in your changes missing coverage. Please review.

Files with missing lines Patch % Lines
crates/spar-analysis/src/lib.rs 6.25% 30 Missing ⚠️
crates/spar-network/src/pmoo.rs 93.24% 21 Missing ⚠️
crates/spar-cli/src/main.rs 35.48% 20 Missing ⚠️
crates/spar-analysis/src/wctt.rs 93.56% 13 Missing ⚠️

📢 Thoughts on this report? Let us know!

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