nmarshall commited on
Commit
3d53811
·
1 Parent(s): a4a8e6f

qvm: landing events

Browse files
docs/ASSET_PIPELINE_TODO.md CHANGED
@@ -306,3 +306,6 @@ Research progress: [QVM actual main posture](research/QVM_MAIN_POSTURE.md) compl
306
 
307
 
308
  Research progress: [QVM ground loss and landing prefix](research/QVM_GROUND_CALLEES.md) completes bounded RE-509–511: actual ground-loss body/animation, landing discriminant/time/impact/timer prefix and16 main caller-order chains. Full landing/native/action effects remain open under RE-508/512; broad game/rendering/runtime/platform milestones remain open.
 
 
 
 
306
 
307
 
308
  Research progress: [QVM ground loss and landing prefix](research/QVM_GROUND_CALLEES.md) completes bounded RE-509–511: actual ground-loss body/animation, landing discriminant/time/impact/timer prefix and16 main caller-order chains. Full landing/native/action effects remain open under RE-508/512; broad game/rendering/runtime/platform milestones remain open.
309
+
310
+
311
+ Research progress: [QVM landing severity/event queue/caller](research/QVM_LANDING.md) completes bounded RE-513–515: two-slot queue writers, full landing body and actual ground/main timer ordering. Numeric event/PS216 semantics and native/remaining main effects remain open under RE-512/516; broad game/rendering/runtime/platform milestones remain open.
docs/FINDINGS.md CHANGED
@@ -632,3 +632,10 @@ Bounded qagame paths recover bomb-plant/inactivity correction requests, direct f
632
  **F-242 — Landing prefix/timer ordering:**45912 always initializes PS+440/state220, then derives a discriminant/root/time/impact estimate. Impact<−200 with flag1 clear writes leg timer130 before39525(27); unequal raw animation resets it to0, equality retains130. Severity/event/damage/suffix remains unevaluated. [LANDPREFIX-001](research/QVM_GROUND_CALLEES.md).
633
 
634
  **F-243 — Caller overrides ground-loss walk:**actual46773 clears walk/plane after46527 even when the deep fraction0.5 helper retained old ground/walk. Sixteen main chains carry those actual effects through timer and selected clear-slide mode; full landing/native/main runtime remains open. [GROUNDCHAIN-001](research/QVM_GROUND_CALLEES.md).
 
 
 
 
 
 
 
 
632
  **F-242 — Landing prefix/timer ordering:**45912 always initializes PS+440/state220, then derives a discriminant/root/time/impact estimate. Impact<−200 with flag1 clear writes leg timer130 before39525(27); unequal raw animation resets it to0, equality retains130. Severity/event/damage/suffix remains unevaluated. [LANDPREFIX-001](research/QVM_GROUND_CALLEES.md).
633
 
634
  **F-243 — Caller overrides ground-loss walk:**actual46773 clears walk/plane after46527 even when the deep fraction0.5 helper retained old ground/walk. Sixteen main chains carry those actual effects through timer and selected clear-slide mode; full landing/native/main runtime remains open. [GROUNDCHAIN-001](research/QVM_GROUND_CALLEES.md).
635
+
636
+
637
+ **F-244 — Numeric event queue:**29913 stores event/parameter in sequence&1 of two slots and increments the int32 sequence.39238 forwards parameter0;45887 can suppress or sign-shift a surface parameter. The recovered body is not an external damage call; downstream event/field meanings remain open. [LANDEVENT-001](research/QVM_LANDING.md).
638
+
639
+ **F-245 — Landing severity and suffix:**45912 scales squared impact by level, gates events on score/health/surface/argument, writes numeric queue/PS216 or Z300 branches, clears PS8 only after score>=1, and conditionally sets an entity bit for horizontal norm>300. Strict event thresholds are7/30/45. [LAND-001](research/QVM_LANDING.md).
640
+
641
+ **F-246 — Actual landing caller:**complete bounded45912 effects precede46773's movement timer250 and touch stores; actual main aging yields234. Level3 skips landing entirely, and a reached child need not emit an event. Native collisions/other main callees/full runtime remain supplied, omitted or unverified. [LANDCHAIN-001](research/QVM_LANDING.md).
docs/PROVISIONAL_TODO.md CHANGED
@@ -618,3 +618,6 @@ Research progress: [QVM actual main posture](research/QVM_MAIN_POSTURE.md) compl
618
 
619
 
620
  Research progress: [QVM ground loss and landing prefix](research/QVM_GROUND_CALLEES.md) completes bounded RE-509–511: actual ground-loss body/animation, landing discriminant/time/impact/timer prefix and16 main caller-order chains. Full landing/native/action effects remain open under RE-508/512; broad game/rendering/runtime/platform milestones remain open.
 
 
 
 
618
 
619
 
620
  Research progress: [QVM ground loss and landing prefix](research/QVM_GROUND_CALLEES.md) completes bounded RE-509–511: actual ground-loss body/animation, landing discriminant/time/impact/timer prefix and16 main caller-order chains. Full landing/native/action effects remain open under RE-508/512; broad game/rendering/runtime/platform milestones remain open.
621
+
622
+
623
+ Research progress: [QVM landing severity/event queue/caller](research/QVM_LANDING.md) completes bounded RE-513–515: two-slot queue writers, full landing body and actual ground/main timer ordering. Numeric event/PS216 semantics and native/remaining main effects remain open under RE-512/516; broad game/rendering/runtime/platform milestones remain open.
docs/RESEARCH_LEDGER.md CHANGED
@@ -395,3 +395,7 @@ Completed bounded RE-505–507 with `analyze_qvm_main_posture.py`:28 fixtures ev
395
  ## 2026-10-18 — Game-QVM ground-loss caller and landing kinematics prefix
396
 
