Skip to content

feat(network): NetworkGraph types + extractor (Track D commit 2/6)#157

Merged
avrabe merged 1 commit intomainfrom
feat/v0.8.0-track-d-commit2
Apr 25, 2026
Merged

feat(network): NetworkGraph types + extractor (Track D commit 2/6)#157
avrabe merged 1 commit intomainfrom
feat/v0.8.0-track-d-commit2

Conversation

@avrabe
Copy link
Copy Markdown
Contributor

@avrabe avrabe commented Apr 25, 2026

Summary

Track D commit 2 of 6 for v0.8.0 — adds the typed network graph that
bridges the AADL SystemInstance and the upcoming WCTT analysis.

  • crates/spar-network/src/types.rsNetworkNode, NetworkLink,
    SwitchType (FIFO / Priority / TSN), NetworkGraph with nodes,
    links, switches, end_stations, and reachable_from accessors.
    Phase 1 classifies TSN switches but treats them as opaque; full
    TSN-shaped service curves arrive with the Spar_TSN property set in
    Phase 2.
  • crates/spar-network/src/extract.rs — walks SystemInstance,
    classifies buses by Spar_Network::Switch_Type, registers the
    devices/processors connected to each switched bus as end stations,
    and emits one NetworkLink per bus-touching connection. Each link
    carries Output_Rate, Forwarding_Latency, and Queue_Depth from
    the bus, using a typed-first / string-fallback property accessor
    pattern that mirrors spar-analysis::property_accessors.
  • crates/spar-network/tests/extract_tests.rs — 6 integration tests
    driving small inline AADL fixtures: simple FIFO topology, Priority
    switch classification, opaque TSN switch (with link annotations
    still propagating), unannotated-bus skip, range latency lowering,
    and graph reachability.
  • New rivet artifacts: REQ-NETWORK-004 (network graph extraction)
    and TEST-SPAR-NETWORK-GRAPH (the new integration tests).

What is intentionally out of scope

  • No Network Calculus primitives — that's Track D commit 3.
  • No wctt.rs analysis pass — Track D commit 4.
  • No Lean theorems — Track D commit 5.
  • No latency.rs integration or COMPLIANCE.md update — Track D commit 6.

Links

Test plan

  • cargo build --workspace clean
  • cargo test -p spar-network — 18 tests green (12 unit + 6 integration)
  • cargo test -p spar-hir-def — 429 tests green (no regression)
  • cargo test --workspace — all crates green
  • cargo clippy --workspace --all-targets -- -D warnings clean
  • cargo fmt --all -- --check clean
  • rivet validateResult: PASS

🤖 Generated with Claude Code

@codecov
Copy link
Copy Markdown

codecov Bot commented Apr 25, 2026

Codecov Report

❌ Patch coverage is 76.88442% with 92 lines in your changes missing coverage. Please review.

Files with missing lines Patch % Lines
crates/spar-network/src/extract.rs 72.13% 90 Missing ⚠️
crates/spar-network/src/types.rs 97.33% 2 Missing ⚠️

📢 Thoughts on this report? Let us know!

Adds the bridge between AADL ItemTree and WCTT analysis.

crates/spar-network/src/types.rs — NetworkNode, NetworkLink,
SwitchType, NetworkGraph. Switch types: FIFO/Priority (Phase 1) and
TSN (opaque until Phase 2's service curves land).

crates/spar-network/src/extract.rs — walks SystemInstance, reads
Spar_Network::* properties, emits a typed NetworkGraph.

No Network Calculus, no analysis pass, no latency.rs integration —
those are Track D commits 3, 4, and 6 respectively.

New requirement: REQ-NETWORK-004.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
@avrabe avrabe force-pushed the feat/v0.8.0-track-d-commit2 branch from 8a97196 to b0692c6 Compare April 25, 2026 16:52
@avrabe avrabe merged commit d17bc9a into main Apr 25, 2026
13 of 14 checks passed
@avrabe avrabe deleted the feat/v0.8.0-track-d-commit2 branch April 25, 2026 22:21
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