-
Notifications
You must be signed in to change notification settings - Fork 69
Technical Overview
Most KSP mods consist of some CLR DLLs that get loaded by KSP. Principia has most of its logic (in particular, all the numerical analysis) in a native library (ksp_plugin/
) compiled from C++14, which is called from the C♯ layer (ksp_plugin_adapter/
) via a P/Invoke interface. That interface is, for the most part, generated by a custom code generator (tools/
) from protocol buffer descriptors (serialization/journal.proto
). Those descriptors allow for journalling of anything crossing the interface; this is used for profile-guided optimization as well as debugging.
For serialization (saves), the C++ objects are serialized using protocol buffers (see the .proto
files in serialization/
), and the protocol buffer binary format is then written as a sequence of hexadecimal strings to the KSP save.
The rest of the codebase is mostly a series of C++14 template libraries, which come with their tests. Roughly in topological order,
-
base/
contains general utilities. -
quantities/
is a strongly-typed library for physical quantities. The implementation usesbinary64
(double
) floating-point in SI units, but this is not exposed to the user, who explicitly multiplies or divides by units. Angles are dimensionful to obviate confusion between degrees and radians. Strongly-typed elementary functions are provided. -
geometry/
deals with geometrical concepts useful for classical physics: strongly-typedVector
s of someQuantity
with a strongly-typed dependency on the reference frame, a distinction betweenVector
s andBivector
s (also known as pseudovectors), a distinction betweenVector
s andPoint
s (which live an affine space). It provides abstractions for changes of coordinates between reference frames (Rotation
,OrthogonalMap
,Permutation
). Vector quantities useful for classical physics are named, e.g.,Position
,Velocity
,AngularVelocity
... -
numerics/
provides various numerical utilities, with enough templatization to work with the aforementioned types. This contains some code with precomputed matrices generated by a Mathematica notebook. -
integrators/
focuses specifically on numerical integration. -
physics/
provides libraries to deal with a physical system under the influence of gravity: abstractions for bodies, trajectories, ephemerides, and reference frames defined from the bodies in the physical system, as well as some support for Kepler orbits and Jacobi coordinates. -
astronomy/
contains libraries and data that have to do with the real world: our solar system, our timescales (support for date literals in TT, TAI, UT1, and UTC, where the typeInstant
counts TT). Time scale handling involves code generated from IERS tables by an awk script. Moreover,astronomy/
contains high-level tests of the above libraries for real-life astronomical scenarii: precession of the perihelion of Mercury, lunar eclipses...
In addition,
-
benchmarks/
contains benchmarks using (a fork of) https://github.com/google/benchmark/, -
benchmark_automation/
is a C♯ utility used to run the benchmarks and parse their output, -
coverage_analyser/
is a C♯ utility that interprets the output of the instrumented tests to yield coverage statistics, -
stacktrace_decoder/
is a C♯ utility used to turn logs containing stack trace addresses and the DLL base address into something usable.
- Крылов
- Kronecker
- Колмогоров
- von Koch
- Klein
- Kleene
- 𒁹𒆠𒁷𒉡
- کاشانی
- Καραθεοδωρή
- Канторович
- 掛谷
- Julia
- Jordan
- 賈憲
- 𓇹𓄟𓋴𓏲
- Jensen
- Jacobi
- 岩澤
- 伊藤
- ابن الهيثم
- Ὑπατία
- Hurwitz
- Householder
- Horner
- l’Hôpital
- Ἱπποκράτης
- Ἱππίας
- Ἵππασος
- Ἵππαρχος
- Hilbert
- Hesse
- Ἥρων
- Hermite
- Heine
- Hausdorff
- हरीश चंद्र
- Hardy
- Hamilton
- Halley
- Hadamard
- Haar
- Grothendieck
- Grossmann
- Gröbner
- Green
- Grassmann
- Goldbach
- Gödel
- Germain
- Гельфонд
- Гельфанд
- Gauss
- Gateaux
- Galois
- Gallai
- Galileo
- Fuchs
- Fubini
- Frobenius
- Frenet
- Frege
- Fréchet
- פרנקל
- Fourier
- Fibonacci
- del Ferro
- Ferrari
- Fermat
- Fatou
- Fáry
- Fano
- Euler
- Εὐκλείδης
- Εὔδοξος
- Erdős
- Ἐρατοσθένης
- Διόφαντος
- Descartes
- Desargues
- Δημόκριτος
- Dedekind
- Darboux
- Cramer
- Coxeter
- Cohen
- Clifford
- Christoffel
- 陈景润
- Chasles
- Cesàro
- Чебышёв
- Cayley
- Cauchy
- Catalan
- Cartan
- Cardano
- Cantor
- بوژگانی
- Burnside
- Буняковский
- Buffon
- Brouwer
- Bourbaki
- Borel
- Bolzano
- Bessel
- Бернштейн
- Bernoulli
- Banach
- Agnesi
- Ackermann
- Abel