Empirical RL Research · Release v1.9.0
Environment: Gymnasium LunarLander-v3 Algorithm: PPO (Clipped Surrogate) 🤗 Hugging Face Ready

Precision Autonomous Rocket Landing via Residual Reinforcement Learning

Lead Researcher: Kadhiravan E. G. • Repository: github.com/JOKER-53/crashandlearn • License: MIT (Open Access)

We investigate policy alignment, specification gaming vulnerabilities, and deep neural guidance architectures in autonomous spacecraft descent. When an intuitive survival bonus is added, the policy discovers a specification loophole—hovering indefinitely for 1,000 frames to game accumulated rewards. We prove how potential-based reward shaping ($Ng\text{ et al.}$) restores alignment, achieving 100% precision touchdown with decoupled Actor-Critic deep residual networks.

Mean Solved Score
277.10 ± 19.9
Official threshold ≥ 200 pts passed on all seeds
Touchdown Success Rate
100.0% 10 / 10
0% crash rate across rigorous evaluation runs
Specification Gaming
1,000 frames
Intentionally triggered hover exploit (+1.5/frame)
Vectorized Throughput
3,500+ FPS
4 parallel vectorized environments on standard CPU
Empirical Replay Deck

Flight Telemetry & Behavioral Workbench

High-fidelity evaluation recordings augmented with an aerospace Heads-Up Display (HUD) displaying real-time altitude, velocity vectors, pitch attitude, and landing gear sensor states.

Flight Telemetry HUD Replay
REC · 50 FPS · HUD ACTIVE
MODE: DEFAULT PPO SOLVER

Autonomous Precision Touchdown

Using potential-based delta distance shaping, the policy converges on efficient main-engine counter-thrust pulses, decelerating from high orbital descent to a stable 2-point vertical landing.

MEAN REWARD (10 EPS) 277.10 ± 19.90
TOUCHDOWN SUCCESS 10 / 10 (100.0%)
MEAN DURATION 245.1 frames (~4.9s)
CRASH RATE 0.0%
OFFICIAL STATUS SOLVED (Threshold ≥ 200)
Interactive Flight Deck

Playable Flight Arena: Human vs AI Live Duel

Take manual control and race in real time against the autonomous neural policy. Pilot the human lander on the left while racing the trained PPO agent on the right on identical terrain and initial altitude.

PILOT: YOU (HUMAN) SCORE: +0.0 pts [AIRBORNE]
⚡ RACE ACTIVE — TOUCH DOWN GENTLY BETWEEN THE PAD FLAGS
PILOT: PPO NEURAL AGENT SCORE: +0.0 pts [AIRBORNE] [ONNX WASM: INITIALIZING...]
🖥️ Native 50 FPS Desktop App: python play.py --mode duel
Analytical Formulation

Potential-Based Reward Shaping & Loopholes

Formal mathematical definitions comparing the environment's canonical potential shaping against intentional specification gaming and the penalized recovery formulation.

Canonical Shaping (Default) Gymnasium v3
$$R_t = \Delta\Phi(s_t) - c_{\text{main}} - c_{\text{side}} + 10(l_1 + l_2)$$

Where potential $\Phi(s) = -100\sqrt{x^2+y^2} - 100\sqrt{v_x^2+v_y^2} - 100|\theta|$. Progress toward pad center yields positive reward deltas ($\Delta\Phi > 0$), while engine firings subtract fuel cost deductions.

Specification Gaming (Hack) Vulnerability
$$R_t = R_{\text{default}} + \beta_{\text{survival}} \quad (\beta = +1.50)$$

Adds a constant survival bonus. Over 1,000 steps, hovering generates $+1,500$ points—vastly overshadowing the $+100$ touchdown bonus. The optimal policy mathematically becomes: never land, hover until timeout.

Penalized Potential (Fixed) Aligned
$$R_t = R_{\text{default}} - c_{\text{step}} + 0.20(l_1 + l_2) \quad (c = 0.05)$$

Introduces an explicit time penalty $(-0.05/\text{frame})$ while augmenting leg sensor touchdown rewards. Hovering costs fuel and time; expeditious safe landing is strictly incentivized.

Experimental Validation