397
  Completed bounded RE-509–511 with `analyze_qvm_ground_callees.py`:32 standalone46527 probes,42 landing45912-prefix probes and16 actual ground-loss/main chains. GROUNDLOST-001/LANDPREFIX-001/GROUNDCHAIN-001/F-241–243 recover initial flags&12/ground1023/deep64-unit query priority, exact fraction1 animation/4096/ground/walk transitions with evaluated39525/39383 children, and actual46773 caller walk/plane clearing after helper short-query retention. Landing prefix zeros PS+440/clears state220 bit4096 before discriminant testing, derives supplied-root time/impact with ordered binary32 arithmetic, and stops before severity/event/damage/suffix. Eight negative-discriminant probes stop46294;34 reach46052, eight request animation27 at strict impact<−200 with flag1 clear. Exact−200/−199.999 skip while−200.001 requests. Parent leg timer130 is reset0 by unequal raw forced animation, retained130 for raw27 equality. Sixteen reached main chains consume actual ground-lost state before timer/selected41768 clear-slide/wrapper/gravity/post environment; post landing request remains omitted, not replaced with a partial prefix. Native deep fraction/root/content/trace responses, initial state and action/logging/other ground/main effects remain supplied or omitted. No original executable/full QVM/native collision/physics/rendering executes. Eight independent tests verify every helper/prefix state/word, geometry/sentinel/call arguments, strict threshold/timer ordering, animation effects, caller override/main/slide state, provenance and scope. All631 tests pass. Prior main-environment report regenerates byte-identically; final new report reproduces twice byte-identically (578318 bytes). Storage/filter setup, documentation links and whitespace checks pass. No assets or existing analyzer/evaluator code changed. RE-508 remains open for broader scope; RE-512 tracks full landing/recovery/action/posture-ground integration/native/legal effects and complete main/scheduler/macOS/Linux Rust/Bevy/Solari gameplay. Broad game/assets/rendering/protocol milestones remain open.
 
 
 
 
 
395
  ## 2026-10-18 — Game-QVM ground-loss caller and landing kinematics prefix
396
 
397
  Completed bounded RE-509–511 with `analyze_qvm_ground_callees.py`:32 standalone46527 probes,42 landing45912-prefix probes and16 actual ground-loss/main chains. GROUNDLOST-001/LANDPREFIX-001/GROUNDCHAIN-001/F-241–243 recover initial flags&12/ground1023/deep64-unit query priority, exact fraction1 animation/4096/ground/walk transitions with evaluated39525/39383 children, and actual46773 caller walk/plane clearing after helper short-query retention. Landing prefix zeros PS+440/clears state220 bit4096 before discriminant testing, derives supplied-root time/impact with ordered binary32 arithmetic, and stops before severity/event/damage/suffix. Eight negative-discriminant probes stop46294;34 reach46052, eight request animation27 at strict impact<−200 with flag1 clear. Exact−200/−199.999 skip while−200.001 requests. Parent leg timer130 is reset0 by unequal raw forced animation, retained130 for raw27 equality. Sixteen reached main chains consume actual ground-lost state before timer/selected41768 clear-slide/wrapper/gravity/post environment; post landing request remains omitted, not replaced with a partial prefix. Native deep fraction/root/content/trace responses, initial state and action/logging/other ground/main effects remain supplied or omitted. No original executable/full QVM/native collision/physics/rendering executes. Eight independent tests verify every helper/prefix state/word, geometry/sentinel/call arguments, strict threshold/timer ordering, animation effects, caller override/main/slide state, provenance and scope. All631 tests pass. Prior main-environment report regenerates byte-identically; final new report reproduces twice byte-identically (578318 bytes). Storage/filter setup, documentation links and whitespace checks pass. No assets or existing analyzer/evaluator code changed. RE-508 remains open for broader scope; RE-512 tracks full landing/recovery/action/posture-ground integration/native/legal effects and complete main/scheduler/macOS/Linux Rust/Bevy/Solari gameplay. Broad game/assets/rendering/protocol milestones remain open.
398
+
399
+ ## 2026-10-18 — Game-QVM full bounded landing, numeric event queue and actual ground caller
400
+
401
+ Completed bounded RE-513–515 with `analyze_qvm_landing.py`:82 landing-body fixtures,10 supplied-severity suffix boundaries, five three-write queue sequences and six actual ground/main chains. LANDEVENT-001/LAND-001/LANDCHAIN-001/F-244–246 recover29913 two-slot event/parameter writes and int32 sequence wrap,39238 parameter0 forwarding/45887 surface8192 suppression and signed surface>>20 parameters, complete45912 level/severity/health/surface/argument gates with numeric queue/PS216/Z300 outputs, field8 cleanup and strict horizontal norm>300 suffix. Numeric event/PS216 consumers and health/damage meanings remain unverified;29913 is a memory queue writer, not an external damage routine. Strict severity cutoffs1/7/30/45 and speed299/300/301 are checked independently; supplied score probes are not claimed collision-derived. Reached39525/39383,39238,45887 and29913 effects evaluate in disjoint frames. Four accepted-ground chains evaluate landing before caller250 movement timer/touch stores and actual aging234; two level3 controls reach41768 while skipping landing effects. Alternative modes/post-ground animation/other posture-action-query-suffix/native effects remain omitted or unverified. Roots/contents/trace records/interpolation/gravity800/legal initial state remain supplied; no original executable/full QVM/native collision/physics/rendering executes. Eight tests independently verify every body/suffix state, score/event/queue/field/velocity output, signed queue wrap/wrapper suppression/root arguments, ground-caller timer/touch order, queue retention and unreached-child/selected-slide controls, source partitions and scope. All639 tests pass. Prior ground-callee report regenerates byte-identically; final landing report reproduces twice byte-identically (506714 bytes). Storage/filter setup, documentation links and whitespace checks pass. No assets or existing analyzer/evaluator code changed. RE-512 remains open for broader scope; RE-516 tracks event/PS216 consumers,46296 recovery/native/legal effects, other action/posture-ground/animation/mode/suffix work and complete main/scheduler/macOS/Linux Rust/Bevy/Solari gameplay. Broad game/assets/rendering/protocol milestones remain open.
docs/REVERSE_ENGINEERING_TODO.md CHANGED
@@ -630,3 +630,9 @@ Purpose: turn the supplied installation into an evidence-backed specification of
630
  - [x] RE-510 Recover45912 initialization/discriminant/root/time/impact prefix and timer130/forced-animation ordering, stopping before severity/event/damage work ([LANDPREFIX-001](research/QVM_GROUND_CALLEES.md)).
