nmarshall commited on
Commit
f54d873
·
1 Parent(s): 947fb1f

qvm: recover complete assistance callback

Browse files
docs/FINDINGS.md CHANGED
@@ -1955,3 +1955,5 @@ RE-1007: Rust matches both original cancellation branches across72 source cases.
1955
  RE-1008: Twenty-four original-QVM cases execute staged f32 progress using34062368 and helper clock6328, then actual152386 on the target with helper meter mirroring. Negative/wrapped elapsed time, signed duration, fractional carry, precision and threshold completion are covered. Assisted completion orders teleport/reset/event108/log and mirrors zero to the helper. Helper clock advances after the target child; ownership remains until later cancellation. Native nested effects remain captured or supplied. [Evidence](research/QVM_ASSIST_PROGRESS.md).
1956
 
1957
  RE-1009: Rust matches24 assisted progress cases, including f32 rounding, negative/wrapped elapsed time and completion. Target meter completion mirrors its result to the helper and preserves original nested effect order. Clock and target updates stage together, so invalid duration or late conversion errors leave both unchanged. Unit cases verify wrapped416-unit progress, zero mirroring at completion and rollback. [Evidence](research/RUST_ASSIST_PROGRESS.md).
 
 
 
1955
  RE-1008: Twenty-four original-QVM cases execute staged f32 progress using34062368 and helper clock6328, then actual152386 on the target with helper meter mirroring. Negative/wrapped elapsed time, signed duration, fractional carry, precision and threshold completion are covered. Assisted completion orders teleport/reset/event108/log and mirrors zero to the helper. Helper clock advances after the target child; ownership remains until later cancellation. Native nested effects remain captured or supplied. [Evidence](research/QVM_ASSIST_PROGRESS.md).
1956
 
1957
  RE-1009: Rust matches24 assisted progress cases, including f32 rounding, negative/wrapped elapsed time and completion. Target meter completion mirrors its result to the helper and preserves original nested effect order. Clock and target updates stage together, so invalid duration or late conversion errors leave both unchanged. Unit cases verify wrapped416-unit progress, zero mirroring at completion and rollback. [Evidence](research/RUST_ASSIST_PROGRESS.md).
1958
+
1959
+ RE-1010: Sixty coherent original-QVM cases execute complete152792 with actual distance65655 and target-meter152386. Admission, cleanup, ascending candidate order, same-team/live/follow filtering, strict distance below75, ownership, acquisition/progress/cancellation and target completion are checked together. Fixtures include two competing targets, exact radius, 64-slot pools, early exits, negative/wrapped progress and stale state. Distance sqrt is modeled; publication/native completion effects remain captured or supplied. [Evidence](research/QVM_ASSIST_COMPLETE.md).
docs/PROVISIONAL_TODO.md CHANGED
@@ -2013,3 +2013,5 @@ RE-974–983 completed routing, command rewrite, inactivity, movement-parameter
2013
  - [x] RE-1008 Recover assisted thaw progress and target completion ([evidence](research/QVM_ASSIST_PROGRESS.md)).
2014
 
2015
  - [x] RE-1009 Port assisted progress with target meter feedback ([evidence](research/RUST_ASSIST_PROGRESS.md)).
 
 
 
2013
  - [x] RE-1008 Recover assisted thaw progress and target completion ([evidence](research/QVM_ASSIST_PROGRESS.md)).
2014
 
2015
  - [x] RE-1009 Port assisted progress with target meter feedback ([evidence](research/RUST_ASSIST_PROGRESS.md)).
2016
+
2017
+ - [x] RE-1010 Recover complete mode10 assistance callback ([evidence](research/QVM_ASSIST_COMPLETE.md)).
docs/RESEARCH_LEDGER.md CHANGED
@@ -2711,3 +2711,7 @@ Twenty-four original-QVM cases execute staged f32 progress using34062368 and hel
2711
  ## 2026-10-29 — RE-1009 Port assisted progress with target meter feedback
2712
 
2713
  Rust matches24 assisted progress cases, including f32 rounding, negative/wrapped elapsed time and completion. Target meter completion mirrors its result to the helper and preserves original nested effect order. Clock and target updates stage together, so invalid duration or late conversion errors leave both unchanged. Unit cases verify wrapped416-unit progress, zero mirroring at completion and rollback. Focused `cargo xtask test-group rust-assist-progress` passes with deterministic report regeneration and selected regressions. Full suite deferred to task ten. Original assets unchanged; Python uses the flake-declared Nix runtime.
 
 
 
 
 
