PHYSICS VERIFICATION
How the physics in this simulator is checked — what runs, against which reference formula, and to what tolerance. This is not marketing copy: where a tolerance is wide, or a check is really a code/UX contract rather than a from-scratch physics derivation, that is said plainly. Nothing below is aspirational — every row maps to a real, currently-passing test file. If a check isn't listed here, it isn't part of the gate.
On this page: Check it yourself · Reproduce it · Full gate · ADRs · What this does not claim
Check it yourself
Type your own numbers. This page imports the live simulator modules
(js/physics/relativity.js, gravity.js,
orbits.js, ship.js) — not a copy of the formulas —
runs them in your browser, and compares the result with an independently
written closed-form value. You see the simulator value, the analytic value,
the relative discrepancy, the tolerance and a PASS/FAIL verdict. Inputs that
have no defined answer (e.g. β ≥ 1, radius ≤ 0, NaN) are refused with a
reason instead of printing garbage.
Reproduce it
bash tests/run.sh
Runs every tests/*.test.mjs file under Node, bare
assert, no framework, no build step — currently
48 files, about 2 seconds. Prints PHYSICS GATE: PASS and
exits 0 only if every assertion in every file holds. Separately,
tests/smoke_playwright.py drives a real browser to catch
frame-loop crashes the Node tests can't see — a crash/console-error smoke
check, not a physics check, and not covered by the tables below.
The machine-readable gate — physics-gate.yaml
physics-gate.yaml at the repo root is valid YAML that
formalizes 4 of the invariants below as individually-runnable
entries — own command, own tolerance, own exit code — rather than lines
inside the combined tests/run.sh output. It documents the
commands for a human or agent to run by hand; the file itself is not wired
into any CI runner (no .github/workflows, and
tests/run.sh doesn't read it) — reproduction is manual, not
automated. These four are the project's load-bearing physical claims:
| Invariant | Test file | Locks | Reference | Tolerance |
|---|---|---|---|---|
| INV-PHYS-01 | longitudinal.regression | Longitudinal 4-force not divided by γ (1000g burn) | γ(t)=√(1+(αt/c)²) | 2% |
| INV-PHYS-03 | orbits | Orbit elements (a, e, periapsis, apoapsis) from state (r,v); actual conservation of h under propagation is checked separately in propagator.conservation, not this file | v²=μ(2/r−1/a) | 1e-3 |
| INV-PHYS-06 | gravity | Φ<0, decreasing with r (sign+monotonicity, no numeric reference); weak-field dτ→1 at large r | Φ=−μ/r (sign/monotonicity only) | dτ→1: 1e-12 abs (not a tolerance on Φ) |
| INV-PHYS-09 | relativity | Aberration formula, round-trip, monotonicity | (cp−β)/(1−β·cp) | 1e-9 |
Several other files carry their own in-code INV-PHYS-NN
labels (04, 05, 07, 10, 11, 12 — see below) that are not yet wired into
physics-gate.yaml; they run inside tests/run.sh
but don't have an individual entry with their own exit code — a real gap,
stated here rather than hidden.
Full gate, by topic
A — Special relativity
| File | Checks | Reference | Tolerance |
|---|---|---|---|
| relativity | Aberration formula, round-trip, monotonicity (INV-PHYS-09) | (cp−β)/(1−β·cp) | 1e-9 |
| longitudinal.regression | γ(t) under constant 1000g proper accel, longitudinal 4-force undivided (INV-PHYS-01, NEVER DELETE/WEAKEN) | γ(t)=√(1+(αt/c)²) | 2% |
| gravity.relativistic | (a) Transverse factor — actually gated: hard guard ratio>1.5 plus 3% tolerance vs (1+β²) at β=0.99 (INV-PHYS-10, not in physics-gate.yaml). (b) Longitudinal factor (1−3β²) — implemented in ship.js, but only printed via console.log in a try/catch; not asserted by the gate | a⊥=(1+β²)g⊥ · a∥=(1−3β²)g∥ | (a) guard>1.5 + 3% rel · (b) none — diagnostic only |
| verify-live | Pure logic behind the interactive “Check it yourself” section: every preset PASSES, a deliberately wrong sim value FAILS (verdict is not always-true), degenerate inputs are refused with no NaN | γ=cosh(aτ/c) · √(μ/r) · 2π√(r³/μ) · Lorentz-boosted photon 4-vector · μ/r² | 1e-9 (closed forms, orbit) · 1e-3 (integrated proper time) · 1e-12 (gravity) |
The (1−3β²) longitudinal factor is a fixed, deliberate
decision by the project owner about the physics engine itself — an internal
decision, not something independently verifiable from a source inside this
repo, and not something this document proposes to revisit. What's
inaccurate is calling it gate coverage: there is currently no
automated regression assertion on the longitudinal term, only the
diagnostic console.log above — a known, stated gap, not a
hidden one.
B — Orbital mechanics / Kepler
| File | Checks | Reference | Tolerance |
|---|---|---|---|
| orbits | Kepler elements (a, e, rPeri, rApo) from state (r,v) (INV-PHYS-03) — does not itself assert conservation of angular momentum under propagation; see propagator.conservation below | v²=μ(2/r−1/a) | 1e-3 |
| orbits.classify | bound/unbound via specific energy, not e≥1 (ADR-8) | ε=v²/2−μ/r<0 | exact identity |
| orbits.guards | Finiteness at degenerate inputs (r→0, e=1) | — | finiteness only |
| orbits.radial | Near-radial orbits: bound ≡ isFinite(rApo) | — | exact identity |
| propagator.conservation | Universal-variable propagator conserves ε, h, and the f/g Wronskian | f·ġ−ḟ·g=1 | ε/h: 1e-8 rel · Wronskian: 1e-9 |
| propagator.parabolic | e≈1 and e>1 match Barker's closed form | Barker's equation | 1e-6 rel |
| propagator.roundtrip | propagate(+Δt)∘propagate(−Δt) ≈ identity, all conics | — | round-trip identity |
| propagator.vs.numeric | Analytic step vs RK4 reference | RK4 | circular 1e-9 · eccentric 1e-4 |
| cabotage.predicate | Analytic↔numeric engagement predicate + boundary look-ahead | — | exact logic |
| cabotage.continuity | γ(w)≈γ(v) continuous across hand-off | — | 1e-12 |
| cabotage.periapsis | No periapsis overshoot on hand-off (NEVER DELETE/WEAKEN) | — | regression corpus |
| cabotage.dtau | Analytic dτ vs converged fine numeric reference | dτ=dt/γ integrated | 1e-6 rel |
C — Gravity
| File | Checks | Reference | Tolerance |
|---|---|---|---|
| gravity | Φ<0, decreasing with r (sign+monotonicity, no numeric reference); weak-field dτ→1 at large r (INV-PHYS-06) | Φ=−μ/r (sign/monotonicity only) | dτ→1: 1e-12 abs (not a tolerance on Φ) |
| gravity.relativistic | see table A above | a⊥=(1+β²)g⊥ · a∥=(1−3β²)g∥ | (a) guard>1.5 · (b) not asserted |
D — Autopilot (orbital-manoeuvre guidance)
| File | Checks | Tolerance |
|---|---|---|
| autopilot.circular | Circularization burn converges to target radius | a: 1e-3–2e-3 rel · e: 1e-3 |
| autopilot.hohmann | Hohmann transfer converges to target orbit radius | final a within 5e-3 rel, e<2e-3 (5e-3 for Earth–Moon) |
| autopilot.integrator | Same manoeuvres via the real Ship.step integrator, not an idealized bench | same order |
| autopilot.refuse | Refusal gate returns the correct reason code (relativistic speed, landed, atmosphere, unbound start, low fuel, multi-body domination, low target) | exact reason-code match |
| autopilot.cancel | Cancellation via a single monotonic inputSeq counter (ADR-7) | exact condition |
| autopilot.invariants | 500 pseudo-random states: determinism + totality | exact, no tolerance |
| autopilot.repair | Regression corpus: 4 defects an earlier green gate missed | regression corpus |
| autopilot.repair3 | Repair round 3: a Hohmann whose target radius lies outside the reference body's dominance is refused at engage (reason perturbed, no impulse spent); dominanceAtTarget must equal dominanceRatio at the target radius; circularize ignores it; a target that is itself a moon is not counted against itself | vs formula: 1e-9 rel (R3-1), 1e-6 rel (R3-4) · refuse/accept: exact phase/reason |
E — Epoch / time
| File | Checks | Reference |
|---|---|---|
| epoch | J2000 mean-anomaly helper, fixed timestamps only | — |
| epoch.tt | J2000.0 = true TT, not UTC (ADR-4) | J2000.0 = UTC noon − 64.184s |
F — Engineering structural guards (not physical-law checks)
These keep the code honest — layering, single-source-of-truth, UI/UX policy, i18n, sound framing — not a formula-vs-textbook check. A few do touch physically-meaningful quantities; where that's true it's flagged in the row rather than folded silently into the tables above.
| File | Checks |
|---|---|
| structure | Static source-text fitness functions (§9) — greps for forbidden duplicate-condition patterns, not a runtime test |
| renderpath | resolveRenderPath truth table (plain/wide/cube render path) |
| cubepolicy | cubeAutoStep auto-demotion policy for the cubemap path |
| cubetoggle | Cube-toggle wiring between the frame loop and renderPolicy.js |
| cockpitpolicy | cockpitDetail LOD policy for the cockpit overlay |
| orientation | Body spin orientation is one quaternion, not two independent Euler components (internal item "A6") |
| soundpolicy | Engine/impact/UI-click sound policy: honest mute conditions, no Doppler (ADR-11, ADR-12) |
| i18n.storage | localStorage access resilience when storage is entirely inaccessible (private browsing) |
| controls.throttle | Throttle-digit-to-accel log-ladder is mode-aware, honestly clamped (INV-PHYS-11) — UX calibration contract, not a law derivation |
| touchdown.impact | Impact speed measured against actual co-rotating ground, not just body velocity (INV-PHYS-12) — a reference-frame contract |
| ship.refpair | Atomicity of the (refBody, refBodyVel) pair fed into Ship.step() within one frame |
| ship | Fuel/dτ bookkeeping, transverse 4-force, drag-vs-rest-frame — exercises the same formulas as A/C, as a code contract, not an independent derivation |
| missions | Student-mission pure predicates: Mars circular orbit, Moon landing, Jupiter-flyby state machine |
| touchpanel | Touch-panel action table has exactly one row per keyboard-only feature, and the keyboard branch in controls.js calls the same hook — input-wiring single-source check, not physics |
| controls.repeat-blur | OS key auto-repeat of action keys neither bumps inputSeq nor re-fires the hook (held Shift+N must not cancel its own autopilot); window blur / hidden tab drops held keys and mouse look — not physics |
| missions.hyperbolic | Jupiter-flyby arming uses the canonical bound/unbound classifier, not ULP-unsafe e≥1 (ADR-8) |
G — Landing radar
The HUD landing radar (landingRadar in js/physics/landing.js) is a ballistic "what if I stop burning now" estimate. Its tests are written from the module's contract, not from the implementation.
| File | Checks | Reference | Tolerance |
|---|---|---|---|
| landing.radar | Constants CRASH_SPEED = 50 and RADAR_MAX_ALT_FRAC = 0.1; Moon free fall from 100 m to 100 km: altitude, impact speed, time to impact; vVert/vHoriz sign and magnitude for oblique vectors; inactive cases (not impacting, ascending, vVert > −0.1 m/s, altitude ≥ 0.1R or < 0); willCrash is a strict impact > 50 (exactly 50 is safe); bad inputs never throw and return inactive; inputs not mutated; out-object reuse; source wiring (main.js uses CRASH_SPEED, i18n keys in EN and RU) | v²imp = v² + 2μ(1/R − 1/r) · t = (−v₀+√(v₀²+2gh))/g · t≈√(2h/g) | altitude 1e-12 · impact speed 1e-9 · tImpact closed form 1e-9 · vs √(2h/g) at 500 m: 1% · vVert/vHoriz 1e-9 abs · thresholds exact |
| landing.timpact | Regression R1: time to impact accounts for horizontal speed (centrifugal term); at vHoriz = 0 it equals the plain closed form; when effective g ≤ 0 it falls back to h/|vVert|, finite and positive | numerical inertial two-body integration (Earth, h = 1 km, vHoriz 0–7800 m/s) | 10% vs the integration (wide, deliberately) · vHoriz = 0: 1e-12 · fallback: 1e-9 |
The radar's impact speed comes from energy conservation in the body's non-rotating frame, so on fast-spinning bodies it overestimates by a few percent; no test quantifies that, and there is no atmosphere model.
Relevant ADRs
The project's append-only decision log documents several of the choices
locked in above. These are the actual ADR.md entry numbers —
not the internal "ТЗ item" labels used in a few test-file comments (like
orientation's "A6"), which are a separate numbering scheme.
- ADR-4 — J2000.0 epoch is true TT, not UTC.
- ADR-7 — Autopilot cancellation: one monotonic counter, one condition, one reader.
- ADR-8 — bound/unbound classification by specific orbital energy everywhere, never e≥1.
- ADR-11 — Sound is heard "from inside the hull": no external events audible, Doppler prohibited outright.
- ADR-12 — AudioContext created lazily, only on a real user gesture; sound off by default.
What this gate does not claim
- No general relativity (no frame-dragging, no curved-spacetime geodesics beyond the weak-field approximation) — Newtonian gravity + special-relativistic kinematics, by design.
- Bodies don't perturb each other's orbits — a stated simplification.
- Transverse thrust is reduced by an extra factor of γ vs longitudinal — the honest relativistic 4-force result, a documented known limitation, not hidden here.
- The landing radar's time-to-impact is checked against a numerical integration only to 10%; its impact-speed overestimate on fast-spinning bodies is documented but not quantified by any test.
- The interactive “Check it yourself” section does not check the Doppler factor in the shader: the renderer computes Doppler in
relativisticPass.js(D = √(1−β²)/(1−β·cosθ′)), andrelativity.js dopplerFactoris not called by the simulator, so it is deliberately left out. Its circular-speed row is partly tautological (it mainly checks direction normalisation), and the aberration analytic is algebraically equivalent to the code (it catches sign/normalisation slips, not an independent derivation). Constant-acceleration checks are limited to aτ/c ≤ 15:ship.js:202loses proper-time precision at γ >~ 1e7 (found by this check, not fixed — physics is frozen, owner's decision). - A green
tests/run.shis a regression gate, not a proof of absolute correctness — it proves the code still agrees with the formulas and tolerances above. Anything not listed here has no automated check.
ПРОВЕРКА ФИЗИКИ
Как устроена проверка физики в этом симуляторе — что именно гоняется, против какой эталонной формулы и с каким допуском. Это не рекламный текст: там, где допуск широк или проверка на самом деле контракт кода/UX, а не вывод формулы «с нуля», об этом сказано прямо. Ничего ниже не выдаётся желаемое за действительное — каждая строка соответствует реальному, сейчас-зелёному тестовому файлу. Если проверки нет в этом списке — она не часть гейта.
На странице: Проверь сам · Как воспроизвести · Полный гейт · ADR · Чего гейт не утверждает
Проверь сам
Введите свои числа. Страница импортирует живые модули симулятора
(js/physics/relativity.js, gravity.js,
orbits.js, ship.js) — не копию формул — считает ими
прямо в вашем браузере и сверяет результат с независимо записанным
замкнутым значением. Вы видите значение симулятора, аналитику, относительное
расхождение, допуск и вердикт PASS/FAIL. Входы, для которых ответа нет
(β ≥ 1, радиус ≤ 0, NaN), отклоняются с причиной, а не выводят мусор.
Как воспроизвести
bash tests/run.sh
Гоняет каждый файл tests/*.test.mjs под Node, голые
assert, без фреймворка и без сборки — сейчас
48 файлов, около 2 секунд. Печатает PHYSICS GATE: PASS
и выходит с кодом 0, только если верны все утверждения во всех файлах.
Отдельно tests/smoke_playwright.py гоняет реальный браузер и
ловит крэши игрового цикла, которых Node-тесты не видят — это
дымовая проверка крэшей/console-ошибок, не физическая проверка, и в
таблицы ниже не входит.
Машиночитаемый гейт — physics-gate.yaml
physics-gate.yaml в корне репозитория — валидный YAML,
формализующий 4 из инвариантов ниже как отдельно запускаемые пункты
гейта — своя команда, свой допуск, свой код выхода — а не просто строки
внутри общего вывода tests/run.sh. Файл документирует команды
для ручного запуска человеком или агентом; сам он не подключён ни к
какому CI-раннеру (нет .github/workflows, и
tests/run.sh его не читает) — воспроизведение ручное, не
автоматическое. Это четыре физических утверждения, на которых держится
проект:
| Инвариант | Файл теста | Что закрепляет | Эталон | Допуск |
|---|---|---|---|---|
| INV-PHYS-01 | longitudinal.regression | Продольная 4-сила не делится на γ (тяга 1000g) | γ(t)=√(1+(αt/c)²) | 2% |
| INV-PHYS-03 | orbits | Элементы орбиты (a, e, периапсис, апоапсис) из состояния (r,v); реальное сохранение h при пропагации проверяется отдельно в propagator.conservation, не в этом файле | v²=μ(2/r−1/a) | 1e-3 |
| INV-PHYS-06 | gravity | Φ<0, убывает с r (только знак+монотонность, без числового эталона); слабопольная dτ→1 при больших r | Φ=−μ/r (только знак/монотонность) | dτ→1: 1e-12 абс. (не допуск на сам Φ) |
| INV-PHYS-09 | relativity | Формула аберрации, round-trip, монотонность | (cp−β)/(1−β·cp) | 1e-9 |
У нескольких других файлов есть собственные внутрикодовые метки
INV-PHYS-NN (04, 05, 07, 10, 11, 12 — см. ниже), которые
ещё не включены в physics-gate.yaml: они выполняются
внутри tests/run.sh, но не имеют отдельной записи со своим
кодом выхода — реальный пробел, названный здесь, а не скрытый.
Полный гейт по темам
A — Специальная теория относительности
| Файл | Проверяет | Эталон | Допуск |
|---|---|---|---|
| relativity | Формула аберрации, round-trip, монотонность (INV-PHYS-09) | (cp−β)/(1−β·cp) | 1e-9 |
| longitudinal.regression | γ(t) при постоянном 1000g собственном ускорении, продольная 4-сила без деления (INV-PHYS-01, NEVER DELETE/WEAKEN) | γ(t)=√(1+(αt/c)²) | 2% |
| gravity.relativistic | (a) Поперечный фактор — реально гейтится: жёсткий guard ratio>1.5 плюс допуск 3% против (1+β²) при β=0.99 (INV-PHYS-10, нет в physics-gate.yaml). (b) Продольный фактор (1−3β²) — реализован в ship.js, но только выводится через console.log в try/catch; гейтом не проверяется | a⊥=(1+β²)g⊥ · a∥=(1−3β²)g∥ | (a) guard>1.5 + 3% отн. · (b) нет — только диагностика |
| verify-live | Чистая логика интерактивного раздела «Проверь сам»: каждый пресет PASS, заведомо неверное значение симулятора даёт FAIL (вердикт не всегда-true), вырожденные входы отклоняются без NaN | γ=cosh(aτ/c) · √(μ/r) · 2π√(r³/μ) · буст 4-вектора фотона · μ/r² | 1e-9 (замкнутые формы, орбита) · 1e-3 (интегрированное собственное время) · 1e-12 (гравитация) |
Продольный фактор (1−3β²) — зафиксированное осознанное
решение владельца проекта о самой физике движка — внутреннее решение, не
проверяемое независимо по источнику внутри этого репозитория, и не то,
что этот документ предлагает пересматривать. Неточность была в другом —
в формулировке этого как покрытия гейтом: сейчас нет
автоматической регрессионной проверки продольного члена, только
диагностический console.log выше — известный, названный
пробел, а не скрытый.
B — Орбитальная механика / законы Кеплера
| Файл | Проверяет | Эталон | Допуск |
|---|---|---|---|
| orbits | Кеплеровы элементы (a, e, rPeri, rApo) из состояния (r,v) (INV-PHYS-03) — сам не проверяет сохранение момента импульса при пропагации; см. propagator.conservation ниже | v²=μ(2/r−1/a) | 1e-3 |
| orbits.classify | bound/unbound по удельной энергии, не по e≥1 (ADR-8) | ε=v²/2−μ/r<0 | точное тождество |
| orbits.guards | Конечность при вырожденных входах (r→0, e=1) | — | только конечность |
| orbits.radial | Near-radial орбиты: bound ≡ isFinite(rApo) | — | точное тождество |
| propagator.conservation | Универсальный Кеплер-пропагатор сохраняет ε, h и вронскиан f/g | f·ġ−ḟ·g=1 | ε/h: 1e-8 отн. · вронскиан: 1e-9 |
| propagator.parabolic | e≈1 и e>1 против решения Баркера | уравнение Баркера | 1e-6 отн. |
| propagator.roundtrip | propagate(+Δt)∘propagate(−Δt) ≈ identity, все конические сечения | — | round-trip identity |
| propagator.vs.numeric | Аналитический шаг vs эталон RK4 | RK4 | круг 1e-9 · эксцентрик 1e-4 |
| cabotage.predicate | Предикат вход/выход аналитика↔интегратор + boundary look-ahead | — | точная логика |
| cabotage.continuity | γ(w)≈γ(v) непрерывна при переключении | — | 1e-12 |
| cabotage.periapsis | Нет overshoot периапсиса при переключении (NEVER DELETE/WEAKEN) | — | регресс-корпус |
| cabotage.dtau | Аналитическое dτ vs сходящийся мелкий численный эталон | dτ=dt/γ, интеграл | 1e-6 отн. |
C — Гравитация
| Файл | Проверяет | Эталон | Допуск |
|---|---|---|---|
| gravity | Φ<0, убывает с r (только знак+монотонность, без числового эталона); слабопольная dτ→1 при больших r (INV-PHYS-06) | Φ=−μ/r (только знак/монотонность) | dτ→1: 1e-12 абс. (не допуск на сам Φ) |
| gravity.relativistic | см. таблицу A выше | a⊥=(1+β²)g⊥ · a∥=(1−3β²)g∥ | (a) guard>1.5 · (b) не проверяется |
D — Автопилот (орбитальные манёвры)
| Файл | Проверяет | Допуск |
|---|---|---|
| autopilot.circular | Циркуляризация сходится к целевому радиусу | a: 1e-3–2e-3 отн. · e: 1e-3 |
| autopilot.hohmann | Хоман-трансфер сходится к целевому радиусу орбиты | финальная a ±5e-3 отн., e<2e-3 (5e-3 для Земля–Луна) |
| autopilot.integrator | Те же манёвры через реальный интегратор Ship.step, не идеализированный стенд | тот же порядок |
| autopilot.refuse | Гейт отказа возвращает верный код причины (релятивистская скорость, посадка, атмосфера, unbound-старт, топливо, доминирование, низкая цель) | точное совпадение кода |
| autopilot.cancel | Отмена через единый монотонный счётчик inputSeq (ADR-7) | точное условие |
| autopilot.invariants | 500 псевдослучайных состояний: детерминизм + totality | точно, без допуска |
| autopilot.repair | Регресс-корпус: 4 дефекта, пропущенных прошлым зелёным гейтом | регресс-корпус |
| autopilot.repair3 | Ремонт, раунд 3: Хоман, у которого целевой радиус вне зоны доминирования опорного тела, отклоняется при запуске (причина perturbed, импульс не тратится); dominanceAtTarget должен совпадать с dominanceRatio на целевом радиусе; циркуляризация поле игнорирует; цель-луна не считается против самой себя | против формулы: 1e-9 отн. (R3-1), 1e-6 отн. (R3-4) · отказ/допуск: точное совпадение фазы/причины |
E — Эпоха / время
| Файл | Проверяет | Эталон |
|---|---|---|
| epoch | Хелпер средней аномалии J2000, только фиксированные метки времени | — |
| epoch.tt | J2000.0 = истинный TT, не UTC (ADR-4) | J2000.0 = полдень UTC − 64.184с |
F — Инженерные структурные гарды (не проверка физических законов)
Эти файлы следят за честностью кода — слоистость, единственный источник правды, UX-политика, i18n, дизайн звука — а не за соответствием формулы учебнику. Некоторые касаются физически осмысленных величин; где это так — отмечено прямо в строке, а не тихо смешано с таблицами выше.
| Файл | Проверяет |
|---|---|
| structure | Статические фитнес-функции по исходному тексту (§9) — grep запрещённых дублирующихся условий, не рантайм-тест |
| renderpath | Таблица истинности resolveRenderPath (plain/wide/cube путь рендера) |
| cubepolicy | Политика авто-демоции cubeAutoStep для кубмап-пути |
| cubetoggle | Проводка тумблера кубмапы между игровым циклом и renderPolicy.js |
| cockpitpolicy | LOD-политика cockpitDetail для оверлея кабины |
| orientation | Ориентация спина тела — один кватернион, не два независимых Euler-компонента (внутренняя метка «A6») |
| soundpolicy | Политика звука двигателя/удара/клика: честные условия заглушения, без Допплера (ADR-11, ADR-12) |
| i18n.storage | Устойчивость доступа к localStorage при полностью недоступном хранилище (приватный режим) |
| controls.throttle | Лог-лестница «цифра тяги → ускорение», зависит от режима, честно ограничена (INV-PHYS-11) — UX-контракт калибровки, не вывод закона |
| touchdown.impact | Скорость удара меряется против реальной со-вращающейся поверхности, не только скорости тела (INV-PHYS-12) — контракт системы отсчёта |
| ship.refpair | Атомарность пары (refBody, refBodyVel), передаваемой в Ship.step() за один кадр |
| ship | Учёт топлива/dτ, поперечная 4-сила, сопротивление относительно системы покоя — те же формулы, что в A/C, но как контракт кода, не независимый вывод |
| missions | Чистые предикаты ученических миссий: круговая орбита у Марса, посадка на Луну, машина состояний пролёта Юпитера |
| touchpanel | В таблице действий тач-панели ровно одна строка на каждую функцию, доступную только с клавиатуры, и клавиатурная ветка в controls.js вызывает тот же хук — проверка единого источника проводки ввода, не физика |
| controls.repeat-blur | Автоповтор клавиш действий ОС не увеличивает inputSeq и не вызывает хук повторно (удерживаемый Shift+N не должен отменять свой автопилот); потеря фокуса окна / скрытая вкладка сбрасывает зажатые клавиши и взгляд мышью — не физика |
| missions.hyperbolic | Взведение пролёта Юпитера — по каноническому классификатору bound/unbound, не по небезопасному e≥1 (ADR-8) |
G — Посадочный радар
Посадочный радар в HUD (landingRadar в js/physics/landing.js) — баллистическая оценка «что будет, если я сейчас перестану жечь». Тесты написаны по контракту модуля, а не по реализации.
| Файл | Проверяет | Эталон | Допуск |
|---|---|---|---|
| landing.radar | Константы CRASH_SPEED = 50 и RADAR_MAX_ALT_FRAC = 0.1; свободное падение на Луне от 100 м до 100 км: высота, скорость удара, время до удара; знак и величина vVert/vHoriz для косых векторов; неактивные случаи (нет столкновения, подъём, vVert > −0.1 м/с, высота ≥ 0.1R или < 0); willCrash — строгое «удар > 50» (ровно 50 безопасно); плохие входы не бросают исключение и дают «неактивно»; входы не мутируются; переиспользование out-объекта; проводка в исходниках (main.js использует CRASH_SPEED, ключи i18n в EN и RU) | v²уд = v² + 2μ(1/R − 1/r) · t = (−v₀+√(v₀²+2gh))/g · t≈√(2h/g) | высота 1e-12 · скорость удара 1e-9 · tImpact замкнутая форма 1e-9 · против √(2h/g) на 500 м: 1% · vVert/vHoriz 1e-9 абс. · пороги точно |
| landing.timpact | Регресс R1: время до удара учитывает горизонтальную скорость (центробежный член); при vHoriz = 0 совпадает с простой замкнутой формой; при эффективном g ≤ 0 — запасная оценка h/|vVert|, конечная и положительная | численное инерциальное интегрирование двух тел (Земля, h = 1 км, vHoriz 0–7800 м/с) | 10% против интегрирования (широкий, осознанно) · vHoriz = 0: 1e-12 · запас: 1e-9 |
Скорость удара радара берётся из сохранения энергии в невращающейся системе тела, поэтому на быстро вращающихся телах она завышена на несколько процентов; ни один тест это не измеряет, модели атмосферы нет.
Релевантные ADR
Append-only журнал решений проекта документирует часть закреплённых
выше решений. Ниже — реальные номера записей ADR.md, не
внутренние метки «пунктов ТЗ» из комментариев некоторых тестов (как
«A6» у orientation) — это отдельная система нумерации.
- ADR-4 — эпоха J2000.0 = истинный TT, не UTC.
- ADR-7 — отмена автопилота: один монотонный счётчик, одно условие, один читатель.
- ADR-8 — классификация bound/unbound по удельной орбитальной энергии везде, никогда по e≥1.
- ADR-11 — звук «слышен изнутри корпуса»: внешние события не звучат, Допплер запрещён прямо.
- ADR-12 — AudioContext создаётся лениво, только по реальному жесту пользователя; звук по умолчанию выключен.
Чего этот гейт не утверждает
- Нет общей теории относительности (нет frame-dragging, нет геодезических искривлённого пространства-времени за пределами слабопольного приближения) — ньютоновская гравитация + специально-релятивистская кинематика, осознанно.
- Тела не возмущают орбиты друг друга — заявленное упрощение.
- Поперечная тяга уменьшена на дополнительный множитель γ относительно продольной — честный релятивистский результат 4-силы, задокументированное известное ограничение, не скрытое здесь.
- Время до удара посадочного радара сверяется с численным интегрированием лишь до 10%; завышение скорости удара на быстро вращающихся телах задокументировано, но ни одним тестом не измеряется.
- Раздел «Проверь сам» не проверяет доплер-фактор в шейдере: рендер считает Доплер в
relativisticPass.js(D = √(1−β²)/(1−β·cosθ′)), аrelativity.js dopplerFactorсимулятором не вызывается, поэтому в раздел он намеренно не входит. Строка круговой скорости отчасти тавтологична (по сути проверяет нормировку направления), а аналитика аберрации алгебраически эквивалентна коду (ловит ошибки знака/нормировки, не независимый вывод). Проверки постоянного ускорения ограничены aτ/c ≤ 15:ship.js:202теряет точность собственного времени при γ >~ 1e7 (найдено этой проверкой, не чинили — физика заморожена, решение владельца). - Зелёный
tests/run.sh— это регресс-гейт, не доказательство абсолютной корректности: он доказывает, что код по-прежнему согласуется с формулами и допусками выше. У всего, чего нет в этом списке, нет автоматической проверки.