Repository navigation
Preserve numeric variable identity across cold checkpoint restore - #8
Merged
Merged
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
GameMaker checkpoint serialization used variable names as identity. Compiled variables with the same empty name collapsed on restore, and runtime-created instance variables lost their bindings; a fresh Undertale restore consequently lost the player name.
Store global and instance slots by numeric VM ID, replacing the cold VM's name map and allocation cursor before restoring values. Preserve undefined slots and independent scopes. Allocation now fails explicitly before signed overflow, including compiled-ID initialization; an exhausted cursor retains existing lookups. The current BSCP v2 contract is updated directly with no historical reader or protocol generation change.
Native coverage exercises
VM_create,Runner_create, andRunner_restoreStateJsonwith synthetic room-creation bytecode, a different cold allocation order, room transition, and legal instance reconstruction. Late failure in the second instance checks normal teardown and subsequent retry under ASAN/leak detection. The complete entry path also exposed and fixes two empty-event UB cases without changing zero-event room behavior. Helper tests retain malformed-input and cell-bound coverage.Validation at
d8e52eb9f0b5df27f74b7c732bc07ac32e34c409: source contract, 11 Web host tests, native checkpoint regression, ASAN/UBSAN with leak detection and halt-on-error, lazy-content and gamepad tests, and protocol gate against original basedb3a882975c0420389fae503ea387e2cce830336pass. CI also passes full/metadata Web builds and candidate validation. Isolated red reproducers confirm the allocator overflow and both empty-event sanitizer findings without the fixes.Actual R21 Retrom product regression passes on this candidate: normal import/review/publication, new 702,880-byte public save, cookie-only fresh-browser restoration with player name B preserved in MENU and STAT, retained room/position, natural unpaused execution, standard direction/confirm input, and normal exit/cleanup. Original images were independently reviewed. Proof SHA-256:
c0ec731789feea06dbe12757e5f19c489a27dedc808921d400eb86b4a88fdabe. Formal release assets still need integration verification in the final paired runtime. Tracks retrom-project/retrom-runtime#116.