# Summit Post: a trained WSRF flight companion

Switch on **Copilot** to fly and deliver all 3 letters automatically. Steer, boost, or steady to take control immediately. Lantern also supports taking over by tapping the sky. The copilot starts off, pauses with the game, and resets for a fresh route. Flights that use it have separate best scores, even after taking manual control.

The model runs entirely in your browser. It loads once; if unavailable, ordinary manual flight remains playable. Model training happens locally and never uses player data.

## What learned to fly

This is **supervised imitation learning** from reference pilots in the existing JavaScript flight simulations. A WSRF classifier learns steering, lift, braking, and boost as joint discrete actions. The game’s existing docking conditions permit automatic delivery; the model cannot skip those checks or move the ship directly.

Inputs are destination offsets, velocity, ground clearance, terrain ahead, and fuel. Separate cruise and approach zones begin within 10 km horizontally of the current peak. The model chooses controls at 10 Hz, while the simulation continues at the display frame rate. Each game has its own forest.

The shared feature extraction and controller live in `shared/flight-policy.js`. The browser UI is `shared/copilot.js`; the complete fitted trees use `shared/wsrf.js`. Explicit branch/leaf tags support arbitrary class counts, and float32 inputs reproduce Python tree traversal.

## Training and evaluation

The fixed seed namespace is `arcade-flight-wsrf-v2`. `pytoolz.indexrng` generates independent named streams per game and split: 128 training routes, 32 validation routes, and 64 unseen test routes. Training includes perturbed positions, velocities, and low fuel. Teacher labels are also collected on candidate-controlled training rollouts so the forest learns recovery from its own mistakes.

Four recipes compare 16/32 trees per zone and depth 10/14, with three samples per leaf and random state 1717. Candidate selection uses validation completion, fewer collisions, faster deliveries, then smaller size. Test and recovery-test routes are excluded from fitting and selection.

WSRF’s out-of-bag collection is enabled for zone reputation. These multiclass forests do not use binary calibration. Adaptive complexity and prior blending are disabled. Export checks preserve zone weights, class order, tree means, and float32 thresholds.

The actual scores, route seeds/results, candidate comparisons, parameters, source hashes, model size, and Python/browser parity measurements are in [training/report.json](training/report.json). Reports distinguish teacher-label agreement from **completing a whole route**. Release checks require at least 63/64 test completions, no increase in mean Summit collisions over the reference pilot, recovery completion matching the reference, and complete sampled routes at 30/60/120 Hz.

## Reproduce from the complete arcade folder

```sh
/home/wiliamrocha/.spenv/bin/python -B tools/wsrf/train.py --game summit-post
node tools/test-wsrf.cjs
npm run build
```

Use an equivalent Python environment on another machine. Library versions and resolved source hashes are recorded in the report. `tools/wsrf/flight-data.cjs` contains the reference pilot, actual simulation runner, perturbations and evaluation. Intermediate data and candidates stay under `tools/wsrf/.cache` and are excluded from the site. `training/validation.json` records Python predictions for the browser checks.

The build includes the trainer and source needed by it. The deployed site uses the frozen `forest.json`; it requires no Python server or external inference service. Training can improve with further demonstrations, but performance on these routes is not a guarantee for every possible seed.

WSRF’s MIT notice is retained in `LICENSE.wsrf`; the original game and nedgelaw notices remain included.
