qvm: compose complete connect caller policy
Browse files- docs/FINDINGS.md +3 -0
- docs/PROVISIONAL_TODO.md +3 -0
- docs/RESEARCH_LEDGER.md +5 -0
- docs/REVERSE_ENGINEERING_TODO.md +3 -0
- docs/research/QVM_CONNECT_COMPLETE.md +7 -0
- docs/research/README.md +3 -0
- docs/research/qvm-connect-complete.json +0 -0
- scripts/analyze_qvm_connect_complete.py +26 -0
- scripts/qvm_connect_complete_oracle.py +20 -0
- scripts/qvm_connect_policy_support.py +17 -1
- scripts/qvm_connect_tail_oracle.py +10 -7
- scripts/test_qvm_connect_complete.py +11 -0
- xtask/checks.tsv +9 -0
docs/FINDINGS.md
CHANGED
|
@@ -1763,3 +1763,6 @@ RE-813–822 replaces the scoreboard decimal assumption with actual37914 executi
|
|
| 1763 |
|
| 1764 |
|
| 1765 |
**RE-921:** Rust matches144 original173979 suffix cases with ordered bot admission, first-time clears, timeout wrapping, supplied userinfo changes, original broadcast bytes, team callback and ranking intentions. Bot rejection retains prior team/flag mutations. Native callbacks/logging/network/ranking and real caller acceptance remain open. [Evidence](research/RUST_CONNECT_TAIL.md).
|
|
|
|
|
|
|
|
|
|
|
|
| 1763 |
|
| 1764 |
|
| 1765 |
**RE-921:** Rust matches144 original173979 suffix cases with ordered bot admission, first-time clears, timeout wrapping, supplied userinfo changes, original broadcast bytes, team callback and ranking intentions. Bot rejection retains prior team/flag mutations. Native callbacks/logging/network/ranking and real caller acceptance remain open. [Evidence](research/RUST_CONNECT_TAIL.md).
|
| 1766 |
+
|
| 1767 |
+
|
| 1768 |
+
**RE-922:** 96 complete173979 executions compose actual userinfo/address/password admission, native client-clear boundary,247520 initialization or247219 restore, team normalization and bot/callback completion. Ordinary authentication rejection preserves client/entity state; bot rejection occurs after lifecycle side effects. Initializer-persisted timeout can precede a first-time overwrite. Client-wide checksums, watched bytes, exact messages, cvar order and selector/formatter carry are verified. Native admission/userinfo/team/ranking/IO/network callbacks remain supplied/captured; this is not native multiplayer acceptance. [Evidence](research/QVM_CONNECT_COMPLETE.md).
|
docs/PROVISIONAL_TODO.md
CHANGED
|
@@ -1803,3 +1803,6 @@ RE-920: 144 actual173979 suffix cases execute original mode classification and b
|
|
| 1803 |
|
| 1804 |
|
| 1805 |
RE-921: Rust matches144 original173979 suffix cases with ordered bot admission, first-time clears, timeout wrapping, supplied userinfo changes, original broadcast bytes, team callback and ranking intentions. Bot rejection retains prior team/flag mutations. Native callbacks/logging/network/ranking and real caller acceptance remain open. Full runtime completion remains open. [Evidence](research/RUST_CONNECT_TAIL.md).
|
|
|
|
|
|
|
|
|
|
|
|
| 1803 |
|
| 1804 |
|
| 1805 |
RE-921: Rust matches144 original173979 suffix cases with ordered bot admission, first-time clears, timeout wrapping, supplied userinfo changes, original broadcast bytes, team callback and ranking intentions. Bot rejection retains prior team/flag mutations. Native callbacks/logging/network/ranking and real caller acceptance remain open. Full runtime completion remains open. [Evidence](research/RUST_CONNECT_TAIL.md).
|
| 1806 |
+
|
| 1807 |
+
|
| 1808 |
+
RE-922: 96 complete173979 executions compose actual userinfo/address/password admission, native client-clear boundary,247520 initialization or247219 restore, team normalization and bot/callback completion. Ordinary authentication rejection preserves client/entity state; bot rejection occurs after lifecycle side effects. Initializer-persisted timeout can precede a first-time overwrite. Client-wide checksums, watched bytes, exact messages, cvar order and selector/formatter carry are verified. Native admission/userinfo/team/ranking/IO/network callbacks remain supplied/captured; this is not native multiplayer acceptance. Full runtime completion remains open. [Evidence](research/QVM_CONNECT_COMPLETE.md).
|
docs/RESEARCH_LEDGER.md
CHANGED
|
@@ -2330,3 +2330,8 @@ Rust matches160 original173979 admission prefixes, preserving bot bypass, addres
|
|
| 2330 |
## 2026-10-28 — RE-921 Rust post-session connect callbacks and normalization
|
| 2331 |
|
| 2332 |
Rust matches144 original173979 suffix cases with ordered bot admission, first-time clears, timeout wrapping, supplied userinfo changes, original broadcast bytes, team callback and ranking intentions. Bot rejection retains prior team/flag mutations. Native callbacks/logging/network/ranking and real caller acceptance remain open. Focused `cargo xtask test-group rust-connect-tail` passes (9 Python tests); selected reports regenerate twice deterministically, with storage, documentation links and whitespace guards. Full suite deferred to task ten. Original assets unchanged; source fixtures do not establish complete native/runtime parity.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 2330 |
## 2026-10-28 — RE-921 Rust post-session connect callbacks and normalization
|
| 2331 |
|
| 2332 |
Rust matches144 original173979 suffix cases with ordered bot admission, first-time clears, timeout wrapping, supplied userinfo changes, original broadcast bytes, team callback and ranking intentions. Bot rejection retains prior team/flag mutations. Native callbacks/logging/network/ranking and real caller acceptance remain open. Focused `cargo xtask test-group rust-connect-tail` passes (9 Python tests); selected reports regenerate twice deterministically, with storage, documentation links and whitespace guards. Full suite deferred to task ten. Original assets unchanged; source fixtures do not establish complete native/runtime parity.
|
| 2333 |
+
|
| 2334 |
+
|
| 2335 |
+
## 2026-10-28 — RE-922 Complete original connect caller with recovered admission/lifecycle/tail
|
| 2336 |
+
|
| 2337 |
+
96 complete173979 executions compose actual userinfo/address/password admission, native client-clear boundary,247520 initialization or247219 restore, team normalization and bot/callback completion. Ordinary authentication rejection preserves client/entity state; bot rejection occurs after lifecycle side effects. Initializer-persisted timeout can precede a first-time overwrite. Client-wide checksums, watched bytes, exact messages, cvar order and selector/formatter carry are verified. Native admission/userinfo/team/ranking/IO/network callbacks remain supplied/captured; this is not native multiplayer acceptance. Focused `cargo xtask test-group qvm-connect-complete` passes (13 Python tests); selected reports regenerate twice deterministically, with storage, documentation links and whitespace guards. Full suite deferred to task ten. Original assets unchanged; source fixtures do not establish complete native/runtime parity.
|
docs/REVERSE_ENGINEERING_TODO.md
CHANGED
|
@@ -1840,3 +1840,6 @@ Purpose: turn the supplied installation into an evidence-backed specification of
|
|
| 1840 |
|
| 1841 |
|
| 1842 |
- [x] RE-921 Rust post-session connect callbacks and normalization ([evidence](research/RUST_CONNECT_TAIL.md)).
|
|
|
|
|
|
|
|
|
|
|
|
| 1840 |
|
| 1841 |
|
| 1842 |
- [x] RE-921 Rust post-session connect callbacks and normalization ([evidence](research/RUST_CONNECT_TAIL.md)).
|
| 1843 |
+
|
| 1844 |
+
|
| 1845 |
+
- [x] RE-922 Complete original connect caller with recovered admission/lifecycle/tail ([evidence](research/QVM_CONNECT_COMPLETE.md)).
|
docs/research/QVM_CONNECT_COMPLETE.md
ADDED
|
@@ -0,0 +1,7 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
# Complete original connect caller with recovered admission/lifecycle/tail
|
| 2 |
+
|
| 3 |
+
RE-922. Reproduce with `python3 scripts/analyze_qvm_connect_complete.py`; focused validation: `cargo xtask test-group qvm-connect-complete`. [Machine report](qvm-connect-complete.json).
|
| 4 |
+
|
| 5 |
+
96 complete173979 executions compose actual userinfo/address/password admission, native client-clear boundary,247520 initialization or247219 restore, team normalization and bot/callback completion. Ordinary authentication rejection preserves client/entity state; bot rejection occurs after lifecycle side effects. Initializer-persisted timeout can precede a first-time overwrite. Client-wide checksums, watched bytes, exact messages, cvar order and selector/formatter carry are verified. Native admission/userinfo/team/ranking/IO/network callbacks remain supplied/captured; this is not native multiplayer acceptance.
|
| 6 |
+
|
| 7 |
+
Original executable/native runtime and complete Linux/macOS Rust/Bevy/Solari acceptance remain unverified.
|
docs/research/README.md
CHANGED
|
@@ -1375,3 +1375,6 @@ The extension collector adds five focused tests for native tail calls, command-r
|
|
| 1375 |
|
| 1376 |
|
| 1377 |
[RE-921: Rust post-session connect callbacks and normalization](RUST_CONNECT_TAIL.md).
|
|
|
|
|
|
|
|
|
|
|
|
| 1375 |
|
| 1376 |
|
| 1377 |
[RE-921: Rust post-session connect callbacks and normalization](RUST_CONNECT_TAIL.md).
|
| 1378 |
+
|
| 1379 |
+
|
| 1380 |
+
[RE-922: Complete original connect caller with recovered admission/lifecycle/tail](QVM_CONNECT_COMPLETE.md).
|
docs/research/qvm-connect-complete.json
ADDED
|
The diff for this file is too large to render.
See raw diff
|
|
|
scripts/analyze_qvm_connect_complete.py
ADDED
|
@@ -0,0 +1,26 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
#!/usr/bin/env python3
|
| 2 |
+
"""Execute the verified original QVM body; native effects are supplied or captured."""
|
| 3 |
+
import itertools
|
| 4 |
+
from pathlib import Path
|
| 5 |
+
from qvm_research_support import source,constants
|
| 6 |
+
from qvm_camera_world_support import B,run
|
| 7 |
+
from qvm_exit_rules_support import POOL,CPOOL
|
| 8 |
+
from analyze_qvm_acceleration import word,number
|
| 9 |
+
from analyze_qvm import write_json
|
| 10 |
+
|
| 11 |
+
def main():
|
| 12 |
+
q,raw,h,ins=source();rows=[]
|
| 13 |
+
from qvm_connect_policy_support import environment,filters,complete_connect,checksum,WATCH
|
| 14 |
+
from qvm_persistence_support import RESTORE,SCRATCH
|
| 15 |
+
from qvm_map_commands_support import put_string
|
| 16 |
+
from qvm_byte_memory_support import read_bytes
|
| 17 |
+
scenarios=[(0,1,b'1.2.3.4',b'secret',b'secret',False),(0,1,b'1.2.3.4',b'SECRET',b'secret',False),(0,1,b'1.2.3.4',b'secret',b'secret',True),(0,1,b'localhost',b'wrong',b'none',False),(1,0,b'1.2.3.4',b'wrong',b'secret',True),(1,1,b'1.2.3.4',b'wrong',b'secret',True),(-1,1,b'8.8.8.8',b'wrong',b'secret',False),(0,1,b'1.2',b'secret',b'secret',False)]
|
| 18 |
+
for mode,first,new,scenario in itertools.product([0,3,9],[0,1],[0,-1],range(8)):
|
| 19 |
+
bot,answer,ip,pw,password,matching=scenarios[scenario];info=b'\\ip\\'+ip+b'\\password\\'+pw+b'\\team\\S\\cl_guid\\ID';m,b=environment(raw,h);slot=3;pointer=CPOOL+6336*slot;entity=POOL+880*slot
|
| 20 |
+
for o in range(0,6336,4):m[pointer+o]=0xaabbccdd
|
| 21 |
+
put_string(m,b,pointer+504,b'old');put_string(m,b,34087240,password);m.update({34090788:mode,35000468:1,34089308:2,34992584:1,34085460:0,34992532:100,34992524:0,34064148:1,34992572:new,entity+520:0,entity+764:0xaabbccdd,entity+768:0xaabbccdd,entity+424:32,entity+532:0});scratch=0x7fffffff if scenario%2 else 0
|
| 22 |
+
for o in SCRATCH:m[RESTORE+o]=scratch
|
| 23 |
+
table=[(0xffffffff,0x04030201)] if matching else [];filters(m,table,1,0xaabbccdd if scenario==7 else 0);m,p,b=complete_connect(ins,m,b,slot,first,bot,info,answer,2 if scenario%2 else None,scratch);part=p['parts'];sets=part.get('parts',{}).get('session',{}).get('sets',[]);reads=part.get('cvars',[]);p.update(input=dict(mode=mode,first=first,new=new,scenario=scenario,bot=bot,answer=answer,ip=ip.hex(),provided=pw.hex(),password=password.hex(),userinfo=info.hex(),entries=table,filter_scratch=0xaabbccdd if scenario==7 else 0,scratch=scratch,changed=bool(scenario%2)),raw=read_bytes(m,b,pointer+3096,944).hex(),client_checksum=checksum(read_bytes(m,b,pointer,6336)),words={str(o):m[pointer+o]&0xffffffff for o in WATCH},entity=[m[entity+424]&0xffffffff,m[entity+532]&0xffffffff,m[entity+764]&0xffffffff,m[entity+768]&0xffffffff,int(m[entity+520]==pointer)],sets=sets,reads=reads,ring=m[23708]&0xffffffff,info_ring=m[23712]&0xffffffff);rows.append(p)
|
| 24 |
+
|
| 25 |
+
write_json(Path('docs/research/qvm-connect-complete.json'),{'source':q['source'],'sha256':q['sha256'],'root':173979,'probes':rows,'limits':'96 complete173979 executions compose actual userinfo/address/password admission, native client-clear boundary,247520 initialization or247219 restore, team normalization and bot/callback completion. Ordinary authentication rejection preserves client/entity state; bot rejection occurs after lifecycle side effects. Initializer-persisted timeout can precede a first-time overwrite. Client-wide checksums, watched bytes, exact messages, cvar order and selector/formatter carry are verified. Native admission/userinfo/team/ranking/IO/network callbacks remain supplied/captured; this is not native multiplayer acceptance.'})
|
| 26 |
+
if __name__=='__main__':main()
|
scripts/qvm_connect_complete_oracle.py
ADDED
|
@@ -0,0 +1,20 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
"""Independent complete-caller oracle, composed with suffix byte policy."""
|
| 2 |
+
from qvm_connect_tail_oracle import policy as tail
|
| 3 |
+
from qvm_connect_policy_support import checksum
|
| 4 |
+
from analyze_qvm_acceleration import word
|
| 5 |
+
def policy(a):
|
| 6 |
+
raw=bytearray((0xaabbccdd).to_bytes(4,'little')*1584);raw[504:516]=b'old'+b'\0'*9;put=lambda o,v:raw.__setitem__(slice(o,o+4),(v&0xffffffff).to_bytes(4,'little'));accepted=a['scenario'] not in [1,2];message=b'Invalid password'.hex() if a['scenario']==1 else b'Banned.'.hex() if a['scenario']==2 else None;events=[];choice=[];sets=[];reads=[];ring=0;ir=1 if a['scenario']==2 else 0;entity=[32,0,0xaabbccdd,0xaabbccdd,0]
|
| 7 |
+
if accepted:
|
| 8 |
+
raw=bytearray(6336);put(468,1);put(6156,3);entity=[32,0,0,0,1];fresh=bool(a['first'] or a['new']);choice=[247520 if fresh else 247219];events=[dict(op='zero',offset=0,length=6336)]
|
| 9 |
+
if fresh:
|
| 10 |
+
for o,v in [(3096,3 if a['mode']==3 else 0),(3104,100),(3108,1),(3140,60100),(3156,17)]:put(o,v)
|
| 11 |
+
raw[3164]=32;team=3 if a['mode']==3 else 0;sets=[[b'session3'.hex(),f'{team},17,0,60100,0,0,0,0,0'.encode().hex()],[b'sessIgnore3'.hex(),'']];ring=3;ir=1 if a['mode']==0 else 0
|
| 12 |
+
else:
|
| 13 |
+
put(3096,1);positive=bool(a['scratch'])
|
| 14 |
+
for o in [3152,3708,3712]:put(o,int(positive))
|
| 15 |
+
put(3740,int(positive and a['mode']==3));put(3784,1);put(3792,1);reads=[[b'session3'.hex(),b'1,-2,3,4,5,1,1,1,1'.hex()],[b'sessIgnore3'.hex(),b'1,3,'.hex()]];ring=2;ir=int(a['mode']==9)
|
| 16 |
+
if a['mode']==9:
|
| 17 |
+
for j,v in enumerate([9,8,7,6,5,4]):put(3716+4*j,word(v))
|
| 18 |
+
ring+=1
|
| 19 |
+
team=int.from_bytes(raw[3096:3100],'little');out=tail(dict(mode=a['mode'],team=team,bot=a['bot'],first=a['first'],answer=a['answer'],changed=a['changed'],now=100,seconds=0),initial=raw,include_raw=True);raw=bytearray(out.pop('raw_bytes'));events+=out['events'];accepted=out['accepted'];message=out['message'];ring+=out['ring'];entity[:2]=[out['entity_flags'],out['in_use']]
|
| 20 |
+
return dict(accepted=accepted,message=message,events=events,choice=choice,raw=bytes(raw[3096:4040]).hex(),client_checksum=checksum(raw),entity=entity,sets=sets,reads=reads,ring=ring,info_ring=ir)
|
scripts/qvm_connect_policy_support.py
CHANGED
|
@@ -17,7 +17,7 @@ def address_filter(ins,m,b,args):
|
|
| 17 |
def environment(raw,h):
|
| 18 |
from qvm_persistence_support import environment as base
|
| 19 |
from qvm_byte_memory_support import write_bytes
|
| 20 |
-
m,b=base(raw,h);write_bytes(m,b,{a:raw[h['data_offset']+a] for lo,hi in [(66288,66416),(68360,68384),(92256,92280)] for a in range(lo,hi)});return m,b
|
| 21 |
|
| 22 |
def filters(m,entries,mode,scratch):
|
| 23 |
m.update({36275948:len(entries),34082796:mode,FILTER+24:scratch})
|
|
@@ -70,3 +70,19 @@ def connect_tail(ins,m,b,slot,first,bot,bot_answer,after_team,name):
|
|
| 70 |
from qvm_exit_rules_support import CPOOL
|
| 71 |
events=[];m[TAIL+20]=CPOOL+6336*slot;m[TAIL+24]=POOL+880*slot
|
| 72 |
m,v,p,b=run(ins,m,174173,174397,1080,{8:slot,12:first,16:bot},b,tail_handlers(slot,bot_answer,after_team,name,events),base=TAIL);changes=p.pop('changes');p.update(events=events,change_count=len(changes),changes_sha256=hashlib.sha256(json.dumps(changes,sort_keys=True).encode()).hexdigest(),accepted=v==0,message=None if v==0 else cstring(m,b,v).hex());return m,p,b
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 17 |
def environment(raw,h):
|
| 18 |
from qvm_persistence_support import environment as base
|
| 19 |
from qvm_byte_memory_support import write_bytes
|
| 20 |
+
m,b=base(raw,h);write_bytes(m,b,{a:raw[h['data_offset']+a] for lo,hi in [(66288,66416),(68360,68384),(83568,83824),(92256,92280)] for a in range(lo,hi)});return m,b
|
| 21 |
|
| 22 |
def filters(m,entries,mode,scratch):
|
| 23 |
m.update({36275948:len(entries),34082796:mode,FILTER+24:scratch})
|
|
|
|
| 70 |
from qvm_exit_rules_support import CPOOL
|
| 71 |
events=[];m[TAIL+20]=CPOOL+6336*slot;m[TAIL+24]=POOL+880*slot
|
| 72 |
m,v,p,b=run(ins,m,174173,174397,1080,{8:slot,12:first,16:bot},b,tail_handlers(slot,bot_answer,after_team,name,events),base=TAIL);changes=p.pop('changes');p.update(events=events,change_count=len(changes),changes_sha256=hashlib.sha256(json.dumps(changes,sort_keys=True).encode()).hexdigest(),accepted=v==0,message=None if v==0 else cstring(m,b,v).hex());return m,p,b
|
| 73 |
+
|
| 74 |
+
def checksum(data):
|
| 75 |
+
value=14695981039346656037
|
| 76 |
+
for byte in data:value=((value^byte)*1099511628211)&0xffffffffffffffff
|
| 77 |
+
return value
|
| 78 |
+
|
| 79 |
+
def complete_connect(ins,m,b,slot,first,bot,userinfo,bot_answer,after_team,scratch):
|
| 80 |
+
import hashlib,json
|
| 81 |
+
from qvm_session_lifecycle_support import initialize
|
| 82 |
+
from qvm_persistence_support import restore_session
|
| 83 |
+
steps=[];state={};events=[];choice=[];parts={};handlers=admission_handlers(userinfo,steps,state);handlers.update(tail_handlers(slot,bot_answer,after_team,b'new^1name',events))
|
| 84 |
+
def fresh(i,m,a,bs):
|
| 85 |
+
choice.append(247520);m,p,b=initialize(i,m,dict(bs),a[8],userinfo,7,17);parts.update(p);return m,0,{'actual_source_child':247520}
|
| 86 |
+
def restored(i,m,a,bs):
|
| 87 |
+
choice.append(247219);data=b'9,8,7,6,5,4';m,p,b=restore_session(i,m,dict(bs),a[8],b'1,-2,3,4,5,1,1,1,1',b'1,3,',userinfo,b'ut4_test',7,len(data),data);parts.update(p);return m,0,{'actual_source_child':247219}
|
| 88 |
+
handlers.update({247520:fresh,247219:restored});m,v,p,b=run(ins,m,173979,174397,1080,{8:slot,12:first,16:bot},b,handlers,base=AUTH);changes=p.pop('changes');p.update(change_count=len(changes),changes_sha256=hashlib.sha256(json.dumps(changes,sort_keys=True).encode()).hexdigest(),steps=steps,filter=state,events=events,choice=choice,parts=parts,accepted=v==0,message=None if v==0 else cstring(m,b,v).hex());return m,p,b
|
scripts/qvm_connect_tail_oracle.py
CHANGED
|
@@ -1,18 +1,21 @@
|
|
| 1 |
"""Independent connect suffix state/event oracle."""
|
| 2 |
WATCH=[504,508,512,516,3096,3140,*range(668,696,4),*range(3204,3592,4)]
|
| 3 |
-
def policy(a):
|
| 4 |
-
raw=bytearray((0xaabbccdd).to_bytes(4,'little')*1584);put=lambda o,v:raw.__setitem__(slice(o,o+4),(v&0xffffffff).to_bytes(4,'little'));put(3096,a['team']);raw[504:516]=b'old'+b'\0'*9;team=(3 if a['team']==0 else a['team']) if a['mode']==3 else 3 if a['team']==3 else 0;put(3096,team);events=[dict(op='classify',mode=a['mode'])];flags=32;active=0;accepted=True;message=None;ring=0
|
| 5 |
if a['bot']:
|
| 6 |
-
flags|=8;active=1;events.append(dict(op='bot',slot=
|
| 7 |
if not a['answer']:accepted=False;message=b'BotConnectfailed'.hex()
|
| 8 |
if accepted:
|
| 9 |
if a['first']:raw[668:696]=b'\0'*28;put(3140,a['now']+a['seconds']*1000);events.append(dict(op='zero',offset=668,length=28))
|
| 10 |
-
events.append(dict(op='log',slot=
|
| 11 |
if a['first']:put(3588,0);raw[3204:3332]=b'\0'*128;raw[3332:3588]=b'\0'*256;events.extend([dict(op='zero',offset=3204,length=128),dict(op='zero',offset=3332,length=256)])
|
| 12 |
-
events.append(dict(op='userinfo',slot=
|
| 13 |
if a['changed']:team=2;put(3096,team)
|
| 14 |
if a['first']:events.extend([dict(op='format'),dict(op='send',recipient=-1,text=b'print "new^1name^7 connected\n"'.hex())]);ring=1
|
| 15 |
events.append(dict(op='classify',mode=a['mode']))
|
| 16 |
-
if a['mode']==3 and team!=3:events.append(dict(op='join',slot=
|
| 17 |
events.append(dict(op='rank'))
|
| 18 |
-
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
"""Independent connect suffix state/event oracle."""
|
| 2 |
WATCH=[504,508,512,516,3096,3140,*range(668,696,4),*range(3204,3592,4)]
|
| 3 |
+
def policy(a,initial=None,slot=3,include_raw=False):
|
| 4 |
+
raw=bytearray((0xaabbccdd).to_bytes(4,'little')*1584) if initial is None else bytearray(initial);put=lambda o,v:raw.__setitem__(slice(o,o+4),(v&0xffffffff).to_bytes(4,'little'));put(3096,a['team']);raw[504:516]=b'old'+b'\0'*9 if initial is None else raw[504:516];team=(3 if a['team']==0 else a['team']) if a['mode']==3 else 3 if a['team']==3 else 0;put(3096,team);events=[dict(op='classify',mode=a['mode'])];flags=32;active=0;accepted=True;message=None;ring=0
|
| 5 |
if a['bot']:
|
| 6 |
+
flags|=8;active=1;events.append(dict(op='bot',slot=slot,restart=int(not a['first'])))
|
| 7 |
if not a['answer']:accepted=False;message=b'BotConnectfailed'.hex()
|
| 8 |
if accepted:
|
| 9 |
if a['first']:raw[668:696]=b'\0'*28;put(3140,a['now']+a['seconds']*1000);events.append(dict(op='zero',offset=668,length=28))
|
| 10 |
+
events.append(dict(op='log',slot=slot))
|
| 11 |
if a['first']:put(3588,0);raw[3204:3332]=b'\0'*128;raw[3332:3588]=b'\0'*256;events.extend([dict(op='zero',offset=3204,length=128),dict(op='zero',offset=3332,length=256)])
|
| 12 |
+
events.append(dict(op='userinfo',slot=slot));raw[504:514]=b'new^1name\0'
|
| 13 |
if a['changed']:team=2;put(3096,team)
|
| 14 |
if a['first']:events.extend([dict(op='format'),dict(op='send',recipient=-1,text=b'print "new^1name^7 connected\n"'.hex())]);ring=1
|
| 15 |
events.append(dict(op='classify',mode=a['mode']))
|
| 16 |
+
if a['mode']==3 and team!=3:events.append(dict(op='join',slot=slot,choice=-1))
|
| 17 |
events.append(dict(op='rank'))
|
| 18 |
+
result=dict(words={str(o):int.from_bytes(raw[o:o+4],'little') for o in WATCH},events=events,entity_flags=flags,in_use=active,accepted=accepted,message=message,ring=ring)
|
| 19 |
+
|
| 20 |
+
if include_raw:result["raw_bytes"]=bytes(raw)
|
| 21 |
+
return result
|
scripts/test_qvm_connect_complete.py
ADDED
|
@@ -0,0 +1,11 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
import json,unittest
|
| 2 |
+
from pathlib import Path
|
| 3 |
+
class OriginalTests(unittest.TestCase):
|
| 4 |
+
def test_instruction_results(self):
|
| 5 |
+
rows=json.loads(Path('docs/research/qvm-connect-complete.json').read_text())['probes']
|
| 6 |
+
self.assertEqual(len(rows),96)
|
| 7 |
+
from qvm_connect_complete_oracle import policy
|
| 8 |
+
for p in rows:
|
| 9 |
+
for k,v in policy(p['input']).items():self.assertEqual(p[k],v)
|
| 10 |
+
|
| 11 |
+
if __name__=='__main__':unittest.main()
|
xtask/checks.tsv
CHANGED
|
@@ -2981,3 +2981,12 @@ report scripts/analyze_rust_connect_tail.py docs/research/rust-connect-tail.json
|
|
| 2981 |
edge docs/research/rust-connect-tail.json scripts/test_rust_connect_tail.py
|
| 2982 |
group rust-connect-tail scripts/analyze_rust_connect_tail.py
|
| 2983 |
edge scripts/analyze_rust_connect_tail.py scripts/analyze_qvm_resumer_audit.py
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 2981 |
edge docs/research/rust-connect-tail.json scripts/test_rust_connect_tail.py
|
| 2982 |
group rust-connect-tail scripts/analyze_rust_connect_tail.py
|
| 2983 |
edge scripts/analyze_rust_connect_tail.py scripts/analyze_qvm_resumer_audit.py
|
| 2984 |
+
edge scripts/qvm_connect_complete_oracle.py scripts/test_qvm_connect_complete.py
|
| 2985 |
+
group qvm-connect-complete scripts/analyze_qvm_connect_tail.py
|
| 2986 |
+
report scripts/analyze_qvm_connect_complete.py docs/research/qvm-connect-complete.json
|
| 2987 |
+
edge docs/research/qvm-connect-complete.json scripts/test_qvm_connect_complete.py
|
| 2988 |
+
group qvm-connect-complete scripts/analyze_qvm_connect_complete.py
|
| 2989 |
+
edge scripts/analyze_qvm_connect_complete.py scripts/analyze_qvm_resumer_audit.py
|
| 2990 |
+
edge scripts/qvm_connect_complete_oracle.py scripts/analyze_qvm_resumer_audit.py
|
| 2991 |
+
group qvm-connect-complete scripts/analyze_qvm_connect_admission.py
|
| 2992 |
+
group qvm-connect-complete scripts/analyze_qvm_address_filter.py
|