feat(network): standard CQF synthesis baseline (REQ-TSN-SYNTH-CQF-BASE-001)#291
Merged
Conversation
…E-001) Synthesize a standard two-buffer 802.1Qch CQF configuration from a set of reserved flows: pick the largest whole-nanosecond global cycle time T meeting every flow's structural deadline (H+1)*T, then admit iff every link's aggregate per-cycle reservation fits the cycle budget csize = T*link_rate. CQF's bounded delay depends only on (hops, T), not on per-link load, so the oracle factors into two small LOCAL checks with no network-calculus curve composition — which is exactly why CQF routes around the NC-composition bridge an MILP frame-scheduler needs. The CQF delay checker is PINNED to the published worked example in IETF draft-eckert-detnet-tcqf-05 (24 hops, 10us cycle => (24+1)*10 = 250us; D_min 230us; jitter 2T), so the synth<->checker duality anchors to external ground truth, not the synthesizer's own assumptions. Self-certifying: synthesize_cqf re-derives every flow's delay and every link's budget through the independent checker before returning. Precursor to REQ-TSN-SYNTH-CQF-001 (Multi-CQF/TCQF: 3-7 tagged buffers, heterogeneous cycles, injection planning), now re-scoped to v0.21.0 — mirroring the REQ-TSN-SYNTH-QBV-BASE-001 -> REQ-TSN-SYNTH-QBV-001 split. Pure arithmetic, NO solver, NO new dependency; builds with --no-default-features. TEST-TSN-SYNTH-CQF-BASE: 7 unit tests (literature delay pin, multiflow admission, monotone cycle-vs-deadline, DeadlineTooTight/Oversubscribed/shared- link/input-validation negatives). cargo test -p spar-network 134 lib pass; clippy -D warnings clean; fmt clean. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Rivet verification gate✅ 20/20 passed
Filter: Failed artifacts(none) Updated automatically by |
Codecov Report❌ Patch coverage is
📢 Thoughts on this report? Let us know! |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What
Standard 802.1Qch CQF (Cyclic Queuing and Forwarding) synthesis — the second TSN synthesizer, complementing the Qbv GCL baseline (#290).
synthesize_cqftakes a set of reserved flows (each with a per-cycle reservation in bits, a path, and an end-to-end deadline) and produces aCqfSchedule: a global cycle timeTplus per-link admission.This implements REQ-TSN-SYNTH-CQF-BASE-001 (standard two-buffer, single-cycle-T baseline), a deliberate precursor split from REQ-TSN-SYNTH-CQF-001 — mirroring the REQ-TSN-SYNTH-QBV-BASE-001 → REQ-TSN-SYNTH-QBV-001 split.
Why CQF is the clean next synthesis target
CQF's worst-case end-to-end delay is structurally decoupled from per-link load: a frame received in cycle c is forwarded in c+1, so for
Hhops at cycle timeT:independent of topology and load, given no cycle is oversubscribed (IETF
draft-eckert-detnet-tcqf-05, IEEE 802.1Qch). So feasibility factors into two small, local checks — no network-calculus curve composition:(H+1)·T ≤ deadlinefor every flow;csize = T·link_rate.That is exactly why CQF routes around the network-wide NC-composition bridge that an MILP frame-scheduler needs to be both necessary and checkable. Synthesis: pick the largest whole-ns
Tmeeting every deadline (looserT→ more bandwidth, so the deadline-limitedTmaximizes admission headroom), then admit iff every link fitscsize.The oracle is anchored to external ground truth
Unlike the Qbv baseline (whose oracle was self-consistent against its own checker), the CQF checker's delay formula is pinned to a published worked example in
draft-eckert-detnet-tcqf-05:delay_bound_matches_published_tcqf_exampleassertscqf_delay_max_ps(24, 10µs) == 250µsandcqf_delay_min_ps == 230µs(jitter exactly 2T). So if the delay model were subtly wrong (e.g.H·Tinstead of(H+1)·T), the pin fails against the literature — something a self-consistent synth↔checker loop would miss. The synthesizer self-certifies against this same checker before returning.Falsification statement
Scope notes (honest to the primitive)
synthesize_cqfis a library primitive with a unit oracle; there is no AADL→synth→export path yet (the DEC-TSN-OSS-001 wedge is demonstrated once the bridge exists).--no-default-features.Gates (local)
cargo test -p spar-network— 134 lib pass (7 new CQF) + integration greencargo clippy -p spar-network --all-targets -- -D warnings— cleancargo fmt -p spar-network -- --check— cleancargo build -p spar-network --no-default-features— OK🤖 Generated with Claude Code