urt-rs / docs /research /QVM_TRACE_REWIND_BATCH.md
nmarshall's picture
qvm: event57 world trace caller return
6740a9c
|
Raw History Blame Contribute Delete
7.69 kB

Trace cleanup and rewind state: RE-626–635

Ten separately checked tasks extend the aim and trace-boundary batch. They recover trace classification, retry and cleanup; the rewind snapshot and restore map; player selectors; and the configured player_bb constructor. Supplied collision responses and captured native requests remain distinct from original engine execution.

Task Recovered scope Evidence
RE-626 Trace entity classification before model-hit/damage consumers Classification
RE-627 Retry unlink, pointer stack and ten-target boundary Retry
RE-628 Skipped-target relink order, including duplicates Relink
RE-629 Candidate bound restoration and f32 round-trip limits Bounds
RE-630 Shooter restore gate, final link and numeric return Finalization
RE-631 Whole trace control flow under supplied response sequences Trace chains
RE-632 Rewind snapshot vectors, client fields and packed bytes Snapshot
RE-633 Complete snapshot restore helper and guarded second call Restore
RE-634 Fixed 64-slot rewind selection and actual restore enumeration Selectors
RE-635 Configured player_bb creation with actual allocation/origin setter Constructor

Findings for the port

Trace IDs at or above 1022 enter cleanup. Smaller IDs select the fixed entity pool, with separate player/model and literal-tag branches. Positive health and the relevant fields can lead to model-hit helper 144766 or damage 211239; those consumers remain suspended. Classification alone does not establish a valid hit.

Retry unlinks and records each skipped pointer, then requests another trace only while fewer than ten pointers have accumulated. Cleanup relinks those pointers in insertion order, preserving duplicate entries. Synthetic repeated-target responses test source behavior without asserting that the engine would return an already unlinked target.

Bound restoration repeats the candidate eligibility gates, reverses floating-point additions/subtractions and writes fixed dimensions. It does not copy a saved record. Canonical ordinary records can round-trip exactly; arbitrary dimensions and some large f32 values do not. Minimum Z fields remain untouched. State changes during actual damage may also change cleanup eligibility and require further recovery.

The final trace suffix requests rewind restoration only for a client shooter with record 424 bit 8 clear and mode exactly 1. Otherwise it requests a final shooter link and returns local 96. Whole-function fixtures now follow supplied world/entity responses through retry and cleanup to that actual return. A returned zero is retained as a source value rather than interpreted as a gameplay result.

The rewind snapshot saves entity vectors from offsets 488, 24, 60 and 36 into client storage, along with six selected client fields. It sets client 4408 and packs the low bytes of entity 200/196 at client 4448/4449. The restore helper clears the guard, copies the saved state back, zero-extends those bytes and requests a link. High animation bits do not survive that snapshot format. A second restore call is inactive. History selection and interpolation in 143100 remain unresolved.

Both rewind and restore selectors inspect exactly 64 pool slots, ignoring the global entity count. Their gates require a client, an in-use record, client state below 3, a different record from the excluded player, and zero client fields 3740/4324. Rewind calls are captured under an explicit nonmutating child contract; the restore selector executes the recovered restore helper.

The configured branch creates file-named player_bb records using a less restrictive selector: it omits the 3740/4324 gates. Actual allocation, initialization and origin setting now execute in this constructor analysis. Records preserve source owner/client fields, a 3000-time expiry and callback 277400, then issue captured link requests. Source order matters: the constructor initially writes the current time to record 16, but the later origin setter clears it to zero. Its final velocity is copied afterward. No rendering, networking or expiry effect is inferred from these records.

Validation and limits

The 988-test baseline gains 35 checks, ending at 1023 tests. Independent branch, full-record, byte-packing, call-order and f32 oracles cover each task. Reports regenerate deterministically and remain below 2 MiB. Storage/filter, documentation-link and whitespace checks pass. No original assets, Rust runtime or shared VM evaluator change in this batch.

Native collision responses in the composed trace fixtures are explicitly supplied. Native link, unlink and entity-registration requests are captured without engine effects. No model-hit/damage result or complete rewind interpolation is fabricated. Synthetic dimensions, large float values, duplicate targets, high animation bits and entity-count fixtures do not establish legal live input domains. No original executable/full VM, native physics/rendering/network stack or macOS/Linux Bevy/Solari gameplay runs here.

Next ten concrete tasks

  1. Recover 143100 history selection: its 20 entries, 80-byte stride, timestamp field, bracketing rules and boundary/equality/extrapolation paths. Establish the meaning of the forwarded time argument from original evidence.
  2. Recover reached interpolation helpers 143031 and 63746, including exact f32 vector order and angular wrapping. Avoid replacing them with generic library interpolation before equivalence is checked.
  3. Compose complete 143100 snapshot, history interpolation and native-link request, then restore with 144165. Test round trips across actual selected history records and retain animation-byte truncation.
  4. Bind recovered rewind/restore selectors and configured construction into the whole trace routine. Keep native responses explicit until original collision is available, and verify cleanup across each reached exit.
  5. Partition model-hit helper 144766, recover its first native/copy/math and model-state contracts, then its actual classification outputs. No successful player hit should be supplied as a shortcut.
  6. Continue shared handler 293732 after actual trace returns into contact 292545 and bookkeeping 279820, preserving caller trace/output pointers and reached damage boundaries.
  7. Recover 295018's full 20-pellet loop and signed seed carry under bounded supplied trace responses, then its four-target/fifteen-slot aggregation and no-target bookkeeping path.
  8. Recover reached damage 211239 and the tagged trace branch's event 64/normal encoding consumers. Reuse actual allocation without inventing health, penetration or impact effects.
  9. Recover player_bb expiry callback 277400 and entity free-time behavior. Continue query 276433, base construction after allocation, and grenade 223156 lifecycle as separate bounded follow-ups.
  10. Capture original executable/native/DLL reference traces and connect a verified gameplay path to Rust. Continue asset/map/model/texture/shader/audio/network analysis and macOS/Linux Bevy/Solari rendering and runtime work; these fixtures do not complete the game.

Follow-up: the RE-637–646 history/pellet batch completes bounded history rewind/restore and the supplied-world event57 path. Use its next ten tasks for current unresolved work.