631
  - [x] RE-511 Evaluate46527 at actual46773 main boundary, retaining helper-versus-caller walk priority and derived timer/selected-mode state ([GROUNDCHAIN-001](research/QVM_GROUND_CALLEES.md)).
632
  - [ ] RE-512 Recover remaining landing severity/event/damage/speed suffix and real landing composition,46296 recovery/native callbacks,54981/action and other omitted callees, posture/ground integration/native collision-content-root ABI/legal domains/impact consumers; complete main/scheduler/macOS/Linux Rust/Bevy/Solari gameplay and broader game/assets/rendering/protocol work.
 
 
 
 
 
 
 
630
  - [x] RE-510 Recover45912 initialization/discriminant/root/time/impact prefix and timer130/forced-animation ordering, stopping before severity/event/damage work ([LANDPREFIX-001](research/QVM_GROUND_CALLEES.md)).
631
  - [x] RE-511 Evaluate46527 at actual46773 main boundary, retaining helper-versus-caller walk priority and derived timer/selected-mode state ([GROUNDCHAIN-001](research/QVM_GROUND_CALLEES.md)).
632
  - [ ] RE-512 Recover remaining landing severity/event/damage/speed suffix and real landing composition,46296 recovery/native callbacks,54981/action and other omitted callees, posture/ground integration/native collision-content-root ABI/legal domains/impact consumers; complete main/scheduler/macOS/Linux Rust/Bevy/Solari gameplay and broader game/assets/rendering/protocol work.
633
+
634
+
635
+ - [x] RE-513 Recover29913 two-slot event/parameter queue and39238/45887 wrappers, including signed parameter/sequence wrap and suppression ([LANDEVENT-001](research/QVM_LANDING.md)).
636
+ - [x] RE-514 Evaluate remaining45912 severity/level/health/surface/argument gates, numeric queue/PS216/Z outputs and cleanup/horizontal-speed suffix ([LAND-001](research/QVM_LANDING.md)).
637
+ - [x] RE-515 Evaluate full bounded landing child at actual ground boundary before250-timer/touch stores and live main aging/routing, suppressing unreached level3 children ([LANDCHAIN-001](research/QVM_LANDING.md)).
638
+ - [ ] RE-516 Recover event/PS216 consumers/health semantics,46296 recovery/native collision/content/root ABI/legal domains,54981/action/posture-ground/animation/alternative-mode/suffix effects and full main/scheduler/macOS/Linux Rust/Bevy/Solari gameplay. Continue broader game/assets/rendering/protocol work.
docs/research/QVM_GROUND.md CHANGED
@@ -75,3 +75,6 @@ Follow-up: [main environment shared-state recovery](QVM_MAIN_ENVIRONMENT.md) com
75
 
76
 
77
  Follow-up: [ground-loss and landing-prefix recovery](QVM_GROUND_CALLEES.md) completes bounded RE-509–511, distinguishing46527 short-query retention from46773 caller walk clearing and documenting45912 timer/impact prefix limits.
 
 
 
 
75
 
76
 
77
  Follow-up: [ground-loss and landing-prefix recovery](QVM_GROUND_CALLEES.md) completes bounded RE-509–511, distinguishing46527 short-query retention from46773 caller walk clearing and documenting45912 timer/impact prefix limits.
78
+
79
+
80
+ Follow-up: [landing/event queue caller composition](QVM_LANDING.md) completes bounded RE-513–515, replacing omitted landing effects in selected actual ground/main chains and preserving caller timer/touch ordering. Native/other callees/legal/full runtime limits remain explicit.
docs/research/QVM_GROUND_CALLEES.md CHANGED
@@ -35,3 +35,6 @@ These chains use the earlier environment path with supplied posture state, not t
35
  Eight tests verify32 standalone plus16 composed ground-loss outcomes, deep geometry/requests/sentinel/strict fraction policy,42 landing-prefix formulas and initialization paths, timer130/forced-animation equality, actual animation children, caller override order, selected main/slide state, source partitions and supplied/partial-native scope. Reproducibility/full-suite/storage/link/whitespace results are recorded in the ledger.
36
 
37
  RE-508 remains open for its broader ground/native/producer/runtime scope. RE-512 tracks remaining45912 severity/event/damage/speed suffix and real ground landing composition,46296 recovery/native callbacks, actual54981/action and other omitted callee effects, posture/ground integration, collision/content/root ABI/legal domains/impact consumers and complete main/scheduler/macOS/Linux Rust/Bevy/Solari gameplay. Other game/assets/rendering/protocol milestones remain open.
 
 
 
 
35
  Eight tests verify32 standalone plus16 composed ground-loss outcomes, deep geometry/requests/sentinel/strict fraction policy,42 landing-prefix formulas and initialization paths, timer130/forced-animation equality, actual animation children, caller override order, selected main/slide state, source partitions and supplied/partial-native scope. Reproducibility/full-suite/storage/link/whitespace results are recorded in the ledger.
36
 
37
  RE-508 remains open for its broader ground/native/producer/runtime scope. RE-512 tracks remaining45912 severity/event/damage/speed suffix and real ground landing composition,46296 recovery/native callbacks, actual54981/action and other omitted callee effects, posture/ground integration, collision/content/root ABI/legal domains/impact consumers and complete main/scheduler/macOS/Linux Rust/Bevy/Solari gameplay. Other game/assets/rendering/protocol milestones remain open.
38
+
39
+
40
+ Follow-up: [complete bounded landing body](QVM_LANDING.md) completes RE-513–515, extending this prefix through severity/queue/suffix and actual ground/main caller stores.29913 is now verified as a two-slot numeric event writer; external damage semantics are not established. Recovery/action/native/full runtime scope remains open under RE-512/516.
docs/research/QVM_LANDING.md ADDED
@@ -0,0 +1,44 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ # QVM landing severity, numeric event queue and ground caller
2
+
3
+ This batch completes bounded RE-513–515 / F-244–246, extending [the landing prefix](QVM_GROUND_CALLEES.md) through the remaining45912 body and evaluating its reached event writers. It also connects the body at the actual46773 landing boundary. Native roots, contents and trace records remain supplied; numeric event/field meanings and full runtime behavior remain unverified.
4
+
5
+ Reproduce with `python3 scripts/analyze_qvm_landing.py`; validate with `python3 scripts/test_qvm_landing.py`. The [machine report](qvm-landing.json) retains verified source identity, complete landing/event instruction partitions,82 landing fixtures,10 supplied-severity suffix probes, five queue sequences and six main chains. No original executable, full QVM, native collision, physics or rendering executes.
6
+
7
+ ## LANDEVENT-001 — Two-slot event and parameter writer (RE-513)
8
+
9
+ Helper29913 writes its first argument to `PS+112+4*(sequence&1)`, its second to `PS+120+4*(sequence&1)`, then increments PS+108 with int32 arithmetic. This is a two-slot numeric event/parameter queue; it is not an external damage routine. Sequential writes overwrite the older slot. Five standalone sequences exercise even/odd selection, overwrite, signed-int32 rollover and0xffffffff-to0 wrap with three actual helper calls each.
10
+
11
+ Helper39238 forwards its event argument with parameter0 and the actual PS pointer into29913. Helper45887 suppresses its write when surface bit8192 is set; otherwise it writes event39 with signed arithmetic `surface>>20` as parameter. Tests include positive3 and negative−1 parameters and retain their exact unsigned memory words. These wrappers and their queue children now evaluate at the actual landing call boundaries, rather than leaving29913 effects omitted.
12
+
13
+ The event IDs and PS+216 output are documented numerically. Their downstream consumers, semantic labels, gameplay/health/damage meaning and legal event/sequence/surface domains remain open. The recovered bodies store queue words; no external damage call is established by these requests. Earlier references to unevaluated “event/damage” work were provisional scope labels, not evidence that29913 performed damage.
14
+
15
+ ## LAND-001 — Severity gates, branch output and suffix (RE-514)
16
+
17
+ The complete bounded45912 body retains the earlier initialization/discriminant/impact/animation behavior, then squares impact and multiplies by exact coefficient word953267991 (approximately0.0001), rounding in source order. Content level3 exits after that initial score and before suffix cleanup. Level2 scales the score by0.25, level1 by0.5 and level0 leaves it unscaled. A score below1 exits before field8 cleanup and the horizontal-speed suffix.
18
+
19
+ At score>=1, numeric event selection additionally requires PS+208>0 and surface bit1 clear:
20
+
21
+ - Score strictly above45 selects event50 for argument>=64, or event87 with the argument as parameter for argument<64.
22
+ - Score strictly above30 through45 selects event49 for argument>=64, or event87 for argument<64.
23
+ - Score strictly above7 through30 requests45887, which may suppress its event39 write via bit8192.
24
+ - Score1 through7 emits no event request.
25
+
26
+ The argument<64 high-score branches store Z velocity300. The event50 branch stores `truncate(round32(round32(score * coefficient1014763457) * 110))` into PS+216; event49 uses coefficient1020054733 and multiplier30. Both coefficients retain exact binary32 words. Other branches leave that field unchanged. These are source outputs, not a proven damage amount.
27
+
28
+ After the score>=1 event region, PS+8 is cleared even if health/surface suppressed event selection. If posture flag1 is set, the source requests the horizontal norm and sets entity flag1 only for a result strictly above300; it does not clear an existing bit for lower speed. Ten isolated suffix probes supply scores around1/7/30/45 to test exact branch boundaries without claiming those exact scores arise from legal collision inputs. Full fixtures include level/health/surface/argument gates, surface8192 suppression, signed surface parameters, low scores, negative discriminant and horizontal speeds299/300/301.
29
+
30
+ All reached39525/39383 animation,39238/45887 event wrappers and29913 queue writers evaluate with disjoint live frames. Native square-root results come from finite math at actual recorded source requests. Supplied gravity800/nonexceptional state does not validate zero/exceptional gravity or native ABI/runtime equivalence. The body stops at its common void-return boundary46294; no skipped severity/event/suffix path is asserted to execute.
31
+
32
+ ## LANDCHAIN-001 — Landing child before ground timer/touch stores (RE-515)
33
+
34
+ Six bounded main chains combine previous Z velocity−300/−700 with supplied initial content level0/2/3 and old ground1023. Actual clock snapshots feed the ground caller. For accepted level0/2 ground, source46773 requests45912(8); the complete evaluated child returns before the caller's remaining stores. Previous Z below−200 then writes movement timer250, sets ground8 and evaluates touch registration. Main's actual elapsed16 ages that250 to234 before mode selection.
35
+
36
+ Level0 requests recorded43626; level2 requests recorded41848. Those alternative mode bodies remain omitted. Level3 does not reach landing and receives no prepared child effects; its selected41768 path retains the earlier contact-chain implementation. Event/parameter queue state survives the later evaluated environment calls and remaining recorded main requests. A reached landing can emit no event, for example the level2-scaled−300 fixture.
37
+
38
+ Post-ground upward-kick animation and other unresolved ground/action/query/posture/alternative-mode/suffix/native effects remain omitted. Viewheight/bounds, native content/ground/slide/down/overlap responses and initial state are supplied. These chains establish child/caller/store ordering and selected shared state, not complete53418/scheduler, geometry-derived collisions or platform gameplay.
39
+
40
+ ## Validation and next tasks
41
+
42
+ Eight tests independently verify all82 full-body and10 supplied-score suffix results, strict event/cleanup/speed thresholds, scaling/health/surface/argument policies, exact queue/field/Z outputs, wrapper suppression, five queue wrap sequences, native root arguments, actual landing/ground250-to234 timer/touch ordering, event retention and unreachable-child suppression, source partitions and scope. Reproducibility/full-suite/storage/link/whitespace results are recorded in the ledger.
43
+
44
+ RE-512 remains open for its broader recovery/action/native/runtime scope. RE-516 tracks numeric event and PS+216 consumers/health semantics, actual46296 recovery/native collision/content/root ABI/legal domains, remaining54981/action/posture-ground/animation/alternative-mode/suffix effects and full main/scheduler/macOS/Linux Rust/Bevy/Solari gameplay. Other game/assets/rendering/protocol milestones remain open.
docs/research/README.md CHANGED
@@ -219,3 +219,6 @@ The extension collector adds five focused tests for native tail calls, command-r
219
 
