XSharp

X2 movie calibration

The active verification now covers Stag Final Climb and Gator Capsule. The Gap Jumps investigation is set aside for this milestone. See the research register for reusable evidence and synchronization with MegaEDX/HunterBaseStudio.

The current target includes the full scene and RNG, not just player motion. See scene-wide parity for the 4,187-state memory capture, 8,458 original RNG calls, camera/physics corrections and current coverage limits. The previous player-only milestones below are historical measurements.

The four user-recorded movies below were replayed locally in BizHawk 2.11 with BSNESv115+, using their embedded initial states and unmodified input logs. Chop Register Floor Travel With CSG.bk2 is excluded. All four identify X2 USA SHA-1 637079014421563283CDED6AEAA0604597B2E33C and CX4 firmware SHA-1 A002F4EFBA42775A31185D443F3ED1790B0E949A.

Movie Input frames Original stage Use
Basic Movements.bk2 6,842 Wire Sponge, start Walking, stopping, jumping and dash transitions
Gap Jumps.bk2 4,186 Wire Sponge, final ladders Wall kicks through the ladder openings
Gator Capsule.bk2 7,395 Wheel Gator Capsule approach and movement; restrict comparisons around moving actors/events
Stag Final Climb.bk2 3,487 Flame Stag Vertical wall-kick sequences; actor and stage-event equivalence must be checked

XSharp.Tests/Fixtures/X2/movie-captures.json records source movie hashes, trace hashes, sync settings, executable hash and frame indexing. Full private captures, copied states and emulator files are deliberately outside the repository. These are original-game measurements, not proof that the entire movie already replays in XSharp. The BizHawk native initial state is not an XSharp save state.

Capture without changing the user’s installation

python tools/parity/capture_bizhawk_movie.py `
    --movie 'C:\Program Files\BizHawk\Movies\Gap Jumps.bk2' `
    --rom 'C:\path\to\Megaman X2 (USA).sfc' `
    --bizhawk 'C:\path\to\portable-BizHawk-2.11\EmuHawk.exe' `
    --output "$env:TEMP\xsharp-gap-jumps-capture"

Use Python 3.10+ and the matching installed core and firmware. Output must be absent or empty. The tool validates the ROM/movie revision and executes the movie in a private copy with isolated configuration, writable paths, disabled sound and background input. Lua only reads WRAM; it never substitutes inputs, moves actors or edits original ROM/state data. Timeout terminates the capture process and leaves its logs for inspection. The tool verifies that its source movie and source configuration remain unchanged.

If the installed executable is marked RUNASADMIN in Windows compatibility settings, use a separate portable copy of EmuHawk.exe, its .config, dll, gamedb, Firmware, defctrl.json and config.ini. The capture can then run as an ordinary user. Do not change UAC or the installed executable’s compatibility settings. Launch options follow BizHawk’s argument parser.

CSV frame n is the state after zero-based input line n-1. BizHawk 2.11’s CLI may start Lua after the first movie frame; the tool records this as first_captured_frame and keeps the original indices. A missing frame zero is never invented or compensated by shifting later rows. X/Y use 8 fractional bits; original VY is positive upward, opposite to XSharp. Lag frames remain explicit.

Current ladder-gap regression

The continuous movie comparison host now also executes all 4,186 Gap Jumps inputs in the real XSharp engine on the ROM-loaded Sponge stage. The first full baseline diverged at stored horizontal velocity on frame 71 and position on frame 80. This continuous run is distinct from the isolated vertical tests below; it does not pass full-movie parity. Its initial-state adapter aligns a standing player once and does not convert original RNG/actors or the native emulator state.

After correcting those two X2 transitions, a second full run matches X/Y/VX/VY through frame 103. Its next difference is stored horizontal speed at frame 104 and position at 105, at the first landing. Later playback still diverges and XSharp enters its dying state at frame 1584. The two reports in docs/parity preserve both results. An improved matching prefix does not establish full-movie parity.

The first flat-floor contact correction subsequently resolves frames 104–106. Its original-runtime evidence shows that contact is acquired during collision, the new fractional Y is retained, and the player controller consumes the contact next update. A further full run matches through frame 121 and moves the next mismatch to wall contact on 122/123. A frame-105 snapshot reproduces 20 updates after restoration. The new report and source-write/control evidence are also preserved under docs/parity; full-movie parity still fails.

gap-jumps.json contains original movie frames 489–505, 2464–2480 and 3178–3194, plus a 256 × 336 pixel collision cutout of the final Sponge ladders. X coordinates are normalized by subtracting 5,344 pixels. The cells come from the unmodified USA ROM through MMXCore.LoadLevel / LoadLevelLayout (sceneLayout -> mapping -> pCollisions), preserving each raw collision ID. The first row of each trace seeds a falling player, with released Jump and the original position/velocity. Subsequent rows supply the recorded Jump/Left/Right inputs.

The headless engine test runs the real player input handler, vertical integrator and world collision checks, using in-memory scene/animation resources and no video/audio device. It compares vertical position and stored vertical speed for 16 updates in each of three clips (48 updates total). It does not assert horizontal/contact rounding, original animation IDs, the complete scheduler or equivalence of the full movie.

The X2 wall kick retains its incoming stored speed during updates 1–5 while movement is suspended, prepares VY=0553 on update 6 without displacement, and starts displacement on update 7 after gravity. Seven moving updates are followed by the original exit-substate pause on update 14. Update 15 resumes ordinary air control. UseOriginalWallJumpTiming and WallJumpDuration=13 select this behavior in the X2 profile. Legacy/X1/X3 retain their previous timing. Existing actor counters encode these phases, so no positional save-state fields are added.

The reported intermittent failure to rise through the gap remains under investigation. The selected clips now match vertically, but they do not reproduce every failed attempt. Another sampled lower-ladder entry exposes a separate contact-rounding difference, and horizontal offsets still differ around the narrow opening. These need bounded regressions before changing the general collision resolver. Next calibration targets remain the Sponge start/final ladders and Counter Hunter Stage II immediately before the underwater region.