2711
  ## 2026-10-29 — RE-1009 Port assisted progress with target meter feedback
2712
 
2713
  Rust matches24 assisted progress cases, including f32 rounding, negative/wrapped elapsed time and completion. Target meter completion mirrors its result to the helper and preserves original nested effect order. Clock and target updates stage together, so invalid duration or late conversion errors leave both unchanged. Unit cases verify wrapped416-unit progress, zero mirroring at completion and rollback. Focused `cargo xtask test-group rust-assist-progress` passes with deterministic report regeneration and selected regressions. Full suite deferred to task ten. Original assets unchanged; Python uses the flake-declared Nix runtime.
2714
+
2715
+ ## 2026-10-29 — RE-1010 Recover complete mode10 assistance callback
2716
+
2717
+ Sixty coherent original-QVM cases execute complete152792 with actual distance65655 and target-meter152386. Admission, cleanup, ascending candidate order, same-team/live/follow filtering, strict distance below75, ownership, acquisition/progress/cancellation and target completion are checked together. Fixtures include two competing targets, exact radius, 64-slot pools, early exits, negative/wrapped progress and stale state. Distance sqrt is modeled; publication/native completion effects remain captured or supplied. Focused `cargo xtask test-group qvm-assist-complete` passes with deterministic report regeneration and selected regressions. Full suite deferred to task ten. Original assets unchanged; Python uses the flake-declared Nix runtime.
docs/REVERSE_ENGINEERING_TODO.md CHANGED
@@ -2050,3 +2050,5 @@ RE-974–983 recover routing, command rewriting, inactivity and composed setup t
2050
  - [x] RE-1008 Recover assisted thaw progress and target completion ([evidence](research/QVM_ASSIST_PROGRESS.md)).
2051
 
2052
  - [x] RE-1009 Port assisted progress with target meter feedback ([evidence](research/RUST_ASSIST_PROGRESS.md)).
 
 
 
2050
  - [x] RE-1008 Recover assisted thaw progress and target completion ([evidence](research/QVM_ASSIST_PROGRESS.md)).
2051
 
2052
  - [x] RE-1009 Port assisted progress with target meter feedback ([evidence](research/RUST_ASSIST_PROGRESS.md)).
2053
+
2054
+ - [x] RE-1010 Recover complete mode10 assistance callback ([evidence](research/QVM_ASSIST_COMPLETE.md)).
docs/research/QVM_ASSIST_COMPLETE.md ADDED
@@ -0,0 +1,5 @@
 
 
 
 
 
 
1
+ # Recover complete mode10 assistance callback
2
+
3
+ RE-1010. Focused validation: `cargo xtask test-group qvm-assist-complete`. [Machine report](qvm-assist-complete.json).
4
+
5
+ Sixty coherent original-QVM cases execute complete152792 with actual distance65655 and target-meter152386. Admission, cleanup, ascending candidate order, same-team/live/follow filtering, strict distance below75, ownership, acquisition/progress/cancellation and target completion are checked together. Fixtures include two competing targets, exact radius, 64-slot pools, early exits, negative/wrapped progress and stale state. Distance sqrt is modeled; publication/native completion effects remain captured or supplied.
docs/research/README.md CHANGED
@@ -1583,3 +1583,5 @@ The extension collector adds five focused tests for native tail calls, command-r
1583
  - [RE-1008: Recover assisted thaw progress and target completion](QVM_ASSIST_PROGRESS.md).
1584
 
1585
  - [RE-1009: Port assisted progress with target meter feedback](RUST_ASSIST_PROGRESS.md).
 
 
 
1583
  - [RE-1008: Recover assisted thaw progress and target completion](QVM_ASSIST_PROGRESS.md).
1584
 
1585
  - [RE-1009: Port assisted progress with target meter feedback](RUST_ASSIST_PROGRESS.md).
1586
+
1587
+ - [RE-1010: Recover complete mode10 assistance callback](QVM_ASSIST_COMPLETE.md).
docs/research/qvm-assist-complete.json ADDED
The diff for this file is too large to render. See raw diff
 
