The full-game ladder is the test behind the claim that the port plays the whole story. It asks one question: from a cold New Game, how far toward the ending credits does the engine get, and where does it stop? The story is cut into segments between milestones; each segment starts from a real retail save taken at its milestone and is scored on how far the engine gets toward the next one. A separate continuous run plays one New Game straight through on pad input alone. When either falls short, the report names the reason one level down - the script instruction that parked, the door gate that refused, the story flag never set and the disc records that set it - so a stall points at the next thing to fix.
crates/engine-shell/tests/full_game_ladder.rs (part C in full_game_ladder/continuous.rs)scripts/replays/full_game_spine.toml - the milestone list, New Game (opdeene) to the credits crawl (edlast)scripts/replays/full_game_baseline.toml - every score is asserted >=; a drop is a findingLEGAIA_DISC_BIN), the extracted tree and the save library; without them every part prints [skip] and passes. Anchor bytes are read at test time and never committed.Three terms recur below. A scene's script records live in partitions: P0[n] holds placed props and doors, P1[n] NPC and entry records, P2[n] walk-on and spawned records. A walk-on band is a run of tiles that starts a P2 record when stepped on. A story flag is one bit of the system-flag bank, written like 0x227; op 0x3F is the field VM's scene change.
| Instrument | Question |
|---|---|
critical_path_replay | How far a pad run gets along the chapter-1 route, with no seating. |
chapter1_frontier_ladder (parity) | Which chapter-1 scenes load, script, walk and leave - breadth. |
| Chapter-2 / chapter-3 / boss spine oracles | Whether the pinned gates of one story arc sequence through the engine. |
| This ladder | How far each stretch of the whole story gets from a real save there, and how far a cold New Game gets without help. |
The chapter ladders are deeper where they reach; this one is shallow and wide. A stall here names where to point the deep instruments.
The spine is the main-story milestone sequence. Each milestone names its scene and a retail anchor: a save on one of the library's memory cards (card file and save name) or a catalogued save state (scenario label and backup fingerprint). The ladder reads the anchor's SC save window, RAM 0x80084140..0x80086140 - exactly the block a memory card stores (save record) - so a card save and a live state yield the same thing: party records, bag, gold, the system-flag bank at 0x80085758, the scene label and the field position snapshot.
The order is the anchors' own. The two playthrough cards are one run whose play-time counters and flag populations rise together; chapter-1 anchors, which come from several sessions, are ordered by flag inclusion; the ending anchor is a debug credits run that anchors the scene but is excluded from the order check.
Part A re-derives all of it: every anchor loads into the scene the spine names, the flag-inclusion order holds pair by pair, every reach flag is set in its own anchor, and a route between consecutive milestones exists in the disc's scene graph. It prints that route with its hop kinds:
| Arrow | Hop |
|---|---|
> | A 0x3F scene change a walk-on .MAP band reaches. |
=> | A 0x3F only a talk, touch or scripted record carries. |
~fmv~> | An FMV hand-off (4C E2 id) from a walk-on record; the destination is retail's post-play dispatch (FUN_801CEA3C). |
~fmv=> | An FMV hand-off from a record no walk-on band reaches. |
Routes are cheapest-first with walk-on hops preferred, so a => in a route means no all-walk-on route exists. What "reached" means is per milestone: scene (in the scene, walking), control (and the pad is back) or flags (and every reach flag is set). A reach flag is one the anchor gained over its predecessor that a clean partition-2 SET site in that scene writes, per the disc-wide system-flag census; entry-script writes are excluded because they fire on every visit.
The cheapest route is not always the story's. A milestone can name via scenes - story waypoints the anchors show the retail run passed through - and they are visited in order, each with its beats pass played, before the route heads for the milestone itself. Each is justified in the spine by the flags that put it there. Typical reasons:
stone, which holds the Star Pearl that opens the tunnela door; the cheaper elevator route only opens after Xain.conc3 P2[10] sets the 0x3E5 the juui1 hand-off in conc2 tests; dohaty P2[13] sets the 0x1D4 every station placement waits on.koin2 and koin4 for the Sage's Gate chests and the bread they ask for.garmel and vozz the cheapest route walks back out to the overworld; the story's way on is a boss or a scripted flight.A milestone may instead name continuous_via: waypoints only the continuous run plays, where a seeded segment starts past the story or its seated hand cannot play it. Dr. Usha's research and Nivora are the case, and so is Biron (bylon) on both sides of the West Voz Genesis Tree: its first-visit talks turn to the mist once the tree has revived, so a run plays them on the way to the forest and the mist chain, where Gala goes ahead and rejoins, on the way back. With Biron's doors shut on arrival, as in retail, the seeded pad tier plays that chain too (pad_via): the hall door into the west wing opens only once the first-visit talks are done, and the door to East Voz only once the tree has revived.
One pad run cannot cross the game, so the ladder is segmented: segment i seeds the engine at milestone i and asks how far it gets toward milestone i + 1. Segment 0 is seeded by BootSession::start_new_game - the cold opening, not a save. The tiers are cumulative:
| # | Tier | Cleared when |
|---|---|---|
| 0 | none | The seed fails, lands outside its milestone scene, or the seated pass panics. |
| 1 | loads | The seeded save lands in its milestone's scene, Field or WorldMap. |
| 2 | enters | The entry script settles: the pad comes back, or the script leaves the scene itself. |
| 3 | progresses | The next milestone is reached by seated traversal plus the beats pass. |
| 4 | pad | The next milestone is reached with pad input only. |
The headline is how many milestones a cold New Game reaches contiguously at progresses and at pad, plus the tier sum over all segments.
A seed goes through the host's own resume path, BootSession::resume_save, so a segment is a load of a real save. The import carries the whole system-flag bank, the party count and roster, and the field position snapshot where the resume seats the party. The anchor's Field Move option comes in with the other options words, as retail's card load restores it, so the ladder's player runs or walks as the anchor's player did - timed scripts are paced for it. A state anchor taken mid-field has a live position that differs from its snapshot, so the ladder arms SceneHost::set_entry_seat with the live one; a card save seats from its own snapshot.
Every segment above starts from the retail save at its milestone, so it plays with the party, bag and gold a retail player had there. That scores each stretch's doors and scripts; it does not say whether the engine's own run arrives at a stretch able to clear it. Part C asks that. It seeds one session with start_new_game and plays the pad pass toward each milestone in turn, never re-seeding.
[continuous] reached, is the count of milestones reached in order. Its distance from the segmented headline is the measurement: how much of each stretch rests on arriving with a retail player's party.World::save_full; after a party wipe it reloads that save, with the same guard retry and reload allowance the pad tier has.A seeded segment starts from state retail wrote, so anything the engine would have had to write itself before that point is never asked of it. The continuous run is the only pass in which those writes are load-bearing:
0x3B (SET_EQUIP_SLOT, how a Ra-Seru is put on and grows a stage) is the case in point: a mis-applied port still passed every segment, because each seed already wore the Ra-Seru.0x49, the buy list, the quantity stepper and the recipient picker, and with the card held every purchase runs its accrual and toast.The continuous hand is the pad tier's hand plus what a player who means to finish does between fights. On arrival in a field scene it runs one upkeep pass, in this order:
4C 82 restore.In a fight it takes the random encounters it expects to win, pricing each from what the run's fights have cost so far, and runs from the rest; it saves MP for fights it cannot flee, aims its strikes and casts at the foe they land hardest on (stepping retail's angular target ring with Right), and runs past encounters on the way to a staged boss so the party's HP and bag are the boss's. Its options travel with its saves, and it switches Field Move to Run when walking is what holds it - the playthrough's player had by Mt. Rikuroa.
CD F8) is stood in after its talk arms it.4C 70) is examined only from a tile the walk reaches, so korb3's maze opens gate by gate from the hall the party arrives in.B1 <object> 00) plays first each round: bylon's wing switches open the south doors the north entrance shut, the way out to West and East Voz. The pad hand walks to each lever before it pulls it, nearest first, and goes back to its walk at the first press that moves a door: the west wing is an airlock, and its switch only lets the party out when pressed from inside. A prop that tests a flag another prop raises plays after it: dolk's Sunrise Gate takes the key the case gives.taiku's Mist Generator door, played first, left the party where Zora's escape could not reach the lift before the clock ran out.kor's guard dogs wait on 0x40A, which the Sage's Gate spawns once all eight chests in koin2 have each been handed a Soru Bread.dolk2's dealers sell nothing while the festival flag 0x27D is up; the hand finds and plays the record that lowers it, then returns.3E FF and the fight it commits (Cort's arrival in jouine) would skip the boss on reload, so the run keeps its earlier save and walks into such a door ready.LEGAIA_FGL_CONTINUOUS_FROM seeds the run once from a later anchor; its stalls read against the anchor's position before its flags.Under LEGAIA_FGL_TRACE the run prints, at each milestone and at the stall, the engine's own state beside the retail anchor's: levels, XP, HP, MP and equipment bytes, the party, gold and bag, and the flags each side holds that the other does not. It is what tells an engine defect from a weak party:
| The diff shows | Reading |
|---|---|
| An equipment byte or bag item retail holds and the engine never gained | A scripted grant: find the op that writes it in the scene the anchors bracket. |
| A member in the roster with no record line (zero max HP) | A join that found no template row. |
| Lower level and XP, same equipment | Growth: the hand fled or the fights paid nothing. |
| Flags the anchor has and the engine lacks | Beats retail played that the hand walked past (optional ones show here too). |
| Flags the engine has and the anchor lacks | A beat retail had not played yet, or a latch. |
A ratchet, not a guarantee
Every random draw - the encounter step, the formation, the escape roll, enemy targeting - comes off one world rand stream, so a change that shifts one draw re-deals every later fight. The baseline therefore records the continuous score on several dealt streams ([continuous_seeds], one row per LEGAIA_FGL_RNG_SEED), and each dealt run asserts its own row.
Seated traversal follows the route hop by hop. On a field scene it seats the player one tile off a walk-on door and then onto it, so the engine's own tile-change dispatch fires the door record; on the overworld it seats the player on the installed portal. The engine does the scene change; the ladder only places the player. A hop that still fails after the scene's beats have run marks its edge dead, and the route is recomputed around it.
The beats pass runs once per scene visit - and again when the story returns to a scene with new flags - when the scene is the target with its reach flags unset, at a waypoint, or when a hop's door does not fire. It approaches every boss stager whose park gate is clear, every round until a contact gains nothing, and talks to the NPCs whose records reach a flag the next anchor carries or a destination the route needs.
The pad tier repeats the route from a fresh seed with the random-encounter roll armed, and plays the same waypoints and beats with pad input only. It plans with an A* search over the collision lattice (World::field_dir_blocked and the actor boxes) and follows the plan with a walker that inverts the live camera remap. The planner models the two ways a field map joins its own parts - a town's house interiors sit in the same map as its street:
31 00);31 00 - opens itself on contact or on the action button, which the follower taps when held against it.Where the start's walk component cannot reach the door, a pad hop tries a crossing scene. Ledge hops, warp pads that read their own floor list, clocks and timed switches are each modelled where the route needs them.
_DAT_8007B6B4): every map install seats 0x28 frames of it, the field-back load after each fight included, and a conversation's release 0x10. The pad controller and its menu accept sit it out, so a Start sent into it is lost; the heal and dress passes after a fight press only once it is out.BootSession::tick routes the naming prompt's pad edges and drains the per-tick queues as both play hosts do, so a headless driver that only ticks crosses the opening.A battle is fought through the command ring, one pad edge at a time, by a fighter shaped like a player. For each member, in priority order:
+0x16E & 0x38) close their own directions, and the plan keeps to the open ones.A member is in danger when it is under 45% of its HP (three fifths against a boss far above the party's HP), or cannot survive another loss the size of the biggest it took between two of the party's command windows - a round, not a hit.
Random encounters that interrupt a segmented pad walk are fled through the round prompt's Run, unless the fight forbids running; after two failed runs with nothing to heal with, against foes the party can plausibly beat, the hand fights instead. Guards and boss reads: a foe that winds up - a charge body that sets its caster's ability latch and deals nothing - is guarded against on the turn its blow lands, and a boss lost to once is retried with its element guarded.
Tick caps. A fight runs at least 60 000 ticks and continues while a foe's HP is still dropping, up to 600 000; it is unresolved only once 36 000 ticks pass with no foe losing HP.
Part B prints one table row per segment and a stall list. Each stall line is one level down from the tier that failed:
| Line shape | Meaning |
|---|---|
seed: ... / seed landed A in <mode> | The resume failed or did not land walking in the milestone's scene (tier 0). |
entry script never released: <holder> ... op=.. | The pad holder - cutscene timeline, dialogue, spawned record - parked on that instruction for a whole window. |
hop A -> B: no walk-on door to B | The scene change is carried by a talk, touch or scripted record that seating cannot trigger, and no talk the ladder finds leads there. |
no overworld portal to B installed | The overworld seeder installed no portal to B under the live flags; the portal set is printed. |
N door(s) to B, none fired: ... gates FAIL: 0x.. clear | The door record's story gates (retail FUN_8003BDE0) refuse it; the failing flags are named. |
B is reached by an FMV hand-off ... | The hop is a movie whose trigger record is not on a walk-on band. |
reach flag(s) 0x.. never set | The target scene was reached but the beat that separates the milestones did not play. |
battle unresolved ...: action SM ctx[7]=0x.. | The fight ran out its budget in that action state (FUN_801E295C). |
party wiped: ... | The fighter lost. |
no walkable path ... / pad walk stalled at tile .. | The lattice cannot reach the door, or the follower stopped making progress on a path that exists. |
PANIC: ... | An engine panic, caught per segment. |
Under each failed seated segment the ladder lists the flags the next anchor has that the engine never set, each with the disc sites that set it (scene, partition, record) from the system-flag census - usually naming the record to look at next.
Two stalls that are not what they look like
An unresolved battle is not proof of a parked engine. The line prints the action state on the tick the budget ran out; a fight still trading blows reaches the cap as readily as one that froze. LEGAIA_FGL_TRACE=1 LEGAIA_FGL_TRACE_HITS=1 settles it: a parked engine shows no [commit] and no [hit] after some tick, an outlasted hand shows commits to the end.
A pad wipe that moves with an unrelated change is first a rand-stream question. Any change in how many draws happen before a fight - gating a fog region, say - deals every later fight another hand. Run the segment under a spread of LEGAIA_FGL_RNG_SEED values and count the wipes; the fragility is often a property of the anchor (a lone member at low HP) rather than of the hand.
A third shape is a boss the anchor's party cannot outlast: the hand's damage rolls are right - every term reads off the disassembly - but the party saved at that anchor cannot survive the boss's turns, and the fix belongs in what the fighter chooses (guards, healing order, MP top-ups) rather than in the engine.
With its wall-clock fields stripped, the trace of part C and of part B is byte-identical across runs of one binary on one stream. Nothing the hand does may follow a std HashMap's iteration order, which is drawn per process: town0d has three talks that lead to jou, and the order they are walked in moves every later frame number in a run that still reaches every milestone. A trace that moves on one binary is checked first by preloading a getrandom that returns a fixed stream, which pins the hash keys and leaves time, threads and heap addresses live.
Trace switches, all environment variables:
| Variable | Prints |
|---|---|
LEGAIA_FGL_TRACE=1 | One line per beat played, hop failures, [battle] start and end lines, per-segment frame and planner cost, and part C's aim and carried-state lines. |
LEGAIA_FGL_TRACE_BATTLE=1 / _HITS=1 | A battle line every 1000 ticks / each HP change with its actor and action state. |
LEGAIA_FGL_CAPS=1 | Each script context the engine's anti-hang timeline cap ends. Retail has no such cap, so each line is a record the engine cut short. |
LEGAIA_FGL_PAD_DEBUG, _SHOP_DEBUG, _HEAL_DEBUG | The fighter's pad and menu windows in a stuck fight; each shop and field-heal pad edge. |
LEGAIA_FGL_WALK_DEBUG, _PLAN_DEBUG, _COMP_DEBUG, _JUMP_DEBUG, _CLOCK_DEBUG, _POS_TRACE | A stalled walk's wall map, the planner's door edges, the tile map of a failed walk component, door and lift rides, clock flags, scripted movement. |
LEGAIA_FGL_PROBE_AT=<scene>:<x>,<z>;U;R;... | Seats the player and holds each listed direction, printing where it went - asking the engine, not the lattice, whether a spot can be walked off. |
LEGAIA_FGL_EDGES, _GAINED, _SITES | Part A: a scene's in- and out-edges; the flags a milestone's anchor gained with their disc SET sites; every site that sets or clears a named flag. |
The extracted tree and the save library default to extracted/ and saves/library/ under the repo root; point a worktree at the main checkout's copies:
LEGAIA_EXTRACTED_DIR=/path/to/extracted LEGAIA_SAVES_LIBRARY=/path/to/saves/library cargo test -p legaia-engine-shell --profile release-test --test integration full_game_ladder:: -- --nocapture --test-threads 1| Variable | Effect |
|---|---|
LEGAIA_FGL_ONLY=<id>,... | Runs only the segments ending at those milestones; no baseline assert. |
LEGAIA_FGL_NO_PAD=1 | Skips the pad tier. |
LEGAIA_FGL_RNG_SEED=<u32> | Deals the pad segments and part C another hand of the world rand stream; part C asserts the matching [continuous_seeds] row. |
LEGAIA_FGL_SEATED_RNG_SEED=<u32> | The same for the seated pass. |
LEGAIA_FGL_PIN_RETAIL=1 | Pins every fidelity toggle to retail (WorldToggles::pin_retail), so both parts measure the retail-faithful mode. |
LEGAIA_FGL_SOLID_NPCS=0 | Lets the pad tier walk through NPC bodies. The default keeps them solid, as both play hosts do; a run with them off is a probe, not the measured configuration. |
LEGAIA_FGL_CHECKPOINT_DIR=<dir> | Part C keeps its own save at each milestone (disc-derived state: keep it under target/). |
LEGAIA_FGL_CONTINUOUS_FROM / _RESUME / _UNTIL=<id> | Start part C from a later anchor, resume it from a kept checkpoint, or stop it at a milestone - probes for one stretch, none of which assert the baseline. |
The ratchet asserts every per-segment tier, both headline counts and the tier sum >= the baseline. Raise the baseline in a reviewed edit from the block the run prints; never lower it to make a red run green. A full continuous run is a whole New Game, so the seed set is run one seed at a time.
Both play hosts make NPC bodies solid, and so does the ladder (LEGAIA_FGL_SOLID_NPCS=0 turns them off). A body stops the walk exactly as it stops a player, and the pad hand has to go round it or be let past by the story:
A body can also be a story gate, and then no route is the right answer: some guards stand in the only way on until a story branch moves them, and the route plays the scenes that do. Nivora Ravine is one: sixteen BLOCK placements stand round the landing until Dr. Usha's research is done, and the entry script retires them only then. A run that left Dr. Usha's lab town without that flag reached Nivora boxed in, which is how the solid-body run found that its hand stood in the intercom's box a few units short of where the intercom answers.
Sol Tower's guard dogs are another. They hold a doorway until eight chests have each been fed a loaf of bread the party has to buy, 48,000 gold in all. With bodies passable the walk went through the dogs, so a run that never fed the chests still scored the stretch; with them solid it has to earn the gold. When fighting out of the bag leaves the purse short, the hand walks back up to the last keeper who rested the party, fights from that bed until the coin in hand pays for the bread and the heals a counter sells first, and only then goes shopping.
0x3F names and FMV hand-offs; a flight or cart an entry script spawns is taken on arrival, which the graph does not model.The full page keeps a long list of scene-specific facts the route and the pad hand depend on, each a property of the disc's scripts cited by scene and record. They fall into four groups:
| Group | What it covers |
|---|---|
| Split parties, pickers and staged fights | Three-actor talks (43 02) where each member stands in its own part of the map and Square hands control on; how a script's picker is answered; staged boss fights on walk-on bands. |
| Sol Tower | The warp pads that read their own floor list (op 0x49 sub-op 4) and branch to one scene change per floor; the stone maze in korb3 and Gaza's fights. |
| Nivora | The Three Tunnels split, the boulders and the flags nilboa's entry script raises; Uru Mais and its three dreams. |
| Overworld and dungeon joins | Where the overworld's static collision grid splits into separate walk components, and which story beat (a drained water gate, a thawed route south) joins them. |