Skip to content

compat(M4): restore native actors and ordinary battle decision continuations - #279

Closed
Roxas2712 wants to merge 148 commits into
UNDERdecoded:mainfrom
Roxas2712:codex/upstream-native-checkpoints
Closed

Roxas2712 wants to merge 148 commits into
UNDERdecoded:mainfrom
Roxas2712:codex/upstream-native-checkpoints

Conversation

@Roxas2712

@Roxas2712 Roxas2712 commented Oct 26, 2026 •

Copy link
Copy Markdown

Mods at API 1/2/3 can capture, restore and resume native checkpoint data through the save/controller services. Settled overworld checkpoints now retain wandering and mid-step NPCs, script placements, native followers, connected-map actors and map patches. Ordinary wild/trainer player decisions reconstruct fresh battle owners, party/stat aliases, volatile state and RNG. Proven native trainer/static completions and built-in data-only start_battle rows resume through fresh owners; coroutines and callbacks are never serialized.

src/core/CheckpointActors.lua, CheckpointBattle.lua, CheckpointScript.lua and the private native factories implement reconstruction with preflight validation, full recapture verification and rollback. Saved mod progress rewinds; current options and separate mod storage remain current. Normal entry hooks stay quiet until the single committed checkpoint.restored event. Battle provenance is owned by the live battle and releases retired callback/coroutine graphs under GC.

Qualified safe points exclude link/multiplayer, Safari/ghost/demo/special battles, forced actions, concurrent scripts, opaque callbacks/custom RNG and native VM call stacks. These operations fail with named refusals. Legacy format-1 static/spinner checkpoints remain readable under their admission rules.

Current upstream refresh: merged 8d5b4387 and qualified runtime d2551170. All 168/168 engine suites, the other four acceptance gates, and 14,520 real-LÖVE assertions on each of 11.5 and 12 pass again. The battle continuation suite now has 858 assertions and restores post-turn decisions as well as checking future-state equality. Native Gen4 field/side state, boolean side keys and chosen-action ownership rewind; an optional existing native move factory reconstructs learned-slot PP bindings without saving metatables. Unqualified dynamic gym controllers and delegated action metadata/references remain named refusals.

Earlier validation on runtime revisions 9532ee36 (composed fork) and 13808f9d (public host):

  • Fork: 493/493 engine suites; public host: 168/168. Both pass all 3 SDK suites, 253 gallery checks, the pinned API-3 contract (200 fork / 48 public comparisons) and all 17 unchanged external fixture entrypoints in complete mode.
  • CPU suites cover all host selections: 18 in the fork, 15 in the public host. Actual native trainer/static producers, data-only story suffixes, malformed payload preflight, partial-apply rollback, title resume and next-turn equivalence are exercised.
  • Actual LÖVE 11.5 and 12 each pass 14,520 assertions on both trees: 384 updates of four spinner modes in Red/Gold, plus 192 complete native world updates and two actual battle turns across eight representative editions at API 1/2/3. Every future checkpoint and RNG value must match after rewind.
  • Native-host content is synthetic and graphics are substituted. No full-ROM story or GPU acceptance is claimed. FrameProfile checkpoint timings: not measured; this additive compatibility service has no performance rollback switch.

The public acceptance stack reuses existing repair PRs #128–#134 and #294; no duplicate repair PRs were created. One existing RTC subscription uses the literal spelling recognized by the coverage gate; no assertions or native producers were removed. The old inherited failures are resolved on this stack.

See native checkpoint ownership and safe points and recorded qualification. These supersede the earlier static/spinner-only scope.

Original contributions by Roxas2712 are offered to Cedric / UNDERdecoded under the specific contribution grant; existing copyright and licence notices remain intact.

Final fork integration is pushed. Full-engine 561/561 evidence remains pinned to a6f947a5; subsequent runtime 8e336d45 passes 22/22 affected engine suites, every required SDK/gallery/contract/unchanged-fixture gate, and 14,520 actual native checkpoint assertions on each of LÖVE 11.5 and 12. Concurrent friend/suspend and native Gen2 output changes are retained. This is not presented as a full-suite rerun of the later revision. Exact revisions, standalone dependency boundaries and unchanged performance-measurement sources are recorded in the current qualification ledger.

# Conflicts:
#	src/mods/Loader.lua
# Conflicts:
#	docs/modding.md
#	src/mods/Loader.lua
#	src/world/WorldAPI.lua
@Roxas2712 Roxas2712 changed the title compat(M4): add native overworld checkpoint transactions compat(M4): add native overworld checkpoints with spinner continuation Oct 26, 2026
@Roxas2712 Roxas2712 changed the title compat(M4): add native overworld checkpoints with spinner continuation compat(M4): restore native actors and ordinary battle decision continuations Oct 26, 2026
@Roxas2712
Roxas2712 marked this pull request as ready for review October 26, 2026 16:53
@Roxas2712 Roxas2712 closed this Nov 4, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant