urt-rs / docs /research /QVM_WEAPON_PREFIX.md
nmarshall's picture
qvm: weapon mode prefix
22a74d4
|
Raw History Blame Contribute Delete
1.77 kB
# Mode switch and ordered weapon prefix
RE-566. Reproduce with `python3 scripts/analyze_qvm_weapon_prefix.py`; check with `python3 scripts/test_qvm_weapon_prefix.py`. The [machine report](qvm-weapon-prefix.json) retains source identity and bounded fixtures.
Complete49327 first handles held/released state16 before any timer gate: release clears16 and returns. Otherwise positive PS44, state1024/8 or ID0 block switching. IDs11/12/13 with state32 and mode1 block. ID1 with magazine1 exits in mode0 but automatically advances a nonzero mode without requiring button8; other cases require button8. New mode=old+1, wrapping to0 if its first record word is zero. A change sets state16, loads the new mode timer+12 into PS44, replaces only packed bits16..23, sets FRAME252=1 and FRAME256=old mode.
The recovered50746 prefix clears state32 when button1 is absent, then exits on PS12 bit256 or nonpositive health. Otherwise actual50250 runs, positive PS44 is reduced by full integer dt, actual50397 runs, then actual49327. A timer1 with dt16 can remain−15 at the bounded stop; no clamp has yet occurred. Tests independently compose each child using its live input and compare final state.
This is deliberately a prefix: evaluation stops at50872 immediately after49327, or at the actual early exit53046. Weapon-selection48798 and the remainder through firing/reload/projectile logic are omitted, not stubbed as completed behavior. Remaining: recover those bodies, live mode initialization, complete command selection and reference runtime parity.
No original executable/full QVM/native collision/physics/rendering executes. Native responses and legal input domains are supplied or unverified where stated; full runtime/macOS/Linux Rust/Bevy/Solari gameplay remains open.