220
 
221
  [QVM ground loss and landing kinematics prefix](QVM_GROUND_CALLEES.md) adds RE-509–511. Reproduce with `python3 scripts/analyze_qvm_ground_callees.py`; check with `python3 scripts/test_qvm_ground_callees.py`. Ground loss composes at its actual main classifier boundary; landing stops before severity/events/damage and native effects remain supplied or omitted.
 
 
 
 
219
 
220
 
221
  [QVM ground loss and landing kinematics prefix](QVM_GROUND_CALLEES.md) adds RE-509–511. Reproduce with `python3 scripts/analyze_qvm_ground_callees.py`; check with `python3 scripts/test_qvm_ground_callees.py`. Ground loss composes at its actual main classifier boundary; landing stops before severity/events/damage and native effects remain supplied or omitted.
222
+
223
+
224
+ [QVM landing severity, event queue and ground caller](QVM_LANDING.md) adds RE-513–515. Reproduce with `python3 scripts/analyze_qvm_landing.py`; check with `python3 scripts/test_qvm_landing.py`. Landing/event writers evaluate before actual ground timer/touch stores; numeric consumers/native collision/full runtime remain open.
docs/research/qvm-landing.json ADDED
The diff for this file is too large to render. See raw diff
 
scripts/analyze_qvm_landing.py ADDED
@@ -0,0 +1,91 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ #!/usr/bin/env python3
2
+ """Complete bounded landing body, event writers and actual ground/main callers."""
3
+ import itertools,json,math
4
+ from pathlib import Path
5
+ from analyze_bsp_references import trace_fields
6
+ from analyze_deferred_auth import trace_slice
7
+ from analyze_qvm import decode,write_json
8
+ from analyze_qvm_acceleration import PS,FRAME,word,number
9
+ from analyze_qvm_slide_prefix import vec
10
+ from analyze_qvm_ground_callees import memory,LAND
11
+ from analyze_qvm_traversal_query import root_word
12
+ from analyze_qvm_animation_contacts import evaluate
13
+ from analyze_qvm_main_environment import contents,ground,env_state
14
+ from analyze_qvm_main_contact import probe
15
+ from analyze_vm_extensions import verified
16
+
17
+ EVENT=0x5b000000
18
+
19
+
20
+ def queue(m):return {'sequence':m[PS+108]&0xffffffff,'events':[m[PS+112]&0xffffffff,m[PS+116]&0xffffffff],'parameters':[m[PS+120]&0xffffffff,m[PS+124]&0xffffffff]}
21
+ def state(m):return {'velocity':vec(m,PS+32),'flags':m[PS+12]&0xffffffff,'legs':m[PS+76]&0xffffffff,'leg_timer':m[PS+72],'state220':m[PS+220]&0xffffffff,'field440':m[PS+440],'field216':m[PS+216],'field8':m[PS+8],'entity_flags':m[PS+104]&0xffffffff,'queue':queue(m)}
22
+
23
+
24
+ def seed(previous=-300,level=0,entity=8,flags=0,health=100,surface=0,speed=10,delta=0):
25
+ m=memory(flags=flags);m.update({PS+28:word(300+delta),PS+32:word(speed),PS+36:word(0),PS+208:health,PS+216:777,PS+8:123,PS+104:0x1234,PS+108:0,PS+112:700,PS+116:701,PS+120:800,PS+124:801,FRAME+212:level,35023988:surface,35024024:word(previous),LAND+96:entity});return m
26
+
27
+
28
+ def event(ins,m,entry,args,depth=0):
29
+ stop={29913:29970,39238:39251,45887:45910}[entry];base=EVENT+depth*0x1000;size=ins[entry]['operand'];locals_map={size+offset:value for offset,value in args.items()};before=queue(m);t=trace_slice(ins,entry+1,stop,m,locals_map,local_base=base,limit=256);m=t['memory'];children=[]
30
+ for c in t['calls']:
31
+ assert c['target']==29913;m,r=event(ins,m,29913,c['args'],depth+1);children.append(r)
32
+ return m,{'entry':entry,'args':args,'before':before,'after':queue(m),'children':children,'calls':t['calls'],**trace_fields(t,False)}
33
+
34
+
35
+ def landing(ins,m,entity,resume_at=45913,score=None):
36
+ initial=state(m);m=dict(m);m[LAND+96]=entity;pc=resume_at;
37
+ if score is not None:m[LAND+20]=word(score);m[LAND+40]=0
38
+ calls=[];trace=[];events=[];animations=[];root=None;horizontal=root_word([number(v) for v in vec(m,PS+32)[:2]]+[0]);impact=None
39
+ while True:
40
+ t=trace_slice(ins,45913,46294,m,{},resume_at=pc,stop_targets=[s for s in [45996,46052,46136,46150,46185,46199,46221] if s!=pc],local_base=LAND,call_results={46001:root or 0,46269:horizontal},limit=2048);m=t['memory'];pc=t['stop'];calls+=t['calls'];trace+=t['trace']
41
+ if pc==45996:root=word(math.sqrt(number(m[LAND+40])))
42
+ elif pc==46052:
43
+ impact=m[LAND+20]&0xffffffff
44
+ if t['calls'] and t['calls'][-1]['target']==39525:before=state(m);child=evaluate(ins,39525,27,m);m=child['memory'];animations.append({'before':before,'after':state(m),'calls':child['calls'],**trace_fields(child,False)})
45
+ elif pc in [46136,46150,46185,46199,46221]:
46
+ if t['calls'] and t['calls'][-1]['instruction'] in [46134,46148,46183,46197,46219]:c=t['calls'][-1];m,r=event(ins,m,c['target'],c['args']);events.append(r)
47
+ elif pc==46294:break
48
+ else:raise AssertionError('Unexpected landing boundary')
49
+ return m,{'entry_instruction':resume_at,'supplied_severity':None if score is None else word(score),'previous':m[35024024]&0xffffffff,'delta':word(number(m[PS+28])-number(m[35024012])),'gravity':m[PS+48],'initial':initial,'entity':entity,'level':m[FRAME+212],'health':m[PS+208],'surface':m[35023988]&0xffffffff,'discriminant':m[LAND+40]&0xffffffff,'supplied_root':root,'supplied_horizontal_root':horizontal,'impact':impact,'last_severity':m[LAND+20]&0xffffffff if impact is not None or score is not None else None,'events':events,'animation_children':animations,'final':state(m),'calls':calls,**trace_fields({'trace':trace},False)}
50
+
51
+
52
+ def landing_probe(ins,previous=-300,level=0,entity=8,flags=0,health=100,surface=0,speed=10,delta=0):
53
+ m=seed(previous,level,entity,flags,health,surface,speed,delta);_,r=landing(ins,m,entity);r.update({'previous':word(previous),'delta':word(delta),'gravity':800});return r
54
+
55
+
56
+ def queue_probe(ins,sequence):
57
+ m=seed();m[PS+108]=sequence;before=queue(m);steps=[]
58
+ for ev,param in [(39,3),(49,0),(87,8)]:m,r=event(ins,m,29913,{8:ev,12:param,16:PS});steps.append(r)
59
+ return {'initial':before,'steps':steps,'final':queue(m)}
60
+
61
+
62
+ def ground_landing(ins,m):
63
+ before=env_state(m);base=0x46000000;pre=trace_slice(ins,46774,47215,m,{},stop_targets=[46847],local_base=base,limit=512);m=pre['memory'];a=pre['calls'][-1]['args'];record=[0,0,word(.5),*vec(m,a[24]),word(0),word(0),word(1),0,0,2,0,8]
64
+ for i,v in enumerate(record):m[a[8]+4*i]=v
65
+ at=trace_slice(ins,46774,47215,m,{},resume_at=46847,stop_targets=[47190],local_base=base,byte_memory={FRAME+25:1},limit=1024);m=at['memory'];child=None
66
+ if at['stop']==47190:m,child=landing(ins,m,at['calls'][-1]['args'][8]);tail=trace_slice(ins,46774,47215,m,{},resume_at=47190,local_base=base,limit=512);m=tail['memory']
67
+ else:tail={'calls':[],'trace':[]}
68
+ for c in tail['calls']:
69
+ if c['target']==39253:m=evaluate(ins,39253,c['args'][8],m)['memory']
70
+ return m,{'target':46773,'before':before,'record':record,'landing_child':child,'after':env_state(m),'queue':queue(m),'calls':pre['calls']+at['calls']+tail['calls'],**trace_fields({'trace':pre['trace']+at['trace']+tail['trace']},False)}
71
+
72
+
73
+ def main_chain(ins,previous,level):
74
+ def effect(ins,m,target,phase):
75
+ if target==47217:m,r=contents(ins,m,[8]*level+[0]*(3-level))
76
+ elif phase=='before':m,r=ground_landing(ins,m)
77
+ else:m,r=ground(ins,m,'flat')
78
+ r['phase']=phase;r['queue']=queue(m);return m,r
79
+ m=seed(previous=previous,flags=2208);m.update({PS+40:word(previous),PS+68:1023,PS+164:38,FRAME+228:-26,FRAME+208:99});return probe(ins,1016,0,2208,'clear',initial_memory=m,environment_effect=effect)
80
+
81
+
82
+ def main():
83
+ q=json.loads(Path('docs/research/qvm/qagame.json').read_text());_,ins=decode(verified(Path(q['source']['member']['output']).read_bytes(),q['sha256']))
84
+ probes=[landing_probe(ins,*v) for v in itertools.product([-100,-300,-650,-700],range(4),[8,64],[0,1])]
85
+ probes += [landing_probe(ins,previous=-700,flags=1,health=h,surface=s) for h,s in itertools.product([0,-1,100],[1,8192,3<<20])]
86
+ probes += [landing_probe(ins,surface=s) for s in [8192,3<<20,0xfff00000]]
87
+ probes += [landing_probe(ins,flags=1,speed=s,entity=64) for s in [299,300,301]]+[landing_probe(ins,previous=v,flags=1) for v in [-50,-90]]+[landing_probe(ins,previous=0,delta=10)]
88
+ out={'source':q['source'],'sha256':q['sha256'],'landing_instructions':ins[45912:46296],'event_partitions':{str(a):ins[a:b] for a,b in [(29913,29972),(39238,39253),(45887,45912)]},'probes':probes,'tail_probes':[landing(ins,seed(entity=64,flags=1,speed=301),64,resume_at=46096,score=s)[1] for s in [.999,1,7,7.001,30,30.001,40,40.001,45,45.001]],'queue_probes':[queue_probe(ins,s) for s in [0,1,2,0x7fffffff,0xffffffff]],'main_chains':[main_chain(ins,v,l) for v,l in itertools.product([-300,-700],[0,2,3])],'limitations':'Bounded finite shipped-QVM landing body and event queue composition; no original executable/full QVM/native collision/physics/rendering executes. Actual45912 body and reached39525/39383,39238,45887,29913 children evaluate;29913 stores a two-slot numeric event/parameter queue, not an external damage call. Numeric event meaning/PS216 consumers/health-damage semantics remain unverified. Roots/native contents/ground records/interpolation and finite gravity/state are supplied; zero/exceptional gravity and legal domains remain open. Selected ground landing children compose before caller250 timer/touch stores and real main timer/routing; level3 unreached landing receives no effects. Other main/posture/action/query/alternative-mode/post-ground animation/suffix/native consumers/full scheduler/macOS/Linux/Rust/Bevy/Solari gameplay remain omitted or unverified.'};write_json(Path('docs/research/qvm-landing.json'),out);print('Recovered bounded landing severity/events/suffix and actual ground/main consumers')
89
+
90
+
91
+ if __name__=='__main__':main()
scripts/test_qvm_landing.py ADDED
@@ -0,0 +1,110 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ #!/usr/bin/env python3
2
+ """Independent full landing severity/event-ring/suffix and caller formulas."""
3
+ import hashlib,json,math
4
+ from pathlib import Path
5
+ import unittest
6
+ from test_qvm_ground import f,n,word
7
+ from test_qvm_slide_repeated import oracle as slide_oracle
8
+
9
+
10
+ def emit(q,event,param):
11
+ q={'sequence':q['sequence'],'events':q['events'][:],'parameters':q['parameters'][:]};slot=q['sequence']&1;q['events'][slot]=event&0xffffffff;q['parameters'][slot]=param&0xffffffff;q['sequence']=(q['sequence']+1)&0xffffffff;return q
12
+
13
+
14
+ def expected(p):
15
+ s=dict(p['initial']);s['velocity']=s['velocity'][:];q=s['queue'];emitted=[];impact=None;score=None
16
+ if p['supplied_severity'] is None:
17
+ s.update({'field440':0,'state220':s['state220']&~4096});v=n(p['previous']);a=f(-p['gravity']);half=f(a*.5);d=f(f(v*v)-f(f(half*4)*f(-n(p['delta']))))
18
+ if d<0:return s,None,None,emitted
19
+ root=f(math.sqrt(d));time=f(f(-v-root)/f(half*2));impact=f(v+f(time*a))
20
+ if impact<-200 and not s['flags']&1:
21
+ s['leg_timer']=130
22
+ if s['legs']!=27:s['leg_timer']=0;s['legs']=(((s['legs']&128)^128)|27)&0xffffffff
23
+ score=f(f(impact*impact)*n(953267991))
24
+ if p['level']==3:return s,impact,score,emitted
25
+ if p['level']==2:score=f(score*.25)
26
+ if p['level']==1:score=f(score*.5)
27
+ else:score=n(p['supplied_severity'])
28
+ if score<1:return s,impact,score,emitted
29
+ if p['health']>0 and not p['surface']&1:
30
+ if score>30:
31
+ if p['entity']<64:ev,param=87,p['entity'];s['velocity'][2]=word(300)
32
+ else:
33
+ ev,param=(50,0) if score>45 else (49,0)
34
+ s['field216']=int(f(f(score*n(1014763457 if score>45 else 1020054733))*f(110 if score>45 else 30)))
35
+ emitted.append((ev,param))
36
+ elif score>7 and not p['surface']&8192:
37
+ surface=p['surface'];signed=surface if surface<0x80000000 else surface-0x100000000;emitted.append((39,signed>>20))
38
+ s['field8']=0
39
+ if s['flags']&1:
40
+ x,y=map(n,s['velocity'][:2]);root=f(math.sqrt(f(f(x*x)+f(y*y))))
41
+ if root>300:s['entity_flags']|=1
42
+ for ev,param in emitted:q=emit(q,ev,param)
43
+ s['queue']=q;return s,impact,score,emitted
44
+
45
+
46
+ class QvmLandingTests(unittest.TestCase):
47
+ @classmethod
48
+ def setUpClass(cls):cls.r=json.loads(Path('docs/research/qvm-landing.json').read_text())
49
+
50
+ def test_full_landing_and_supplied_severity_suffix_against_independent_formula(self):
51
+ self.assertEqual(len(self.r['probes']),82);self.assertEqual(len(self.r['tail_probes']),10)
52
+ for p in self.r['probes']+self.r['tail_probes']:
53
+ state,impact,score,events=expected(p);self.assertEqual(p['final'],state);self.assertEqual(p['impact'],None if impact is None else word(impact));self.assertEqual(p['last_severity'],None if score is None else word(score))
54
+
55
+ def test_exact_score_thresholds_event_selection_and_field8_gate(self):
56
+ for p,events in zip(self.r['tail_probes'],[[],[],[],[39],[39],[49],[49],[49],[49],[50]]):
57
+ self.assertEqual([r['after']['events'][(r['after']['sequence']-1)&1] for r in p['events']],events);self.assertEqual(p['final']['field8'],123 if n(p['supplied_severity'])<1 else 0)
58
+
59
+ def test_health_surface_level_and_entity_gates_do_not_imply_damage(self):
60
+ levels=set();parameters=set()
61
+ for p in self.r['probes']:
62
+ _,_,_,ev=expected(p);levels.add(p['level']);parameters.update(param&0xffffffff for event,param in ev if event==39)
63
+ if p['level']==3:self.assertEqual(p['events'],[]);self.assertEqual(p['final']['field8'],123)
64
+ if p['health']<=0 or p['surface']&1:self.assertEqual(p['events'],[])
65
+ if ev and ev[0][0]==87:self.assertEqual(p['final']['velocity'][2],word(300));self.assertEqual(p['final']['field216'],777)
66
+ if ev and ev[0][0] in [49,50]:self.assertNotEqual(p['final']['field216'],777)
67
+ self.assertEqual(levels,{0,1,2,3});self.assertTrue({0,3,0xffffffff}<=parameters)
68
+
69
+ def test_two_slot_queue_overwrite_and_signed_sequence_wrap(self):
70
+ self.assertEqual(len(self.r['queue_probes']),5)
71
+ for p in self.r['queue_probes']:
72
+ q=p['initial']
73
+ for r,(event,param) in zip(p['steps'],[(39,3),(49,0),(87,8)]):self.assertEqual(r['before'],q);q=emit(q,event,param);self.assertEqual(r['after'],q)
74
+ self.assertEqual(p['final'],q)
75
+ self.assertTrue(any(p['initial']['sequence']==0xffffffff and p['steps'][0]['after']['sequence']==0 for p in self.r['queue_probes']))
76
+
77
+ def test_event_wrappers_run_queue_and_horizontal_speed_is_strict(self):
78
+ for p in self.r['probes']+self.r['tail_probes']:
79
+ roots=[c for c in p['calls'] if c['target']==-107]
80
+ for c in roots:
81
+ if c['instruction']==46001:self.assertEqual(c['args'],{'8':p['discriminant']})
82
+ else:
83
+ self.assertEqual(c['instruction'],46269);x,y=map(n,p['initial']['velocity'][:2]);square=f(f(x*x)+f(y*y));self.assertEqual(c['args'],{'8':word(square)});self.assertEqual(p['supplied_horizontal_root'],word(math.sqrt(square)))
84
+ for e in p['events']:
85
+ if e['entry']==45887 and p['surface']&8192:self.assertEqual(e['calls'],[]);self.assertEqual(e['children'],[]);self.assertEqual(e['before'],e['after'])
86
+ elif e['entry'] in [39238,45887]:self.assertEqual([c['target'] for c in e['calls']],[29913]);self.assertEqual(len(e['children']),1);self.assertEqual(e['after'],e['children'][0]['after'])
87
+ else:self.assertEqual(e['entry'],29913)
88
+ for speed,bit in [(299,0),(300,0),(301,1)]:
89
+ p=next(p for p in self.r['probes'] if n(p['initial']['velocity'][0])==speed);self.assertEqual(p['final']['entity_flags']&1,bit)
90
+
91
+ def test_ground_landing_children_and_parent250_timer_order(self):
92
+ self.assertEqual(len(self.r['main_chains']),6)
93
+ for p in self.r['main_chains']:
94
+ g=p['environment'][1];child=g['landing_child'];level=p['environment'][0]['after']['level']
95
+ if level==3:self.assertIsNone(child);continue
96
+ state,_,_,_=expected(child);self.assertEqual(child['final'],state);self.assertEqual(child['previous'],p['initial']['velocity'][2]);self.assertEqual(child['delta'],0);self.assertEqual(g['after']['timer'],250);self.assertEqual(g['after']['ground'],8);self.assertEqual(g['after']['touches'],[8]);self.assertEqual(g['queue'],state['queue']);self.assertEqual(p['timer']['before']['movement'],250);self.assertEqual(p['timer']['after']['movement'],234);self.assertEqual(p['selected_mode'],41848 if level>1 else 43626)
97
+
98
+ def test_event_queue_persists_through_main_requests_and_unreached_child(self):
99
+ for p in self.r['main_chains']:
100
+ env=p['environment'];q=env[1]['queue'];self.assertEqual(env[2]['queue'],q);self.assertEqual(env[3]['queue'],q)
101
+ if env[0]['after']['level']==3:
102
+ self.assertIsNone(env[1]['landing_child']);self.assertEqual(q['sequence'],0);self.assertEqual(p['selected_mode'],41768);w=p['mode']['wrapper'];entry=dict(w['before']);entry['ground_normal']=env[1]['after']['normal'];slide_oracle(self,w['first_slide'],entry);self.assertIsNone(w['step'])
103
+ else:self.assertEqual(q,expected(env[1]['landing_child'])[0]['queue'])
104
+
105
+ def test_source_partitions_and_numeric_native_runtime_limits(self):
106
+ q=json.loads(Path('docs/research/qvm/qagame.json').read_text());self.assertEqual(self.r['source'],q['source']);self.assertEqual(self.r['sha256'],hashlib.sha256(Path(q['source']['member']['output']).read_bytes()).hexdigest());self.assertEqual(self.r['landing_instructions'][-1]['index'],46295);self.assertEqual(set(self.r['event_partitions']),{'29913','39238','45887'})
107
+ for text in ['no original executable/full QVM/native collision/physics/rendering executes','not an external damage call','health-damage semantics remain unverified','level3 unreached landing receives no effects']:self.assertIn(text,self.r['limitations'])
108
+
109
+
110
+ if __name__=='__main__':unittest.main()