ORIX Cosmos — Architecture
ORIX Cosmos is a native macOS (Apple Silicon) astronomical atlas, digital observatory and astrophysics laboratory. Swift 6, SwiftUI + AppKit + MetalKit, own Metal renderer, SQLite for metadata, indexed binary files for large catalogues. No game engine, no web view, no mandatory server.
1. Environment the project was built on
| Item | Value (audited 2026-11-24) |
|---|---|
| Machine | MacBook Pro, Apple M5 Max, 18 CPU cores, 40 GPU cores, 48 GB |
| OS / Xcode / Swift | macOS 27.0 · Xcode 27.2 · Swift 6.4.2 |
| Metal | Metal 4 reported by the system; capabilities are detected at runtime |
| Deployment target | macOS 15.0 — same floor as the other ORIX macOS apps; gives Metal 3, MetalFX, Swift Testing, modern SwiftUI. Newer features are runtime-gated |
| Project generation | XcodeGen (project.yml) for the app; one SwiftPM manifest (Package.swift) for all modules |
2. Modules
One SwiftPM target per directory Packages/<Module>/Sources, tests in Packages/<Module>/Tests
(fixtures in Tests/Fixtures, never used as production data). The allowed dependency edges are
declared in Package.swift; the compiler enforces them.
| Module | Responsibility |
|---|---|
| CosmosCore | Scientific status, provenance, Measured<T>, typed units, constants, ObjectID, Instant, StateVector, provider protocols |
| CosmosMath | Vectors/matrices/quaternions in Double, Chebyshev, interpolation, root finding, ODE helpers, statistics |
| CosmosTime | UTC/TAI/TT/TDB/UT1, leap seconds, Julian dates, calendar, simulation clock |
| CosmosCoordinates | Frame rotations (ICRF, ecliptic, galactic, body-fixed), precession/nutation, sidereal time, spherical/topocentric conversions |
| CosmosEphemeris | DAF/SPK kernel reader, text-kernel (LSK/PCK) parser, body orientation, light-time/aberration, sampled trajectories |
| CosmosCatalog | Object model, SQLite metadata store, binary star/galaxy catalogues, search |
| CosmosSpatial | Scale hierarchy, floating origin, octree / HEALPix indices, LOD selection |
| CosmosRender | Metal engine: frame graph, pipelines, planets, atmospheres, rings, stars, galaxies, trajectories, labels |
| CosmosPlanetary | Physical and visual descriptions of bodies (radii, rotation, textures, atmosphere parameters, rings) |
| CosmosAstrodynamics | Kepler elements, SGP4, Lambert, Hohmann, delta-v, event finding (eclipses, transits, conjunctions, phases) |
| CosmosCosmology | FLRW distances, lookback time, horizons |
| CosmosObservation | Topocentric sky, rise/set, refraction, telescope field of view, HR diagram data, FITS/WCS |
| CosmosLaboratory | N-body solvers, integrators, experiments, diagnostics, reproducibility records |
| CosmosDataPacks | Pack manifests, SHA-256, resumable download, atomic install, archive validation, quotas |
| CosmosExport | PNG, CSV, JSON, PDF, video, reproducibility bundle |
| CosmosScripting | Restricted, sandboxed scripting language and API |
| CosmosAI | Optional assistant with typed tools; never a source of scientific values |
| CosmosUI | SwiftUI/AppKit interface; the only module that sees everything |
App/ holds the thin application target, Shaders/ the Metal Shading Language sources,
DataPipeline/ the scripts that turn public source data into packs, Benchmarks/ the headless
benchmark runner, Scripts/ build/test/release tooling, Documentation/ user documentation.
3. Conventions (binding)
- Units. SI internally: metres, seconds, kilograms, radians, m/s. Kernels in km are converted at
the reader. Public APIs use the typed quantities of
CosmosCoreor name the unit in the parameter. - Time. The time argument of every dynamical computation is
Instant(TDB seconds past J2000.0). UTC appears only at input/output boundaries. - Frames. Default axes are ICRF (treated as J2000 equatorial, as JPL kernels do). A
StateVectoralways names its frame and its centre. - Precision. Absolute positions are
SIMD3<Double>on the CPU. The renderer receives positions relative to the camera (floating origin) and only then narrows to float32. - Unknown is nil. A missing value is
nil, never0, never a guessed default. - Status and provenance. Anything shown to the user carries a
ScientificStatusand, when it comes from data, aProvenance.ID. Approximate modes (Kepler, pedagogical scale) are labelled as such. - No silent extrapolation. Outside coverage, providers throw
CosmosError.outOfCoverage. - Identifiers.
ObjectIDvalues are stable and namespaced; they are never renumbered. - Concurrency. Swift 6 language mode, strict concurrency. Long work is cancellable (
Task.checkCancellation), streams apply backpressure, UI state is@MainActor. - Data honesty. Production data comes from the pipeline with recorded provenance and licence.
Test fixtures live under
Tests/Fixturesonly. No invented numbers, no fabricated test or benchmark results. - Headers. Every first-party source file starts with the ORIX Cosmos header (File, Description, Author, Contact).
- No private keys, tokens or personal data in the repository, logs or artefacts.
4. Rendering and data flow
packs (SQLite + binary) -> Catalog / Ephemeris providers -> scene assembly (CosmosUI, Double, ICRF)
| camera-relative, float32
time (CosmosTime clock) -> Instant -----------------------------+-> CosmosRender (Metal) -> MTKViewThe renderer never imports catalogue or simulation modules: it draws a value-type scene description. The laboratory never mutates the reference universe: experiments are separate documents.
5. Decision log
See Documentation/DECISIONS.md.