Skip to content

Dependency Graph

spoxnr edited this page May 7, 2026 · 7 revisions

Workspace dependency graph

Generated from cargo metadata. Mermaid blocks render directly on the GitHub wiki; for local inspection paste into https://mermaid.live or any Mermaid-aware viewer.

xtask is omitted (no workspace deps; build-tooling only).

Layered architecture (production path, regular deps only)

graph TD
    classDef foundation fill:#dfe3ee,stroke:#34495e,color:#000
    classDef physics fill:#e8f0d8,stroke:#27ae60,color:#000
    classDef gateway fill:#ffeaa7,stroke:#fdcb6e,stroke-width:2px,color:#000
    classDef consumer fill:#dceffb,stroke:#3498db,color:#000
    classDef verif fill:#f9d6d6,stroke:#c0392b,color:#000

    quantities[astrodyn_quantities]:::foundation

    math[astrodyn_math]:::physics
    time[astrodyn_time]:::physics
    planet[astrodyn_planet]:::physics
    ephemeris[astrodyn_ephemeris]:::physics
    frames[astrodyn_frames]:::physics
    atmosphere[astrodyn_atmosphere]:::physics
    dynamics[astrodyn_dynamics]:::physics
    gravity[astrodyn_gravity]:::physics
    interactions[astrodyn_interactions]:::physics

    astrodyn["<b>astrodyn</b><br/><i>gateway / root</i>"]:::gateway

    runner[astrodyn_runner]:::consumer
    bevy[astrodyn_bevy]:::consumer

    verif_jeod[astrodyn_verif_jeod]:::verif
    verif_parity[astrodyn_verif_parity]:::verif

    %% physics depends on foundation
    math --> quantities
    time --> quantities
    planet --> quantities
    ephemeris --> quantities
    frames --> quantities
    atmosphere --> quantities
    dynamics --> quantities
    gravity --> quantities
    interactions --> quantities

    %% physics inter-deps
    frames --> math
    dynamics --> math
    dynamics --> frames
    gravity --> math
    gravity --> dynamics
    interactions --> atmosphere

    %% gateway pulls everything
    astrodyn --> atmosphere
    astrodyn --> dynamics
    astrodyn --> ephemeris
    astrodyn --> frames
    astrodyn --> gravity
    astrodyn --> interactions
    astrodyn --> math
    astrodyn --> planet
    astrodyn --> quantities
    astrodyn --> time

    %% consumers
    bevy --> astrodyn
    runner --> astrodyn
    runner --> dynamics
    runner --> frames
    runner --> gravity
    runner --> interactions
    runner --> math
    runner --> quantities
    runner --> time

    %% verification
    verif_jeod --> astrodyn
    verif_jeod --> runner
    verif_jeod -.-> atmosphere
    verif_jeod -.-> dynamics
    verif_jeod -.-> ephemeris
    verif_jeod -.-> frames
    verif_jeod -.-> gravity
    verif_jeod -.-> interactions
    verif_jeod -.-> math
    verif_jeod -.-> quantities
    verif_jeod -.-> time

    verif_parity --> astrodyn
    verif_parity --> bevy
    verif_parity --> runner
    verif_parity --> verif_jeod
    verif_parity -.-> dynamics
    verif_parity -.-> gravity
    verif_parity -.-> quantities
Loading

Solid arrows are direct deps the crate explicitly lists; dashed arrows are direct deps that also arrive transitively through astrodyn.