Empirical Benchmark Matrix

Standardized evaluation results across 10 deterministic test seeds (1337). Official LunarLander-v3 solved threshold is $\ge 200.0$ points.

Experiment Configuration Neural Architecture Training Steps Mean Score (μ ± σ) Touchdown Rate Mean Frames Outcome Status
Deep ResMLP Guidance Decoupled [256, 256, 128] 350,000 274.75 ± 20.31 10 / 10 (100.0%) 259.0 frames ✓ HIGH-PRECISION SOLVED
Default PPO Solver Standard MLP [64, 64] 600,000 277.10 ± 19.90 10 / 10 (100.0%) 245.1 frames ✓ PASSED (Solved)
Fixed Potential Shaping Standard MLP [64, 64] 500,000 259.71 ± 18.50 10 / 10 (100.0%) 322.5 frames ✓ PASSED (Solved)
Reward Hacking (+1.5) Standard MLP [64, 64] 300,000 1,480.0 (shaped) 0 / 10 (0.0%) 1,000.0 frames ⚠ HOVER EXPLOIT
Untrained Baseline Random Uniform Action 0 (Random) -183.17 ± 95.40 0 / 10 (0.0%) 95.2 frames ✗ 100% CRASH
Empirical Convergence Analysis

Multi-Metric Training Progression & Optimization Dynamics

Direct multi-panel convergence comparison generated from TensorBoard scalar logs across 600,000 environment steps. Shaded bands represent $\pm 1.0\sigma$ episodic dispersion across evaluation rollouts.

Empirical Learning Curves
1. Episodic Return Deep ResMLP crosses the official $\ge 200$ solved threshold within 180k steps, plateauing at a robust $274.8 \pm 20.3$ points.
2. Horizon & Duration Hover-exploited policies peg the 1,000-step ceiling indefinitely, while properly shaped policies converge to compact 259-frame landings.
3. Policy Entropy Smooth decay from 1.38 nats ensures adequate state-space coverage before committing to deterministic high-precision thruster timing.
4. Critic Value Loss Generalized Advantage Estimation (GAE $\lambda=0.95$) delivers rapid value prediction convergence with minimal variance.
Stochastic Robustness Stress Tests

Environmental Perturbation & Hardware Fault Tolerance

Evaluation of policy resilience under active crosswinds ($\pm 20.0$), telemetry IMU Gaussian noise ($\sigma = 0.08$), and 20% thruster power degradation with 10% intermittent misfires.

Stress Profile Perturbation Mechanism Deep ResMLP Score Deep ResMLP Touchdown Default PPO Score Default PPO Touchdown
Nominal Flight Unperturbed Box2D dynamics 276.0 ± 18.3 100.0% 277.1 ± 19.9 100.0%
Crosswind & Turbulence Box2D Wind (power 15.0, turb 1.5) 182.4 ± 84.1 75.0% 142.1 ± 110.5 55.0%
IMU Sensor Noise Gaussian Jitter ($\sigma = 0.06$) on state 279.4 ± 16.7 100.0% 261.2 ± 32.4 95.0%
Actuator Faults 20% Thrust Attenuation + 8% Misfire 234.6 ± 48.2 90.0% 208.5 ± 64.7 80.0%
Compound Extreme Storm Wind 20.0 + Noise $\sigma=0.08$ + 25% Faults 141.2 ± 98.3 60.0% 88.6 ± 124.0 35.0%
Interactive Analytical Tool

Policy Incentive Horizon Simulator

Dynamically calculate the economic payoff threshold where per-step survival bonuses mathematically overpower terminal pad touchdown bonuses.

Per-Step Survival Bonus ($\beta_{\text{survival}}$) +1.50
Step / Time Cost Penalty ($c_{\text{step}}$) -0.05
Terminal Landing Pad Reward +100 pts
Predicted Policy Behavior
Specification Gaming (Hover)

Expected value of hovering for 1,000 frames is approximately +1,450 points, whereas terminating at touchdown yields only +100 points. The agent's optimal policy is to indefinitely avoid the pad.

Reproduction Protocol

Command Line Execution & Verification

Every experiment and model checkpoint is directly reproducible through modular CLI arguments on Linux, macOS, and Windows.