Document architecture checkpoint and restore original task callback order
This commit is contained in:
1 parent
69d0187a21
commit
531883aaac
45 files changed
+2935
-43
No files matched your search
@@ -0,0 +1,194 @@
|
||||
# Ordinary scene loader and editor reset boundary
|
||||
|
||||
Read-only C7 follow-up, 2026-10-25. Original `Neutron.exe` SHA-256
|
||||
`f5281076e1a2492f2d61f87aae3f4544b6d0f535ebe33f9fbb6f78710fe1aea8`.
|
||||
Every VA in this report is in that module at preferred base400000. The inspected
|
||||
sites map to file offset **VA−400000**; `checkpoint_scene_loader.py` independently
|
||||
maps PE sections and emits each VA/raw offset/bytes/vtable dependency. Static
|
||||
facts do not constitute original runtime verification. No originals were executed
|
||||
or modified; modern gameplay was not changed for this investigation.
|
||||
|
||||
## Main result
|
||||
|
||||
The ordinary scene request is owned by the long-lived **CEditor** application
|
||||
object at global509980, not by the current level game object509948 or the queued
|
||||
TSK reader. Its deferred loader selectively tears down scene objects, loads GAM
|
||||
records, then invokes per-object initialization and actual PostLoad. Jimmy and
|
||||
Goddard constructors explicitly select survival through that teardown predicate
|
||||
and mark themselves reusable. The enclosing retention/reuse contract is recovered;
|
||||
class initialization and PostLoad still reset fields independently.
|
||||
|
||||
The previously unresolved “reset flag”50988A is **keyboard R** in the input array,
|
||||
and its acquired-item reset consumer is **Jimmy's editor update**, not ordinary
|
||||
loading. Do not turn it into a gameplay load/reset policy.
|
||||
|
||||
## Receiver, request and consumption chain
|
||||
|
||||
| Link / state | Source fact / offset |
|
||||
|---|---|
|
||||
|Application identity|Bootstrap46A641 calls constructor46B160; constructor46B200 installs complete vtable4D5EA0 and46B237 stores this in509980. Literal4F57D8 is`CEditor()`. Bootstrap46A654 also stores the returned pointer.|
|
||||
|Player request|43B7F1 dispatches slot100 on509980 after staging strings and departure root.4D5EA0+100→46DF70.|
|
||||
|Deferred state|46DF76 writes byte app+74C=1;46DF7D selects filename buffer+74D and copies the argument. This is one pending flag/name, not a demonstrated multi-request queue.|
|
||||
|Application update|4D5EA0+C4→46BEC0; its final46C052 checks+74C and46C05E invokes104→46DFF0. Earlier update logic includes an alternate signed frame countdown+7FA that can also set+74C at46BEDF.|
|
||||
|Consume request|46DFF0 checks+74C again and performs teardown;46E152 dispatches app+FC→46E170 with stored filename and−1;46E158 clears+74C after return.|
|
||||
|Load completion|46E170 reads GAM, creates/reuses records;46E4FF dispatches app128→46E570. This closes the formerly missing source edge to actual placement PostLoad.|
|
||||
|Placement pass|46E570 registry traversal calls each object's28 at46E5C3, then40C at46E61A; Jimmy4A373C+40C→423610. At traversal end46E681 invokes app10C and46E694 resets the performance timer47E470.|
|
||||
|
||||
App10C resolves46E710. Its inspected body traverses registry and logs object
|
||||
tag/class/id; do not label it a cleanup/free operation solely because callers
|
||||
surround it with “gcu” logs. App+7A4 receives the currently loading filename at
|
||||
46E19F; pending+74D and current+7A4 are separate strings.
|
||||
|
||||
## Teardown phases and survival predicate
|
||||
|
||||
46DFF0 first calls app10C and479000, then makes three registry50999C passes.
|
||||
Each pass calls object slot200, which for Jimmy/Carl/lab game interfaces resolves
|
||||
4719B0: return byte **interface+139**.
|
||||
|
||||
1. If predicate nonzero, call object20 at46E054 (logs “Uniniting”).
|
||||
2. If predicate nonzero, call object34 at46E091 (same log).
|
||||
3. If predicate nonzero, set interface+6=1 at46E0CA (“Delme”).
|
||||
|
||||
46E0D9 calls473710, which repeatedly finds a marked interface+6 object and calls
|
||||
its slot0 with argument1, restarting traversal after deletion. Thus this is
|
||||
selective teardown; the “Deleted all objects” log is not proof of universal
|
||||
destruction.4685F0 and app10C run next;46E117 calls46B000, which traverses a
|
||||
database registry and closes referenced databases. Exact meaning of479000 and
|
||||
4685F0 is outside this bounded audit and remains unnamed here.
|
||||
|
||||
**Survival provenance.** Generic setter470F40 writes supplied byte tointerface+11
|
||||
then calls slot204; Jimmy/Carl204 resolves4719C0, storinginterface+139. Generic
|
||||
constructor46FDB3..B7 passes1; Jimmy constructor4226B5..BF passes zero instead,
|
||||
and Goddard41C99B..99E does likewise. Jimmy and Goddard therefore start with the
|
||||
non-destructible predicate. This explains why the departure root/RETURN flags
|
||||
can be fields on the character object across a scene change. It does not prove
|
||||
every character field remains unchanged: initialization, property loading,
|
||||
gadget cleanup and PostLoad can reset fields independently.
|
||||
|
||||
The lab game object also explicitly sets predicate0 at44D456/44D472. An object's
|
||||
retention and the current-level global509948 are distinct: GAM loading assigns
|
||||
509948 to the destination's game object at46E360 after factory construction.
|
||||
Further class-specific lifecycle flags or later predicate changes require their
|
||||
own evidence; do not generalize the constructor default into a full object map.
|
||||
|
||||
**Critical integration consistency gate: old level-game ownership.** The lab game
|
||||
is itself selected for preservation (interface4C386C slots200/204 resolve
|
||||
4719B0/C0;44D456 pushes0 before44D472 dispatches204). Ordinary GAM loading then
|
||||
constructs a new destination game. A bounded inspection of46E170 through factory
|
||||
46E335 found prefix46E26C→4766E0, whose literal is`UnInitCaptions()` and whose
|
||||
registry is5099FC;46E271→479000 clears physics records rooted509B04. Neither
|
||||
inspected prefix identifies an old509948 game destructor.
|
||||
|
||||
The lab constructor chain44F300→44F358/44D2B0→44D306/4745A0 was also inspected.
|
||||
4745A0 constructs/links a new OMT element (IAT48D284 is OMediaElement constructor;
|
||||
48D320 is OMediaElement::link), registers its game interface, clears control via
|
||||
475A40(0) at474683, then overwrites global509948 at474688. No explicit old-game
|
||||
destructor/removal was established in this inspected chain. **Overwriting the
|
||||
current-game pointer does not remove an old game from registry50999C.**
|
||||
|
||||
Consequently the remaining contract must include the old level-game registry
|
||||
membership and callback eligibility: locate its explicit removal/deactivation
|
||||
or account for its retained28/40C/update callbacks. Do not infer a clean sequence
|
||||
containing only Jimmy/Goddard plus the new game from selective deletion alone.
|
||||
Possible later class/OMT ownership effects remain open; this negative bounded
|
||||
audit does not prove that old games accumulate or remain active at runtime.
|
||||
|
||||
## GAM construction/reuse and initialization
|
||||
|
||||
46E170 builds`gam\\`+filename, opens a bounded original stream, reads FourCC, and
|
||||
uses class factory459CB0 for the game. Factory-returned game interface is shifted
|
||||
by−8C to its complete object and stored as current game509948. It then reads
|
||||
entity count and serialized objects. For each class/ObjectID it asks app11C
|
||||
(46E45A), resolving46E6A0: scan registry for matchinginterface+404 and require
|
||||
interface byte+9 nonzero. App110 (46E46E) resolves46E6E0: return the matching
|
||||
interface. Otherwise46E49A calls factory459CB0. The object's property stream is
|
||||
read at46E3FD through IAT48D190 before proceeding to the next record.
|
||||
|
||||
**Coordinated constructor proof.** The loop/registry investigator independently
|
||||
recovered Jimmy42275A and Goddard41C9C0 writing complete+C9=1, which is game
|
||||
interface+9. Both exact sequences are now guarded by this report's helper too.
|
||||
Together with their zero destruction predicate, this establishes that Jimmy and
|
||||
Goddard are retained and can be reused by class code. Factory3JIM branch45B1C1
|
||||
allocates and calls constructor422160 when no reusable object qualifies; it is
|
||||
not itself a singleton lookup. Other surviving classes need their own+9 proof.
|
||||
See [lab-registry.md](lab-registry.md) for insertion order and constructor details.
|
||||
|
||||
After successful stream close,46E4FF→app12846E570 processes the resulting live
|
||||
registry in order. It invokes object28, handles attached render-object state,
|
||||
then object40C, handles attached render state again, then advances registry.
|
||||
These are per-object boundaries, not “initialize all, then PostLoad all.” Jimmy's
|
||||
28 is437890; it calls4587F0→470540 and resets movement fieldsinterface+608/+614/
|
||||
+618 and captures another velocity component+61C. Jimmy40C423610 applies:
|
||||
|
||||
1. Matching source STRT root42399D and rotation4239E6.
|
||||
2. Existing companion source root423A36.
|
||||
3. Pending RETURN flag test423A90 and clear423A9E.
|
||||
4. Saved departure root423ABF; identical companion root423B1E.
|
||||
5. Game control assignment423B3D, followed by viewport camera fields423B43.
|
||||
|
||||
STRT's own40C callback and trigger-suppression flag consumption run at its
|
||||
position in that same registry pass. The exact registry ordering for the
|
||||
lab/practice route still needs a construction trace. Existing recovered placement
|
||||
and suppression behavior stays valid; its enclosing temporal interactions must
|
||||
be tested when implementing retention.
|
||||
|
||||
## Acquired reset belongs to editor input
|
||||
|
||||
Key handlers46A360/380 read virtual-key byte and set/clear509838[key] at46A370/
|
||||
46A390.50988A−509838=52hex, ASCII/Windows virtual key **R**. Therefore4235D8
|
||||
reads R, not a scene-loader-owned flag. If pressed,4235E2 sets count1068hex=4200,
|
||||
4235E9 chooses4F8438 and4235EE clears4200 integers; it then iterates29 group2
|
||||
inventory entries through403910.
|
||||
|
||||
Jimmy interface slot3C8→4235B0. Wrapper470280 chooses3C8 at4702B5 only when
|
||||
app509980 exists and byteapp+8C is nonzero; otherwise4702C5 chooses normal3C4
|
||||
Jimmy424600. This matches the current source naming of editor versus normal
|
||||
update. The reset routine also handles a saved sound/effect handle before the
|
||||
key test. It is not present as an unconditional phase in46DFF0/46E170.
|
||||
|
||||
## Route persistence versus TSK load
|
||||
|
||||
| State / event | Ordinary lab→VR04→lab→outside | TSK reader4603F0 |
|
||||
|---|---|---|
|
||||
|Request owner|CEditor app+74C/+74D, consumed in app update|Globals4FC67C/4FC604, consumed by460EA0; distinct request path|
|
||||
|Character root/RETURN fields|Character stores+9A8 and transient954/9A5; predicate selects retention, PostLoad consumes flags|Reader restores three departure floats; flags are absent from file|
|
||||
|GAM properties/actors|Selective teardown, class factory/reuse, per-object28→40C|Does not itself execute this ordinary scene teardown/GAM loader|
|
||||
|Task assignment|Class initialization/task callbacks depend on registry and source task records|Calls45F990, then duplicate matching424; positive task-count path finally invokes all-object420; distinct from40C|
|
||||
|Acquired items|No unconditional4200 reset found in this chain; R reset is editor-only|Explicit4200 serialized integers read into globaltable|
|
||||
|Score, energy, inventory, objective|Global ownership; no blanket zeroing in inspected loader. Jimmy construction itself sets energy20 at4226E5, making exact reuse significant.|Reader restores explicit fields/inventory/task data|
|
||||
|Clocks/render/audio|PostLoad resets performance timer; database closes and render attachment phases exist. Exact per-bank/handle ownership pending.|Reader has its own stream/object callbacks; not a complete scene lifecycle|
|
||||
|
||||
**Current implementation at baseline69d0187.** Program carries OriginalSave
|
||||
snapshots and explicit RETURN root/identity while reconstructing scene actors,
|
||||
physics and audio, with application-owned RenderSession kept alive. This is a
|
||||
useful playable testing harness; it is not the recovered retained-object loader.
|
||||
Keep its presentation ownership as the user-authorized modern policy. Do not
|
||||
force original editor R semantics into the game's current R reset control.
|
||||
|
||||
## Bounded continuation gate
|
||||
|
||||
1. Resolve old level-game removal/deactivation and callback eligibility across
|
||||
destination construction. Then trace a retained Jimmy through one departure,
|
||||
identifying every mutation
|
||||
from property load, initialization and PostLoad. Constructor evidence closes
|
||||
byte+9 ownership; it does not substitute for this per-field reset trace.
|
||||
2. Build an event trace covering request, three teardown passes, destructor,
|
||||
property load, per-object28/40C, STRT suppression and first input/physics tick.
|
||||
Use source target/vtable evidence; test retained versus recreated objects.
|
||||
3. Map per-level class constructors/initializers' score/energy/inventory writes
|
||||
before adopting global persistence beyond the demonstrated route.
|
||||
4. Contrast ordinary load trace against queued TSK load and its duplicate424/420
|
||||
callbacks. Preserve full wire data and do not silently serialize transient
|
||||
RETURN flags or reinterpret StoredVector as immediate position.
|
||||
|
||||
The loader retention contract can now support a bounded state-container design;
|
||||
transferring every arbitrary field unchanged would still be unsupported. The
|
||||
source chain and editor-reset correction replace an unbounded “loader unknown”
|
||||
task with these concrete tests.
|
||||
|
||||
Validation: five Python tests pass, covering the original hash,39 exact byte
|
||||
sites,14 virtual targets, object factory/destruction/timer dependencies and R key
|
||||
identity. Run `python3 -m unittest discover -s tests -p
|
||||
test_checkpoint_scene_loader.py -v`. Helper JSON is reproducible with
|
||||
`python3 tools/binary/checkpoint_scene_loader.py ../Original`. These are static
|
||||
evidence checks, not original or port runtime verification.
|
||||
Reference in new issue
Block a user