Autopilot · write-up
Level 5 opening pickups and full-level validation — 2026-10-04
Why R299 missed one of the two opening upgrades
Recording: E:/xenon_runs/level5-diagonal-final-20261004-r299.validation/level5-diagonal-final-20261004-r299.x2events.
POWERUP #132972 was active from 39849 through 39945 and expired below the playfield at 39946. The controller selected it at 39881/39890, then switched to the nearer second POWERUP #133137 at 39899. The second was collected at 39915, confirmed by Drone power changing from 0 to 1. By then the first upgrade's remaining interception window was short: following its current orbit position and then its eight-pixel-per-frame drop was too late. Its closest hull gap was 13.15 pixels at 39899; proximity did not mean collection.
This was pickup selection/interception, not an invisible pickup or a collision mask problem. Both upgrades matter even with Side Shot already at maximum: the new validation confirms improvements to Drone and Double Shot.
Local C correction
choose_opening_powerup() in src/autopilot/xenon_autopilot_level5.c applies
only to Level 5's opening, with scroll at least 4300, before the laser corridor.
It retains the selected live POWERUP until retirement rather than switching
to whichever one is nearest. Without a retained target it chooses the lower
drop. It uses the existing C orbit/drop predictor over 24 frames to choose a
reachable intercept, removes the ordinary cruising band for this collection,
and replans over 12 frames. The normal evaluator still checks hazards and walls.
No Python gameplay policy was changed.
R302 and R303 both collected the first at 39878 (Drone 0 → 1), then the second at 39896 (Double Shot 1 → 2). The second identity became #133140 because different gameplay changes subsequent object allocation.
Other full-level problems found and addressed
R302: E:/xenon_runs/level5-full-opening-powerups-20261004-r302.validation/level5-full-opening-powerups-20261004-r302.x2events.
| Frame | Problem | Resulting local correction |
|---|---|---|
| 42251 | Tank central column caused 6 shield damage. | Unresolved tank avoidance; not repaired by the pickup change. |
| 42568 | Homing missile and central column caused 14 damage. | Unresolved tank avoidance; see rejected experiments below. |
| 43132 onward | Tank reward collection took only 6/10 coins, worth 400/750. | Retain a tank cash phase and reuse the final boss's low convergence lane until the coins are gone. |
| 44574 onward; monitor 45473 | After the shop, the pilot targeted an absent side emplacement behind it and stalled. | Do not select a directional-barrier group behind the ship when its controlling actor is absent. Preserve actual terrain occupancy. |
The cash phase adds an enum value, not new mission-state fields or per-frame
Python calls. Replay descriptions are regenerated by
python xenon_tools/generate_replay_descriptions.py.
R303: E:/xenon_runs/level5-full-tank-transition-20261004-r303.validation/level5-full-tank-transition-20261004-r303.x2events.
It completed at 48935, passed the shop transition, and collected 10/10 tank
coins (750) and 20/20 spaceship coins (1500). It was not a clean pass:
tank damage was 28 and a life was lost at 47623 during the final boss.
Rejected tank experiments
Extending the contact escape search and zero reserve to tank side-emplacement WALL_ATTACK made R303's tank damage worse than R302's 20. That driver change was removed completely. Requiring arrival beyond X=125/185 before giving the near emplacement priority then lost a life in focused R304 at 42903. That mission change and its corresponding new test were also removed. Neither experiment is part of the final source.
R304: E:/xenon_runs/level5-tank-flank-20261004-r304.validation/level5-tank-flank-20261004-r304.x2events.
It ran from the R302 checkpoint at 42082 through shop opening at 43787.
These failures show that cannon pulse avoidance, emplacement suppression and
homing missiles need a coupled encounter analysis; a more plausible mission
label or passing synthetic fixture does not establish safer gameplay.
Final-source validation
R305: E:/xenon_runs/level5-full-validated-20261004-r305.validation/level5-full-validated-20261004-r305.x2events.
The final validation resumes
E:/xenon_runs/level4-full-after-level3-20261003-r278.validation/checkpoints/f39693-periodic.sav.
Both Hatari Release and the replay DLL were rebuilt with the official
xenon_tools/hatari_dev.ps1; 73 targeted Level 5 mission, driver, session and
replay-description tests passed. Live gameplay uses the resident C pilot,
visible Hatari, fast-forward, both AVIs and 150-frame checkpoints.
Result: level finished, including the spaceship, with no lost lives and no stalls. Final completion was recorded at 48971; the finalized capture covers 39695–48978. Shield ended at 15/39, lives at 3/3. The spaceship encounter began at 47267, lost its last mounted part at 48417, and released cash at 48523. It caused zero shield damage.
Both opening POWERUP collections again occurred at 39878 and 39896, with the corresponding Drone and Double Shot power changes. The diagonal chamber passed without damage. Tank reward collection improved to 10/10, worth 750, and the shop transition progressed normally.
Remaining incidents in R305
Every frame in this table belongs to the R305 recording named above.
| Frame | Short description | Confirmed evidence / next investigation |
|---|---|---|
| 42251 | Tank central column #146261 caused 6 shield damage. | $50B38; same hit as R302. Analyze pulse avoidance and its transition between cannon/emplacement tactics. |
| 42568 | Homing missile #147852 and central column #148065 caused 14 damage together. | $4FA1E caused 8, $50B38 caused 6. Highest-priority remaining encounter problem; a mission-only change did not repair it. |
| 46764 | Directional projectile #164953 caused 2 damage before the spaceship. | $4180; projectile contact captured. Forecast/available escape still needs focused analysis. |
| 46765 | Directional projectile #164958 caused another 2 damage. | $4180, adjacent update. Treat these as one passage incident rather than unrelated tweaks. |
| 48582 | First missed spaceship reward: large cash #175182 expired after last destroying observation at 48581. | Falling at X=147; ship alternated X=161/170 at screen Y=176. |
| 48635 | Second missed spaceship reward: large cash #175172 expired after last observation at 48634. | Falling at X=148; ship stayed near X=161. |
Spaceship cash was 18/20, worth 1300/1500, not all collected. R303 took
all twenty, so the shared low-lane rule is not yet reliable across arrival
states. The actual C trace keeps the cash mission active, but occasionally
applies a different maneuver from its proposed left/up movement. For example,
at 48570 the proposal is 0x05 and applied movement is 0x02. Do not infer
a stale boss map or an overriding mission without checking the physical
one-step veto and arbitration. This residual collection issue is unresolved.
Pickups, equipment and shop
Health Power 2 #139631 retired beside the ship at 41092; the passive audit labels this likely collected because there is no explicit collection event. The two POWERUPs are additionally confirmed by scalar power changes. Side Shot #141065/#141099/#166189 were missed, but Side Shot was already power 2 of 2 throughout, so these were duplicate upgrades. Homing Missile
145558 was skipped by the existing preserve-Side-Shot rule. No Rear Shot
was collected and no installed attachment was lost.
At the tank shop (43236–44569), cash was 6000. The C shop bought a third Laser into slot 4 at 44123 and upgraded it from power 0 to 1 at 44190, spending all 6000. This adds a forward stream for the remaining enemies and spaceship; Dive was not bought. The later mode-255 interval is completion state, not a second purchasing visit, although the generic shop report lists it as Shop 2. No equipment was bought there.
Across the complete capture, the cash lifetime audit found 58 drops, 37 collected (2850) and 21 expired (1950). Most misses were ordinary enemy drops; boss-specific totals are given separately above.
Evidence and reproduction
Both finalized AVIs pass structural/index verification, each with 32785 indexed video frames. The emulator was closed after graceful recording finalization. The recording folder contains both AVIs, checkpoints, trace, manifest, source patch, incident report and final state.
Saved passive audits:
- R305 complete audit
- R305 spaceship health and reward audit
- R305 AVI structure audit
- R305 shop report
- Build and validation metadata
Run from the repository root, choosing a fresh name:
set XAP_LEVEL5_TRACE_FILE=E:\xenon_runs\NEW-L5.validation\level5-trace.log
python xenon_tools\validate_campaign.py native-run NEW-L5 --output-root E:/xenon_runs --resume E:/xenon_runs/level4-full-after-level3-20261003-r278.validation/checkpoints/f39693-periodic.sav --frames 30000 --checkpoint-interval 150 --build --build-type Release --build-directory out/build/codex-validate --fast-forward --memory-trace off --png-level 3 --port 6932 --continue-after-life-loss --continue-after-stall
The highest priority remaining issue is tank avoidance (20 damage), followed by the two-hit passage (4 damage), then complete spaceship reward collection (200 missed). The final spaceship attack itself succeeded without damage in this full-entry run; avoid changing it to repair the earlier tank encounter.