nmarshall commited on
Commit
b5fc9e6
·
1 Parent(s): 5778d8d

qvm: main contact bridge

Browse files
docs/ASSET_PIPELINE_TODO.md CHANGED
@@ -294,3 +294,6 @@ Research progress: [QVM continuous repeated contacts](research/QVM_SLIDE_REPEATE
294
 
295
 
296
  Research progress: [QVM contact slide caller composition](research/QVM_CONTACT_CALLERS.md) completes bounded RE-493–495: both actual slide children inside step/wrapper, down/overlap/fallback/height policy and actual mode-tail state across22 fixtures. Native responses remain supplied. RE-492/496 retain native collision/legal state/main/full runtime/platform work; broad game/rendering milestones remain open.
 
 
 
 
294
 
295
 
296
  Research progress: [QVM contact slide caller composition](research/QVM_CONTACT_CALLERS.md) completes bounded RE-493–495: both actual slide children inside step/wrapper, down/overlap/fallback/height policy and actual mode-tail state across22 fixtures. Native responses remain supplied. RE-492/496 retain native collision/legal state/main/full runtime/platform work; broad game/rendering milestones remain open.
297
+
298
+
299
+ Research progress: [QVM clock/main/contact composition](research/QVM_MAIN_CONTACT.md) completes bounded RE-497–499: actual clock/timer state, exact-expiry source routing and selected contact chain back to main requests across48 fixtures. Native responses/other main effects remain supplied or omitted. RE-496/500 retain missing producers/native collision/full main/scheduler/runtime/platform work; broad game/rendering milestones remain open.
docs/FINDINGS.md CHANGED
@@ -604,3 +604,10 @@ Bounded qagame paths recover bomb-plant/inactivity correction requests, direct f
604
  **F-230 — Contact-capable fallback:**actual raised-slide output feeds down/overlap step traces. Failure restores first-attempt position/velocity and sets32 while retaining child touch/impact and other unrolled state. Success keeps step output; deltaZ>2 precedes height truncation. [CALLSTEP-001](research/QVM_CONTACT_CALLERS.md).
605
 
606
  **F-231 — Contact-to-mode chain:**actual60091 output now feeds41768 tail with both contact-capable slide children evaluated. Gravity updates current Z; negative results clear192/timer. Native collision/main environment and complete gameplay/platform behavior remain open. [CALLMODE-001](research/QVM_CONTACT_CALLERS.md).
 
 
 
 
 
 
 
 
604
  **F-230 — Contact-capable fallback:**actual raised-slide output feeds down/overlap step traces. Failure restores first-attempt position/velocity and sets32 while retaining child touch/impact and other unrolled state. Success keeps step output; deltaZ>2 precedes height truncation. [CALLSTEP-001](research/QVM_CONTACT_CALLERS.md).
605
 
606
  **F-231 — Contact-to-mode chain:**actual60091 output now feeds41768 tail with both contact-capable slide children evaluated. Gravity updates current Z; negative results clear192/timer. Native collision/main environment and complete gameplay/platform behavior remain open. [CALLMODE-001](research/QVM_CONTACT_CALLERS.md).
607
+
608
+
609
+ **F-232 — Clock/timer shared state:**source clock clamps elapsed1–200, retains requested PS time and actual vector snapshots, and drives real53048 timer state plus movement fractional time in48 main fixtures. Intervening prefix-to-main producers remain omitted. [MAINCONTACT-001](research/QVM_MAIN_CONTACT.md).
610
+
611
+ **F-233 — Actual timer routing:**36 fixtures select41768; exact-expiry controls route six to43626 and six to55465. Alternative requests receive no41768 effects. Other environment/action/query/mode effects remain omitted. [MAINCONTACT-002](research/QVM_MAIN_CONTACT.md).
612
+
613
+ **F-234 — Selected main-to-contact chain:**actual aged main state flows into41768/60091/59710 and54 evaluated slide children, then back to bounded main suffix requests. Native responses remain supplied; full53418/scheduler/suffix/environment/native gameplay is unverified. [MAINCONTACT-003](research/QVM_MAIN_CONTACT.md).
docs/PROVISIONAL_TODO.md CHANGED
@@ -606,3 +606,6 @@ Research progress: [QVM continuous repeated contacts](research/QVM_SLIDE_REPEATE
606
 
607
 
608
  Research progress: [QVM contact slide caller composition](research/QVM_CONTACT_CALLERS.md) completes bounded RE-493–495: both actual slide children inside step/wrapper, down/overlap/fallback/height policy and actual mode-tail state across22 fixtures. Native responses remain supplied. RE-492/496 retain native collision/legal state/main/full runtime/platform work; broad game/rendering milestones remain open.
 
 
 
 
606
 
607
 
608
  Research progress: [QVM contact slide caller composition](research/QVM_CONTACT_CALLERS.md) completes bounded RE-493–495: both actual slide children inside step/wrapper, down/overlap/fallback/height policy and actual mode-tail state across22 fixtures. Native responses remain supplied. RE-492/496 retain native collision/legal state/main/full runtime/platform work; broad game/rendering milestones remain open.
609
+
610
+
611
+ Research progress: [QVM clock/main/contact composition](research/QVM_MAIN_CONTACT.md) completes bounded RE-497–499: actual clock/timer state, exact-expiry source routing and selected contact chain back to main requests across48 fixtures. Native responses/other main effects remain supplied or omitted. RE-496/500 retain missing producers/native collision/full main/scheduler/runtime/platform work; broad game/rendering milestones remain open.
docs/RESEARCH_LEDGER.md CHANGED
@@ -379,3 +379,7 @@ Completed bounded RE-489–491 with `analyze_qvm_slide_repeated.py`: continuous
379
  ## 2026-10-16 — Game-QVM evaluated contact slides through step, wrapper and mode
380
 
381
  Completed bounded RE-493–495 with `analyze_qvm_contact_callers.py`:22 mode/wrapper fixtures evaluate38 actual57714 children at60091/59710 call boundaries with shared PS/frame/touch/impact state and disjoint live local frames. CALLSLIDE-001/CALLSTEP-001/CALLMODE-001/F-229–231 replace supplied first/raised slide return/vector effects with evaluated clear/repeated-contact/early-return children, original-snapshot raised/shrunk geometry, actual child-to-down/overlap traces, step clipping/returns, first-attempt fallback/flag32/height recording and actual41768 gravity/flag/timer tail. Six fixtures bypass step, six succeed, ten fail/fall back. Second child retains first-child touches/impact at entry; positional fallback preserves final child touch/impact effects. Initial impact0 is supplied once before mode; native roots and slide/down/overlap records/interpolation remain supplied, legal record/normal/state domains/native side effects/main dispatch/environment/actions/runtime unverified. No original executable/full QVM/native collision/physics/rendering executes. Repeated-slide evaluator accepts optional initial memory/result-memory return with unchanged defaults; independent slide oracle accepts entry snapshots and first-clear return0. Eight tests verify all38 children using independent generalized state-machine formulas, raise/shrink geometry, child/down/overlap/step outputs, wrapper bypass/success/fallback/height, full recorded mode-tail state, retained touch/impact, exact caller arguments/frame isolation, provenance and scope. All599 tests pass. Prior repeated-slide report regenerates byte-identically; new caller report reproduces twice byte-identically (639493 bytes). Storage/filter setup, documentation links and whitespace checks pass. No assets or shared instruction evaluator changed. RE-492 remains open for broader native/legal/main/runtime scope; RE-496 tracks native trace/BSP collision/side effects/legal domains/impact reset-consumers, other callers and real main-dispatch/environment/clock/basis/action composition with full macOS/Linux Rust/Bevy/Solari gameplay. Broad game/assets/rendering/protocol milestones remain open.
 
 
 
 
 
379
  ## 2026-10-16 — Game-QVM evaluated contact slides through step, wrapper and mode
380
 
381
  Completed bounded RE-493–495 with `analyze_qvm_contact_callers.py`:22 mode/wrapper fixtures evaluate38 actual57714 children at60091/59710 call boundaries with shared PS/frame/touch/impact state and disjoint live local frames. CALLSLIDE-001/CALLSTEP-001/CALLMODE-001/F-229–231 replace supplied first/raised slide return/vector effects with evaluated clear/repeated-contact/early-return children, original-snapshot raised/shrunk geometry, actual child-to-down/overlap traces, step clipping/returns, first-attempt fallback/flag32/height recording and actual41768 gravity/flag/timer tail. Six fixtures bypass step, six succeed, ten fail/fall back. Second child retains first-child touches/impact at entry; positional fallback preserves final child touch/impact effects. Initial impact0 is supplied once before mode; native roots and slide/down/overlap records/interpolation remain supplied, legal record/normal/state domains/native side effects/main dispatch/environment/actions/runtime unverified. No original executable/full QVM/native collision/physics/rendering executes. Repeated-slide evaluator accepts optional initial memory/result-memory return with unchanged defaults; independent slide oracle accepts entry snapshots and first-clear return0. Eight tests verify all38 children using independent generalized state-machine formulas, raise/shrink geometry, child/down/overlap/step outputs, wrapper bypass/success/fallback/height, full recorded mode-tail state, retained touch/impact, exact caller arguments/frame isolation, provenance and scope. All599 tests pass. Prior repeated-slide report regenerates byte-identically; new caller report reproduces twice byte-identically (639493 bytes). Storage/filter setup, documentation links and whitespace checks pass. No assets or shared instruction evaluator changed. RE-492 remains open for broader native/legal/main/runtime scope; RE-496 tracks native trace/BSP collision/side effects/legal domains/impact reset-consumers, other callers and real main-dispatch/environment/clock/basis/action composition with full macOS/Linux Rust/Bevy/Solari gameplay. Broad game/assets/rendering/protocol milestones remain open.
382
+
383
+ ## 2026-10-16 — Game-QVM actual clock, main timer routing and selected contact-mode state
384
+
385
+ Completed bounded RE-497–499 with `analyze_qvm_main_contact.py`:48 fixtures evaluate clock53723–53788 without reseeding source vectors, main54244–54472, actual53048 timer effects and selected41768/60091/59710/both57714 children in shared memory with disjoint live helper frames. MAINCONTACT-001–003/F-232–234 recover requested-time versus clamped1–200 interval, exact source vector snapshots/fraction, timer-derived equality-expiry routing and actual mode state back into bounded main suffix requests.36 fixtures select/evaluate41768 with54 slide child invocations; six route to43626 and six to55465 without attaching prepared contact-mode effects. Other main/query/alternative-mode/suffix/native requests retain omitted effects, query return0 and supplied environment/type/state inputs. Intervening clock-to-main instructions/earlier dispatch/scheduler/full53418 remain omitted. Initial impact0 and native roots/ordered slide/down/overlap trace records/interpolation remain supplied; native collision/legal domains/runtime unverified. No original executable/full QVM/native collision/physics/rendering executes. Caller composition now accepts optional initial/result memory with unchanged default report. Eight independent tests verify48 clock/timer/route cases and exact expiry,54 slide children and step/wrapper outputs, actual clock-fraction gravity/flag/timer tail, shared-state transfers/main call ordering/saved level, provenance and scope. All607 tests pass. Prior contact-caller report regenerates byte-identically; new report reproduces twice byte-identically (1107356 bytes). Storage/filter setup, documentation links and whitespace checks pass. No assets or shared instruction evaluator changed. RE-496 remains open for its broader scope; RE-500 tracks missing environment/view/basis/action/alternative-mode/suffix/native effects, trace/BSP collision/legal domains/impact reset-consumers, complete main/scheduler state and macOS/Linux Rust/Bevy/Solari gameplay. Broad game/assets/rendering/protocol milestones remain open.
docs/REVERSE_ENGINEERING_TODO.md CHANGED
@@ -606,3 +606,9 @@ Purpose: turn the supplied installation into an evidence-backed specification of
606
  - [x] RE-494 Connect raised-child outputs to down/overlap traces, step policy and wrapper fallback/height stores while retaining accumulated touch/impact ([CALLSTEP-001](research/QVM_CONTACT_CALLERS.md)).
607
  - [x] RE-495 Feed actual contact-capable wrapper state into41768 gravity/flag/timer tail and validate complete bounded chain outputs ([CALLMODE-001](research/QVM_CONTACT_CALLERS.md)).
608
  - [ ] RE-496 Recover native trace/BSP collision/side effects/legal state-record domains/impact reset-consumers; other slide/step/mode callers and real main-dispatch/environment/clock/basis/action composition. Validate full macOS/Linux Rust/Bevy/Solari gameplay and continue broader game/assets/rendering/protocol work.
 
 
 
 
 
 
 
606
  - [x] RE-494 Connect raised-child outputs to down/overlap traces, step policy and wrapper fallback/height stores while retaining accumulated touch/impact ([CALLSTEP-001](research/QVM_CONTACT_CALLERS.md)).
607
  - [x] RE-495 Feed actual contact-capable wrapper state into41768 gravity/flag/timer tail and validate complete bounded chain outputs ([CALLMODE-001](research/QVM_CONTACT_CALLERS.md)).
608
  - [ ] RE-496 Recover native trace/BSP collision/side effects/legal state-record domains/impact reset-consumers; other slide/step/mode callers and real main-dispatch/environment/clock/basis/action composition. Validate full macOS/Linux Rust/Bevy/Solari gameplay and continue broader game/assets/rendering/protocol work.
609
+
610
+
611
+ - [x] RE-497 Connect actual clock-prefix elapsed/fraction/snapshots to live main53048 timer aging without reseeding source vectors ([MAINCONTACT-001](research/QVM_MAIN_CONTACT.md)).
612
+ - [x] RE-498 Evaluate timer-derived main mode selection with exact-expiry controls and no unrequested contact-mode effects ([MAINCONTACT-002](research/QVM_MAIN_CONTACT.md)).
613
+ - [x] RE-499 Evaluate selected41768/60091/59710/both57714 children in actual main shared state, then resume bounded main suffix requests ([MAINCONTACT-003](research/QVM_MAIN_CONTACT.md)).
614
+ - [ ] RE-500 Recover missing main environment/view/basis/action/alternative-mode/suffix/native effects and trace/BSP collision/legal domains/impact reset-consumers; compose complete main/scheduler shared state and validate macOS/Linux Rust/Bevy/Solari gameplay. Continue broader game/assets/rendering/protocol work.
docs/research/QVM_CONTACT_CALLERS.md CHANGED
@@ -33,3 +33,6 @@ These22 fixtures therefore compose both contact-capable slide children, raised/d
33
  Eight tests independently verify all38 slide children, original-snapshot raise/shrink geometry, actual child-to-down/overlap endpoints and bounds, step returns/clipping, first-attempt fallback and height recording, wrapper-to-mode gravity/flag/timer state, retained touch/impact, exact caller arguments/disjoint frames, source hash and supplied-effect scope. The generalized prior oracle retains its default tests. Reproducibility/full-suite/storage/link/whitespace results are recorded in the research ledger.
34
 
35
  RE-492 remains open for its broader native/legal/main/runtime scope; these bounded caller connections are covered by RE-493–495. RE-496 tracks native trace/BSP collision/side effects, legal state and record domains, impact reset/consumers, other slide/step/mode callers and real main-dispatch/environment/clock/basis/action state composition; validate full macOS/Linux Rust/Bevy/Solari gameplay. Other game/assets/rendering/protocol milestones remain open.
 
 
 
 
33
  Eight tests independently verify all38 slide children, original-snapshot raise/shrink geometry, actual child-to-down/overlap endpoints and bounds, step returns/clipping, first-attempt fallback and height recording, wrapper-to-mode gravity/flag/timer state, retained touch/impact, exact caller arguments/disjoint frames, source hash and supplied-effect scope. The generalized prior oracle retains its default tests. Reproducibility/full-suite/storage/link/whitespace results are recorded in the research ledger.
34
 
35
  RE-492 remains open for its broader native/legal/main/runtime scope; these bounded caller connections are covered by RE-493–495. RE-496 tracks native trace/BSP collision/side effects, legal state and record domains, impact reset/consumers, other slide/step/mode callers and real main-dispatch/environment/clock/basis/action state composition; validate full macOS/Linux Rust/Bevy/Solari gameplay. Other game/assets/rendering/protocol milestones remain open.
36
+
37
+
38
+ Follow-up: [clock/main/contact bridge](QVM_MAIN_CONTACT.md) completes bounded RE-497–499, connecting actual clock/timer/selected main routing to this chain and back to main suffix requests. Earlier dispatch/intervening environment/alternative modes/native/suffix effects remain open under RE-496/500.
docs/research/QVM_MAIN_CONTACT.md ADDED
@@ -0,0 +1,35 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ # QVM clock, main timer routing and selected contact-mode composition
2
+
3
+ This batch completes bounded RE-497–499 / F-232–234 by connecting source clock-prefix instructions, the main path's real timer helper and the selected contact-capable movement chain. It builds on [contact caller composition](QVM_CONTACT_CALLERS.md) and [timer/main routing recovery](QVM_TIMERS_DISPATCH.md). Other main callees, alternative modes and native responses remain supplied or omitted as specified below.
4
+
5
+ Reproduce with `python3 scripts/analyze_qvm_main_contact.py`; validate with `python3 scripts/test_qvm_main_contact.py`. The [machine report](qvm-main-contact.json) retains verified source identity, clock/timer outputs, main call order, selected child reports and final recorded state. No original executable, full QVM, native collision, physics or rendering executes.
6
+
7
+ ## MAINCONTACT-001 — Clock into actual main timer state (RE-497)
8
+
9
+ Forty-eight fixtures vary requested time1000/1016/1201 against old time1000, movement timer0/16/17/201, flags2208/2212 and prepared clear/contact slide patterns. Clock instructions53723–53788 run directly against the same seeded memory subsequently used by the main slices. They preserve source origin[100,200,300] and velocity[10,20,30] in the actual snapshot globals; this bridge does not substitute the vector seeds used in an older isolated clock fixture.
10
+
11
+ The source stores requested time directly, clamps elapsed time to1–200, writes PS elapsed and computes fractional time with binary32 conversion/multiplication by coefficient word981668463. Thus equal requested/old time produces elapsed1, while requested1201 produces elapsed200 and stored time1201. Integer elapsed feeds timer53048; its binary32 fraction feeds the reached movement children and gravity tail. The elapsed interval is not inferred independently for each child.
12
+
13
+ At the actual main CALL54272 boundary the timer body evaluates against live flags and movement/leg/torso timers, preserving the main frame. Movement expiry clears192; zero movement timer does not clear it. Leg/torso countdown outputs remain live through the selected mode. Intervening instructions between the clock prefix and main entry54244 are omitted, so this establishes a selected producer/consumer connection rather than full helper53418 execution.
14
+
15
+ ## MAINCONTACT-002 — Source selection and timer-expiry controls (RE-498)
16
+
17
+ The source main routing reads the flags produced by that evaluated timer. Of48 fixtures,36 select41768 and execute the recovered contact-mode chain. Six select43626 and six select55465 after expiry; those alternative callees record requests with omitted effects. Their prepared contact patterns are not run, and no41768 side effects are attached to them.
18
+
19
+ At exact elapsed16/movement timer16, expiry suppresses41768. With the otherwise corresponding timer17, one remaining tick preserves128 and selects41768. Supplied flag4 survives expiry and selects55465; without it the supplied walk/level/state combination selects43626. Timer0 preserves the existing128 bit. Tests require these route counts and equality boundaries as well as the exact main request order/arguments and saved first content level.
20
+
21
+ Content level0, walk1, type0, state220=0 and initial impact0 remain seeded inputs. Requests to content/posture/ground/action/query helpers, alternative modes and suffix helpers retain omitted effects; query returns0. This batch does not establish those inputs from environment geometry, actions or native state.
22
+
23
+ ## MAINCONTACT-003 — Actual selected chain and return to main (RE-499)
24
+
25
+ At reached CALL54380, helper41768 receives the actual aged flags/timer and clock-derived timestep in shared PS/frame/touch/impact memory. Its prefix,60091 wrapper,59710 step and both57714 slide children evaluate as previously recovered. The caller-composition helper now accepts optional initial/result memory while preserving its original default report byte-for-byte.
26
+
27
+ Across the36 selected fixtures,54 slide child invocations execute:36 first attempts plus18 raised-step attempts. Clear first attempts bypass step. Contact first attempts evaluate the raised child and supplied down/overlap policy. Requested1016 prepares overlap-startsolid failure; the other requested-time groups prepare clear overlap. Wrapper fallback/height recording and mode gravity/flag/timer behavior consume their actual child outputs. Native roots and ordered slide/down/overlap traces/interpolated positions remain supplied.
28
+
29
+ The evaluated mode state returns to the original main frame, which continues the source suffix request sequence through instruction54472. Tests compare the final recorded snapshot, timers and time against the actual child chain and independent arithmetic. Suffix native/callee effects remain omitted; unchanged recorded state across those requests is a property of this bounded model, not a claim that the real callees have no effects.
30
+
31
+ ## Validation and remaining tasks
32
+
33
+ Eight tests verify all48 clock/timer/selection cases, exact expiry,54 independent slide-child predictions, step/wrapper results, clock-fraction gravity tail, shared-state handoffs, main call order, saved level, source provenance and explicit omitted effects. The clock/timer/routing and motion formulas are independent of the shared instruction evaluator; prior child formulas are reused with actual entry snapshots. Reproducibility/full-suite/storage/link/whitespace results are recorded in the ledger.
34
+
35
+ Main coverage is54244–54472 plus the separate clock prefix, not complete53418. Earlier dispatch/scheduler, intervening environment/view/basis/action helpers, alternative modes, suffix/native effects, legal normal/state/record domains and collision-derived traces remain open. RE-496 retains its broader scope. RE-500 tracks those missing producers/callees and native trace/BSP collision, impact reset/consumers, complete main/scheduler shared state and macOS/Linux Rust/Bevy/Solari gameplay. Other game/assets/rendering/protocol milestones remain open.
docs/research/QVM_TIMERS_DISPATCH.md CHANGED
@@ -65,3 +65,6 @@ RE-456 and earlier broad tasks remain open. RE-460 tracks actual54981/56639 and
65
  Follow-up: [query56639 recovery](QVM_TRAVERSAL_QUERY.md) replaces independently supplied query outputs in16 selected main bridges with evaluated return/state words. This explains acquired-bit/return0 event23 and cleared-bit/return1 caller flag2 under supplied collision/clearance assumptions. Other query/shared-state/native effects remain open (RE-461–464).
66
 
67
  Follow-up: [mode41768 tail recovery](QVM_CLEARANCE_MODE.md) evaluates the flag32 prefix and conditional gravity/negative-Z mask192/timer policy, with18 main selection/aged-timer bridges. Collision child60091 and complete mode/shared state remain omitted under RE-468.
 
 
 
 
65
  Follow-up: [query56639 recovery](QVM_TRAVERSAL_QUERY.md) replaces independently supplied query outputs in16 selected main bridges with evaluated return/state words. This explains acquired-bit/return0 event23 and cleared-bit/return1 caller flag2 under supplied collision/clearance assumptions. Other query/shared-state/native effects remain open (RE-461–464).
66
 
67
  Follow-up: [mode41768 tail recovery](QVM_CLEARANCE_MODE.md) evaluates the flag32 prefix and conditional gravity/negative-Z mask192/timer policy, with18 main selection/aged-timer bridges. Collision child60091 and complete mode/shared state remain omitted under RE-468.
68
+
69
+
70
+ Follow-up: [actual main-to-contact composition](QVM_MAIN_CONTACT.md) completes bounded RE-497–499, evaluating clock/timer and selected41768 children in shared state. This earlier report retains its omitted-mode effects; full main/environment/native/runtime scope remains open.
docs/research/README.md CHANGED
@@ -207,3 +207,6 @@ The extension collector adds five focused tests for native tail calls, command-r
207
 
208
 
209
  [QVM contact slides inside step/wrapper/mode](QVM_CONTACT_CALLERS.md) adds RE-493–495. Reproduce with `python3 scripts/analyze_qvm_contact_callers.py`; check with `python3 scripts/test_qvm_contact_callers.py`. Both57714 children run against actual shared state; native roots/traces and initial mode environment remain supplied.
 
 
 
 
207
 
208
 
209
  [QVM contact slides inside step/wrapper/mode](QVM_CONTACT_CALLERS.md) adds RE-493–495. Reproduce with `python3 scripts/analyze_qvm_contact_callers.py`; check with `python3 scripts/test_qvm_contact_callers.py`. Both57714 children run against actual shared state; native roots/traces and initial mode environment remain supplied.
210
+
211
+
212
+ [QVM clock/main routing into selected contact mode](QVM_MAIN_CONTACT.md) adds RE-497–499. Reproduce with `python3 scripts/analyze_qvm_main_contact.py`; check with `python3 scripts/test_qvm_main_contact.py`. Actual clock/timer and selected contact children share state; intervening/other main/native effects remain omitted or supplied.
docs/research/qvm-main-contact.json ADDED
The diff for this file is too large to render. See raw diff
 
scripts/analyze_qvm_contact_callers.py CHANGED
@@ -32,8 +32,10 @@ def step(ins,m,args,records,policy):
32
  elif t['trace'] and ins[t['trace'][-1]]['opcode']=='LEAVE':return m,{'initial':initial,'at_slide':at_slide,'slide':slide,'requests':requests,'return_word':t['stack'][-1],'final':snapshot(m),'calls':calls,**trace_fields({'trace':trace},False)}
33
 
34
 
35
- def composition(ins,first_name,timer,policy,second_name):
36
- ground=int(first_name=='early');m=seed(flags=2208,timer=timer,plane=ground);m[35024000]=word(0);initial=snapshot(m);pre=trace_slice(ins,41769,41846,m,{},stop_targets=[41789],local_base=MODE);m=pre['memory'];before_wrapper=snapshot(m);pc=60092;calls=[];trace=[];first=None;stepped=None
 
 
37
  patterns={'clear':[{'fraction':1,'normal':[0,0,1],'entity':8}],'contacts':specs([(1,0,0)]*4),'early':specs([(0,0,-1)]*4)}
38
  while True:
39
  t=trace_slice(ins,60092,60213,m,{92:1} if pc==60092 else {},resume_at=pc,stop_targets=[s for s in [60113,60148] if s!=pc],local_base=WRAP,halt_on_leave=True,capture_stack=True,limit=512);m=t['memory'];calls+=t['calls'];trace+=t['trace'];pc=t['stop']
@@ -41,7 +43,8 @@ def composition(ins,first_name,timer,policy,second_name):
41
  elif pc==60148:m,stepped=step(ins,m,t['calls'][-1]['args'],patterns[second_name],policy);m[WRAP+76]=stepped['return_word']
42
  elif t['trace'] and ins[t['trace'][-1]]['opcode']=='LEAVE':wrapper={'before':before_wrapper,'first_slide':first,'step':stepped,'return_word':t['stack'][-1],'final':snapshot(m),'calls':calls,**trace_fields({'trace':trace},False)};break
43
  post=trace_slice(ins,41769,41846,m,{},resume_at=41789,local_base=MODE)
44
- return {'first_pattern':first_name,'step_pattern':second_name,'policy':policy,'initial':initial,'wrapper':wrapper,'mode_final':snapshot(post['memory']),'mode_calls':pre['calls']+post['calls']}
 
45
 
46
 
47
  def main():
 
32
  elif t['trace'] and ins[t['trace'][-1]]['opcode']=='LEAVE':return m,{'initial':initial,'at_slide':at_slide,'slide':slide,'requests':requests,'return_word':t['stack'][-1],'final':snapshot(m),'calls':calls,**trace_fields({'trace':trace},False)}
33
 
34
 
35
+ def composition(ins,first_name,timer,policy,second_name,initial_memory=None,return_memory=False):
36
+ ground=int(first_name=='early');m=seed(flags=2208,timer=timer,plane=ground) if initial_memory is None else dict(initial_memory)
37
+ if initial_memory is None:m[35024000]=word(0)
38
+ initial=snapshot(m);pre=trace_slice(ins,41769,41846,m,{},stop_targets=[41789],local_base=MODE);m=pre['memory'];before_wrapper=snapshot(m);pc=60092;calls=[];trace=[];first=None;stepped=None
39
  patterns={'clear':[{'fraction':1,'normal':[0,0,1],'entity':8}],'contacts':specs([(1,0,0)]*4),'early':specs([(0,0,-1)]*4)}
40
  while True:
41
  t=trace_slice(ins,60092,60213,m,{92:1} if pc==60092 else {},resume_at=pc,stop_targets=[s for s in [60113,60148] if s!=pc],local_base=WRAP,halt_on_leave=True,capture_stack=True,limit=512);m=t['memory'];calls+=t['calls'];trace+=t['trace'];pc=t['stop']
 
43
  elif pc==60148:m,stepped=step(ins,m,t['calls'][-1]['args'],patterns[second_name],policy);m[WRAP+76]=stepped['return_word']
44
  elif t['trace'] and ins[t['trace'][-1]]['opcode']=='LEAVE':wrapper={'before':before_wrapper,'first_slide':first,'step':stepped,'return_word':t['stack'][-1],'final':snapshot(m),'calls':calls,**trace_fields({'trace':trace},False)};break
45
  post=trace_slice(ins,41769,41846,m,{},resume_at=41789,local_base=MODE)
46
+ report={'first_pattern':first_name,'step_pattern':second_name,'policy':policy,'initial':initial,'wrapper':wrapper,'mode_final':snapshot(post['memory']),'mode_calls':pre['calls']+post['calls']}
47
+ return (post['memory'],report) if return_memory else report
48
 
49
 
50
  def main():
scripts/analyze_qvm_main_contact.py ADDED
@@ -0,0 +1,41 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ #!/usr/bin/env python3
2
+ """Actual clock/timer/routing and selected contact-mode shared-state bridge."""
3
+ import itertools,json
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
9
+ from analyze_qvm_slide_prefix import seed,vec
10
+ from analyze_qvm_contact_callers import composition,snapshot
11
+ from analyze_qvm_timers_dispatch import MAIN_LOCAL,TIMER_LOCAL,MODES
12
+ from analyze_vm_extensions import verified
13
+
14
+
15
+ def timer_state(m):return {'flags':m[PS+12]&0xffffffff,'movement':m[PS+16],'leg':m[PS+72],'torso':m[PS+80],'dt':m[35023932]}
16
+
17
+
18
+ def probe(ins,requested,timer,flags,pattern):
19
+ m=seed(flags=flags,timer=timer);m.update({PS:1000,FRAME+4:requested,PS+4:0,PS+72:200,PS+80:17,PS+220:0,FRAME+212:0,35023936:1,35024000:word(0)});initial=snapshot(m)
20
+ clock=trace_slice(ins,53723,53789,m,{104:FRAME},local_base=MAIN_LOCAL);m=clock['memory'];clock_report={'old_time':1000,'requested':requested,'result_time':m[PS],'elapsed':m[35023932],'ps_elapsed':m[PS+284],'float_dt':m[35023928]&0xffffffff,'origin_snapshot':vec(m,35024004),'velocity_snapshot':vec(m,35024016),**trace_fields(clock,False)}
21
+ pc=54244;calls=[];trace=[];timers=None;mode=None;at_mode=None;policy='overlap_solid' if requested==1016 else 'clear'
22
+ while True:
23
+ t=trace_slice(ins,54244,54473,m,{104:FRAME},resume_at=pc,stop_targets=[s for s in [54274,54382,54438] if s!=pc],local_base=MAIN_LOCAL,call_results={54313:0},limit=1024);m=t['memory'];calls+=t['calls'];trace+=t['trace'];pc=t['stop']
24
+ if pc==54274:
25
+ before=timer_state(m);tt=trace_slice(ins,53049,53184,m,{},local_base=TIMER_LOCAL);m=tt['memory'];timers={'before':before,'after':timer_state(m),'calls':tt['calls'],**trace_fields(tt,False)}
26
+ elif pc==54382:
27
+ at_mode=snapshot(m);m,mode=composition(ins,pattern,m[PS+16],policy,'clear',initial_memory=m,return_memory=True)
28
+ elif pc==54438:
29
+ after_dispatch=snapshot(m);tail=trace_slice(ins,54244,54473,m,{104:FRAME},resume_at=54438,local_base=MAIN_LOCAL,limit=512);m=tail['memory'];calls+=tail['calls'];trace+=tail['trace'];break
30
+ else:raise AssertionError('Unexpected main slice stop')
31
+ selected=[c['target'] for c in calls if c['target'] in MODES];assert len(selected)==1
32
+ return {'requested':requested,'initial':initial,'pattern':pattern,'policy':policy,'clock':clock_report,'timer':timers,'selected_mode':selected[0],'at_mode':at_mode,'mode':mode,'after_dispatch':after_dispatch,'final':snapshot(m),'final_timers':timer_state(m),'final_time':m[PS],'saved_level':m[35024028],'calls':calls,**trace_fields({'trace':trace},False)}
33
+
34
+
35
+ def main():
36
+ q=json.loads(Path('docs/research/qvm/qagame.json').read_text());_,ins=decode(verified(Path(q['source']['member']['output']).read_bytes(),q['sha256']))
37
+ probes=[probe(ins,*v) for v in itertools.product([1000,1016,1201],[0,16,17,201],[2208,2212],['clear','contacts'])]
38
+ out={'source':q['source'],'sha256':q['sha256'],'probes':probes,'limitations':'Bounded finite shipped-QVM clock-prefix/main-routing composition; no original executable/full QVM/native collision/physics/rendering executes. Actual clock53723..53788 preserves seeded origin/velocity; intervening prefix-to-main instructions are omitted. Timer53048 and selected41768/60091/59710/both57714 children evaluate actual shared state with disjoint live helper frames. Other main callees/query/alternative modes/suffix native requests record calls with omitted effects and query return0. Content/ground/walk/type/state220 inputs and initial impact0 remain supplied; native roots and ordered slide/down/overlap traces/interpolation are supplied. Main captures only54244..54472, not complete53418/all actions/environment/dispatch/scheduler. Alternative mode requests never receive41768 effects. Full legal state/native collision/runtime/macOS/Linux/Rust/Bevy/Solari gameplay remains open.'};write_json(Path('docs/research/qvm-main-contact.json'),out);print('Composed actual clock/timer/main routing into selected contact mode')
39
+
40
+
41
+ if __name__=='__main__':main()
scripts/test_qvm_main_contact.py ADDED
@@ -0,0 +1,75 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ #!/usr/bin/env python3
2
+ """Independent clock/timer/route and conditional actual-contact chain checks."""
3
+ import hashlib,json
4
+ from pathlib import Path
5
+ import unittest
6
+ from test_qvm_ground import f,n,word
7
+ from test_qvm_timers_dispatch import timer_oracle,dispatch_oracle
8
+ from test_qvm_slide_repeated import oracle as slide_oracle
9
+ from test_qvm_contact_callers import expected_step
10
+
11
+
12
+ def timer_input(p):
13
+ a=p['timer']['before'];return {'initial_flags_word':a['flags'],'initial_movement_timer_word':a['movement'],'initial_leg_timer_word':a['leg'],'initial_torso_timer_word':a['torso'],'dt_word':a['dt']}
14
+
15
+
16
+ class QvmMainContactTests(unittest.TestCase):
17
+ @classmethod
18
+ def setUpClass(cls):cls.r=json.loads(Path('docs/research/qvm-main-contact.json').read_text())
19
+
20
+ def test_actual_clock_clamp_fraction_and_original_snapshots(self):
21
+ self.assertEqual(len(self.r['probes']),48)
22
+ for p in self.r['probes']:
23
+ c=p['clock'];elapsed=max(1,min(200,p['requested']-1000));self.assertEqual([c['elapsed'],c['ps_elapsed'],c['result_time'],p['final_time']],[elapsed,elapsed,p['requested'],p['requested']]);self.assertEqual(c['float_dt'],word(f(f(elapsed)*n(981668463))));self.assertEqual(c['origin_snapshot'],p['initial']['origin']);self.assertEqual(c['velocity_snapshot'],p['initial']['velocity']);self.assertEqual(c['origin_snapshot'],list(map(word,[100,200,300])))
24
+
25
+ def test_clock_output_drives_actual_timer_body(self):
26
+ for p in self.r['probes']:
27
+ before=p['timer']['before'];after=p['timer']['after'];self.assertEqual(before['dt'],p['clock']['elapsed']);self.assertEqual(before['flags'],p['initial']['flags']);self.assertEqual(before['movement'],p['initial']['timer']);expected=timer_oracle(timer_input(p));self.assertEqual([after['flags'],after['movement'],after['leg'],after['torso']],list(expected));self.assertEqual(p['timer']['calls'],[]);self.assertEqual([p['final_timers']['leg'],p['final_timers']['torso']],list(expected[2:]))
28
+
29
+ def test_exact_expiry_changes_route_without_unreached_mode_effects(self):
30
+ counts={41768:0,43626:0,55465:0}
31
+ for p in self.r['probes']:
32
+ flags=timer_oracle(timer_input(p))[0];expected=41768 if flags&128 else 55465 if flags&12 else 43626;self.assertEqual(p['selected_mode'],expected);counts[expected]+=1;self.assertEqual(p['mode'] is not None,expected==41768)
33
+ if expected!=41768:
34
+ self.assertIsNone(p['at_mode']);state=dict(p['initial']);state.update({'flags':flags,'timer':timer_oracle(timer_input(p))[1]});self.assertEqual(p['final'],state)
35
+ self.assertEqual(counts,{41768:36,43626:6,55465:6})
36
+ equality=[p for p in self.r['probes'] if p['requested']==1016 and p['initial']['timer']==16];self.assertTrue(equality);self.assertTrue(all(p['mode'] is None for p in equality))
37
+
38
+ def test_actual_mode_receives_aged_shared_state_and_clock_fraction(self):
39
+ for p in self.r['probes']:
40
+ if not p['mode']:continue
41
+ self.assertEqual(p['mode']['initial'],p['at_mode']);self.assertEqual(p['at_mode']['flags'],p['timer']['after']['flags']);self.assertEqual(p['at_mode']['timer'],p['timer']['after']['movement']);w=p['mode']['wrapper'];self.assertEqual(w['before']['flags'],p['at_mode']['flags']&~32);self.assertEqual(w['first_slide']['dt'],p['clock']['float_dt']);self.assertEqual(p['after_dispatch'],p['mode']['mode_final']);self.assertEqual(p['final'],p['after_dispatch'])
42
+
43
+ def test_all_reached_slide_children_and_step_wrapper_formula(self):
44
+ children=0
45
+ for p in self.r['probes']:
46
+ mode=p['mode']
47
+ if not mode:continue
48
+ w=mode['wrapper'];first=w['first_slide'];slide_oracle(self,first,w['before']);children+=1;s=w['step']
49
+ if s:
50
+ slide_oracle(self,s['slide'],s['at_slide']);children+=1;ret,origin,v,flags=expected_step(s);self.assertEqual([s['return_word'],s['final']['origin'],s['final']['velocity'],s['final']['flags']],[ret,origin,v,flags])
51
+ if not ret:origin=first['final']['origin'];v=first['final']['velocity'];flags|=32
52
+ delta=f(n(origin[2])-n(w['before']['origin'][2]));height=int(delta) if delta>2 else 99
53
+ else:origin,v,flags,height=first['final']['origin'],first['final']['velocity'],first['final']['flags'],99
54
+ self.assertEqual([w['final']['origin'],w['final']['velocity'],w['final']['flags'],w['final']['height']],[origin,v,flags,height])
55
+ self.assertEqual(children,54)
56
+
57
+ def test_actual_mode_tail_uses_clock_timestep_and_retains_child_state(self):
58
+ for p in self.r['probes']:
59
+ mode=p['mode']
60
+ if not mode:continue
61
+ expected=dict(mode['wrapper']['final']);vz=f(n(expected['velocity'][2])-f(f(800)*n(p['clock']['float_dt'])));expected['velocity']=expected['velocity'][:2]+[word(vz)]
62
+ if vz<0:expected['flags']&=~192;expected['timer']=0
63
+ self.assertEqual(mode['mode_final'],expected);self.assertEqual(p['final_timers']['movement'],expected['timer']);self.assertEqual(mode['mode_calls'],[{'instruction':41787,'target':60091,'args':{'8':1}}])
64
+
65
+ def test_main_call_order_arguments_and_saved_level_remain_source_driven(self):
66
+ for p in self.r['probes']:
67
+ pseudo={'timer_probe':timer_input(p),'supplied_after_action_state220_word':0,'type_word':0,'supplied_after_query_state220_word':None,'supplied_query_result_word':0,'level_word':0,'walk_word':1}
68
+ _,_,_,mode,calls=dispatch_oracle(pseudo);self.assertEqual([(c['target'],c['args']) for c in p['calls']],calls);self.assertEqual(p['selected_mode'],mode);self.assertEqual(p['saved_level'],0)
69
+
70
+ def test_verified_source_and_omitted_main_native_scope(self):
71
+ 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())
72
+ for text in ['no original executable/full QVM/native collision/physics/rendering executes','intervening prefix-to-main instructions are omitted','Alternative mode requests never receive41768 effects','not complete53418/all actions/environment/dispatch/scheduler']:self.assertIn(text,self.r['limitations'])
73
+
74
+
75
+ if __name__=='__main__':unittest.main()