Preserve contact-owned roots and independent body modes

This commit is contained in:
UnixNight committed 2026-11-05 11:06:13 -05:00
1 parent 3845ea7114
commit c9d0c5be59
25 files changed
+16388 -74

No files matched your search

@@ -0,0 +1,79 @@
# Body callback ownership implementation
2026-11-05. Continues Jimmy movement after the air/render checkpoint27be8ed.
Current lab/outside capsule and all special-contact admission gates are preserved.
This implements the body publication/mode prerequisites, not new climb/hazard
mechanics or a complete original body in every level.
## Evidence and implementation
[Root publication](body-root-publication.md) records19 new original component
cases using actual copied479D20/47B4B0/kernel. [Body modes](body-modes.md) records87
new observations using full479D20/support/friction and a synthetic dispatcher.
Both reuse retained REA Evidence and guard original spans/offsets/provenance.
`OriginalBodyState` now retains finite live-root W, source previous Vec4, support
anchor and independent `BodyModes`: integration210, support1C8, collision220,
world response1D0 and alternate228. Nullable modes mean the ordinary constructor
defaults; the explicit point constructor supplies W1. Scooter reset now uses that
point constructor instead of zero-initializing W through default(struct).
`OrdinaryBodyStep.PreviousPosition` deliberately stays the frame-entry XYZ
diagnostic consumed by the existing provisional dynamic adapter. It is not used
as a substitute for the newly retained previous Vec4.
- Support clear precedes the integration gate. Inactive integration preserves
roots, anchor, pending work and the existing collision context, then returns.
- The geometry argument/global getter remains independent of body modes. Global
geometry-off follows the recovered gravity/support policy. A scene getter
optionally models support's fresh global read after callbacks.
- World response-off copies current root to previous and translates, retaining
gravity/impulse, optional support/friction and the previous static context.
- Collision-off translates or holds according to228, preserves previous root,
skips support/friction and still reaches suppression. Neither unclipped branch
acquires the world branch's−25000 candidate clamp.
- World callbacks now receive the live entry root, not the tentative clipped
candidate. They may edit live/previous independently. Fresh XYZW equality
controls publication of the precomputed candidate and its original W. Callback
roots rejected by that barrier receive neither old fallingY nor candidate clamp.
Changing both roots to equal still permits the old candidate to overwrite them.
- Support uses fresh live/previous XYZ after publication/rejection. Landing37C
observes the floor root, anchor and zeroed vertical acceleration but old velocity.
Callback root/anchor/acceleration/impulse/modes survive; source cached VX/Z plus
Y0 and supported=true are published afterward. Friction/suppression read current
speed/motion and retain their own ownership.
- The existing wall hook remains wall-only. Ordinary/profile ceiling/reflection
behavior is kept separate. Static context resets only in the world branch;
other branches retain it, reporting zero new traversal work.
`tests/GamePort.BodyOwnershipTests` compares81 complete native mode/landing outputs
and19 root outputs. The17 native root-isolation cases no-op support; the managed
support gate mirrors those publication outputs, while two cases execute actual
support in both implementations. For six native synthetic-dispatch mutation cases,
a real wall delivers the managed callback: owned state/flags/branch continuation
compare, while intentionally different clipped XYZ is not claimed as numeric
conformance. All100 complete comparisons and six state comparisons pass.
Existing20 body,13 Scooter and13 Grappler groups pass in initial targeted runs.
Artifacts: artifacts/body-contact-integration/{ownership-initial,body-initial,
scooter-initial,grappler-initial,build-initial}.log. The full regression, native and
package results are recorded below as verification finishes.
## Remaining integration boundary
No real Jimmy material120..129/110..119/FENCE/LADDER callback is enabled here.
Animation acceptance/end/fallback, hazard/impulse updater4255C0, successful ray
filters, control/facing/action state, dynamic eligibility and scene-wide shared
collision globals still need separate recovery and runtime proof. No callback is
classified ordinary merely to bypass constructor rejection.
LabSimulation still reconstructs the admitted ordinary body each pass; actual
multi-frame special modes must persist actor state when their callbacks are
integrated. Vehicles/projectiles already retain their body records. The per-body
static context remains a bounded approximation of original scene-global ownership.
Radius/factor/friction/suppression arguments remain fixed during the admitted
pass; reentrant/nested body updates and other mutable getter side effects are not
established by these finite probes. Modern F3 noclip is a separate policy.
The root record adds no TSK/save fields or runtime original-code dependency.
Physics remains independent of raw player control. The existing rendering/air
state and upright local alignment from the previous checkpoint are preserved.
+131
View File
@@ -0,0 +1,131 @@
# Body modes and post-callback ownership
2026-11-05. This closes a bounded prerequisite for Jimmy's special contacts; it
does not enable new terrain/climb policies or replace the lab/outside capsule.
The authoritative EXE SHA256 is
`f5281076e1a2492f2d61f87aae3f4544b6d0f535ebe33f9fbb6f78710fe1aea8`.
JN-Engine gameplay is not the oracle. Retained REA instruction Evidence
`ev_0d64cc58fa8f5573fc8e61e0f2c20e36288099212bd2257d3a3121361fd6c904`
is artifacts/jimmy-movement-audit/rea-original-disassembly.json; the original
479D20 procedure Evidence is
`ev_5439072b32ae9f9208795ad2b07bc524e2407b46da487072fb3dfd8c10e7c4b0`.
No unchanged failed Ghidra selector was repeated. This investigation reuses those
instructions and independently guards the complete body/support/friction spans.
## Source branch and state map
Addresses are EXE VAs; raw offsets equal VA−400000 in these PE-mapped spans.
Slot numbers refer to the body/game interface, Jimmy complete object+C0.
The generic data fields and initialization are separately recorded in
[body composition](collision-body-composition-source.md).
| Source VA / raw offset | Recovered phase |
|---|---|
|479D2E/479D34 /79D2E/79D34|Read supported218; cache prior support695D49 even if integration will reject.|
|479D3D..479D4E /79D3D..79D4E|If support handling1C8, clear supported21C(false). Otherwise preserve the previous supported flag.|
|479D58..479D60 /79D58..79D60|Integration210=false returns after those effects: root/previous/anchor, impulse, velocity, acceleration, angular velocity and static context remain unchanged.|
|479DDA..479E54 /79DDA..79E54|Global geometry4F69E5=true publishes anchor(0,−25000,0). False publishes supported=true, anchor(0,currentY,0), acceleration(0,+800,0), velocity(oldX,0,oldZ). Pending impulse still applies later.|
|479E63..479FD2 /79E63..79FD2|Rotate by angular×dt; consume impulse once; add acceleration then gravity separately; compute displacement from final velocity.|
|479FD6 /79FD6|Collision220 gates the post-integration branch.|
|479FE8 /79FE8|When collision=true, world-response1D0 selects clipping versus direct translation. This is not the integration/global-geometry gate.|
|47A038..47A096 /7A038..7A096|World branch alone resets last polygon/nearest face130000/nearest edge radius/auxiliary; captures full live root into previous2FC, then dispatches world traversal.|
|47A123..47A1C4 /7A123..7A1C4|World path compares fresh previous/live Vec4; equality permits candidate clampY≥−25000/publication314. See the independent root-publication investigation.|
|47A1CC..47A220 /7A1CC..7A220|Collision=true/world-response=false copies live Vec4 to previous, then translates31C(displacement). No static-context reset, world dispatch or−25000 clamp.|
|47A22A /7A22A|Fresh support1C8 read after world callback/publication/direct translation; true calls47B890.|
|47B890 /7B890|Support independently rereads global geometry. False skips its query/result publication; it does not retroactively cancel the gravity already consumed earlier in479D20.|
|47A241..47A25A /7A241..7A25A|Fresh published-speed268==0 enters friction47A330. That helper reads current supported218 and only damps when supported and magnitude>0.|
|47A264..47A28E /7A264..7A28E|Collision=false reads alternate228: false translates31C; true holds root. Both skip previous-root copy, support and friction.|
|47A294..47A31D /7A294..7A31D|All integrated branches reach suppression. Angular and linear quick magnitude×scale≤.1 clear the respective velocity; linear additionally requires a fresh published268==0. Rotation already happened, even if angular velocity is then cleared.|
A support-disabled body may retain supported=true, including while moving upward.
If collision is enabled, that stale-but-owned supported state still allows
friction. Disabling support is not permission to clear it unconditionally.
Collision-disabled bodies skip friction even when global geometry-off forced
supported=true. World-response-off retains integration, gravity, impulse,
optional support and friction, plus the prior static context. F3 noclip remains a
separate modern policy.
## Flag mutation timing
The source does not reselect a branch already entered. Synthetic world callbacks
that change integration210, collision220 or world1D0 still finish the selected
world publication/support/friction path in the current call. The changed flags
persist for a later call. Support1C8 is read fresh after world dispatch, so changing
it there suppresses the current support query. Global geometry is also read fresh
inside support; changing it during world work suppresses support while retaining
the already integrated gravity/acceleration and earlier anchor.
For example, the final native fixture's world mutation5 changes global geometry
to false after integrating fallingVy−213.333328. The output still has that Vy,
acceleration0 and anchorY−25000, with no support query; it is not the early
geometry-off result with acceleration+800/support=true/vertical cancellation.
A mutable scene-global getter can represent that read boundary; embedding a new
per-body geometry flag would misstate its ownership. No live original writer or
new gameplay use of that global is inferred from the synthetic callback.
## Landing37C: writes before and after callback
47BB10..47BB4B publishes anchor, supported root through318 and acceleration
(oldAx,0,oldAz). It checks prior supported695D49 and invokes37C at47BB5E only on
an unsupported→supported transition. The callback observes the new root/anchor/
zeroed vertical acceleration but old live velocity and supported=false.
47BB64..47BB80 then overwrites velocity with **cached pre-callback VX/Z and Y0**,
and writes supported=true. Support pointers34C/33C follow at47BB91/47BBA1.
Consequently:
- Callback velocityXYZ and supported edits are overwritten, even though the
callback legitimately owned them during its invocation.
- Callback root (including W), acceleration, anchor and pending impulse survive.
Pending impulse is not consumed a second time; its next owner is a later body pass.
- Modes and published speed survive. Published speed is read fresh by friction;
changing it to100 skips damping in the same call.
- Callback angular velocity survives into friction/suppression; with(7,123,9),
friction.8/dt1/60 yields approximately(6.906667,121.360001,8.88).
- Changing support/collision/integration modes during37C does not rerun preceding
branches or stop the support function's final supported=true publication.
The native payload cases verify each item. They do not execute Jimmy's real37C
(which is an inherited no-op), an animation event or a special Player callback.
They establish generic phase ownership for safe composition.
## Copied-original fixture and verification
`tools/binary/body_modes.py` reuses the existing read-only body/support range and
relocation collector. Generated sources are separated from the Wine work/prefix
under artifacts/body-modes/generated. The probe executes full copied479D20,
47A330 friction and47B890/support queries against the existing synthetic floor.
Its47B4B0 world dispatcher is deliberately substituted: it adds the supplied
movement to the candidate and performs selected synthetic flag mutations.
Angular334 is a simple additive synthetic virtual, not proof of generic angle
normalization. The copied original OMT quick-magnitude export is retained.
No real world traversal, actor, loader/game entrypoint, animation or audio runs.
The final isolated Wine32 run exits0 with BODY_MODES_COMPLETE.87 observations:
64 combinations of integration/support/world/collision/alternate/global geometry;
6 world-mutation cases;11 genuine landing-mutation cases;6 no-clamp/suppression
extras. Source, generator/shared harness/generated EXE/log hashes and all numeric
vectors/counters/event traces are committed in tests/body-modes-reference.json.
The initial landing setup had prior support=true and therefore correctly emitted
no37C; it was corrected to unsupported before using those cases as callback
evidence. A regeneration attempt into the parent directory containing a Wine
prefix was rejected by the symlink guard; separate generated output resolved it.
Only the final87-case run is retained as the committed conformance fixture.
Four Python groups pass: identity/ranges/provenance, all64 branch/counter/context
combinations, callback/suppression observations and generated-output separation.
Run from GamePort:
```
python3 -m unittest discover -s tests -p test_body_modes.py -v
python3 tools/binary/body_modes.py ../Original --generate-probe artifacts/body-modes/new-generated
```
Parent owns managed integration and its conformance claim. Source-world mutation
outputs depend on the synthetic unclipped dispatcher candidate; a real-wall
adapter may compare branch/state invariants without claiming candidateXYZ parity.
All64 flag cases,11 landing payload cases and6 no-clamp/suppression cases permit
full numeric body comparison under the corresponding floor/empty-world fixture.
Contact metadata, root-changing Vec4 publication, special animation/control and
dynamic body eligibility remain independent gates. Whole-original gameplay and
native Windows movement are not established by these component calls.
+135
View File
@@ -0,0 +1,135 @@
# Contact-owned Vec4 root publication
2026-11-05. Follow-up to [body composition](collision-body-composition-source.md)
and [special contacts](jimmy-special-contact.md). This closes one body-state
boundary; it does not enable special contacts or replace the lab/outside capsule.
Original Neutron.exe SHA256:
`f5281076e1a2492f2d61f87aae3f4544b6d0f535ebe33f9fbb6f78710fe1aea8`.
## Source structures and phases
All VAs below are independently PE-mapped; raw offsets equal VA−400000 for these
ranges. REA's retained complete EXE disassembly is
`ev_0d64cc58fa8f5573fc8e61e0f2c20e36288099212bd2257d3a3121361fd6c904`,
artifacts/jimmy-movement-audit/rea-original-disassembly.json. Earlier body Evidence
`ev_5439072b32ae9f9208795ad2b07bc524e2407b46da487072fb3dfd8c10e7c4b0`
and its prototype limitations remain in the composition report. No unchanged
failed Ghidra selector was repeated. Instructions establish the following facts;
original component execution corroborates their numeric consequences below.
Jimmy uses the game interface at complete+C0. **Data** previous-root Vec4 is
interface1F4/1F8/1FC/200 (complete2B4..2C0); current-root Vec4 is
interface214/218/21C/220 (complete2D4..2E0). These are not same-numbered virtual
slots. Vtable4A373C binds previous getter2F8→4721E0, previous setter2FC→472240,
live getter310→472300 and Vec4 setter314→472360. Each getter copies all four
floats into the caller buffer.314 is a plain four-float store; unlike XYZ318's
472330 wrapper, it does not immediately call3DC. Full logical/render publication
ownership therefore remains distinct from the body-state store.
| VA / raw offset | Recovered operation |
|---|---|
|47A084 /7A084|After integration and before world dispatch, copy current full Vec4 into previous2FC. A stale initial previous root does not survive this boundary.|
|47A0D6 /7A0D6|Positive displacementY:47B4B0 receives fullXYZ.|
|47A10F..47A11F /7A10F..7A11F|NonpositiveY:47B4B0 receives XZ/zeroY, then add the original already-computed fallingY to the **candidate**, after dispatcher/contact returns.|
|47B80F /7B80F;47B82E /7B82E|Dispatcher terminal374/370 receives actor/normal/polygon, not the candidate pointer. The bounded dispatcher call closure has no actor310/314/2FC root publication before those callbacks. It modifies the separate candidate.|
|47A12C /7A12C;47A13D /7A13D|After dispatch/contact, read fresh previous2F8 and then fresh current310 into separate stack buffers.|
|47A143..47A181 /7A143..7A181|Compare X,Y,Z,W. Only equality through all four comparisons reaches candidate publication.|
|47A187..47A1C4 /7A187..7A1C4|Only the permitted candidate has Y clamped to−25000, then full Vec4 is stored through314. A rejected callback-owned live root is neither displaced nor clamped here.|
|47A22A..47A235 /7A22A..7A235|Support eligibility is read afterward. Support47B890 can run even when publication was rejected; it reads current/previous afresh.|
For admitted finite values, the useful projection is:
```
previous = live // world branch entry
candidate = dispatch(entry, full or XZ delta)
if falling: candidate.Y += precontactDelta.Y
previousNow = getPrevious(); liveNow = getLive()
if previousNow.XYZW == liveNow.XYZW:
candidate.Y = max(candidate.Y, -25000)
setLive(candidate) // candidate W, not callback W
supportIfEnabled() // uses current/previous now
frictionAndSuppression() // source state remains independently owned
```
This is not `callback changed Position => skip`: changing **both** previous and
live to equal values permits the old candidate to overwrite that change. Changing
only previous can reject publication even when live XYZ stayed at entry. Changing
only W can reject it even when all XYZ match. The initial entry root remains a
useful diagnostic, but must not substitute for the fresh source previous record
when the support phase runs.
## Original execution and observations
The generated probe executes full copied479D20, real47B4B0/grid/kernel and, in two
cases, real47B890/support. It reuses the independently guarded
body_step_probe.c mapper and synthetic virtual/body/grid contracts. A broad
synthetic vertical wall produces one actual terminal374 contact per case.
The custom contact mutates body records; it is not a recovered climb/hazard
mechanic. A wrapper at the support CALL either logs/no-ops to isolate candidate
publication or calls the unchanged original47B890. No game entrypoint, script,
animation, audio or GPU is executed. Original files are not modified/executed in
place; the existing reference_capture sandbox mounts only a separate copied
installation, disables networking and uses a generated Wine32 prefix.
19 final cases exit0 and print BODY_ROOT_PUBLICATION_COMPLETE. Native output,
capture.json, generated source/header and source hashes are under
artifacts/body-root-publication/. The committed fixture is
`tests/body-root-publication-reference.json`; its input/flag schemas and source,
shared harness, probe executable and output hashes are recorded. Build output is
kept in build/ separately from the Wine prefix: output-symlink protection
intentionally rejects generating over a directory containing prefix symlinks.
Representative observations (entry=(0,20,20,1), radius10, factor1.265,
velocity=(0,−120,−900), dt1/60):
| Contact action | Final live / previous effect | Publication |
|---|---|---|
|None|Live(0,17.7777786,10,1)|Allowed; original gravity and old falling delta applied.|
|Change liveX to100|Live(100,20,20,1), previous remains entry|Rejected; no old fallingY is added to live.|
|Change previousX to100|Live remains entry|Rejected even though live itself did not move.|
|Change liveW to2 or previousW to2|XYZ remains entry; changed W is retained|Rejected.|
|Set both XYZ to(101,250,303)|Old candidate overwrites live; previous remains(101,250,303,1)|Allowed because fresh roots are equal.|
|Set both W to2|Old candidateW1 overwrites liveW; previousW2 remains|Allowed; retaining callback liveW would be incorrect.|
|Set liveY to−30000|Callback-owned liveY remains−30000 in isolated-support case|Rejected, so candidate clamp does not clamp live.|
|EntryY−26000, no root mutation|LiveY−25000|Allowed candidate is clamped.|
|Entry previous=(999,999,999,3)|Contact sees entry previous=(0,20,20,1)|World branch resets previous before callback.|
The unchanged upward case endsY23.1111107; upward liveX/W mutations reject just
as downward ones do. `callback_motion` consumes an initial impulse30 before the
contact (seenVy≈−103.3333), then the contact writes velocity(9,8,7),
acceleration(4,5,6), pendingImpulseY77. Those new fields survive. The root still
uses the precontact falling delta and endsY18.2777786; the new positiveVy8 is not
integrated again during this pass.
Event strings corroborate ownership: C=terminal contact, R=fresh previous read,
L=fresh live read, P=candidate Vec4 publication, S=support CALL. Permitted cases
are `CRLPS`; rejected cases `CRLS`. The two original-support cases continue
`CRLSRL`, proving support reads both records after rejection. With contact-owned
live=(101,5,303,1), real support raises rootY12.6499996, zeros Vy, sets support
and emits one landing. Therefore rejection is not a blanket return from physics.
## Verification and implementation boundary
Four Python groups pass: original identity/ranges/12 publication anchors/four
bindings/four root leaves; all19 saved boundaries and call ordering; generator/
shared-harness provenance; original/output/symlink isolation. Commands:
```
python3 -m unittest discover -s tests -p test_body_root_publication.py -v
python3 tools/binary/body_root_publication.py ../Original --generate-probe artifacts/body-root-publication/build
i686-w64-mingw32-gcc -O0 -I tools/binary -I artifacts/body-root-publication/build artifacts/body-root-publication/build/body_root_publication_probe.c -o artifacts/body-root-publication/build/body_root_publication_probe.exe -lm
python3 tools/recon/reference_capture.py --asset-probe --probe-executable artifacts/body-root-publication/build/body_root_publication_probe.exe --probe-success BODY_ROOT_PUBLICATION_COMPLETE --seconds 15 --output artifacts/body-root-publication/probe
```
Parent owns runtime integration and managed conformance. Preserve live Vec4 W and
fresh previous Vec4; call a contact with live root state rather than candidate.
After it returns, compare those records before applying candidate/clamp. Keep
callback velocity/acceleration/queued impulse, and pass fresh previous into
support. A legacy entry-position diagnostic may remain a distinct output.
Confidence is high for these guarded finite component cases. Nonfinite/x87
unordered comparisons, arbitrary callback-driven flag/radius/material mutations,
actual special animation handlers and their root/previous policies, real dynamic
pairs/shared context, whole-original movement and native Windows gameplay remain
separate gates. This report makes no lab/outside source-body admission claim and
changes no runtime/shared documentation or existing fixtures/tests.
+6
View File
@@ -24,6 +24,12 @@ full current Euler publication and source hierarchical model rotation.146 native
observations now compare with managed components. The model-local sole correction
is modern; exact final OMT render decomposition and broad collision remain open.
[Body contact ownership](body-contact-implementation.md) now closes the finite
current/previous XYZW barrier, independent body modes, context lifetime and landing
payload ordering.100 new complete original comparisons and six callback-state
comparisons pass. Special callback mechanics, actor mode persistence and scene-wide
dynamic/shared context remain separate gates; lab/outside capsule is preserved.
| ID / system | Recovered contract / anchors | Port implementation | Evidence / remaining gap | Next bounded action |
|---|---|---|---|---|
| LOOP | Viewport47E4F0 physics before registry473740, including input44DF80; second sync473770; construction order and selective retained-character/new-game ordering. Separate engine morph clock. | Player now integrates prior body state, then fresh input/player/fire or retained player/fire/input. Uncontrolled body/fire now continue while movement/input are gated. Other systems remain grouped; fixed60Hz policy. | S/M/R. Controlled player partial order implemented; bounded raw-owner preparation implemented; full wrapper/registry/cadence open. | C3 continue other callbacks and morph/control phases; C4 support/response remains separate. |
+10
View File
@@ -128,3 +128,13 @@ or existing tests/docs were modified by this investigator; no commit was made.
4. Complete dynamic pair eligibility/shared context and Vec4 publication, then
run input-only lab/tutorial/RETURN/outside cases with known special contacts.
General floor/step/wall fidelity is not established by these27 leaf probes.
## Subsequent prerequisite implementation
[Body contact implementation](body-contact-implementation.md) now supplies the
fresh previous/live XYZW barrier, independent source modes and landing ownership,
with100 complete native comparisons plus six callback-state cases. The missing
barrier/flag paragraphs above describe the audit baseline, superseded by that
bounded foundation. Actual hazard/climb callbacks, animation acceptance/completion,
per-actor multi-frame state and dynamic context still gate broad admission.