scripts/analyze_qvm_assist_complete.py ADDED
@@ -0,0 +1,12 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ """Verified original movement-context source contract."""
2
+ from pathlib import Path
3
+ from analyze_qvm import write_json
4
+ from qvm_research_support import source
5
+ from qvm_assistance_support import seed,full,full_fixtures
6
+
7
+ def main():
8
+ q,raw,h,ins=source();probes=[]
9
+ for a in full_fixtures():
10
+ m,b=seed(raw,h,a);m,p,b=full(ins,m,b,a);p['input']=a;probes.append(p)
11
+ write_json(Path('docs/research/qvm-assist-complete.json'),dict(source=q['source'],sha256=q['sha256'],probes=probes,limits='Complete152792 through153417 void-return boundary with actual65655 and152386. Native sqrt modeled finite; event/log/teleport/reset captured and allocation supplied. No native runtime conformance.'))
12
+ if __name__=='__main__':main()
scripts/qvm_assistance_oracle.py CHANGED
@@ -24,3 +24,37 @@ def progress(a):
24
  if e['op']=='log':e['slots']=[2,3]
25
  events.append(e)
26
  return dict(flags=a['flags'],active=a['active'],target=a['target'],last=a['tick'],target_meter=r['meter'],carry_bits=r['carry_bits'],target_flags220=r['flags220'],target_flags104=r['flags104'],target_pm_type=r['pm_type'],helper_meter=r['receiver'],event_entity=[0x23456789,0x80000021] if events else [7,0x80000001],events=events)
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
24
  if e['op']=='log':e['slots']=[2,3]
25
  events.append(e)
26
  return dict(flags=a['flags'],active=a['active'],target=a['target'],last=a['tick'],target_meter=r['meter'],carry_bits=r['carry_bits'],target_flags220=r['flags220'],target_flags104=r['flags104'],target_pm_type=r['pm_type'],helper_meter=r['receiver'],event_entity=[0x23456789,0x80000021] if events else [7,0x80000001],events=events)
27
+
28
+ import copy,math
29
+ def initial(a):return dict(clients=copy.deepcopy(a['clients']),event_entity=[7,0x80000001])
30
+ def step(a,state):
31
+ clients=state['clients'];own=clients[2];events=[];distances=[]
32
+ active=a['entity'] and a['client'] and a['mode']==10 and own[0]==2 and signed(own[1])>0 and not own[2]
33
+ def clear(c):c[4]&=~8192;c[5]=0;c[6]=None
34
+ if active:
35
+ if own[4]&16384:clear(own)
36
+ else:
37
+ for c in clients[:a['count']]:
38
+ if c[5]:
39
+ t=clients[c[6]]
40
+ if t[0]!=2 or signed(t[1])<=0 or t[2]:clear(c)
41
+ for j,t in enumerate(clients[:a['count']]):
42
+ if j==2 or t[0]!=2 or signed(t[1])<=0 or t[2] or t[3]!=own[3]:continue
43
+ if t[4]&16384:
44
+ d=[f32(f32(a['points'][j][k])-f32(a['points'][2][k])) for k in range(3)];square=f32(f32(f32(d[0]*d[0])+f32(d[1]*d[1]))+f32(d[2]*d[2]));distance=f32(math.sqrt(square));distances.append([j,word(distance)])
45
+ if distance<75:
46
+ if own[4]&8192 and own[5] and own[6]==j:
47
+ p=progress(dict(flags=own[4],active=own[5],target=j,tick=a['tick'],last=own[7],meter=t[8],carry=__import__('struct').unpack('<f',__import__('struct').pack('<I',t[9]))[0],target_flags220=t[4],target_flags104=t[11],target_pm_type=t[10],seconds=a['seconds']))
48
+ own[7]=a['tick'];own[8]=p['helper_meter'];t[8]=p['target_meter'];t[9]=p['carry_bits'];t[4]=p['target_flags220'];t[11]=p['target_flags104'];t[10]=p['target_pm_type']
49
+ for e in p['events']:
50
+ e=copy.deepcopy(e)
51
+ if e['op'] in ['teleport','reset']:e['slot']=j
52
+ if e['op']=='log':e['slots']=[2,j]
53
+ events.append(e)
54
+ if p['events']:state['event_entity']=[0x1000+j,state['event_entity'][1]|32]
55
+ elif not (own[4]&8192 and own[5] and own[6]!=j):
56
+ own[4]|=8192;own[5]=1;own[6]=j;own[7]=a['tick'];events.extend([dict(op='publish',slot=2,event=104,param=100+j),dict(op='log',format=b'ThawOutStarted: %i %i: %s started thawing out %s\n'.hex(),slots=[2,j])])
57
+ continue
58
+ if own[4]&8192 and own[5] and own[6]==j:clear(own);events.append(dict(op='publish',slot=2,event=105,param=0xffffffff))
59
+ return dict(clients=copy.deepcopy(clients),events=events,distances=distances,event_entity=list(state['event_entity']))
60
+ def full(a):return step(a,initial(a))
scripts/qvm_assistance_support.py CHANGED
@@ -63,3 +63,74 @@ def progress(ins,m,b,a):
63
  progress_seed(m,a);m,b=frame_args(m,b,{BASE+32:CLIENT,BASE+28:OTHER,BASE+96:ENTITY});events=[]
