Skip to content

feat(wctt): per-stream WCTT analysis pass (Track D commit 4/6)#168

Merged
avrabe merged 1 commit intomainfrom
feat/v0.8.0-track-d-commit4-wctt
Apr 26, 2026
Merged

feat(wctt): per-stream WCTT analysis pass (Track D commit 4/6)#168
avrabe merged 1 commit intomainfrom
feat/v0.8.0-track-d-commit4-wctt

Conversation

@avrabe
Copy link
Copy Markdown
Contributor

@avrabe avrabe commented Apr 26, 2026

Summary

Track D commit 4/6 (of 6 for v0.8.0): wires together the network graph extraction (commit 2) and NC primitives (commit 3) into a new spar-analysis::WcttAnalysis pass that walks extracted streams and composes per-hop delay bounds end-to-end.

  • Phase 1 scope (this commit): classical FIFO + Priority switches with closed-form residual-service splitting from spar-network::curves. Streams are inferred from AADL data-port connections that bind to one or more switched buses via Deployment_Properties::Actual_Connection_Binding. Per-stream end-to-end WCTT = sum of per-hop delays.
  • Deferred: TSN-shaped service curves (TAS/CBS/preemption) land in Phase 2 alongside the Spar_TSN property set. latency.rs integration is the closeout commit 6. Lean theorems are commit 5.
  • New AADL property: Spar_Network::WCTT_Budget (Time). Predeclared-property total goes 120 -> 121 (Spar_Network grew by 1).

What's new

  • crates/spar-analysis/src/wctt.rs — new pass with 10 unit tests covering: non-regression (zero Wctt* on unswitched models), single-hop / multi-hop chain bounds, two-stream residual-service split, competing-flow exhaustion, budget exceed/within, Priority switch (treated like FIFO in Phase 1), TSN switch deferral, unannotated bus skip.
  • crates/spar-analysis/tests/fixtures/wctt/classical_ethernet.aadl + .expected.json snapshot, driven by tests/wctt_fixtures.rs.
  • New diagnostics: WcttBound (Info per stream), WcttExceedsBudget (Error), WcttUnservable (Error), WcttSwitchOverloaded (Error), WcttDeferred (Info Phase-2 note).
  • Spar_Network grew by 1 property (WCTT_Budget => Time); per-set test bumped 4 -> 5; total-count test bumped to 121 reconciled with the v0.7.1 PIP/PCP additions already on main.
  • register_all count bumped 29 -> 30.
  • Rivet artefacts: REQ-NETWORK-006 (per-stream WCTT analysis) appended to requirements.yaml; TEST-WCTT linked to REQ-NETWORK-{004,005,006} appended to verification.yaml.

Test plan

  • cargo build --workspace clean
  • cargo test -p spar-analysis — 824 lib + 3 rta_fixtures + 1 wctt_fixtures pass
  • cargo test -p spar-network — 26 lib + 6 integration pass
  • cargo test -p spar-hir-def — 448 lib pass (including the bumped property-count assertion)
  • cargo clippy --workspace --all-targets -- -D warnings clean
  • cargo fmt --all -- --check clean
  • rivet validate PASS

Out of scope

  • TSN-shaped service curves (Phase 2)
  • latency.rs integration with WctttCache (commit 6)
  • Lean theorems for the headline NC bounds (commit 5)
  • Hierarchical RTA / Track A surfaces

🤖 Generated with Claude Code

Wires together NetworkGraph extraction (commit 2) and NC primitives
(commit 3) into a new spar-analysis::WcttAnalysis pass that walks
extracted streams and composes per-hop delay bounds end-to-end.

Phase 1 covers FIFO + Priority switches with classical residual-service
splitting. TSN-shaped service curves (TAS/CBS/preemption) are deferred
to Phase 2 as documented in the research doc.

New diagnostics: WcttBound (Info per stream), WcttExceedsBudget (Error
when Spar_Network::WCTT_Budget is set and exceeded), WcttUnservable
(Error when competing flows exhaust server rate), WcttSwitchOverloaded
(Error when port utilization > 1).

New property: Spar_Network::WCTT_Budget (Time). Total predeclared
property count 120 -> 121.

Non-regression: models without Spar_Network::Switch_Type produce zero
Wctt* diagnostics (no_switched_buses_emits_no_diagnostics test).

New requirement: REQ-NETWORK-006.

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

codecov Bot commented Apr 26, 2026

Codecov Report

❌ Patch coverage is 94.26606% with 50 lines in your changes missing coverage. Please review.

Files with missing lines Patch % Lines
crates/spar-analysis/src/wctt.rs 94.22% 50 Missing ⚠️

📢 Thoughts on this report? Let us know!

@avrabe avrabe merged commit b760e10 into main Apr 26, 2026
17 checks passed
@avrabe avrabe deleted the feat/v0.8.0-track-d-commit4-wctt branch April 26, 2026 18:27
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