Layer semantics (Three-Layer Architecture)

  • Foundationastrodyn_quantities (typed-quantities phantoms).
  • Physics layer — pure Rust, zero Bevy dep. Each astrodyn_* crate owns one slice of the JEOD port (math, frames, gravity, …).
  • Gatewayastrodyn is the single API surface for the production path. Every Bevy system, every mission crate, every published consumer reads the workspace through astrodyn and only through astrodyn.
  • Consumersastrodyn_bevy (ECS adapter, mission code's runtime) and astrodyn_runner (arena harness for batch propagation; no JEOD specifics).
  • Verificationastrodyn_verif_jeod owns every JEOD parser, fixture, scenario rig, type, and tier-3 test; astrodyn_verif_parity asserts bit-identical state between runner and Bevy.

The verification crates are allowed to reach around astrodyn and import physics crates directly because they are not mission-path consumers. See the Strategy page's "astrodyn_bevy vs astrodyn_runner" section for the dep-graph rights asymmetry.

Mission-path slice (what published consumers see)

graph TD
    classDef gateway fill:#ffeaa7,stroke:#fdcb6e,stroke-width:2px,color:#000
    classDef consumer fill:#dceffb,stroke:#3498db,color:#000
    classDef physics fill:#e8f0d8,stroke:#27ae60,color:#000

    bevy[astrodyn_bevy]:::consumer
    astrodyn[<b>astrodyn</b><br/>gateway]:::gateway
    physics["10 × astrodyn_*<br/>(physics + ephemeris)"]:::physics
    bevy_ext[bevy 0.18]

    bevy --> astrodyn
    bevy --> bevy_ext
    astrodyn --> physics
Loading

A mission crate that wants to ship code into Bevy depends on astrodyn_bevy and bevy; that's the entire surface. The 10 physics crates sit behind the gateway and only get pulled in transitively.

Full edge listing (regular + dev)

→ regular dep, ⇢ dev-dep.

astrodyn:
  → astrodyn_atmosphere
  → astrodyn_dynamics
  → astrodyn_ephemeris
  → astrodyn_frames
  → astrodyn_gravity
  → astrodyn_interactions
  → astrodyn_math
  → astrodyn_planet
  → astrodyn_quantities
  → astrodyn_time

astrodyn_atmosphere:
  → astrodyn_quantities
  ⇢ astrodyn_verif_jeod

astrodyn_bevy:
  → astrodyn
  ⇢ astrodyn (dev — for examples/tests reaching gateway types)
  ⇢ astrodyn_dynamics
  ⇢ astrodyn_quantities
  ⇢ astrodyn_runner
  ⇢ astrodyn_verif_jeod

astrodyn_dynamics:
  → astrodyn_frames
  → astrodyn_math
  → astrodyn_quantities
  ⇢ astrodyn_gravity
  ⇢ astrodyn_planet
  ⇢ astrodyn_verif_jeod

astrodyn_ephemeris:
  → astrodyn_quantities

astrodyn_frames:
  → astrodyn_math
  → astrodyn_quantities
  ⇢ astrodyn_time
  ⇢ astrodyn_verif_jeod

astrodyn_gravity:
  → astrodyn_dynamics
  → astrodyn_math
  → astrodyn_quantities
  ⇢ astrodyn_frames
  ⇢ astrodyn_time

astrodyn_interactions:
  → astrodyn_atmosphere
  → astrodyn_quantities
  ⇢ astrodyn_dynamics
  ⇢ astrodyn_ephemeris
  ⇢ astrodyn_gravity
  ⇢ astrodyn_math
  ⇢ astrodyn_planet
  ⇢ astrodyn_time
  ⇢ astrodyn_verif_jeod

astrodyn_math:
  → astrodyn_quantities
  ⇢ astrodyn_ephemeris
  ⇢ astrodyn_planet
  ⇢ astrodyn_verif_jeod

astrodyn_planet:
  → astrodyn_quantities
  ⇢ astrodyn_math

astrodyn_quantities: (foundation — no workspace deps)

astrodyn_runner:
  → astrodyn
  → astrodyn_dynamics
  → astrodyn_frames
  → astrodyn_gravity
  → astrodyn_interactions
  → astrodyn_math
  → astrodyn_quantities
  → astrodyn_time
  ⇢ astrodyn_atmosphere
  ⇢ astrodyn_verif_jeod

astrodyn_time:
  → astrodyn_quantities

astrodyn_verif_jeod:
  → astrodyn
  → astrodyn_atmosphere
  → astrodyn_dynamics
  → astrodyn_ephemeris
  → astrodyn_frames
  → astrodyn_gravity
  → astrodyn_interactions
  → astrodyn_math
  → astrodyn_quantities
  → astrodyn_runner
  → astrodyn_time

astrodyn_verif_parity:
  → astrodyn
  → astrodyn_bevy
  → astrodyn_dynamics
  → astrodyn_gravity
  → astrodyn_quantities
  → astrodyn_runner
  → astrodyn_verif_jeod

Verification of acyclicity

cargo build --workspace and cargo tree --workspace succeed — Cargo would refuse the build on any cycle in the regular-dep graph. The astrodyn_runner ↔ astrodyn_verif_jeod pair has a dev-dep back-edge (runner has verif_jeod as dev-dep so the earth_moon / mars_orbit examples can demo the SH-gravity reference data); Cargo handles that as a separate compilation unit.

Regenerate

# Quick text view
cargo metadata --format-version=1 --no-deps | jq '
  .workspace_members as $ws |
  .packages
  | map(select(.id as $id | $ws | index($id)))
  | map({name, deps: [.dependencies[] | "\(.kind // "normal"): \(.name)"]})
'

# Or just inspect Cargo.toml files
for f in Cargo.toml crates/*/Cargo.toml; do
  echo "=== $f ==="
  awk '/\[(dev-)?dependencies\]/,/^\[/' "$f" | grep -E '^astrodyn_'
done

Clone this wiki locally