64
  m,p=resume(ins,153121,153417,m,BASE,boundaries=(153406,),handlers={152386:target_meter_handler(events)},byte_inputs=b,repeated_calls=True,sync_child_words=True,coherent_memory=True,byte_handlers=True,capture_byte_memory=True)
65
  return m,dict(**helper_view(m),**progress_view(m),events=events,execution={k:p[k] for k in ['stop','trace_length','trace_sha256']}),p['byte_memory']
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
63
  progress_seed(m,a);m,b=frame_args(m,b,{BASE+32:CLIENT,BASE+28:OTHER,BASE+96:ENTITY});events=[]
64
  m,p=resume(ins,153121,153417,m,BASE,boundaries=(153406,),handlers={152386:target_meter_handler(events)},byte_inputs=b,repeated_calls=True,sync_child_words=True,coherent_memory=True,byte_handlers=True,capture_byte_memory=True)
65
  return m,dict(**helper_view(m),**progress_view(m),events=events,execution={k:p[k] for k in ['stop','trace_length','trace_sha256']}),p['byte_memory']
66
+
67
+ import copy,math
68
+ FIELDS=[468,208,4324,3096,220,6316,6320,6328,232,6332,4,104]
69
+ def full_fixtures():
70
+ rows=[]
71
+ for profile in range(30):
72
+ for seconds in [2.,-2.]:
73
+ count=64 if profile in [21,28] else 4
74
+ clients=[[0,1,0,1,0x80000002,0,None,9900,0,0,0,0x80000012] for _ in range(count)]
75
+ clients[2]=[2,1,0,1,0x80000002,0,None,9900,999,word(0.5),0,0x80000012]
76
+ frozen=[2,1,0,1,0x80004002,0,None,9900,0,word(0.5),4,0x80000012];clients[3]=list(frozen)
77
+ points=[[0.,0.,0.] for _ in clients];points[3]=[10.,0.,0.]
78
+ a=dict(profile=profile,entity=1,client=1,mode=10,count=count,tick=10000,seconds=seconds,clients=clients,points=points)
79
+ own=clients[2];target=clients[3]
80
+ if profile in [1,2,10,12,22,24,25,26]:own[4]|=8192;own[5]=1;own[6]=3
81
+ if profile==2:own[7]=10000;target[8]=31999;target[9]=word(1.25)
82
+ if profile in [3,4,5]:points[3][0]={3:75.,4:76.,5:74.999}[profile]
83
+ if profile==6:target[3]=2
84
+ if profile==7:target[0]=1
85
+ if profile in [8,22]:target[1]=0
86
+ if profile==9:target[2]=1
87
+ if profile==10:target[4]&=~16384
88
+ if profile in [11,12,23]:clients[0]=list(frozen);points[0]=[5.,0.,0.]
89
+ if profile==13:own[4]|=16384|8192;own[5]=1;own[6]=3
90
+ if profile==14:a['mode']=9
91
+ if profile==15:own[1]=0
92
+ if profile==16:own[0]=1
93
+ if profile==17:own[2]=1
94
+ if profile==18:a['entity']=0
95
+ if profile==19:a['client']=0
96
+ if profile==20:a['count']=0
97
+ if profile==23:own[4]|=8192;own[5]=1;own[6]=0;points[0]=[80.,0.,0.]
98
+ if profile==24:own[7]=10100
99
+ if profile==25:a['tick']=10;own[7]=0xfffffff0
100
+ if profile==26:target[8]=31999
101
+ if profile==27:own[3]=3;target[3]=3
102
+ if profile==28:clients[63]=list(frozen);clients[3][0]=0;points[63]=[10.,0.,0.]
103
+ if profile==29:own[5]=1;own[6]=3
104
+ rows.append(a)
105
+ return rows
106
+
107
+ def full_seed(m,b,a):
108
+ m.update({34090788:a['mode'],34992524:a['count'],34992532:a['tick'],34062368:word(a['seconds'])})
109
+ for j,row in enumerate(a['clients']):
110
+ c=CPOOL+6336*j;e=POOL+880*j;m.update({e+520:c,e:100+j,e+168:0x1000+j,c+140:j})
111
+ for offset,v in zip(FIELDS,row):m[c+offset]=0 if offset==6320 and v is None else POOL+880*v if offset==6320 else v
112
+ for k,v in enumerate(a['points'][j]):m[e+488+4*k]=word(v);m[e+24+4*k]=word(v)
113
+ if not a['client']:m[ENTITY+520]=0
114
+
115
+ def full_view(m,a):
116
+ rows=[]
117
+ for j in range(len(a['clients'])):
118
+ c=CPOOL+6336*j
119
+ rows.append([None if not m[c+o] else (m[c+o]-POOL)//880 if o==6320 else m[c+o]&0xffffffff for o in FIELDS])
120
+ # Zero ordinary words remain numeric zero; only target pointers use null.
121
+ for j,row in enumerate(rows):
122
+ for k,o in enumerate(FIELDS):
123
+ if o!=6320:row[k]=m[CPOOL+6336*j+o]&0xffffffff
124
+ return rows
125
+
126
+ def full_run(ins,m,b,a):
127
+ events=[];distances=[]
128
+ def distance(i,m,args,bs):
129
+ def sqrt(i,m,args,b):return m,word(math.sqrt(number(args[8]))),{'modeled_native_sqrt':True}
130
+ m,value,p,b=run(i,m,65655,65728,40,args,dict(bs),{-107:sqrt},base=ROOT+0xd0000)
131
+ distances.append([(args[12]-POOL-488)//880,value&0xffffffff]);return m,value,{'actual_source_child':65655}
132
+ handlers={**effect_handlers(events),65655:distance,152386:target_meter_handler(events)}
133
+ m,v,p,b=run(ins,m,152792,153417,88,{8:ENTITY if a['entity'] else 0},b,handlers,base=BASE)
134
+ return m,dict(clients=full_view(m,a),events=events,distances=distances,event_entity=[m[ALLOC+168]&0xffffffff,m[ALLOC+424]&0xffffffff],execution=p['execution']),b
135
+
136
+ def full(ins,m,b,a):full_seed(m,b,a);return full_run(ins,m,b,a)
scripts/test_qvm_assist_complete.py ADDED
@@ -0,0 +1,13 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ import json,unittest
2
+ from pathlib import Path
3
+ from qvm_assistance_oracle import full
4
+ class OriginalTests(unittest.TestCase):
5
+ def test_original_contract(self):
6
+ rows=json.loads(Path('docs/research/qvm-assist-complete.json').read_text())['probes'];self.assertEqual(len(rows),60)
7
+ for p in rows:
8
+ with self.subTest(input=p['input']):
9
+ for k,v in full(p['input']).items():self.assertEqual(p[k],v,k)
10
+ def test_fixture_identity_and_trace(self):
11
+ r=json.loads(Path('docs/research/qvm-assist-complete.json').read_text());self.assertEqual(len(r['sha256']),64)
12
+ self.assertTrue(all(p['execution']['trace_length']>0 for p in r['probes']))
13
+ if __name__=='__main__':unittest.main()
xtask/checks.tsv CHANGED
@@ -4066,3 +4066,7 @@ edge crates/urt-gameplay/src/bin/urt-move-callbacks.rs scripts/analyze_rust_assi
4066
  edge crates/urt-gameplay/src/assistance.rs scripts/analyze_rust_assist_progress.py
4067
  edge crates/urt-gameplay/src/bin/urt-assistance.rs scripts/analyze_rust_assist_progress.py
4068
  edge crates/urt-gameplay/src/move_callbacks.rs scripts/analyze_rust_assist_progress.py
 
 
 
 
 
4066
  edge crates/urt-gameplay/src/assistance.rs scripts/analyze_rust_assist_progress.py
4067
  edge crates/urt-gameplay/src/bin/urt-assistance.rs scripts/analyze_rust_assist_progress.py
4068
  edge crates/urt-gameplay/src/move_callbacks.rs scripts/analyze_rust_assist_progress.py
4069
+ report scripts/analyze_qvm_assist_complete.py docs/research/qvm-assist-complete.json
4070
+ edge docs/research/qvm-assist-complete.json scripts/test_qvm_assist_complete.py
4071
+ group qvm-assist-complete scripts/analyze_qvm_assist_complete.py
4072
+ edge scripts/analyze_qvm_assist_complete.py scripts/analyze_qvm_resumer_audit.py