The Relativistic Engine is written in ISO C++23. It is structured around data-oriented memory layouts, static compile-time polymorphism, deterministic execution guarantees, & parallel computation.
LinearMemoryArena) aligned to 64-byte and 128-byte cache boundaries. The per-ray integration loops of SoftwareComputeEngine do not allocate. Frame-level data of the render and capture pipelines (framebuffers, body lists, tile-culling tables, texture upload buffers) are std::vector objects resized on demand (see ARCHITECTURE.md).SpacetimeMetric) and templates to enable compile-time inlining of metric and equation of state routines.PCG64Engine). Floating-point arithmetic rounding behavior is preserved to maintain identical results across runs. Procedural sky and body surface patterns are integer hash functions of the ray direction or surface coordinates and a user-controlled seed. Randomized body creation in BodyManagerWindow uses std::mt19937_64 seeded from std::random_device and is not reproducible.The simulation and raytracing engine compiles and executes across major desktop, workstation, cloud instance, and high-performance computing operating systems.
CMAKE_CXX_STANDARD 23, CMAKE_CXX_STANDARD_REQUIRED ON, CMAKE_CXX_EXTENSIONS OFF).-Wall -Wextra -Wpedantic -Wconversion -Wshadow -Wnon-virtual-dtor -Wold-style-cast
-Wcast-align -Woverloaded-virtual -Wdouble-promotion -Wformat=2 -fno-math-errno
GNU GCC targets append -frounding-math. Windows MinGW targets append -Wa,-mbig-obj to manage large translation units.
/W4 /permissive- /fp:strict /Zc:__cplusplus /utf-8 /bigobj
-DENABLE_LTO=ON, setting CMAKE_INTERPROCEDURAL_OPTIMIZATION ON with -flto=auto on GNU/Clang toolchains or /GL and /LTCG on MSVC. Third-party fetched libraries (GLFW, ImGui, LZ4, ENet) compile with -fno-lto to safeguard symbol boundaries.-DENABLE_PGO_GENERATE=ON (-fprofile-generate / /LTCG:PGINSTRUMENT) followed by -DENABLE_PGO_USE=ON (-fprofile-use -fprofile-correction / /LTCG:PGOPTIMIZE).$ORIGIN and $ORIGIN/../lib via CMAKE_INSTALL_RPATH to achieve portable relocation.@executable_path, @executable_path/../Frameworks, @executable_path/../lib, @loader_path, and Homebrew directories (/opt/homebrew/lib, /opt/homebrew/opt/molten-vk/lib, /usr/local/lib, /usr/local/opt/molten-vk/lib).ENGINE_PORTABLE_EXE=ON instructs MinGW to link runtime libraries statically (-static -static-libgcc -static-libstdc++), producing self-contained single-file binaries.relativistic_core: Static physics, tensor algebra, spacetime metrics, integrators, optics, hydrodynamics, and uncertainty library.relativistic_distributed: Static cluster networking, cryptographic channel, LZ4/QOI compression, scheduling, and remote worker execution library.imgui_lib: Static GUI and plotting engine combining Dear ImGui (docking branch), ImPlot, GLFW, and OpenGL backends.RelativisticEngine (alias engine_cli): Master interactive simulation application with full multi-window GUI, REPL loop, and rendering pipeline.headless_exporter: Automated batch processor and verification benchmark harness without windowing dependencies.cluster_worker: Lightweight headless compute node daemon for LAN/Slurm network compute offload.startup_preview: Standalone testing harness for the platform bootstrap and splash window subsystem.Tensor<T, Rank, Dim>: Cache-aligned multidimensional tensor container supporting compile-time rank & dimension validation, outer products, Einstein summation contractions, metric inversions, & determinants.SimdVec<T, Width> & SimdMask<T, Width>: Register-width SIMD abstraction wrappers providing vector arithmetic, conditional blending (select), fused multiply-add (fma), & trigonometric evaluations.GeodesicBundle<T, Width>: Structure-of-Arrays (SoA) layout executing parallel Runge-Kutta integrations for bundles of rays (e.g. 4-wide or 8-wide double-precision channels).All metric types satisfy the SpacetimeMetric concept:
FlatMinkowskiMetric: Pseudo-Euclidean baseline with signature $(-c^2, 1, 1, 1)$.SchwarzschildMetric: Static spherically symmetric vacuum metric with exact analytical Christoffel symbols.SchwarzschildIsotropicMetric, PainleveGullstrandMetric, EddingtonFinkelsteinMetric: Coordinate regularized forms of the Schwarzschild geometry.KerrMetric: Stationary axisymmetrical geometry in Boyer-Lindquist coordinates, providing conserved Killing quantities & Carter constant invariants.KerrSchildMetric: Horizon-regular Cartesian formulation $g_{\mu\nu} = \eta_{\mu\nu} + 2H k_\mu k_\nu$.ReissnerNordstromMetric & KerrNewmanMetric: Charged static & rotating electrovacuum spacetimes.SchwarzschildDeSitterMetric: Cosmological constant $\Lambda$ coupling.FLRWMetric: Expanding cosmological background with dynamic scale factor $a(t)$ & Hubble parameter $H(t)$.MorrisThorneWormholeMetric: Spherically symmetric traversable wormhole with throat radius $b_0$.AlcubierreWarpMetric: Spacetime bubble metric with hyperbolic tangent shaping functions.BssnGrid & BssnEvolution: Numerical relativity module implementing 3+1 conformal BSSN evolution with 4th-order spatial finite differencing, iterative RK4 time advancement, tricubic spatial interpolation, and quintic Hermite temporal interpolation.LemaitreTolmanBondiMetric: Inhomogeneous spherically symmetric cosmological void metric driven by LtbProfile (include/relativistic/cosmology/lemaitre_tolman_bondi_profile.hpp), evaluating exact analytical hyperbolic and cycloid shell evolution $R(r, t)$ and $\dot{R}(r, t)$, spatial curvature $k(r) = H_0^2(1 - \Omega(r))r^2$, non-simultaneous bang times $t_B(r)$, and 4th-order spatial derivative stencils $R’, \dot{R}’, R’’$ (Mathematical Formulation Section 1.10).QuintessenceCosmologyMetric & ChaplyginCosmologyMetric: Dynamical dark energy models driven by QuintessenceBackground and ExpansionHistoryBuilder (include/relativistic/cosmology/dark_energy_models.hpp), solving background scalar field evolution over $N = \ln a \in [-6.9078, 1.3863]$ across 4 analytical potentials (Exponential, InversePowerLaw, PseudoNambuGoldstone, Supergravity), generalized Chaplygin gas fluids ($P = -A/\rho^\alpha$), and tabulated expansion grids TabulatedExpansionHistory (Section 1.11 and Section 1.12).EvaporatingVaidyaMetric: Semiclassical radiating black hole metric driven by HawkingRadiation, KerrHorizon, RenormalizedStressTensor, EvaporatingBlackHole, and UnruhEffect (include/relativistic/semiclassical/hawking_unruh.hpp), evaluating Kerr horizon surface gravity $\kappa$, Hawking temperatures $T_H$, 2D Polyakov s-wave stress tensors, coupled mass and spin-down integration, and Unruh-DeWitt detector excitation rates (Section 1.13).TeVeSSpacetimeMetric: Tensor-Vector-Scalar covariant modified gravity metric.include/relativistic/metrics/kerr_de_sitter.hpp: Kerr-de Sitter geometry.compute_kerr_invariants_bl & compute_zamo_angular_velocity (include/relativistic/metrics/kerr_invariants.hpp): Conserved energy, axial angular momentum and Carter constant of a Boyer-Lindquist state, and the angular velocity of zero-angular-momentum observers.BardeenKerrShadow (include/relativistic/metrics/bardeen_shadow.hpp): Photon orbit radii and shadow boundary of the Kerr metric for a given observer polar angle.SubsidiarySourceParams (include/relativistic/metrics/subsidiary_source_field.hpp): Compact parameter structure holding position, velocity, mass, Kerr spin parameter $a$, polar horizon radius $r_+$, equatorial horizon radius $r_{h,\text{eq}} = \sqrt{r_+^2 + a^2}$, Kerr ISCO radius, shadow capture radius $r_{\text{cap}} = \max(0.9 M (5.196 - 0.55 a_*^2), 1.05 r_{h,\text{eq}})$, inner and outer accretion disk radii, primary spin axis orientation triad $(\mathbf{f}_x, \mathbf{f}_y, \hat{\mathbf{s}})$, and an internal KerrSchildMetric<double> instance.SubsidiarySourceField (include/relativistic/metrics/subsidiary_source_field.hpp): Evaluates ray interactions against subsidiary Kerr black holes in scalar rendering passes: segment_crosses_horizon solves the quadratic ray-ellipsoid entry equation in normalized local coordinates; segment_is_captured tests ray intersection with the critical shadow capture radius; segment_crosses_disk detects equatorial plane crossings ($z_{\text{local}} = 0$) and computes crossing radius, frame-dragged azimuth $\phi_c$, and Keplerian angular momentum ratio $L_z / E$; compute_weak_field_deflection computes monopole deflection $2 M b / r^3$, Lense-Thirring spin deflection $-2 a M (\hat{\mathbf{s}} \cdot \hat{\mathbf{n}}) / r^3$, and quadrupole deflection $\frac{15\pi}{8} M^2 / r^3$; integrate_local_geodesic_correction integrates 4th-order Runge-Kutta steps in the local Kerr-Schild metric when within strong-field distance $r < \max(r_{\text{disk,out}}, 40 r_h)$; apply_all_source_corrections applies distance-sorted deflections sequentially.MultiSourceData (include/relativistic/render/software_compute_engine.hpp): Compiles up to 16 Kerr black holes (kMaxSources = 16) storing 4-vectors for position/mass, axis/spin, local frame vectors, horizon dimensions, and accretion disk radii. Drives trace_multi_source using Kerr-Schild metric superposition: ks_field extracts Boyer-Lindquist radial coordinate $r$ and scalar potential $H = M r^3 / (r^4 + a^2 z^2)$; ks_source_terms evaluates spatial gradients $\nabla H$ and $\nabla(\mathbf{k} \cdot \mathbf{p})$; ms_rhs and ms_rk4_step evaluate superposed Hamiltonian equations of motion; ms_initial_momentum constructs observer tetrads via Gram-Schmidt orthonormalization in the superposed metric; ms_horizon_entry and ms_disk_crossing resolve horizon entries and disk crossings. Implemented identically in GLSL within shaders/geodesic_tracer_fp64.comp, utilizing workgroup shared memory (ms_position_mass, ms_axis_spin, etc.) with workgroup barriers for parallel GPU execution.SoftwareComputeEngineThe metric identifiers correspond to Render::MetricId (include/relativistic/render/gpu_types.hpp). The central mass used by the tracers is max(metric_mass, 1e-4) and spin is clamped to $\pm 0.999 M$. Multi-source configurations containing two or more independent black holes (preset_3d == 8) automatically dispatch to trace_multi_source using Cartesian Kerr-Schild metric superposition.
| Id | MetricId |
Tracer Function | Horizon Boundary | Accretion Disk | Model Parameters Evaluated |
|---|---|---|---|---|---|
| 0 | FlatMinkowski |
step_schwarzschild_null_rk4 ($M = 0$) |
No | No | None |
| 1 | Schwarzschild |
step_schwarzschild_null_rk4 |
Yes ($r_h = 2M$) | Yes | $M$ |
| 2 | Kerr |
step_schwarzschild_null_rk4 if $\lvert a \rvert \le 10^{-9}M$, else trace_kerr_schild_photon |
Yes ($r_h = M + \sqrt{M^2-a^2}$) | Yes | $M, a$ |
| 3 | KerrSchild |
Same selection as Kerr; executes trace_kerr_schild_photon |
Yes ($r_h = M + \sqrt{M^2-a^2}$) | Yes | $M, a$ |
| 4 | ReissnerNordstrom |
step_schwarzschild_null_rk4 if $\lvert Q \rvert \le 10^{-9}M$, else trace_planar_photon |
Yes ($r_+ = M + \sqrt{M^2-Q^2}$) | Yes | $M, Q$ |
| 5 | KerrNewman |
trace_exact_photon with KerrNewmanMetric |
Yes ($r_+ = M + \sqrt{M^2-a^2-Q^2}$) | Yes | $M, a, Q$ |
| 6 | SchwarzschildDeSitter |
trace_planar_photon with SchwarzschildDeSitterMetric |
Yes (Cosmological and Event Horizons) | Yes | $M, \Lambda$ |
| 7 | FLRW |
trace_extended_photon (Friedmann expansion solver) |
Boundary ($a < 10^{-3}$) | No | $H_0, \Omega_m, \Omega_\Lambda$ |
| 8 | MorrisThorne |
trace_extended_photon (Wormhole throat solver) |
No (Throat transit $l \in (-\infty, \infty)$) | No | $b_0, \Phi_0$ |
| 9 | Alcubierre |
trace_extended_photon (Warp metric solver) |
Boundary (Apparent Horizon) | No | $v_s, R, \sigma$ |
| 10 | LemaitreTolmanBondi |
trace_spherical_photon (trace_spherical_spacetime_dispatch) |
No | Yes | $H_0, r_{\text{void}}, w_{\text{void}}, \Omega_{\text{in}}, \Omega_{\text{out}}$ |
| 11 | QuintessenceCosmology |
trace_extended_photon (Tabulated expansion history) |
Boundary | No | $w_0, w_a, \Omega_m, \Omega_\phi$ |
| 12 | ChaplyginCosmology |
trace_extended_photon (Tabulated expansion history) |
Boundary | No | $A, \alpha, \Omega_m$ |
| 13 | EvaporatingBlackHole |
trace_spherical_photon (VaidyaEvaporatingMetric) |
Yes ($r_h = 2M(v)$) | Yes | $M(v), \dot{M}_{\text{Hawking}}$ |
| 14 | EddingtonFinkelstein |
trace_spherical_photon (EddingtonFinkelsteinMetric) |
Yes ($r_h = 2M$) | Yes | $M$ |
| 15 | PainleveGullstrand |
trace_spherical_photon (PainleveGullstrandMetric) |
Yes ($r_h = 2M$) | Yes | $M$ |
| 16 | TeVeS |
trace_spherical_photon (TeVeSSpacetimeMetric) |
Yes ($r_h = 2M e^\phi$) | Yes | $M, a_0, \phi$ |
| * | Multi-Source Superposition | trace_multi_source (Up to 16 Kerr black holes) |
Yes (Individual Kerr Horizons) | Yes (Per-Source Disks) | Superposed Kerr-Schild centroids, spins, disks |
Parameters including cosmological_lambda, wormhole_throat, warp_velocity, warp_bubble_radius, warp_wall_sharpness, wormhole_tidal_potential, and teves_critical_acceleration are directly evaluated along geodesics by trace_extended_photon and trace_spherical_spacetime_dispatch. BssnGrid is not referenced by the render path; the BSSN selection resolves to Schwarzschild (see CLI_REFERENCE.md). Ray-tracing equations are given in MATHEMATICAL_FORMULATION.md.
GeodesicState<Scalar> (include/relativistic/integrators/geodesic_state.hpp): Cache-aligned 32-byte representation holding 4-position $x^\mu$ and 4-velocity $u^\mu$.RK45AdaptiveIntegrator<MetricType, Scalar> (include/relativistic/integrators/rk45_adaptive.hpp): Dormand-Prince 5(4) embedded adaptive Runge-Kutta scheme with FSAL evaluation, automatic radial time-step limits $0.5 r / |
u^r | $ in spherical coordinates, and algebraic constraint projection $g_{\mu\nu} u^\mu u^\nu = \text{const}$ solving the quadratic equation for $u^0$ (MATHEMATICAL_FORMULATION.md Section 18.1 and Section 18.6). Monitored via RK45Config (tolerances, safety factors, horizon modes) and RK45Stats (accepted/rejected steps, evaluations, max invariant residual). |
CashKarpIntegrator<MetricType, Scalar> (include/relativistic/integrators/cash_karp.hpp): Embedded 5(4) 6-stage Runge-Kutta scheme with distinct 4th-order and 5th-order weight vectors, providing wide stability intervals for stiff or oscillatory curved spacetime regions (MATHEMATICAL_FORMULATION.md Section 18.1).Vernier9Integrator<MetricType, Scalar> (include/relativistic/integrators/vernier9.hpp): High-order 16-stage 9(8) embedded Runge-Kutta scheme implementing Jim Vernier’s coefficients for ultra-low truncation error across long orbital arcs (MATHEMATICAL_FORMULATION.md Section 18.2).GaussLegendreIntegrator<MetricType, Stages, Scalar> (include/relativistic/integrators/symplectic_gauss_legendre.hpp): Implicit Runge-Kutta integrator supporting 2 stages (4th order, GaussLegendre4) and 3 stages (6th order, GaussLegendre6). Evaluates stage equations via Picard fixed-point iteration to tolerance $10^{-14}$ (GaussLegendreConfig), preserving phase space symplectic 2-forms and Killing invariants (MATHEMATICAL_FORMULATION.md Section 18.3).Hermite4AarsethIntegrator<MetricType, Scalar> (include/relativistic/integrators/hermite4_aarseth.hpp): 4th-order predictor-corrector scheme evaluating acceleration $\mathbf{a}$ and 4th-order centered finite difference jerk $\mathbf{j} = \dot{\mathbf{a}}$, interpolating snap $\mathbf{s}$ and crackle $\mathbf{c}$ to advance states with Aarseth variable timestep regulation $\Delta t \propto \sqrt{(|\mathbf{a}| |\mathbf{s}| + |\mathbf{j}|^2) / (|\mathbf{j}| |\mathbf{c}| + |\mathbf{s}|^2)}$ (MATHEMATICAL_FORMULATION.md Section 18.4).AdaptiveStepController<Scalar> (include/relativistic/integrators/step_controller.hpp): Digital filter step regulator supporting Standard (elementary integral), PI30 (proportional-integral, $\beta_I = 0.7/k, \beta_P = 0.3/k$), and PID42 (proportional-integral-derivative, $\beta_I = 0.6/k, \beta_P = 0.4/k, \beta_D = 0.2/k$) to suppress step-size oscillations (MATHEMATICAL_FORMULATION.md Section 18.5).HorizonDetector<Scalar> (include/relativistic/integrators/horizon_manager.hpp): State machine monitoring trajectory radial distance against horizon radius $r_s$ and singularity threshold $\delta_{\text{sing}} r_s$, classifying regional transitions (Exterior, HorizonSurface, Interior, PhysicalSingularity) and executing absorption or continuity modes (MATHEMATICAL_FORMULATION.md Section 18.6).SphericalPlanarNullIntegrator (include/relativistic/core/spherical_planar_null_integrator.hpp): Planar equatorial null geodesic RK4 integrator operating on PlanarNullState $(r, \psi, u^t, u^r, u^\psi)$ with 8th-order Christoffel evaluations.SchwarzschildNullIntegrator (include/relativistic/core/schwarzschild_null_integrator.hpp): Vectorized and scalar RK4 null geodesic integrator operating on SphericalNullState and CartesianNullState, enforcing angular momentum conservation $\mathbf{h} = \mathbf{r} \times \mathbf{v}$ and unwrap angle transformations.KerrSchildNullIntegrator (include/relativistic/core/kerr_schild_null_integrator.hpp): Cartesian Kerr-Schild null geodesic RK4 integrator operating on KerrSchildNullState, computing analytical field gradients and Gram-Schmidt observer tetrad constructions.GeodesicBundle<T, Width> (include/relativistic/core/math/geodesic_bundle.hpp): Structure-of-Arrays (SoA) SIMD ray bundle container executing vectorized null geodesic updates across AVX2, AVX-512, and ARM Neon lanes (GeodesicBundle4d, GeodesicBundle8f).SimulationOrchestrator is consumed by SimulationOrchestrator::step_nbody_dynamics, which selects SymplecticForestRuthPNIntegrator when the name contains Symplectic or Gauss and RungeKutta4PNIntegrator otherwise (include/relativistic/dynamics/pn_integrator.hpp, ARCHITECTURE.md).SoftwareComputeEngine does not call the integrators of this section. It uses step_schwarzschild_null_rk4 (include/relativistic/core/schwarzschild_null_integrator.hpp) and, for the exact tracer, a fixed-step RK4 scheme on the Christoffel symbols of the selected metric (Core::compute_christoffel with 8th-order differences).step_size_factor, min_step_size, max_step_size, far_field_step_scale and pole_guard_precision_scale. integration_rtol and integration_atol are stored, saved in scenarios and benchmark runs, and displayed, but are not read by the renderer. The step formulas are given in MATHEMATICAL_FORMULATION.md.include/relativistic/ui/compatibility_notes.hpp for BSSN with symplectic or Hermite schemes are display-only.PostNewtonianBody: State structure containing mass, radius, position, velocity, acceleration, spin vector, & multipole coefficients ($J_2, J_3, J_4$).PostNewtonianSolver: Evaluates gravitational accelerations from Newtonian up to 3.5PN order, including 2.5PN radiation damping, spin-orbit, spin-spin, & spherical harmonic potentials.DarkMatterProfileMath (include/relativistic/dark_matter/dark_matter_field.hpp): Evaluates enclosed mass fractions $f_{\text{enc}}(x, \alpha)$ and derivatives $f’_{\text{enc}}(x, \alpha)$ for 13 analytic profiles: NavarroFrenkWhite, Hernquist, Burkert, Einasto, Plummer, CoredIsothermal, SingularIsothermal, Dehnen, PointMass, Jaffe, Moore, Soliton, and BetaModel (Mathematical Formulation Section 17.1).DarkMatterHaloSettings & DarkMatterFieldSettings (include/relativistic/dark_matter/dark_matter_field.hpp): Manages up to 32 halos (kMaxHalos = 16 GPU active slots), 11 presets (DarkMatterHaloPreset), triaxial axis ratios $q_y, q_z$, Euler orientations, Keplerian orbits (DarkMatterHaloOrbit), 5 layout patterns (DarkMatterLayoutPattern), subhalo populations (DarkMatterPopulationSettings), and field serialization (store, restore).DarkMatterLensing (include/relativistic/dark_matter/dark_matter_field.hpp): Evaluates triaxial ellipsoidal coordinates $m$, local and world accelerations, perpendicular ray kicks with $\Delta\theta \le 0.2\,\text{rad}$ limiter, adaptive step bounds, and line-of-sight emission for 3 visualization modes (column density, field strength, circular speed squared).BarnesHutOctree (include/relativistic/dark_matter/barnes_hut.hpp): Hierarchical spatial tree with bounding boxes, quadrupole moment tensors, opening angle criterion $\theta = 0.6$, and symplectic leapfrog time integration for collisionless particles (CollisionlessParticle).CompositeGalaxyGenerator (include/relativistic/dark_matter/galaxy_model.hpp): Synthesizes composite galaxies with exponential stellar disks, Hernquist bulges, and NFW dark matter halos with velocity dispersion sampling and barycenter diagnostics.PostNewtonianSystem: Container managing multi-body systems, energy conservation tracking, angular momentum bookkeeping, & quadrupole gravitational wave emission ($h_+, h_\times, P_{\text{GW}}$).SphericalHarmonicsGravityModel: Fully normalized associated Legendre polynomial potential solver up to degree & order 32 (EGM96, LP165, MRO110, Jupiter, Sun models).RungeKutta4PNIntegrator & SymplecticForestRuthPNIntegrator (include/relativistic/dynamics/pn_integrator.hpp): Fixed-step integrators of PostNewtonianSystem. The orchestrator subdivides each tick into at most 500 sub-steps (ARCHITECTURE.md).PostNewtonianBody with is_spacetime_source set carries a Kerr outer horizon derived from its mass and spin (kerr_outer_horizon_radius, kerr_spin_parameter, set_spin_state, enforce_spacetime_source_invariants). Absorption and merging are handled by SimulationOrchestrator::handle_horizon_absorption; the primary source stays fixed at the origin.InteractionConfig (include/relativistic/dynamics/interaction_config.hpp) & the interaction solver (interaction_solver.hpp): Electromagnetic forces (Coulomb and dipole-dipole, with configurable permittivity and permeability), collisions (elastic or inelastic response, rotation, friction, restitution multiplier, contact stiffness scale, position correction), thermodynamics (radiative exchange with an ambient temperature and a coupling scale), fragmentation (integrity loss from collisions and tidal stress, minimum fragment mass, maximum fragments per event) and annihilation (contact scale, opposite-charge requirement). interaction_compatibility.hpp produces the warnings displayed in the Interactions tab.BodySurfaceLayerRegistry (include/relativistic/dynamics/body_surface_layers.hpp): Per-body procedural texture layers, at most Render::kMaxSurfaceLayers (4) per body. Each layer selects one of 10 patterns, 5 blend modes and 7 region masks (SurfaceLayerPattern, SurfaceLayerBlend, SurfaceLayerMask).BodyManagerWindow architecture: Reorganized into seven specialized functional tabs:
include/relativistic/ui/body_manager/body_catalog_list.hpp): Dynamically constructs parent-satellite hierarchy trees using Hill sphere and tidal dominance criteria via build_gravitational_hierarchy, reporting Hill radius occupancy percentages, Kozai-Lidov resonance windows ($i_{\text{rel}} \in [39.23^\circ, 140.77^\circ]$), and satellite stability boundaries.include/relativistic/ui/body_manager/source_property_editor.hpp): Decomposes orbital motion into local Radial ($\hat{\mathbf{R}}$), Tangential Prograde ($\hat{\mathbf{T}}$), and Normal ($\hat{\mathbf{N}}$) components relative to any designated parent body via compute_local_frenet_frame, providing pre-burn trajectory prediction diagnostics (preview_frenet_maneuver: eccentricity, semi-major axis, periapsis, apoapsis, plunge warnings) before committing impulses via apply_frenet_delta_v. Supports Hohmann transfer orbit insertion and isokinetic plane-change burns.include/relativistic/ui/body_manager/body_property_editor.hpp): Implements render_batch_object_editor and render_batch_source_editor providing absolute value staging and relative delta/scaling transformations across multi-body selections, including mass scaling, velocity vector offsets, temperature deltas, and uniform inclination alignments.include/relativistic/ui/body_manager/source_property_editor.hpp): Evaluates mutual inclination, line of nodes, and argument of periapsis relative to any designated reference body via compute_relative_orbital_plane_state, performing isokinetic rotations via apply_relative_orbital_plane_rotation, coplanar snaps, polar alignments, and retrograde inversions.include/relativistic/ui/body_manager/system_presets.hpp): Pre-built systems including the full real Solar System (Sun through Neptune, Pluto, Earth-Moon, Galilean moons: Io, Europa, Ganymede, Callisto, Titan), Inner Solar System, Jovian sub-system, and Earth-Moon frame with automatic physical unit scaling through ConstantsEngine.BulkBodyActions (include/relativistic/dynamics/bulk_body_actions.hpp): Global batch modifications on scoped bodies (velocity inversion, grid snapping, spatial scattering, mass equalization, mass averaging, spin zeroing, parameter assignment across 16 scalar properties, culling by radius or frustum).PostNewtonianSystem::bodies_mutex() is a recursive mutex locked by the orchestrator, the UI windows, the path preview and the capture recorder when they read or modify the body list.include/relativistic/hydro/hydro_types.hpp):
PrimitiveVariables<Scalar>: 64-byte aligned structure storing rest-mass density $\rho$, isotropic gas pressure $p$, 3-velocity $(v_x, v_y, v_z)$, lab magnetic field $(B_x, B_y, B_z)$, specific internal energy $\varepsilon$, Lorentz factor $W$, specific enthalpy $h$, and comobile magnetic energy density $b^2$. The method recompute_derived(gamma) computes $v^2 = \mathbf{v} \cdot \mathbf{v}$, enforces subluminality $v^2 \le 1 - 10^{-15}$, derives $W = (1 - v^2)^{-1/2}$, $b^2 = B^2 / W^2 + (\mathbf{B} \cdot \mathbf{v})^2$, $\varepsilon = p / ((\Gamma - 1)\rho)$, and $h = 1 + \Gamma p / ((\Gamma - 1)\rho)$ (MATHEMATICAL_FORMULATION.md Section 4.2).ConservedVariables<Scalar>: 64-byte aligned structure holding conserved density $D = \rho W$, momentum density $\mathbf{S} = (\rho h W^2 + B^2)\mathbf{v} - (\mathbf{B} \cdot \mathbf{v})\mathbf{B}$, energy density $\tau = \rho h W^2 + B^2 - P_{\text{tot}} - D$, and lab-frame magnetic vector $(B_x, B_y, B_z)$ with overloaded arithmetic operators.FluxVariables<Scalar>: 64-byte aligned directional flux container holding $(F_D, F_{S_x}, F_{S_y}, F_{S_z}, F_\tau, F_{B_x}, F_{B_y}, F_{B_z})$.Metric3Plus1<Scalar>: Encapsulates lapse $\alpha$, shift $\beta^i$, 3-metric $\gamma_{ij}$ and inverse $\gamma^{ij}$, volume determinant $\sqrt{\gamma}$, and extrinsic curvature $K_{ij}$.prim_to_con_flat: Evaluates flat Minkowski mappings from PrimitiveVariables to ConservedVariables.compute_flux_1d_x: Computes the 1D physical flux vector along the $x$-axis from primitive variables.include/relativistic/hydro/solvers/con2prim.hpp):
Con2PrimSolver<EOS, Scalar>: Converts conserved state vectors back to primitive variables subject to floors $p_{\text{floor}} = 10^{-15}$, $\rho_{\text{floor}} = 10^{-15}$, iteration cap 60, and relative tolerance $10^{-12}$ (MATHEMATICAL_FORMULATION.md Section 4.4).solve_hydro: Solves unmagnetized relativistic hydrodynamic states via 1D Newton-Raphson iteration on pressure $p$. At each iteration with $z = \tau + p + D$, $v^2 = S^2 / z^2$, $W = (1 - v^2)^{-1/2}$, and $h = z / (D W)$, it evaluates objective $f(p) = \Gamma p - (\Gamma - 1)(z / W^2 - D / W) = 0$ with analytical derivative $df/dp = \Gamma - (\Gamma - 1)v^2(1 - 1/h)$, enforcing bracketed bisection fallbacks on $[p_{\min}, p_{\max}]$ whenever $p_{\text{next}}$ escapes or evaluates to non-finite values.solve_mhd: Solves relativistic magnetohydrodynamic states via 1D root-finding on scalar $z = \rho h W^2$. At each step, $v^2 = [S^2 z^2 + (\mathbf{S} \cdot \mathbf{B})^2(2z + B^2)] / [z^2 (z + B^2)^2]$, $W = (1 - v^2)^{-1/2}$, $\mathbf{B} \cdot \mathbf{v} = (\mathbf{S} \cdot \mathbf{B})/z$, $b^2 = B^2 / W^2 + (\mathbf{B} \cdot \mathbf{v})^2$, $p = z + B^2 - 0.5 b^2 - \tau - D$, $h = z / (D W)$, and tests residual $f(z) = p - p_{\text{EOS}}(\rho, h) = 0$ with derivative approximation $df/dz = 1 + 0.5(\Gamma - 1)$, reconstructing primitive velocities $\mathbf{v} = \mathbf{S} / (z + B^2) + (\mathbf{S} \cdot \mathbf{B})\mathbf{B} / [z(z + B^2)]$.include/relativistic/hydro/solvers/reconstruction.hpp):
WENO5Reconstructor<Scalar>: Computes 5th-order interface states across 5-point stencils $(q_{i-2}, q_{i-1}, q_i, q_{i+1}, q_{i+2})$. Supports Jiang-Shu weights and WENO-Z weights with global smoothness indicator $\tau_5 = |
\beta_0 - \beta_2 | $ (MATHEMATICAL_FORMULATION.md Section 4.5). |
MP5Reconstructor<Scalar>: Evaluates Suresh-Huynh monotonicity-preserving 5th-order reconstruction with curvature parameter $\alpha = 4.0$. Checks original value $q^{\text{orig}}$ against $q^{\text{MP}} = q_0 + \operatorname{minmod}(q_1 - q_0, \alpha(q_0 - q_{-1}))$ and bounds candidates via minmod4 curvature estimates and median selection.TVDReconstructor<Scalar>: Evaluates second-order TVD reconstruction using MinMod or Monotonized Central (MC) slope limiters.reconstruct_primitive_variable_component: Applies reconstruction across all hydrodynamic primitive fields, clamping density and pressure above $10^{-15}$ and re-scaling velocities to satisfy $v^2 \le 1 - 10^{-14}$.include/relativistic/hydro/solvers/riemann_solvers.hpp):
HLLRiemannSolver<EOS, Scalar>: Evaluates acoustic wave speeds $\lambda_L, \lambda_R$ using local sound speed $c_s = \text{eos.sound_speed}(\rho, p)$ and relativistic velocity addition $\lambda_\pm = (v_x \pm c_s) / (1 \pm v_x c_s)$, resolving intermediate HLL fluxes (MATHEMATICAL_FORMULATION.md Section 4.6).HLLCRiemannSolver<EOS, Scalar>: Restores central contact wave speed $\lambda_$ by solving the quadratic dispersion relation derived from intermediate energy $E^{\text{HLL}}$ and momentum $U^{\text{HLL}}_{S_x}$, evaluating star-region pressure $p_ = -U^{\text{HLL}}{S_x} \lambda* + F^{\text{HLL}}_{S_x}$ and star-state conserved vectors $U^_L, U^_R$.HLLDRiemannSolver<EOS, Scalar>: Resolves five-wave relativistic MHD Riemann problems with intermediate contact and Alfvén waves when transverse magnetic fields are non-zero.include/relativistic/hydro/solvers/constrained_transport.hpp):
ConstrainedTransport2D<Scalar>: Manages staggered 2D grid meshes holding $(n_x + 1) \times n_y$ face-centered $B_x$ components, $n_x \times (n_y + 1)$ face-centered $B_y$ components, and $(n_x + 1) \times (n_y + 1)$ vertex-centered electric field components $E_z$ (MATHEMATICAL_FORMULATION.md Section 4.7).compute_vertex_electric_fields_from_cell_centered: Averages cell-centered electric fields $E_z = -(v_x B_y - v_y B_x)$ from four adjacent cell centers to vertices.update_face_magnetic_fields: Advances face magnetic fields via discrete curls $\Delta B_x = -(\Delta t / \Delta y) \Delta E_z$ and $\Delta B_y = (\Delta t / \Delta x) \Delta E_z$.average_to_cell_centers: Projects face-centered fields to cell-centered primitives ($B_{x,\text{cell}} = 0.5(B_{x,i} + B_{x,i+1})$).compute_max_divergence: Measures cell-by-cell numerical divergence $\nabla \cdot \mathbf{B} = (B_{x,i+1} - B_{x,i})/\Delta x + (B_{y,j+1} - B_{y,j})/\Delta y$, guaranteeing machine-precision preservation $\partial_t (\nabla \cdot \mathbf{B}) = 0$.include/relativistic/hydro/solvers/grhd_solver.hpp):
RelativisticHydroSolver1D<EOS, Scalar>: Manages 1D computational domains of $n_x$ cells with 3 ghost cells on each boundary. Supports Outflow, Periodic, and Reflecting boundary conditions ($v_x \leftarrow -v_x$).compute_time_step: Computes CFL-bounded time increments $\Delta t = \text{CFL} \cdot \Delta x / \max_i ( |
v_{x,i} | + c_{s,i}) / (1 + | v_{x,i} | c_{s,i})$. |
step_ssp_rk3: Advances the system across 3 Runge-Kutta stages using third-order Strong Stability Preserving time integration ($U^{(1)} = U^n + \Delta t L(U^n)$, $U^{(2)} = \frac{3}{4} U^n + \frac{1}{4}(U^{(1)} + \Delta t L(U^{(1)}))$, $U^{n+1} = \frac{1}{3} U^n + \frac{2}{3}(U^{(2)} + \Delta t L(U^{(2)}))$), executing reconstruction, boundary application, and Riemann solver passes at each stage.initialize_sod_shock_tube: Sets up the relativistic Sod shock tube problem ($\rho_L = 10.0, p_L = 40.0/3.0, v_L = 0$ on $x < 0.5$; $\rho_R = 1.0, p_R = 10^{-6}, v_R = 0$ on $x \ge 0.5$).initialize_balsara1_mhd: Sets up the Balsara-1 relativistic MHD shock tube benchmark ($\rho_L = 1.0, p_L = 1.0, B_{x,L} = 0.5, B_{y,L} = 1.0$; $\rho_R = 0.125, p_R = 0.1, B_{x,R} = 0.5, B_{y,R} = -1.0$).include/relativistic/hydro/solvers/tov_solver.hpp):
TOVConfig<Scalar>: Holds gravitational constant $G$, speed of light $c$, integration bounds, step bounds ($\Delta r_{\min} = 10^{-4}\,\text{m}$, $\Delta r_{\max} = 20000.0\,\text{m}$), and surface pressure floor fraction ($10^{-14}$).TOVStarProfile<Scalar>: Results structure storing central density $\rho_c$, central pressure $p_c$, total gravitational mass $M$, baryonic mass $M_b$, surface radius $R$, surface redshift $z_s = (1 - 2GM/(c^2 R))^{-1/2} - 1$, compactness $C = GM/(c^2 R)$, central redshift $z_c = e^{-\Phi(0)} - 1$, gravitational mass in solar masses, and radially discretized profiles for $r, m(r), m_b(r), p(r), \rho(r), \varepsilon(r), \Phi(r), c_s^2(r)$ (MATHEMATICAL_FORMULATION.md Section 4.8).solve_star_from_central_density: Integrates the coupled Tolman-Oppenheimer-Volkoff system $(dm/dr, dm_b/dr, dp/dr, d\Phi/dr)$ using 4th-order Runge-Kutta stepping. Initializes state at $r_0$ via quadratic Taylor series expansions, regulates step size adaptively via local pressure scale height $\Delta r = \operatorname{clamp}(0.05 p / |
dp/dr | , \Delta r_{\min}, \Delta r_{\max})$, locates stellar surface radius $R$ via linear sub-step fraction interpolation upon detecting $p \le 0$, and normalizes interior metric potential $\Phi(r)$ to match the analytical exterior Schwarzschild metric $\Phi(R) = \frac{1}{2} \ln(1 - 2GM/(c^2 R))$. |
compute_mass_radius_curve: Sweeps central density across $\log_{10}\rho_c \in [\log_{10}\rho_{\min}, \log_{10}\rho_{\max}]$, evaluates maximum gravitational mass $M_{\max}$, radius at maximum mass, and canonical $1.4 M_\odot$ neutron star radius, tagging dynamic stability boundaries where $\partial M / \partial \rho_c \le 0$.include/relativistic/hydro/eos.hpp):
IdealGasEOS<Scalar>: Gamma-law fluid $p = (\Gamma - 1)\rho \varepsilon$, with sound speed $c_s^2 = \Gamma p / (\rho h)$, enthalpy $h = 1 + \Gamma p / ((\Gamma - 1)\rho)$, and analytical partial derivatives $dp/d\rho = (\Gamma - 1)\varepsilon$ and $dp/d\varepsilon = (\Gamma - 1)\rho$ (MATHEMATICAL_FORMULATION.md Section 4.3).SyngeEOS<Scalar> & MathewsEOS<Scalar>: Relativistic kinetic models for monoatomic gases with temperature parameter $\theta = p / \rho$, specific enthalpy $h = 2.5\theta + \sqrt{2.25\theta^2 + 1}$, and pressure from enthalpy $p = \rho (h^2 - 1)/(5h)$. Evaluates exact analytical sound speeds: $c_s^2 = \theta / [h (dh/d\theta - 1/h)]$ for Synge, and $c_s^2 = 5\theta (h - 1/h) / [3h \sqrt{2.25\theta^2 + 1}]$ for Mathews.RelativisticFermiGasEOS<Scalar>: Degenerate Fermi gas for electrons, neutrons, protons, or custom fermions (FermiParticleType). Evaluates characteristic pressure scale $p_0 = m^4 c^5 / (24\pi^2 \hbar^3)$, density scale $\rho_0 = \mu m^4 c^3 / (3\pi^2 \hbar^3)$, dimensionless Fermi momentum $x = (\rho / \rho_0)^{1/3}$, pressure $p(x) = p_0 [x(2x^2 - 3)\sqrt{1 + x^2} + 3\operatorname{asinh}(x)]$, kinetic energy density $E_k(x)$ with 5th-order polynomial series expansions for $x < 0.05$, sound speed $c_s^2 = c^2 x^2 / (3(1 + x^2))$, and Newton-Raphson density inversion from pressure using exact derivative $dp/dx = 8 p_0 x^4 / \sqrt{1 + x^2}$ (MATHEMATICAL_FORMULATION.md Section 4.9).PolytropicEOS<Scalar>: Barotropic relation $p = K \rho^\Gamma$, energy density $\varepsilon = \rho + p / (\Gamma - 1)$, specific enthalpy $h = 1 + \frac{\Gamma K}{\Gamma - 1}\rho^{\Gamma - 1}$, and density inversion $\rho(p) = (p / K)^{1/\Gamma}$.PiecewisePolytropicEOS<NumPieces, Scalar>: Multi-segment polytrope with continuity matching across dividing densities $\rho_{\text{div}, i}$, piecewise indices $\Gamma_i$, and energy shift constants $a_i = a_{i-1} + \frac{P_{i-1}}{\rho_{\text{div}, i-1} c^2} (\frac{1}{\Gamma_{i-1} - 1} - \frac{1}{\Gamma_i - 1})$ guaranteeing continuous specific enthalpy $h(\rho) = 1 + a_i + \frac{\Gamma_i}{\Gamma_i - 1}\frac{p}{\rho c^2}$ and energy density $\varepsilon(\rho) = (1 + a_i)\rho c^2 + \frac{p}{\Gamma_i - 1}$.TabulatedNuclearEOS<Scalar>: 3D tabulated nuclear equation of state with trilinear interpolation over $(\log_{10}\rho, \log_{10}T, Y_e)$. Implements built-in calibrated presets for SFHo, Shen, LS220, SLy4, and APR4 models, binary search density inversion along the cold slice, and serializes tables to custom binary containers via to_hdf5_container and from_hdf5_container (FILE_FORMATS.md Section 3.2).NovikovThorneDisk (include/relativistic/hydro/novikov_thorne.hpp): Evaluates Page-Thorne analytical flux distribution $F(r) = \frac{3GM\dot{M}}{8\pi r^3} \frac{f(x)}{x(x^3 + a_*)}$, cubic roots $x_1, x_2, x_3$, ISCO, marginally bound and photon orbit radii, scale height $h(r) = c_s / \Omega_K$, surface density $\Sigma(r) = \dot{M}/(3\pi \nu)$, radiative efficiency $\eta = 1 - E_{\text{ISCO}}$, and local blackbody spectrum sampling.FishboneMoncriefTorus (include/relativistic/hydro/fishbone_moncrief.hpp): Stationary magnetized thick accretion torus in Kerr spacetime with constant specific angular momentum $l = -u_\phi / u_t$, effective potential $W(r, \theta) = \frac{1}{2} \ln(u_t^2)$, polytropic equilibrium density $\rho(r, \theta) = [(\Gamma - 1)(h - 1) / (\Gamma K)]^{\frac{1}{\Gamma - 1}}$, and local Boyer-Lindquist four-velocities.BlandfordZnajekModel (include/relativistic/magnetosphere/blandford_znajek.hpp): Horizon-threading force-free jet magnetosphere evaluating stream functions $A_\phi(r, \theta)$, Znajek boundary conditions, toroidal magnetic field generation, Poynting power extraction, and polarized synchrotron transfer along null rays.StokesVector<Scalar> (include/relativistic/optics/stokes_vector.hpp): 32-byte cache-aligned polarimetric state vector storing $(I, Q, U, V)^T$, evaluating linear polarization intensity $I_L = \sqrt{\max(Q^2 + U^2, 0)}$, total polarization $I_P = \sqrt{\max(Q^2 + U^2 + V^2, 0)}$, degree of linear polarization (DoLP $\Pi_L$), degree of circular polarization (DoCP $\Pi_V$), total polarization degree (DoP $\Pi$), electric vector position angle (EVPA $\chi = \frac{1}{2}\operatorname{atan2}(U, Q)$), physical validity invariants ($I \ge 0, Q^2 + U^2 + V^2 \le I^2$), and reference frame Mueller rotations (MATHEMATICAL_FORMULATION.md Section 6.2).StokesEmissivity<Scalar> & StokesTransferMatrix<Scalar> (include/relativistic/optics/stokes_vector.hpp): 32-byte and 64-byte aligned structures representing directional emissivity vectors $(j_I, j_Q, j_U, j_V)$ and polarimetric absorption/dispersion matrices $(\alpha_I, \alpha_Q, \alpha_U, \alpha_V, \rho_Q, \rho_U, \rho_V)$.RadiativeProcessEngine<Scalar> (include/relativistic/optics/radiative_processes.hpp): Evaluates cyclotron frequencies $\nu_B = \frac{e B}{2\pi m_e}$, thermal bremsstrahlung with relativistic Gaunt factor corrections and thermal factor $(1 + 4.4 \times 10^{-10} T_e)$, non-thermal power-law synchrotron emission and self-absorption $(\alpha_I, \alpha_Q)$ with analytical Gamma function integrals, thermal synchrotron emissivity and absorptivity via Petrosian-Mahadevan approximations, and Faraday rotation ($\rho_V$) and conversion ($\rho_Q$) coefficients (MATHEMATICAL_FORMULATION.md Section 6.4).PolarizedRadiativeTransfer<Scalar> (include/relativistic/optics/polarized_radiative_transfer.hpp): Evaluates polarized transport integration: step_delano_analytical implements Delano’s analytical matrix exponential method using matrix 1-norm scaling and squaring ($m = \lceil \log_2(2\mu_K) \rceil$), 12th-order Taylor series expansions of $\Psi(A)$, and squaring recurrences, with RK4 fallback step_rk4, relativistic Doppler frequency transformations ($g^2$ emissivity and $g^{-1}$ transfer matrix scaling), and hybrid non-thermal/thermal segment integration.PolarizedSpectrumSynthesizer (include/relativistic/optics/polarization_spectrum.hpp): Synthesizes polarized spectra across NonThermalPowerLaw, ThermalMaxwellJuttner, and Hybrid plasma models over logarithmic wavelength grids, evaluating DoLP, DoCP, DoP, EVPA, polarization ellipse semi-axes, linear regression Faraday rotation measure (RM) fitting from $\chi(\lambda^2)$, and spectral index fitting.MaxwellJuttnerDistribution<Scalar> (include/relativistic/optics/maxwell_juttner.hpp): Evaluates relativistic thermal electron velocity distributions: analytical Bessel function approximations ($K_0, K_1, K_2, K_3$), mean Lorentz factor $\langle \gamma \rangle = K_1/K_2 + 3\Theta_e$, Pozdnyakov-Sobol 4-regime rejection sampling algorithm, and line-broadening Doppler kernels.InverseComptonEngine (include/relativistic/optics/inverse_compton.hpp): Evaluates Klein-Nishina total and differential scattering cross sections with low-energy series expansions ($x < 10^{-4}$), Compton $y$-parameter $y = 4\Theta_e(1 + 4\Theta_e)\tau_{\text{eff}}$, and Monte Carlo photon packet scattering (PhotonPacket) with relativistic Lorentz velocity boosts.ContinuousSpectrum<Scalar> (include/relativistic/optics/spectrum.hpp): High-resolution continuous spectrum container discretizing radiances across 4096 logarithmic wavelength bins from $10^{-14}\,\text{m}$ to $10^3\,\text{m}$. Supports Planck blackbody generation, synchrotron power-law generation, monochromatic lines, Doppler beaming transformations ($g^5$), linear and logarithmic trapezoidal band integrations, and bolometric radiance evaluation.CIE1931Observer (include/relativistic/optics/cie_observer.hpp): Convolves continuous spectral radiance curves against analytical tri-Gaussian CIE 1931 color matching functions $(\bar{x}, \bar{y}, \bar{z})$ from 380 to 780 nm, evaluating tristimulus coordinates $(X, Y, Z)$, conversion to linear sRGB, and sRGB gamma encoding.Tonemapper (include/relativistic/optics/tonemapping.hpp): Applies HDR tonemapping curves: ACES filmic curve mapping, logarithmic HDR mapping over $[10^{-12}, 10^{20}]\,\text{W/m}^2/\text{sr}$, extended Reinhard mapping with maximum white parameter $L_{\text{white}} = 10.0$, and EV exposure scaling.CarterPhaseClassifier<Scalar> (include/relativistic/optics/carter_ray_classifier.hpp): Pre-classifies Kerr null geodesics into CertainAbsorption, CertainEscape, or RequiresIntegration via Cardano cubic and Ferrari depressed quartic analytical root extractions of the radial potential $R(r) = r^4 + (a^2 - \xi^2 - \eta)r^2 + 2M(\eta + (\xi - a)^2)r - a^2\eta$.DiskThermalProfile (include/relativistic/optics/disk_thermal_profile.hpp): Evaluates Page-Thorne / Novikov-Thorne normalized disk temperature profiles, Bardeen Kerr ISCO radii, circular orbit kinematic Doppler shifts, and gravitational redshifts $\sqrt{1 - 3M/r}$.GeodesicRayProbe (include/relativistic/optics/geodesic_ray_probe.hpp): Traces exact null geodesics under screen pixels across Flat, Schwarzschild, Kerr, Kerr-Schild, Reissner-Nordström, Kerr-Newman, and Schwarzschild-de Sitter spacetimes, extracting constants of motion ($E, L_z, \xi, \mathcal{Q}, \eta, b$), sub-step equatorial disk crossings, observed temperatures, image orders, and 3D deflection angles.GenericMetricTracer<Metric> (include/relativistic/optics/generic_metric_tracer.hpp): Evaluates general static tetrad orthonormalization, spherical frame axes, and RK4 null ray tracing on arbitrary spacetimes with pole guard damping and horizon clearance checks.TerrellPenroseOptics<Scalar> (include/relativistic/optics/terrell_penrose.hpp): Evaluates forward and backward relativistic aberration for 3-velocity vector $\boldsymbol{\beta}$, apparent visual Terrell rotation angle $\arcsin(\beta)$, and moving sphere analytical spacetime ray intersections with retarded time root-finding.VisibilitySynthesizer (include/relativistic/interferometry/visibility_synthesis.hpp), VlbiArrayCatalog (include/relativistic/interferometry/vlbi_array.hpp), and OifitsWriter (include/relativistic/interferometry/oifits_writer.hpp): Synthetic VLBI visibility synthesis, baseline tracking, thermal noise, closure phases, and OIFITS data export.Interval<Scalar> (include/relativistic/uncertainty/interval.hpp): IEEE 1788 compliant interval arithmetic container aligned to sizeof(Scalar)*2. Implements inf/sup bounds, midpoint, width, radius, absolute value, hull, intersection, directed division with zero-inclusion branches, powers with exponent parity, and transcendental functions (sqrt, exp, log, sin, cos with critical period testing; Mathematical Formulation Section 7.1).Zonotope<Scalar, Dim> (include/relativistic/uncertainty/zonotope.hpp): Multidimensional affine generator set $\mathcal{Z} = \mathbf{c} \oplus \sum \alpha_i \mathbf{g}i$. Evaluates interval bounding boxes, Minkowski sums, linear matrix transformations, scaling, translation, point containment, exact 2D hypervolume via determinant sums, and Girard order reduction sorting generator heuristic scores $s_i = |\mathbf{g}_i|_1 - |\mathbf{g}_i|\infty$ to condense excess generators into axis-aligned intervals (Section 7.2).CovarianceMatrix<Scalar, Dim> (include/relativistic/uncertainty/covariance.hpp): Symmetric positive semi-definite covariance container. Implements sandwich products $\mathbf{\Phi}\mathbf{\Sigma}\mathbf{\Phi}^T$, continuous Lyapunov derivative evaluation $\dot{\mathbf{\Sigma}} = \mathbf{J}\mathbf{\Sigma} + \mathbf{\Sigma}\mathbf{J}^T + \mathbf{Q}$, explicit Euler and RK4 stage integrators, cyclic Jacobi eigensystem solver with threshold rotations, confidence hypervolumes $V_n = \frac{\pi^{D/2}}{\Gamma(D/2+1)}\prod (n\sqrt{\lambda_i})$, Frobenius norm, submatrix extraction/assignment, and multivariate Gaussian sampling via eigensystem square roots and Box-Muller PCG64 variates (Section 7.3).PhaseState8D<Scalar> & VariationalGeodesicState<Scalar> (include/relativistic/uncertainty/variational_geodesic.hpp): 64-byte aligned phase-space structures holding 4-position $x^\mu$, 4-momentum $p^\mu$, covariance matrix $\mathbf{\Sigma} \in \mathbb{R}^{8 \times 8}$, and variational transition matrix $\mathbf{\Phi} \in \mathbb{R}^{8 \times 8}$.GeodesicJacobianComputer<MetricType, Scalar> (include/relativistic/uncertainty/variational_geodesic.hpp): Evaluates the complete $8 \times 8$ phase-space Jacobian $\mathbf{J}$ driven by 8th-order centered finite difference derivatives of Christoffel symbols $\partial_\nu \Gamma^\mu_{\alpha\beta}$ (Section 7.4).VariationalGeodesicIntegrator<MetricType, Scalar> (include/relativistic/uncertainty/variational_geodesic.hpp): 4th-order Runge-Kutta integrator simultaneously advancing phase coordinates, continuous Lyapunov covariance envelopes, and the variational transition matrix, computing Gaussian elimination phase determinants to monitor symplectic volume preservation.MonteCarloCovarianceValidator<MetricType, Scalar> (include/relativistic/uncertainty/variational_geodesic.hpp): Generates antithetic Gaussian ensembles with whitening transformations $\mathbf{W} = \mathbf{Z}_{\text{cov}}^{-1/2}$ matching initial analytical covariance, propagates ensembles across multiple threads, and evaluates principal semi-axes relative errors $\epsilon_k = |
a_k - e_k | / \max(a_k, 10^{-12})$ (Section 7.6). |
MonteCarloGeodesicSampler<MetricType, Scalar> (include/relativistic/uncertainty/monte_carlo_bundle.hpp): Manages multithreaded ensemble generation and RK45 trajectory integration, computing component statistical moments (mean, variance, skewness, kurtosis).PolynomialChaosExpansion<NumDims, MaxDegree> (include/relativistic/uncertainty/polynomial_chaos.hpp): Evaluates generalized polynomial chaos expansions over probabilists’ Hermite polynomials (Gaussian distributions) and Legendre polynomials (uniform distributions). Evaluates total degree basis indexing $\sum d_i \le M$, norm squared denominators, multidimensional tensor-grid spectral projection, mean, variance, statistical moments, and quantile estimation (compute_quantiles) via the Beasley-Springer-Moro inverse normal CDF approximation (Section 7.5).GaussQuadrature (include/relativistic/uncertainty/polynomial_chaos.hpp): Generates Gauss-Hermite and Gauss-Legendre quadrature nodes and weights via the Golub-Welsch algorithm using symmetric tridiagonal QL iterations (tridiagonal_symmetric_ql).PceGeodesicPropagator<MetricType, NumDims, MaxDegree, Scalar> (include/relativistic/uncertainty/pce_geodesic.hpp): Propagates 8D phase states through multidimensional tensor-grid quadrature points, solving trajectory ensembles with RK45 integration and projecting final states onto polynomial chaos basis functions.OrbitalWrappingBenchmark (include/relativistic/uncertainty/orbital_wrapping_benchmark.hpp): Evaluates interval vs zonotope enclosure wrapping in 2D circular orbits, demonstrating hypervolume reduction factors under periodic Girard reduction (Section 7.7).MetrologyVisualizer (include/relativistic/uncertainty/metrology.hpp): Constructs 3D covariance ellipsoid meshes with analytical surface normals and sigma scaling, computes 2D bivariate Gaussian probability heatmaps via inverse covariance Mahalanobis metrics, generates empirical 2D spatial point heatmaps, and extracts time-series quantile bands (Section 7.7).UncertainQuantity<T, Method> (include/relativistic/uncertainty/uncertain_quantity.hpp): Unified wrapper providing overloaded arithmetic operators across interval, zonotope, covariance, and polynomial chaos representations.Scheduler: Deterministic fixed-step clock engine supporting dynamic time-warp factors, pause/step functionality, & real-time accumulator regulation. It starts paused at 60 Hz, accepts rates from 10 to 1000 Hz, and clamps the accumulator to 0.25 s (ARCHITECTURE.md).SimulationOrchestrator: Coordinates physics processing, parameter updates, camera state management, & thread communication over lock-free single-producer single-consumer queues (SpscQueue, capacity 1024 for commands and results). It owns PhysicalParameters, CameraState and a home camera, the N-body system, the surface layer registry, PerformanceProfiler, ConstantsEngine, InteractionConfig, UnitDisplayPreferences, the active metric, integrator and scenario, and 32 custom parameter slots (names up to 63 characters). It applies 25 CommandType values and 123 ParameterType identifiers. state_version() is incremented after every applied command and simulation advance, and the windows compare it to resynchronize their widgets. Command semantics are listed in CLI_REFERENCE.md and the state advance in ARCHITECTURE.md.InteractiveCameraController: Coordinates observer worldlines and navigation across six operational modes:
Observer::SurfaceWalker).Observer::PlanetOrbit).Gamepad Controller Integration (GamepadConfig, GamepadAxesConfig, GamepadState, include/relativistic/ui/gamepad_input.hpp): Full dual-stick flight control supporting Xbox, Bluetooth, and USB gamepads using GLFW gamepad state polling (glfwGetGamepadState). Evaluates configurable left stick deadzone ($d_{\text{LS}} = 0.14$), right stick deadzone ($d_{\text{RS}} = 0.14$), and trigger deadzone ($d_{\text{trig}} = 0.08$) via non-linear quadratic mapping curves $\mathcal{F}(v, d) = \operatorname{sgn}(v)(( |
v | -d)/(1-d))^2$. Translates stick deflections into 10 virtual button tokens (indices 15 to 24: LSB Up/Down/Left/Right, RSB Up/Down/Left/Right, LT, RT) when exceeding a $0.40$ threshold. Evaluates 4 action modes: Mode 0 (Hold), Mode 1 (Toggle), Mode 2 (Tap, window $\le 0.25\,\text{s}$), Mode 3 (Double-Tap, window $\le 0.30\,\text{s}$). Rebindable button chords support multi-button combinations (such as RB + LB to reset roll). |
ArrowKeysMode): Configurable operational modes governing arrow keys: Movement (0, translational traversal), LookPitchYaw (1, look pitch/yaw with arrow_look_sensitivity), LookPitchRoll (2, look pitch/roll), and LookRollYaw (3, look roll/yaw), with individual axis inversion flags (arrow_look_invert_pitch, arrow_look_invert_yaw, arrow_look_invert_roll).GeodesicComputePipeline: Owns the framebuffers, the render worker thread, the VulkanContext and VulkanComputeExecutor, and the per-frame telemetry. It selects between the Vulkan path and SoftwareComputeEngine for every frame, and also serves capture rendering in bands (ARCHITECTURE.md).SoftwareComputeEngine: Multithreaded CPU ray tracer with a 4-lane double-precision SIMD path, a 8-lane single-precision SIMD path, and scalar paths in both precisions. Details are given in Section 2.9.UiManager: Coordinates GLFW windowing, ImGui docking workspaces, multi-viewport separation, & secondary camera views. It restores window visibility, units, constants, interaction settings, camera controls and secondary views from UserSettings, queues the startup scenario, processes the global hotkeys through ActionEdgeTracker (67 rebindable InputAction values in 8 categories, include/relativistic/ui/input_actions.hpp), and draws the main menu bar. The layout preset DeepAnalysis has no dedicated branch and is applied as the docked layout.ViewportPrimaryWindow (include/relativistic/ui/viewport_primary_window.hpp): Primary ray-traced viewport owning GeodesicComputePipeline and CaptureCoordinator. Dispatches native FP64 Vulkan compute or multi-threaded CPU SIMD/scalar solvers with dynamic resolution regulation, host color grading, and texture streaming. Features:
HudLayoutConfig (include/relativistic/ui/hud/hud_layout_config.hpp). Elements are positioned across 6 anchors (TopLeft, TopRight, BottomLeft, BottomRight, TopCenter, BottomCenter) and can stack automatically without gaps via HudAutoArranger. Each element supports Compact, Standard, or Extended display formats, decimal precision (0 to 6), custom draw priorities, refresh intervals, background opacities, and dual dynamic threshold color rules (HudColorRule: warning and critical tints):
FrameTimeReadout (0): Instantaneous and rolling-average frame times and FPS with McCamy frame-rate formatting.CameraDistanceReadout (1): Boyer-Lindquist radial coordinate $r$ and orbit distance in user units.CameraAnglesReadout (2): Observer colatitude $\theta$ and azimuth $\phi$.CameraOrientationReadout (3): Pitch, yaw, and roll in selected angular units.MetricSummaryReadout (4): Active manifold name, central mass $M$, spin $a$, charge $Q$, and ODE integrator.RayStatisticsReadout (5): Counts of horizon-absorbed, celestial-escaped, and accretion-disk-hit pixels.NavigationControlsPanel (6): Dynamic hotkey and gamepad binding summaries for active movement and flight actions.ViewportToolbar (7): Floating action bar hosting up to 26 interactive shortcuts.LoadingIndicator (8): Animated circular progress indicator rendering during asynchronous geodesic integration.SimulationClockReadout (9): Physical simulation coordinate time $t$, tick counter, and scheduler frequency.WarpFactorReadout (10): Time dilation warp multiplier and pause status.PerformancePresetReadout (11): Active performance profile preset designation.TelemetryQuickReadout (12): Lapse function $\alpha = \sqrt{-g_{tt}}$, gravitational time dilation, and ZAMO frame-dragging rate $\omega_{\text{ZAMO}}$.SpectrographQuickReadout (13): Line-of-sight Doppler beaming factor $g$, disk band status, EV exposure, and tonemapper.DiagnosticsQuickReadout (14): Active metric manifold paired with active numerical ODE integrator.ProfilerFrameTimeReadout (15): Detailed frame timing breakdown (dispatch, texture upload, HUD overlay).ProfilerBottleneckReadout (16): Automated bottleneck diagnosis identifying dominant execution stages and ray step saturation.ProfilerStageBreakdownReadout (17): Precise durations for HUD, camera updates, schematic passes, and post-processing.ProfilerRayClassificationReadout (18): Pixel termination statistics with percentage shares.ProfilerIterationRangeReadout (19): Minimum, maximum, and average integration steps consumed per ray.ProfilerGpuCpuSplitReadout (20): Rolling percentage distribution of GPU compute vs CPU fallback dispatches.BodyCountReadout (21): Active N-body celestial bodies count.GpuComputeStatusReadout (22): Vulkan device compute queue readiness and cluster worker node status.IntegratorStatsReadout (23): Active differential solver tolerances (rtol, atol).ConstantsQuickReadout (24): Active base constants preset (SI, Planck, Custom), speed of light $c$, and gravitational constant $G$.RayProbeReadout (25): Probed ray pixel coordinates, termination fate, spectral shift $g$, impact parameter $b$, Carter constant $Q$, and iterations.RayProbeEmissionReadout (26): Probed ray emission coordinates ($r_e, \theta_e, \phi_e$), periapsis closest approach, and dual-system coordinate transforms.PolarizationQuickReadout (27): Linear polarization degree (DoLP), circular polarization degree (DoCP), and electric vector position angle (EVPA $\chi$) at selected wavelength.InterferometryQuickReadout (28): Synthetic VLBI visibility counts, closure triangles, maximum baseline length in $\text{G}\lambda$, nominal resolution in $\mu\text{as}$, and mean SNR.RayProbeGeometryReadout (29): Total gravitational deflection angle, disk image order (direct vs $n$-th photon ring), and observed disk temperature.DarkMatterQuickReadout (30): Active and total dark matter halos count, total enclosed halo mass, and lensing/glow toggles.CameraPositionReadout (31): Dual-system coordinate readout evaluating Cartesian, spherical, cylindrical, or metric-adapted coordinates ($r, \theta, \phi, r^*$).CursorReadout (32): Real-time cursor coordinates in screen space, viewport space, internal render pixel indices, and live ray probe tracing under cursor.ArrowKeysModeReadout (33): Current arrow keys operational mode (Movement, LookPitchYaw, LookPitchRoll, LookRollYaw).ToolbarButtonVisibility: Play/Pause, Step, Reset View, Look-At Target combo (with dynamic target list: origin, horizon, photon sphere, ISCO, outer disk, polar axes, and every active celestial body with live distance labels), Jump to Target (repositioning observer to recommended framing distance), Camera Mode combo, HUD master toggle, Capture Studio shortcut, Fullscreen toggle, GPU compute toggle, Space-Skip toggle, LOD toggle, EV-/EV+ buttons, Warp-/Warp+ buttons, Tonemapper cycle, Projection cycle, Skybox toggle, Metric cycle, Integrator cycle, Performance preset combo, QSave/QLoad, StepCtrl cycle, Render Distance toggle, Pole-/Pole+ precision nudge buttons, Arrow Keys Mode toggle, and Coordinate system cycle buttons. Button padding scale can be adjusted from $0.4\times$ to $3.0\times$.build_ray_probe_query), with freeze toggle and on-screen crosshair overlay, feeding live metrics to the Spectrograph window and HUD readouts.RGBA32F texture.ControlPanelWindow (Master Simulation Controls, include/relativistic/ui/control_panel_window.hpp): Central configuration console organized into 14 functional tabs managed via MultiRowTabBar:
SpacetimeSourcePanel with HorizonRegimeAnalyzer evaluating sub-extremal, extremal, and super-extremal states, horizon lock enforcement, and visual horizon zone strips; primary accretion disk editor with thin procedural, Novikov-Thorne relativistic flux, and Fishbone-Moncrief thick torus models; and Blandford-Znajek jet magnetosphere editor.MultiRowTabBar (include/relativistic/ui/multi_row_tab_bar.hpp): Dynamic multi-row tab container providing:
AutoTwoRowsBalanced (dynamic bisection search minimizing width difference between two rows), AutoWrap (greedy line wrap based on available width), and FixedRows (enforces explicit row assignments).MultiRowLabelFitMode): FullOnly, ShortOnly, and SmartAdaptive (dynamically falls back from full title to medium abbreviated dictionary words, short initial phrase, or compact uppercase acronym).MRT_TAB_REORDER) with drop indicator insertion lines, and right-click context menu (Move Left, Move Right, Move to First, Move to Last, Reset Default Order).active_elevation with accent highlight lines.WindowChromeController (include/relativistic/ui/window_chrome.hpp): Manages thematic window accent styling and multi-monitor window placement:
WindowThemeId): Viewport, Controls, Scenarios, Bodies, Performance, Telemetry, Spectrograph, Diagnostics, Analysis, Keybinds, Constants, LogConsole, CaptureStudio, SecondaryViews.WindowThemePalette): derives active/inactive title bar backgrounds, borders, headers, slider grabs, check marks, and docking tabs from a single accent color. Enforces relative luminance clamping ($Y \le 0.14$) to maintain high contrast with text.kWindowThemeSwatches) with per-window and global reset actions.WindowGeometry), fitting them dynamically to monitor work areas (fit_to_monitors) to prevent windows from opening off-screen across display changes.CoordinateAwareWidgets & CoordinateDisplay (include/relativistic/ui/coordinate_aware_widgets.hpp, include/relativistic/ui/coordinate_display.hpp):
coordinate_aware_input_position) supporting 9 coordinate systems: Cartesian, Spherical, Cylindrical, Boyer-Lindquist, Metric-Adapted, Isotropic, Kruskal-Szekeres, Painlevé-Gullstrand, and Eddington-Finkelstein.ScenarioSelectorWindow: Two tabs. Browse Catalog scans the scenario directory, lists compatible and incompatible files with filter and sort modes, shows the metadata and parameters of the selected file, loads it, assigns the startup scenario (with the startup behavior options), and deletes files after confirmation; the built-in startup file cannot be deleted. Save & Export edits the scenario metadata (author, version tag with major, minor and patch increment, name, description, output block), shows the live content summary with duplicate and delete actions for bodies, saves a new preset without overwriting any file, or saves to a given path with an overwrite confirmation. File formats are in FILE_FORMATS.md.TelemetryWindow: Observer position in user units, Ricci scalar $R$, Kretschmann invariant $K_1$, the residual $\lvert R \rvert$, static lapse, time dilation, ZAMO angular velocity, Keplerian period and Newtonian escape fraction at the observer radius, inside or outside status relative to the horizon, ISCO and outer photon orbit, and the scheduler state. Values are recomputed every 0.15 s or when mass, spin or the observer radius (by more than 0.1) change. $K_1$ is $48M^2/r^6$ for $\lvert a \rvert < 10^{-12}$ and is otherwise evaluated by RiemannComputer with fourth-order differences on the Kerr metric.SpectrographWindow: Spectral analysis laboratory structured into four specialized tabs:
PolarizationPanel, include/relativistic/ui/polarization_panel.hpp): Full-Stokes polarization synthesis ($I, Q, U, V$) modeling linear polarization (DoLP), circular polarization (DoCP), total polarization (DoP), electric vector position angle (EVPA $\chi$), polarization ellipse geometry, rotation measure ($\text{RM}$), spectral index, Stokes $(Q/I, U/I)$ trajectories, and CSV export. Plasma parameters support manual editing, Spectrum tab linking, or direct sampling from the Blandford-Znajek jet magnetosphere.RayProbePanel, include/relativistic/ui/ray_probe_panel.hpp): Geodesic inspection tool for a single ray under the viewport cursor or screen center with freeze toggle, reporting termination status, spectral shift $g$, static redshift $1/E$, impact parameters $b$ and total $b$ relative to critical $3\sqrt{3}M$, Carter constant $Q$ and reduced $\eta$, affine path length, periapsis closest approach, total deflection angle, disk crossings and image order, emission coordinates, and 2D path projections.InterferometryPanel, include/relativistic/ui/interferometry_panel.hpp): Synthetic VLBI observation simulator synthesizing visibilities from the viewport image. Features source calibration presets (M87, Sgr A, custom) with gravitational angular scale $\theta_g = GM/(c^2 D)$, VLBI ground and orbital array presets, observation scheduling, SEFD thermal noise, interactive $(u, v)$ coverage plots with Hermitian conjugates, visibility amplitude vs baseline plots with radial FFT profiles and thin-ring first null diameter fitting ($u_{\text{null}} \approx 0.7655 / d_{\text{ring}}$), closure phase plots over station triangles, UV Fourier plane heatmaps, sample tables, and standard OIFITS binary table export. Feeds linked readouts to HudLinkedReadouts.PerformanceSettingsWindow: Preset selection (preset contents in CLI_REFERENCE.md), internal render scale, ray step budget, arithmetic precision, SIMD, thread pool and tiling options, render distance, level of detail, adaptive space-skipping, polar step damping, far-field step multiplier, texture reallocation, dynamic resolution, adaptive tile sky prepass, interlacing, GPU compute with device status and the active path of the last frame, body tile coverage, motion-adaptive quality, step controller mode, and orchestrator counters.VisualDiagnosticsWindow: Local curvature invariants and metric tensor $g_{\mu\nu}$ at the observer, horizon structure (outer and inner horizon, outer ergosphere at the observer polar angle, extremality status), horizon thermodynamics (area, surface gravity, Hawking temperature, entropy, angular velocity, irreducible mass), the photon orbit radii range for $\lvert a_* \rvert < 0.999999$, and a radial profile of $\log_{10} K_1$ and $\log_{10} \lvert R \rvert$ on the equatorial plane. The profile uses 48 samples between $\max(1.05\,r_+, 0.05M)$ and $\max(2 r_{\min}, 60M)$ and is recomputed only when mass or spin change; it is a function of the parameters, not of simulation time. Formulas: MATHEMATICAL_FORMULATION.md.BodyManagerWindow: Divided into seven functional tabs: Object Catalog (flat list and hierarchical tree views, range filters, batch editing), Source Catalog (primary metric source and independent Kerr black holes), Create Object (single body draft and multi-body geometric pattern generator), Create Source (astrophysical black hole presets), System Dynamics (system invariants, GW emission, scoped bulk actions, plane alignment), Interactions (electromagnetic, collision, thermal, fragmentation, annihilation models), and Randomizer Controls (procedural parameter generation bounds).HudManagerWindow: Master HUD switch and, for each of the 34 elements, enabled state, anchor corner, offsets, text scale, text color and background panel. The display format, decimal precision, label, horizontal layout, draw priority, refresh interval, warning and critical color rules, primary/secondary coordinate system selection (HudCoordinateDisplay), automatic gap-free stacking (HudAutoArranger), toolbar button selection (24+ buttons) and keybind summary content are edited in the HUD & Overlay tab of ControlPanelWindow.ConstantsWindow: Editable base physical constants ($c$, $G$, $h$, $k_B$, $N_A$, $K_e$, $K_{cd}$) under SI, Planck, or Custom presets, alongside derived constants & dimensional scaling factors between simulation & SI units. Includes smart quantity inputs (smart_quantity_input) with dimensional analysis verifying mathematical unit expressions.KeybindSettingsWindow (include/relativistic/ui/keybind_settings_window.hpp): Keybinding rebinding interface with keyboard layout presets (QWERTY, AZERTY), chord capture with modifier tracking (Ctrl, Shift, Alt), real-time conflict detection with visual alerts, and activation modes (Hold, Toggle, Tap, Double-Tap) with millisecond threshold timing adjustments. Gamepad tab provides controller device auto-detection/selection, analog axis deadzone calibration (left stick, right stick, triggers), look/move/roll sensitivities, axis inversions, and chord mapping.LogConsoleWindow: Scrollback viewer for the engine log with severity filtering (info, warning, error), text search, clipboard export, and on-demand live diagnostic snapshot triggers (CrashReporter::capture_snapshot).PerformanceAnalysisWindow: Performance telemetry and benchmarking laboratory organized into five operational tabs:
BenchmarkWorkbench, include/relativistic/ui/benchmark_workbench.hpp): Multi-run comparative visualization tool supporting up to 6 Y-metrics across 4 chart types (Grouped Bars, Lines sorted by X, Scatter, Stacked Stage Breakdown), 8 data normalization transforms (Raw, Log10, Ln, Log2, Ratio to Baseline, Percent Delta from Baseline, Min-Max Normalized, Z-Score), linear and log axis scales, flexible run ordering, seven one-click presets, series summary statistics tables, and TSV clipboard export.config/performance_profiler.cfg).SecondaryViewportManager / SecondaryViewWindow (include/relativistic/ui/secondary_viewport_manager.hpp, include/relativistic/ui/secondary_view_window.hpp): Independent auxiliary observer viewports rendered synchronously on CPU through SoftwareComputeEngine::dispatch_fp64 (native FP64 precision). Features:
SecondaryViewRole, include/relativistic/ui/secondary_view_roles.hpp): Free Observer (0, orbital camera around target point with interactive mouse drag orbiting and scroll zooming), Comoving Probe (1, free-falling cockpit view with relativistic velocity boost 4-vector $\mathbf{\beta} = \kappa_v v_{\text{ff}} \hat{\mathbf{v}}$ and aberration transform), Asymptotic Global (2, quasi-orthogonal telephoto view positioned at $d = 100M$ to $20000M$ with auto-derived narrow FOV $\theta_{\text{FOV}} = 2\arctan(H / D)$ from half-extent $H \in [1M, 2000M]$), and Equirectangular 360 Panorama (3, full $4\pi$ steradian spherical projection).SecondaryTargetMode): Central Object (0, coordinate origin), Primary Camera Position (1, locks gaze to the live primary observer), Primary Camera Focus Point (2, aims at the primary camera’s orbit center $\mathbf{x}{\text{cam}} + \mathbf{f} d{\text{orbit}}$), Tracked Celestial Body (3, dynamically tracks any active catalog body $\mathbf{x}_{\text{body}}(t)$ via body ID), and Custom Point (4, user Cartesian coordinates with unit-aware distance editing).make_beacon_body) into the primary viewport raytracer with IDs starting at kBeaconBodyIdBase + 2*view_id, color-coded via the golden ratio hue sequence $\text{Hue}k = \operatorname{fract}(k \cdot 0.61803398875)$ with forward line-of-sight indicator dots at $2.4 R{\text{beacon}}$, participating in gravitational light bending and shadow casting.target_sync_enabled) forcing all secondary views to track a shared observation target, and a one-click “Add Comoving Probe + Asymptotic Pair” action configuring synchronized accelerated free-fall and spatial-infinity viewpoints simultaneously.SoftwareComputeEngine::dispatch_fp64, dispatch_fp32 and dispatch_double_single. The scalar tracer is used when the metric requires the exact path (requires_exact_metric_path) or when USE_SCALAR_PIPELINE is set. Otherwise the SIMD tracer is used; when bodies are present, compute_body_screen_tiles marks the 32 x 32 pixel tiles covered by body bounding volumes, the SIMD tracer skips the marked tiles and the scalar tracer renders them with a per-tile list of candidate bodies.GeodesicBundle4d (4 double-precision lanes) and GeodesicBundle8f (8 single-precision lanes). They trace the Schwarzschild null equations only, without 3D bodies, exact metrics or subsidiary sources. Only the double-precision SIMD tracer applies the Carter pre-classification and the far-field step factor.SoftwareComputeEngine:
trace_kerr_schild_photon: Integrates Boyer-Lindquist Kerr spacetimes in Cartesian Kerr-Schild coordinates using step_kerr_schild_null_rk4, resolving geodesics across the horizon without coordinate singular points.trace_planar_photon: Solves equatorial and orbital-plane null geodesics for static spherical metrics (SchwarzschildDeSitterMetric, ReissnerNordstromMetric) using step_planar_null_rk4.trace_spherical_photon: Numerically integrates geodesics for general spherically symmetric spacetimes (LemaitreTolmanBondiMetric, VaidyaEvaporatingMetric, EddingtonFinkelsteinMetric, PainleveGullstrandMetric, TeVeSSpacetimeMetric) via analytical metric tetrad projection.trace_multi_source: Evaluates photon trajectories through up to 16 interacting Kerr black holes using Cartesian Kerr-Schild superposition. Automatically invoked when preset_3d == 8 bodies exist in the catalog alongside the central mass. Computes initial null 4-momentum via Gram-Schmidt tetrad lifting (ms_initial_momentum), steps trajectories with adaptive multi-center RK4 integration (ms_rk4_step), resolves simultaneous horizon entries (ms_horizon_entry), and accumulates radiance from primary and subsidiary accretion disks sorted by ray parameter (ms_disk_crossing).dispatch_double_single forwards to dispatch_fp32; the render mode named double-single therefore integrates rays in float, and exact-metric rays are still traced in double. DoubleSingle (include/relativistic/render/double_single.hpp) provides error-free sum and product transformations, arithmetic operators, ds_sqrt, ds_sin, ds_cos and ds_atan2, but is not referenced by SoftwareComputeEngine. The shader shaders/geodesic_tracer_ds.comp is part of the repository, whereas VulkanComputeExecutor loads only geodesic_tracer_fp64.comp.spv.disk_temperature_scale_k, disk_temperature_floor_k and disk_doppler_beaming_exponent (see MATHEMATICAL_FORMULATION.md).preset_3d == 8): collect_subsidiary_sources extracts them from the body list. In single-source spacetimes, the scalar tracer evaluates subsidiary deflection (apply_subsidiary_deflection_step), horizon absorption (segment_crosses_horizon), shadow capture (segment_is_captured), disk crossing (segment_crosses_disk), and horizon rim emission. In multi-source configurations, execution routes directly to trace_multi_source.GpuPixelOutput stores color, alpha, redshift, affine parameter, PixelFlags (horizon absorbed, celestial hit, accretion disk hit, photon sphere proximity, body surface hit) and the iteration count. RenderFlags assigns bits 0 to 3 to the skybox mode and bits 4 to 18 to the options (grid skybox, scalar pipeline, per-frame threads, tiled distribution, texture reallocation, level of detail, space-skipping, adaptive tile prepass, 3D bodies, body Doppler beaming, body gravitational redshift, atmosphere scattering, body shadows, bodies-only mode, body disk occlusion).GpuCameraPushConstants defines operator==; the viewport compares the new constants with the previous ones to decide whether a new dispatch is required. GpuBodyData is converted to the 704-byte GpuBodyGpuLayout for the Vulkan storage buffer.sky_background_source selects an equirectangular panorama (SkyPanoramaLoader) instead. Panoramas are described by sky_panorama_catalog.hpp.evaluate_3d_bodies intersects rays with oblate, prolate, or triaxial ellipsoids, evaluating 27 surface texture modes: 13 procedural shaders and 14 imported photographic texture maps (Earth Blue Marble, Sun Photosphere, Mercury Cratered, Venus Atmosphere, Venus Radar Altimetry, Mars Basalt, Jupiter Zonal Bands, Saturn Belts, Uranus Methane, Neptune Vortex, Ceres, Eris, Haumea, Makemake) with selectable 1K/2K resolution and Day/Night/Automatic twilight terminator blending. Evaluates up to four procedural BodySurfaceShading layers with 10 patterns, 5 blend modes, and 7 region masks.BodyLighting, include/relativistic/render/bodies/body_lighting.hpp): Evaluates direct irradiance, specular reflection, and inter-body radiant energy transport across ray-traced celestial body surfaces in CPU rasterization and Vulkan GPU compute shaders:
LightSourceMode): CentralSource (0, fixed at origin $(0, 0, 0)$), CameraHeadlight (1, positioned at camera coordinates), FixedDirection (2, distant directional key light oriented via horizontal azimuth $\phi_L \in [-180^\circ, 180^\circ]$ and elevation $\theta_L \in [-90^\circ, 90^\circ]$), FixedPoint (3, localized point light source at Cartesian coordinates $\mathbf{x}{\text{light}}$), NearestEmissiveBody (4, dynamic nearest-neighbor query across catalog bodies with $I{\text{em}} > 10^{-3}$, modulated by emitter primary color), SpecificBody (5, assigned catalog emitter $B_{\text{id}}$ with primary color modulation), and Unlit (6, uniform unit diffuse shading bypassing directional light and shadows).LightAttenuationMode): None (0, unattenuated constant irradiance) and InverseSquare (1, $\mathcal{E}(d) = I_{\text{light}} \min((d_{\text{ref}}/d)^2, 64.0)$), clamping maximum amplification to $64\times$ to avoid floating-point overflow near emitter centroids.emitted_irradiance): Accumulates irradiance from active emitting celestial bodies ($I_{\text{em}, j} > 10^{-3}$) onto facing surfaces, weighted by distance attenuation $\min((d_{\text{ref}, e}/d)^2, 16.0)$, Lambertian cosine factor $\max(0, \hat{\mathbf{N}} \cdot \hat{\mathbf{L}}j)$, emitter primary color $\mathbf{C}{\text{primary}, j}$, and global gain multiplier $G_{\text{em}}$.BodyLightingDetail): Minimal (0, ambient and wrapped diffuse only; shadow rays and emission lighting bypassed), Reduced (1, shadow occlusion testing capped to body_shadow_caster_limit $\le 512$ and emission sources capped to body_emission_source_limit $\le 512$), and Full (2, unrestricted shadow occlusion testing and emission accumulation across all catalog bodies).shaders/geodesic_tracer_fp64.comp via resolve_body_light, light_is_occluded, and emitted_irradiance, and in C++ within SoftwareComputeEngine::evaluate_3d_bodies.SkyboxRenderer, include/relativistic/render/skybox_renderer.hpp): Evaluates celestial environment radiance along escaping null geodesics. Parameterized by ProceduralSkySettings and packed into the 1808-byte GpuSkyProfile uniform structure transferred to GPU compute shaders at binding 0 (CameraParams.sky). Features:
SphericalPartition): Divides $\mathbb{S}^2$ into equal-area cells with grid resolution $N_{\text{grid}} = \operatorname{clamp}(14\sqrt{\rho_{\text{stars}} Q_{\text{eff}}}, 6, 120)$. Queries 27 adjacent neighborhood cells via 64-bit coordinate integer hashing (hash_3d, hash_coords), evaluating candidate presence via normalized hash thresholds.StarProfileModel): Gaussian (0), Lorentzian (1), Moffat (2), AiryDiffraction (3, using rational Chebyshev polynomial approximation for Bessel $J_1(x)$), HardDisc (4), DiffractionSpikes (5, with 4, 6, or 8 spikes, rotation angle, radial length, and exponential decay), PinpointDirac (6, with concentration parameter $\eta_{\text{dirac}}$), and CinematicBloom (7, with core Gaussian and secondary exponential halo).StarPlacementModel): UniformEqualArea (0), GalacticDisk (1, exponential vertical scale-height falloff from galactic plane), FractalClustered (2, 3D FBM noise clustering), DualPopulation (3, 70% thin-disk and 30% spherical isotropic halo), SpiralArmDensity (4, logarithmic two-arm spiral density modulation), and ConstellationAssociations (5, spatial hash noise clustering).GalaxyMorphologyModel: GrandDesignSpiral, FlocculentSpiral, BarredSpiral with Gaussian bars, GiantElliptical with de Vaucouleurs Sersic profiles, Lenticular with resonant dust rings, RingGalaxy) with inclined near-side dust extinction.GridCellFillMode: None, Checkerboard2Color, CyclicPalette, CheckerboardPattern, RandomHashFill) indexing an editable 16-color palette.shaders/geodesic_tracer_fp64.comp and shaders/cluster_tile_tracer_fp64.comp, and in C++ within include/relativistic/render/skybox_renderer.hpp.CaptureCoordinator (include/relativistic/capture/capture_coordinator.hpp) and CaptureProgress: Manages offline screenshot captures and multi-frame image sequences in deterministic or real-time modes. Features:
clamp(2^21 / (width * k^2), 1, height) rows streamed directly to ImageStreamWriter, bounding host RAM independent of output resolution. When distributed cluster workers evaluate capture tiles, record_cluster_stages captures ClusterNetworkDispatch and ClusterTileDecompress stage statistics in PerformanceProfiler.shutter_phase in $[-1.0, 1.0]$), blending supersampled pixels in linear light using 4096-entry sRGB decoding and 16384-entry sRGB encoding LUTs.CameraCollisionField::resolve during trajectory progression when camera_collision_enabled is active, maintaining specified clearance distances from bodies and horizon boundaries.kMaxQueuedFrames = 2) in deterministic mode to balance rendering throughput and memory consumption.ColorGrade (lift, contrast, gamma, gain, highlights, shadows, saturation, vignette) and 32-bit linear-congruential triangular noise dither (triangular_noise) on output bands before disk writing (MATHEMATICAL_FORMULATION.md Section 9.5).CaptureStudioWindow (include/relativistic/ui/capture_studio_window.hpp): Integrated capture control workspace organized across five functional tabs, a live summary bar, and a resizable status footer:
MotionScriptEditor and viewport trajectory preview controls (play/pause, speed multiplier, scrubber, and pose transfer to interactive camera).PhysicsRecorder sampling 54 physical channels per frame into 7 file formats (CSV, TSV, JSON, JSON Lines, Binary Columns .bin, Container .rcap, VTK Polyline .vtp), with decimation, precision (3 to 17 digits), SI scaling toggle, script event logging, and per-body columns (positions, velocities, distances, speeds up to 256 bodies).MotionScriptEditor (include/relativistic/ui/motion_script_editor.hpp): Comprehensive timeline and trajectory authoring interface organized across four operational panes:
DriverSpec): Maps live measurements onto channel values via 12 signal sources (Distance to Target, Distance to Origin, Position X/Y/Z, Camera Speed, Segment/Script Progress, Segment/Script Time, Event Time Offset, Custom Expression), configurable input/output bounds, response easing, and blend modes (Replace, Add, Multiply).ProjectionTransitionMode: StepAtMidpoint, StepAtStart, StepAtEnd, SmoothMorph, FovCompensatedMorph, CrossZoom, WarpCurvature) with projection blend weights and FOV compensation (MATHEMATICAL_FORMULATION.md Section 9.4).ShakeSpec): Adds multi-axis procedural noise perturbations to camera position and rotation with amplitude, frequency, deterministic seed, and edge fade.config/motion_script.cfg).build_path_preview and make_body_position_lookup (path_preview_builder.hpp): Samples motion scripts into continuous 3D polyline previews (PathPreview), rendering segment paths, reference paths (without shake/transitions), orientation frustums, markers, and transition boundaries into the schematic overlay.PhysicsRecorder (physics_recorder.hpp): Samples kinematic and relativistic telemetry channels at frame intervals, applying SI scale conversions through ConstantsEngine, and serializing data tables into seven file formats accompanied by JSON schemas and CSV event logs.ConstantsEngine (include/relativistic/core/physical_constants_engine.hpp): Base constants ($c, G, h, k_B, N_A, K_e, K_{cd}$), SI/Planck/Custom presets, derived constants, and dimensional scale factors (ARCHITECTURE.md Section 2.13). The post-Newtonian solver synchronizes $c$ and $G$ with the constants engine via sync_nbody_constants_with_engine.config/preferences/ (general.cfg, camera.cfg, render_sky.cfg, interface.cfg, units.cfg, physics.cfg, celestial_bodies.cfg, capture.cfg, cluster.cfg).include/relativistic/core/diagnostics/diagnostics_registry.hpp): Registry manages thread-safe diagnostic state without dynamic memory allocations in logging paths:
TextRing): CommandRing (256 slots of 384 bytes) recording timestamped commands applied by the orchestrator, ProblemRing (128 slots of 448 bytes) recording warnings and errors, MilestoneRing (192 slots of 320 bytes) recording phase transitions and subsystem initialization events, and events ring (512 slots of 320 bytes) buffering raw diagnostic events.SnapshotBuffer): Maintains two 16 KiB buffers per domain (scene, render, startup, vulkan, opengl), flipping active indices atomically upon publication to allow concurrent lock-free reading during crash reporting.ActivitySlot), recording thread ID, monotonic creation timestamp, thread name (set_thread_name), and activity description (set_activity). RAII ActivityScope instruments execution scopes, and ActivityHandle manages thread registration automatically.frame_counter, last_frame_ns), simulation heartbeats (simulation_heartbeat, simulation_heartbeat_ns), commands processed and dropped, render frames, warnings, and errors.AppPhase (Launching, Startup, Running, Headless, ShuttingDown).include/relativistic/core/diagnostics/crash_reporter.hpp):
AddVectoredExceptionHandler) for first-chance notifications, Unhandled Exception Filters (SetUnhandledExceptionFilter), CRT invalid parameter handlers (_set_invalid_parameter_handler), pure virtual call handlers (_set_purecall_handler), and abort handlers. On POSIX, installs sigaction with SA_SIGINFO | SA_ONSTACK for SIGSEGV, SIGBUS, SIGFPE, SIGILL, and SIGABRT over a dedicated 64 KiB alternate stack (g_alternate_stack).VirtualQuery checking target memory regions for MEM_COMMIT and excluding PAGE_NOACCESS and PAGE_GUARD before attempting dereferences.dbghelp.dll (StackWalk64, SymFromAddr, SymGetLineFromAddr64), resolving function names and source code file lines, with fallback to CaptureStackBackTrace or backtrace/backtrace_symbols_fd.GetModuleHandleExW and classifies faulting modules into categories (classify_module: graphics stack/driver, CRT/OS runtime, application/third-party).0xC00000FD), heap corruption (0xC0000374), fast-fail (0xC0000409), illegal instructions (0xC000001D), and arithmetic faults.MiniDumpWriteDump on Windows writing minidump.dmp with flags MiniDumpWithDataSegs | MiniDumpWithThreadInfo | MiniDumpWithUnloadedModules | MiniDumpWithIndirectlyReferencedMemory | MiniDumpWithHandleData.crash_<timestamp>_<code>_pid<pid>_n<n>/ containing report.txt, minidump.dmp, session log tail up to 16 MiB, active configuration preferences from config/preferences/, and active scenario definitions.include/relativistic/core/diagnostics/hang_watchdog.hpp):
std::jthread polling at 500 ms intervals (HangWatchdogConfig).GetGUIThreadInfo to detect active modal loops (GUI_INMOVESIZE, GUI_INMENUMODE, GUI_POPUPMENUMODE, GUI_SYSTEMMENUMODE), suppressing false-positive hang reports during window resizing or menu interaction.OpenThread, suspends execution via SuspendThread, captures register contexts via GetThreadContext, walks the call stack, resumes execution via ResumeThread, and generates non-terminating diagnostic reports (hang_<timestamp>_...) and minidumps.include/relativistic/core/diagnostics/diagnostics_paths.hpp):
logs/), %LOCALAPPDATA%/RelativisticEngine/logs, $XDG_STATE_HOME/relativistic-engine/logs or ~/.local/state/relativistic-engine/logs, and system temporary folders..write_probe_<pid>.kRetainedSessionLogs) and 25 crash report folders (kRetainedCrashFolders).last_crash.txt, detects unacknowledged crashes on subsequent launches, sets environment variable previous.crash.folder, and renames the file to last_crash_acknowledged.txt.include/relativistic/core/diagnostics/diagnostics_session.hpp):
DiagnosticsSession, sets application phase to Launching, registers UI thread, initializes session logging, and starts HangWatchdog.VK_ICD_FILENAMES, DISPLAY, etc.).StartupProgress snapshots, publishing startup progress percentages, stage labels, and detail strings to the startup snapshot buffer and milestone ring.HangWatchdog, sets phase to ShuttingDown, records session duration and performance statistics, and flushes log streams.include/relativistic/core/system_console.hpp):
AttachConsole(ATTACH_PARENT_PROCESS) or allocates a new console window via AllocConsole.stdin, stdout, and stderr to CONIN$ and CONOUT$ using freopen_s, clears stream error flags, and configures unbuffered execution (_IONBF).GetSystemMenu to disable SC_CLOSE, preventing accidental process termination when closing the console window.EngineLog to the console upon allocation and synchronizes console window visibility with configuration settings.include/relativistic/core/engine_log.hpp):
LogEntry: level, timestamp, message).[timestamp] [uptime] [thread_id:name] [level] message to session log files up to 96 MiB (kMaxSessionBytes), automatically noting trace line truncation when the size limit is reached.EventSink) without heap allocations, feeding error and warning rings in DiagnosticsRegistry.UnitSystem (include/relativistic/units/unit_system.hpp): Defines unit enumerations, conversion multipliers, and formatting functions across 19 physical categories:
DistanceUnit: Meters, Kilometers, Feet, Miles, NauticalMiles, AstronomicalUnits, LightYears, Parsecs, Kiloparsecs, SolarRadii.MassUnit: Kilograms, Grams, Pounds, MetricTonnes, SolarMasses, EarthMasses, JupiterMasses, Turkeys (11.0 kg).VelocityUnit: MetersPerSecond, KilometersPerHour, MilesPerHour, KilometersPerSecond, FractionOfC ($c = 299792458\,\text{m/s}$), ParsecsPerYear, AstronomicalUnitsPerDay.EnergyUnit: Joules, Kilojoules, Megajoules, ElectronVolts, KilowattHours, Ergs, FootPounds, Calories.AngleUnit: Radians, Degrees, Arcminutes, Arcseconds, Gradians, Revolutions, Milliradians.TemperatureUnit: Kelvin, Celsius (offset $273.15$), Fahrenheit (scale $5/9$, offset $459.67$), Rankine.ChargeUnit: Coulombs, Millicoulombs, Microcoulombs, ElementaryCharges ($e = 1.602176634 \times 10^{-19}\,\text{C}$), AmpereHours, Statcoulombs.CurrentUnit: Amperes, Milliamperes, Microamperes, Kiloamperes.FrameRateUnit: FramesPerSecond, Milliseconds, Microseconds, Hertz.TimeUnit: Seconds, Milliseconds, Microseconds, Nanoseconds, Minutes, Hours, Days, Years (Julian year $365.25 \times 86400\,\text{s}$).AccelerationUnit: MetersPerSecondSquared, CentimetersPerSecondSquared, FeetPerSecondSquared, StandardGravity ($g_0 = 9.80665\,\text{m/s}^2$), KilometersPerSecondSquared.AngularVelocityUnit: RadiansPerSecond, DegreesPerSecond, RevolutionsPerMinute, Hertz.DensityUnit: KilogramsPerCubicMeter, GramsPerCubicCentimeter, PoundsPerCubicFoot, SolarMassesPerCubicParsec.PressureUnit: Pascals, Kilopascals, Megapascals, Gigapascals, Bars ($10^5\,\text{Pa}$), Atmospheres ($101325\,\text{Pa}$), PSI ($6894.757\,\text{Pa}$).PowerUnit: Watts, Kilowatts, Megawatts, SolarLuminosities ($3.828 \times 10^{26}\,\text{W}$), Horsepower ($745.6998\,\text{W}$).FrequencyUnit: Hertz, Kilohertz, Megahertz, Gigahertz.ForceUnit: Newtons, Kilonewtons, Dynes ($10^{-5}\,\text{N}$), PoundsForce ($4.44822\,\text{N}$).MagneticFieldUnit: Teslas, Gauss ($10^{-4}\,\text{T}$), Microteslas.VoltageUnit: Volts, Millivolts, Kilovolts, Megavolts.
Includes parse functions (parse_distance_unit, parse_mass_unit, etc.) with text fallbacks and UnitDisplayPreferences managing active display selections.DimensionVector & Dimensions (include/relativistic/units/expression_engine.hpp): 6-dimensional integer vector tracking base powers $[L, M, T, I, \Theta, A]$ with equality checks, addition, subtraction, scalar scaling, and negation (MATHEMATICAL_FORMULATION.md Section 19.1). Predefined constants in namespace Dimensions: Length, Mass, Time, Current, Temperature, Angle, Dimensionless, Velocity, Charge, Energy, Force, Power, Frequency, Pressure, Acceleration, GravitationalConstant, PlanckAction, BoltzmannConstant, CoulombConstant, Area, Volume, Density, AngularVelocity, MomentOfInertia, Torque, Luminosity, MagneticField, MassFlowRate, Momentum.UnitRegistry (include/relativistic/units/expression_engine.hpp): Static table of 164 unit tokens (UnitToken) defining symbol, SI scale factor, affine offset, and dimension vector, supporting lookup via case-insensitive matching.Units::ExpressionEvaluator (include/relativistic/units/expression_engine.hpp): Recursive descent mathematical expression parser with dimensional analysis. Evaluates primary literals, scientific notation, identifier lookup, unit suffixes with powers (e.g. m/s^2), division, square roots with dimension parity validation, and additive dimensional homogeneity checks (evaluate_expect_dimension, evaluate_dimensionless; MATHEMATICAL_FORMULATION.md Section 19.3).UnitAwareWidgets (include/relativistic/units/unit_aware_widgets.hpp): ImGui UI widgets integrating UnitDisplayPreferences:
unit_aware_slider_double: Converts canonical SI values to displayed units, adjusts slider and logarithmic boundaries, appends unit suffix labels, and converts modified values back to canonical SI units.unit_aware_input_double & unit_aware_input_float: Single-variable numeric input fields with unit labels and conversion.unit_aware_input_double3 & unit_aware_input_float3: 3-component vector input fields with unit conversion.numeric_slider_utils.hpp: slider_float_with_input, slider_double_with_input and slider_int_with_input combine a slider, a numeric field and an optional logarithmic mode with explicit bounds.tooltip_utils.hpp: delayed tooltips with an optional warning line, and wrapped colored text.compatibility_notes.hpp: five checks (BSSN with symplectic or Hermite schemes, GPU compute with double-single precision, near-extremal Kerr spin, wormhole with disk overlay, level of detail beyond the render distance). The first three are displayed by ControlPanelWindow and PerformanceSettingsWindow; the wormhole and level-of-detail checks are defined but not called by the windows reviewed.hud_layout_config.hpp: HudLayoutConfig, HudElementStyle, HudColorRule, HudAutoArranger and hud_anchor_resolve (anchor corners and clamping at zero).schematic_view_config.hpp: SchematicViewConfig with object display styles (point, fixed-radius sphere, parameter-driven sphere; opaque, translucent, wireframe, shaded and gradient styles; 10 color coding modes), per-body style overrides, vector styles for velocity, total force, spin and rotation axis, trails, orbit predictions and off-screen indicators.spatial_reference_config.hpp, spatial_reference_editor.hpp, & spatial_reference_renderer.hpp: SpatialReferenceConfig, SpatialReferenceEditor, and SpatialReferenceRenderer rendering a 3D coordinate reference overlay across interactive viewports:
SpatialCenterMode): WorldOrigin (0), CustomPoint (1, unit-aware 3D coordinates), Body (2, follows any active celestial body dynamically), and CameraSnapped (3, snaps reference origin to integer multiples of the grid spacing $s_{\text{grid}}$ under the observer, preventing line vanishing during large spatial translations).Automatic or Fixed).Automatic or Fixed), and radial edge falloff ($w_{\text{radial}} = 1 - (r/R)^2$) eliminating abrupt boundary cuts.capture_widgets.hpp: form scope, flow layout, property grids, statistic tables, splitters and edit_easing.BodyManagerWindow: 9 body templates (kBodyTemplateSpecs), 6 creation archetypes (kCreationArchetypes), and the tabs Body Catalog, Create Body, Spacetime Sources, System Dynamics and Interactions. Body editor sections are Identity, Physical State, Multipoles, Material, and Surface (base surface, atmosphere and lighting, texture layers).The distributed subsystem (include/relativistic/distributed/) provides network-distributed compute offloading across homogeneous or heterogeneous machines:
ClusterOrchestrator (cluster_orchestrator.hpp): Master coordinator managing peer sessions (MasterPeerSession), network pumps, cryptographic handshakes, body catalog broadcasting via BodyCatalogStore, frame tile dispatch (dispatch_frame), work stealing, and compute job management (run_compute_job). Routes five task classes: interactive viewport tiles, capture studio bands, N-body row blocks (evaluate_nbody_accelerations), Monte Carlo geodesic ensembles (run_geodesic_ensemble), and gPCE stochastic quadratures (evaluate_stochastic_pce_quadrature).DistributionScheduler (distribution_scheduler.hpp): Evaluates normalized capacity allocations $\Omega_i(t)$ via compute_capacity_shares, tile quotas $K_i$ via compute_tile_quotas, Bresenham credit interleaving, dynamic deadlines via estimate_tile_compute_seconds, three-tier work stealing (collect_expired, steal_speculative, reclaim_node), and atomic frame completion detection (is_frame_complete).NetworkTransport (network_transport.hpp): Transport abstraction wrapping ENet/UDP. Channel 0 handles reliable sequenced control traffic (handshakes, clock sync, catalog chunks, cancellations); Channel 1 handles unsequenced unreliable-fragmented tile payloads up to $256\,\text{KiB}$, preventing head-of-line blocking stalls.CryptoChannel (crypto_channel.hpp): AEAD encryption layer implementing X25519 ECDH key agreement (generate_node_identity_keys, perform_handshake_server, perform_handshake_client), HKDF-SHA256 key derivation with "RelativisticEngineV1", ChaCha20 symmetric stream cipher (chacha20_block), and Poly1305 MAC tag generation (poly1305_generate_tag) over the 28-byte authenticated header and ciphertext with a 64-packet sliding replay window (check_and_update_replay_window).PacketEnvelope (packet_protocol.hpp): 48-byte binary envelope aligned to 16 bytes:
0x52454C44 (RELD).protocol_version (uint16_t, 1), PacketType (uint16_t opcode), session_identifier (uint32_t), packet_sequence (uint32_t), frame_index (uint32_t), payload_bytes (uint32_t), payload_crc32 (uint32_t).authentication_tag (16 bytes Poly1305 MAC) and 4-byte padding (alignas(16)).validate_envelope_structure(envelope, buffer_size) verifies packet magic, version, and buffer bounds.TaskPayloads (task_payloads.hpp): Binary payload definitions:
RenderTileTaskPayload: Encapsulates RenderTileTaskHeader (16 bytes packed: tile index, tile grid coordinates, step budget, flags, compression type), dispatch timestamp (double, 8 bytes), and GpuCameraPushConstants (1808 bytes). Serialized via serialize_render_tile_task ($k\text{RenderTileTaskPayloadBytes} = 1832$) and deserialize_render_tile_task.RenderTileResultPayload: Encapsulates RenderTileResultHeader (24 bytes packed: tile index, frame index, pixel count, compression type, uncompressed bytes, execution microseconds) and compressed_bytes (uint32_t, 4 bytes).tile_grid_columns(width), tile_grid_rows(height), and resolve_tile_geometry(tile_index, width, height) mapping $32 \times 32$ work units.TileCodec & TileSanitizer (compression_codecs.hpp): Multi-tier tile compression codecs:
DirectRaw: Uncompressed raw 32-byte pixel stream for low-latency LAN links.QoiHdrRle: Converts RGB and alpha to 16-bit half-floats via HalfFloat::to_bits, maintains a 64-entry hash table, encodes short runs (1–64) and long runs (65–16448), and emits partial delta updates with a 6-bit field difference bitmask.Lz4Block: Block compression via LZ4_compress_fast with automatic fallback to DirectRaw when compressed bytes equal or exceed uncompressed bytes or when acceleration $\ge 8$.TileSanitizer: Evaluates AVX2/Neon vector sweeps validating IEEE 754 floating-point finiteness, repairing non-finite alpha and redshifts, and clamping radiant flux to $[0.0, 1.0 \times 10^8]\,\text{W/m}^2/\text{sr}$. Reports modifications through SanitizationReport.DiscoveryService (discovery_service.hpp): Peer discovery executing periodic UDP multicast beacons on 239.255.77.88:42424 using the 72-byte DiscoveryBeacon structure with CRC32 checksum verification, domain-separated cluster namespace tag derivation (derive_discovery_cluster_tag), and thread-safe event queue draining (drain_events).NodeRegistry (node_registry.hpp): Thread-safe registry tracking active nodes, peer bindings, hardware capabilities, RFC 6298 RTT estimators (LatencyEstimator), throughput rates (ThroughputEstimator), and watchdog timeout enforcement.BodyCatalogStore & NBodyStateStore (body_catalog.hpp, compute_kernels.hpp): Chunked binary streaming stores assembling body collections (BodyCatalogChunkHeader, 24 bytes) and N-body states (NBodyStateChunkHeader, 32 bytes) across datagrams, retaining up to 4 completed frames/jobs.TileRenderer & ClusterWorkerService (tile_renderer.hpp, worker_service.hpp, worker_options.hpp): Autonomous execution engine on worker nodes driving VulkanComputeExecutor with dedicated SPIR-V shader cluster_tile_tracer_fp64.comp or CPU multi-threading. Returns TileRenderOutcome (completed, cancelled, execution_time_us). Supports cooperative cancellation via atomic flags (cancel_flag).GpuNBodyExecutor (gpu_nbody_executor.hpp): GPU-accelerated post-Newtonian acceleration evaluator executing nbody_accel_fp64.comp in 64-bit precision on Vulkan with uniform parameter binding 0, input state binding 1, output result binding 2, workgroups of 64 threads, and host-coherent staging buffer readback.SlurmInterface (slurm_interface.hpp): Integration layer inspecting SLURM_JOB_ID, SLURM_PROCID, SLURM_NTASKS, and nodelists to auto-configure MPI cluster topologies, deriving cluster tokens from job IDs, assigning rank 0 as Master, and configuring worker port offsets (base_port + 1 + local_id).ClusterMasterService (cluster_master_service.hpp): Master lifecycle coordinator managing orchestrator instance lifetime, configuration persistence (config/distributed_cluster.cfg), and UI telemetry status binding.The application lifecycle and startup instrumentation subsystem (include/relativistic/startup/) provides host integration, inter-process synchronization, and progress tracking prior to workspace presentation:
platform_bootstrap.hpp):
enable_per_monitor_dpi: Dynamically queries SetProcessDpiAwarenessContext in user32.dll to establish per-monitor v2 DPI awareness (DPI_AWARENESS_CONTEXT_PER_MONITOR_AWARE_V2, handle value -4).register_application_identity: Calls SetCurrentProcessExplicitAppUserModelID in shell32.dll registering Wartets.RelativisticEngine for Windows taskbar grouping and notification routing.HeapSetInformation: Enables immediate termination on heap corruption (HeapEnableTerminationOnCorruption).normalize_working_directory: Inspects the working directory for required asset subdirectories (shaders, scenarios). If absent, inspects the directory containing the running executable (executable_directory) and up to 4 parent ancestor directories, rebinding the current path via std::filesystem::current_path to guarantee deterministic asset resolution across diverse launch environments.show_notice and show_fatal_error format diagnostic text to stderr and display native modal dialogs (MessageBoxW) on Windows platforms.single_instance_guard.hpp):
Local\Wartets.RelativisticEngine.SingleInstance. If GetLastError() returns ERROR_ALREADY_EXISTS, the acquisition fails. POSIX platforms open a user-isolated lockfile /tmp/wartets-relativistic-engine-<uid>.lock using O_RDWR | O_CREAT | O_CLOEXEC and evaluate non-blocking advisory file locking via ::flock(descriptor, LOCK_EX | LOCK_NB).activate_existing_instance queries top-level windows via FindWindowW searching for the application title, restores iconic windows with ShowWindow(target, SW_RESTORE), and transfers focus via SetForegroundWindow(target).startup_progress.hpp):
StartupRange: Defines contiguous sub-ranges $[R_{\text{begin}}, R_{\text{end}}]$ with clamped local interpolation $f_{\text{global}} = R_{\text{begin}} + (R_{\text{end}} - R_{\text{begin}}) \cdot \operatorname{clamp}(f_{\text{local}}, 0, 1)$.StartupStage: Defines standardized progress partitions:
Runtime: $[0.00, 0.05]$ (Platform bootstrap, logging, command line).Settings: $[0.05, 0.12]$ (Persistent configuration migration and ingestion).Simulation: $[0.12, 0.22]$ (Orchestrator and physics subsystem instantiation).WindowSystem: $[0.22, 0.28]$ (GLFW window initialization and display queries).GraphicsContext: $[0.28, 0.36]$ (OpenGL context creation and extension binding).RenderBackend: $[0.36, 0.70]$ (Vulkan compute context and shader compilation).Interface: $[0.70, 0.84]$ (ImGui contexts, dock trees, font generation).Content: $[0.84, 0.96]$ (Scenario resolution, body catalog loading, textures).Finalize: $[0.96, 1.00]$ (Workspace ready, splash window handoff).report updates stage and detail strings, advancing the global fraction monotonically; note applies asymptotic creep increments toward the current range ceiling ($f \leftarrow f + 0.16(R_{\text{end}} - f)$); complete sets the fraction to $1.0$ and phase to Completed; fail records fatal startup errors.request_cancel sets an atomic boolean flag; throw_if_cancelled throws StartupCancelled to abort long-running initialization loops cleanly.set_active_progress and active_progress support progress notifications from worker threads without explicit object coupling.startup_window.hpp):
std::thread), creating an unconstrained WS_POPUP window with class RelativisticEngineStartupWindow and drop shadow style CS_DROPSHADOW. Communicates thread readiness through std::promise<bool> and terminates on WM_APP + 2U (kMessageClose).Surface memory device contexts (backdrop_ for static visual branding and frame_ for dynamic status overlays) blitted to screen on WM_PAINT via BitBlt(SRCCOPY) to eliminate flicker.WM_DPICHANGED, scaling font metrics and layout rectangles dynamically. Synthesizes eight specialized fonts (fonts_.title, header, section, stage, body, body_bold, small, mono).kEaseTimerId) smooths displayed progress fractions toward target fractions using exponential relaxation ($f_{\text{disp}} \leftarrow f_{\text{disp}} + 0.2(f_{\text{target}} - f_{\text{disp}}) \pm 0.0004$), invalidating only the progress rect bounds.kClockTimerId) invalidates the time readout, rendering formatted seconds or minute-second representations ($M\text{m } S.S\text{s}$) from launch to completion.WM_NCHITTEST), mouse movements, and button clicks across five control bounds: Minimize, Close/Cancel (which triggers cooperative startup cancellation), License button, Documentation button, and GitHub repository button (invoking external URLs via ShellExecuteW).DWMWA_WINDOW_CORNER_PREFERENCE) to value 1 (DWMWCP_ROUND) to enforce system rounded window corners on Windows 11.