Skip to content

feat(network): PLP on converging sink-trees via topological relabel (REQ-NC-PLP-CONVERGE-001)#285

Merged
avrabe merged 1 commit into
mainfrom
feat/nc-plp-converging-reorder
Jun 14, 2026
Merged

feat(network): PLP on converging sink-trees via topological relabel (REQ-NC-PLP-CONVERGE-001)#285
avrabe merged 1 commit into
mainfrom
feat/nc-plp-converging-reorder

Conversation

@avrabe

@avrabe avrabe commented Jun 14, 2026

Copy link
Copy Markdown
Contributor

Summary

Fires PLP (REQ-NC-PLP-001) on single-successor converging sink-trees handed in non-topological order — the many-talkers→one-listener TSN shape that v0.18 shipped rejecting (PlpError::NonTopologicalSinkTree). plp_bound now topologically relabels servers (Kahn, smallest-index-first) as a pure permutation before the sink-tree projection, so the sink lands at the highest index — the invariant the per-flow solve assumes.

Sound with no change to the bound: TFA/PLP are invariant under server renumbering, and a single-successor + acyclic graph is a rooted in-forest that always admits a topological order. The former reject guard is repurposed as a post-relabel invariant (never panics; Errs only if the topo sort is buggy).

This is the converging-tree precursor split out of REQ-NC-PLP-002; the generic/cyclic core remains there (gated on not-yet-generated cyclic fixtures).

Correctness discovery — PLP and TFA are incomparable

This feature's bridge test surfaced that the shipped "PLP ≤ TFA" universal claim was false. Pure polynomial PLP and TFA are incomparable over-approximations — both sound (≥ exact), neither dominates. On the deliberately pathological converging-bridge net (10000-µs-slow-switch), panco's own PLP exceeds its own TFA:

flow panco PLP panco TFA panco EXACT
dataA 1148.33µs 1048.09µs 1035.2µs

spar reproduces panco's PLP to the decimal → the relabel is correct; the sandwich claim was the error. Fixes:

  • Bridge test asserts index alignment (slow-stream PLP dominates fast ×5), not a sandwich.
  • Per-fixture plp ≤ TFA pins kept, but relabelled as per-fixture regression pins (not a universal law) in check_plp + docs.
  • REQ-NC-PLP-001 / BRIDGE-001 text corrected; authoritative per-flow bound min(PLP, TFA) filed as REQ-NC-PLP-MIN-001 (backlog).

Verification

  • plp.rs permutation-invariance unit test: relabelled bound == same net presented topologically.
  • 3 panco-pinned converging xval fixtures: converge_2to1 (48.89 ≪ 60.39), converge_2to1_tail2 (60.0 ≪ 106.44, the 1.77× wedge), converge_3to1 (70.0 ≪ 74.59 µs).
  • Full suites green: spar-network 134, spar-analysis 883. fmt + clippy clean.
  • TEST-NC-PLP-CONVERGE oracle step filter corrected (plp_converge_xval matched zero tests → plp_xval::panco_converge).

Falsification

If the topological relabel were not a pure permutation, the converging tree's per-flow bound would differ from the same physical network presented sink-last — the permutation-invariance test would fail. If pure PLP were universally ≤ TFA, the converging-bridge counterexample (panco PLP 1148 > TFA 1048) could not exist.

🤖 Generated with Claude Code

…REQ-NC-PLP-CONVERGE-001)

Fire PLP on single-successor CONVERGING sink-trees whose server indices
arrive in NON-topological order — the many-talkers->one-listener TSN shape
that REQ-NC-PLP-001 shipped REJECTING (PlpError::NonTopologicalSinkTree).
plp_bound now computes a topological relabelling (Kahn, smallest-index-first)
and applies it as a pure permutation BEFORE the sink-tree projection, so the
sink lands at the highest index — the invariant the per-flow sub-network
solve assumes. Sound with no change to the bound: TFA/PLP are invariant under
server renumbering, and a graph already validated single-successor + acyclic
is a rooted in-forest that always admits a topological order. The former
reject guard is REPURPOSED as a post-relabel invariant (no edge may point to
a lower index; a violation means the topo sort is buggy -> Err, never panic).

Verified by permutation-invariance (the bound equals the same physical net
presented already-topologically) plus three panco-pinned converging fixtures:
converge_2to1 (PLP 48.89 << TFA 60.39), converge_2to1_tail2 (60.0 << 106.44,
the 1.77x wedge), converge_3to1 (70.0 << 74.59 us).

Also corrects a false universal "PLP <= TFA" claim that this feature's bridge
test surfaced. Pure polynomial PLP and TFA are INCOMPARABLE over-approximations
(both sound, neither dominates): on the deliberately pathological converging-
bridge net (10000-us-slow-switch) panco's OWN PLP exceeds its OWN TFA
(PLP 1148 > TFA 1048 >= EXACT 1035 us), and spar reproduces panco's PLP to the
decimal — so the relabel is correct and the sandwich claim was the error. The
bridge test now asserts index alignment (slow-stream PLP dominates fast), not
a sandwich; the per-fixture plp<=TFA pins are kept but relabelled as such; and
the authoritative per-flow bound min(PLP, TFA) is filed as REQ-NC-PLP-MIN-001.

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

codecov Bot commented Jun 14, 2026

Copy link
Copy Markdown

Codecov Report

❌ Patch coverage is 98.80952% with 1 line in your changes missing coverage. Please review.

Files with missing lines Patch % Lines
crates/spar-network/src/plp.rs 98.71% 1 Missing ⚠️

📢 Thoughts on this report? Let us know!

@github-actions

Copy link
Copy Markdown

Rivet verification gate

20/20 passed

count
Passed 20
Failed 0
Skipped (no steps) 0

Filter: (and (= type "feature") (or (has-tag "v093") (has-tag "v0100")))

Failed artifacts

(none)

Updated automatically by tools/post_verification_comment.py. Source of truth: artifacts/verification.yaml.

@avrabe avrabe merged commit e5ffb49 into main Jun 14, 2026
18 checks passed
@avrabe avrabe deleted the feat/nc-plp-converging-reorder branch June 14, 2026 19:23
avrabe added a commit that referenced this pull request Jun 15, 2026
Cuts v0.19.0. Scope (exactly the implemented set, per release-planning hygiene):
- REQ-NC-PLP-CONVERGE-001 — PLP on converging sink-trees via topological relabel (#285)
- REQ-NC-PLP-003 — TFA-strengthened PLP tightening to EXACT (#287)

REQ-NC-PLP-003 repairs the pure-PLP / TFA incomparability: on the converging-
bridge net where pure PLP exceeds TFA (1148.33 > 1048.09 us), the TFA-delay-
strengthened LP drives the bound to EXACT 1035.2 us — back below TFA. Together
with CONVERGE-001 this makes the many-talkers->one-listener TSN topology yield
the PLP <= TFA dominance LUDB/PMOO cannot show on a tree.

The 11 still-proposed/planned items previously tagged v0.19.0 were moved to
v0.20.0 in #287 for re-triage; this release contains only verified-green work.

Co-authored-by: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
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