nmarshall commited on
Commit
ce4435c
·
1 Parent(s): bc3e762

qvm: recover bot settings admission wrapper

Browse files
docs/FINDINGS.md CHANGED
@@ -1769,3 +1769,6 @@ RE-813–822 replaces the scoreboard decimal assumption with actual37914 executi
1769
 
1770
 
1771
  **RE-923:** Rust matches96 complete173979 executions across admission, client clear, initialization/restore, bot admission and callback completion. Auth denial preserves client/entity state; bot denial retains lifecycle effects. Source messages, cvar timing, full-client checksums, raw watched bytes and selector/formatter carry match. Native callback bodies, actual network/IO acceptance and runtime integration remain open. [Evidence](research/RUST_CONNECT_COMPLETE.md).
 
 
 
 
1769
 
1770
 
1771
  **RE-923:** Rust matches96 complete173979 executions across admission, client clear, initialization/restore, bot admission and callback completion. Auth denial preserves client/entity state; bot denial retains lifecycle effects. Source messages, cvar timing, full-client checksums, raw watched bytes and selector/formatter carry match. Native callback bodies, actual network/IO acceptance and runtime integration remain open. [Evidence](research/RUST_CONNECT_COMPLETE.md).
1772
+
1773
+
1774
+ **RE-924:** 288 actual161744 cases execute original userinfo lookup, bounded copy and37144/36779 float conversion. The292-byte setup record contains144-byte characterfile, raw f32 skill and144-byte team fields; logical strings truncate143 bytes and pad with NUL. Three lookups alternate the userinfo buffer selector. Supplied125185 setup result is normalized to0/1; zero requests native client drop with exact text. Actual bot setup125185, engine userinfo/drop and native strncpy remain supplied/captured/modeled boundaries. [Evidence](research/QVM_BOT_SETTINGS.md).
docs/PROVISIONAL_TODO.md CHANGED
@@ -1812,3 +1812,6 @@ RE-923: Rust matches96 complete173979 executions across admission, client clear,
1812
 
1813
 
1814
  RE-914–923 completed bounded comparison/filter/admission/completion and whole173979 caller composition. RE-924 tracks concrete callback bodies, filter writers, native engine ownership and full runtime integration. [Batch and next work](research/QVM_CONNECT_POLICY_BATCH.md).
 
 
 
 
1812
 
1813
 
1814
  RE-914–923 completed bounded comparison/filter/admission/completion and whole173979 caller composition. RE-924 tracks concrete callback bodies, filter writers, native engine ownership and full runtime integration. [Batch and next work](research/QVM_CONNECT_POLICY_BATCH.md).
1815
+
1816
+
1817
+ RE-924: 288 actual161744 cases execute original userinfo lookup, bounded copy and37144/36779 float conversion. The292-byte setup record contains144-byte characterfile, raw f32 skill and144-byte team fields; logical strings truncate143 bytes and pad with NUL. Three lookups alternate the userinfo buffer selector. Supplied125185 setup result is normalized to0/1; zero requests native client drop with exact text. Actual bot setup125185, engine userinfo/drop and native strncpy remain supplied/captured/modeled boundaries. Full runtime completion remains open. [Evidence](research/QVM_BOT_SETTINGS.md).
docs/RESEARCH_LEDGER.md CHANGED
@@ -2345,3 +2345,8 @@ Rust matches96 complete173979 executions across admission, client clear, initial
2345
  ### RE-914–923 full batch validation (2026-10-28)
2346
 
2347
  After the tenth commit, `cargo xtask test-full --since 2b1ac7ec` passed on its first full attempt with the flake-declared Nix Python: 1,783 Python tests,216 Rust tests (assets10, gameplay176, xtask30),32 affected report producers regenerated twice deterministically, storage policy,491 documentation link checks and whitespace guards. No generated-report drift. Ten task commits since2b1ac7ec; validation notes are amended into the tenth commit. [Findings and next work](research/QVM_CONNECT_POLICY_BATCH.md).
 
 
 
 
 
 
2345
  ### RE-914–923 full batch validation (2026-10-28)
2346
 
2347
  After the tenth commit, `cargo xtask test-full --since 2b1ac7ec` passed on its first full attempt with the flake-declared Nix Python: 1,783 Python tests,216 Rust tests (assets10, gameplay176, xtask30),32 affected report producers regenerated twice deterministically, storage policy,491 documentation link checks and whitespace guards. No generated-report drift. Ten task commits since2b1ac7ec; validation notes are amended into the tenth commit. [Findings and next work](research/QVM_CONNECT_POLICY_BATCH.md).
2348
+
2349
+
2350
+ ## 2026-10-28 — RE-924 Original bot settings admission wrapper
2351
+
2352
+ 288 actual161744 cases execute original userinfo lookup, bounded copy and37144/36779 float conversion. The292-byte setup record contains144-byte characterfile, raw f32 skill and144-byte team fields; logical strings truncate143 bytes and pad with NUL. Three lookups alternate the userinfo buffer selector. Supplied125185 setup result is normalized to0/1; zero requests native client drop with exact text. Actual bot setup125185, engine userinfo/drop and native strncpy remain supplied/captured/modeled boundaries. Focused `cargo xtask test-group qvm-bot-settings` passes (4 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
@@ -1849,3 +1849,6 @@ Purpose: turn the supplied installation into an evidence-backed specification of
1849
 
1850
 
1851
  - [ ] RE-924 Recover bot/userinfo/team/ranking callback bodies, filter writers and native engine acceptance, with remaining scalar/alias and full runtime integration ([next work](research/QVM_CONNECT_POLICY_BATCH.md)).
 
 
 
 
1849
 
1850
 
1851
  - [ ] RE-924 Recover bot/userinfo/team/ranking callback bodies, filter writers and native engine acceptance, with remaining scalar/alias and full runtime integration ([next work](research/QVM_CONNECT_POLICY_BATCH.md)).
1852
+
1853
+
1854
+ - [x] RE-924 Original bot settings admission wrapper ([evidence](research/QVM_BOT_SETTINGS.md)).
docs/research/QVM_BOT_SETTINGS.md ADDED
@@ -0,0 +1,7 @@
 
 
 
 
 
 
 
 
1
+ # Original bot settings admission wrapper
2
+
3
+ RE-924. Reproduce with `python3 scripts/analyze_qvm_bot_settings.py`; focused validation: `cargo xtask test-group qvm-bot-settings`. [Machine report](qvm-bot-settings.json).
4
+
5
+ 288 actual161744 cases execute original userinfo lookup, bounded copy and37144/36779 float conversion. The292-byte setup record contains144-byte characterfile, raw f32 skill and144-byte team fields; logical strings truncate143 bytes and pad with NUL. Three lookups alternate the userinfo buffer selector. Supplied125185 setup result is normalized to0/1; zero requests native client drop with exact text. Actual bot setup125185, engine userinfo/drop and native strncpy remain supplied/captured/modeled boundaries.
6
+
7
+ Original executable/native runtime and complete Linux/macOS Rust/Bevy/Solari acceptance remain unverified.
docs/research/README.md CHANGED
@@ -1384,3 +1384,6 @@ The extension collector adds five focused tests for native tail calls, command-r
1384
 
1385
 
1386
  [RE-914–923 complete connect caller policy batch](QVM_CONNECT_POLICY_BATCH.md).
 
 
 
 
1384
 
1385
 
1386
  [RE-914–923 complete connect caller policy batch](QVM_CONNECT_POLICY_BATCH.md).
1387
+
1388
+
1389
+ [RE-924: Original bot settings admission wrapper](QVM_BOT_SETTINGS.md).
docs/research/qvm-bot-settings.json ADDED
The diff for this file is too large to render. See raw diff
 
scripts/analyze_qvm_bot_settings.py ADDED
@@ -0,0 +1,18 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
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_callback_support import environment,bot_settings
14
+ for file,skill,team,restart,answer in itertools.product([b'',b'bots/a.c',b'X'*200,b'\xffchar'],[b'',b'1.5',b'-1.25',b'2tail'],[b'',b'red',b'R'*200],[0,1],[0,1,-1]):
15
+ info=b'\\characterfile\\'+file+b'\\skill\\'+skill+b'\\team\\'+team;m,b=environment(raw,h);m,p,b=bot_settings(ins,m,b,3,restart,info,answer);p.update(input=dict(file=file.hex(),skill=skill.hex(),team=team.hex(),restart=restart,answer=answer,userinfo=info.hex()),ring=m[23712]&0xffffffff);rows.append(p)
16
+
17
+ write_json(Path('docs/research/qvm-bot-settings.json'),{'source':q['source'],'sha256':q['sha256'],'root':161744,'probes':rows,'limits':'288 actual161744 cases execute original userinfo lookup, bounded copy and37144/36779 float conversion. The292-byte setup record contains144-byte characterfile, raw f32 skill and144-byte team fields; logical strings truncate143 bytes and pad with NUL. Three lookups alternate the userinfo buffer selector. Supplied125185 setup result is normalized to0/1; zero requests native client drop with exact text. Actual bot setup125185, engine userinfo/drop and native strncpy remain supplied/captured/modeled boundaries.'})
18
+ if __name__=='__main__':main()
scripts/qvm_connect_callback_support.py ADDED
@@ -0,0 +1,26 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ """Original bot settings wrapper and connect announcements."""
2
+ from qvm_camera_world_support import B,run
3
+ from qvm_string_memory_support import cstring,copy_bounded
4
+ from qvm_persistence_support import info_lookup
5
+ from qvm_byte_memory_support import read_bytes,write_bytes
6
+ BOT=B+0x80000
7
+ ANNOUNCE=B+0x84000
8
+
9
+ def environment(raw,h):
10
+ from qvm_connect_policy_support import environment as base
11
+ m,b=base(raw,h);write_bytes(m,b,{a:raw[h['data_offset']+a] for lo,hi in [(65360,65488),(78512,78584)] for a in range(lo,hi)});return m,b
12
+
13
+ def bot_settings(ins,m,b,slot,restart,userinfo,answer):
14
+ calls=[];settings=[];lookups=[]
15
+ def get(i,m,a,bs):
16
+ calls.append(dict(op='userinfo',slot=a[8]));data=userinfo.split(b'\0')[0][:a[16]-1];return m,0,{'engine_userinfo_supplied':True,'child_memory_bytes':{a[12]+j:v for j,v in enumerate((data+b'\0').ljust(a[16],b'\0'))}}
17
+ def lookup(i,m,a,bs):
18
+ lookups.append(cstring(m,bs,a[12]).hex());m,v,p,b=info_lookup(i,m,dict(bs),a);return m,v,{'actual_source_child':70503,'child_memory_bytes':{v+j:x for j,x in enumerate(cstring(m,b,v)+b'\0')}}
19
+ def copy(i,m,a,bs):return copy_bounded(i,m,a,dict(bs))
20
+ def number(i,m,a,bs):
21
+ def actual(j,m,v,vs):
22
+ m,r,p,b=run(j,m,36779,37142,52,v,dict(vs),base=BOT+0x2000);return m,r,{'actual_source_child':36779}
23
+ m,v,p,b=run(i,m,37144,37157,20,a,dict(bs),{36779:actual},base=BOT+0x1000);return m,v,{'actual_source_child':37144}
24
+ def setup(i,m,a,bs):settings.append(read_bytes(m,bs,a[12],292).hex());calls.append(dict(op='setup',slot=a[8],restart=a[16]));return m,answer,{'bot_setup_answer_supplied':True}
25
+ def drop(i,m,a,bs):calls.append(dict(op='drop',slot=a[8],message=cstring(m,bs,a[12]).hex()));return m,0,{'engine_drop_captured':True}
26
+ m,v,p,b=run(ins,m,161744,161840,1356,{8:slot,12:restart},b,{-21:get,70503:lookup,69338:copy,37144:number,125185:setup,-17:drop},base=BOT);p.update(calls=calls,lookups=lookups,settings=settings,result=v);return m,p,b
scripts/test_qvm_bot_settings.py ADDED
@@ -0,0 +1,13 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
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-bot-settings.json').read_text())['probes']
6
+ self.assertEqual(len(rows),288)
7
+ from qvm_scan_oracle import scan
8
+ for p in rows:
9
+ a=p['input'];skill=scan(bytes.fromhex(a['skill']),'f',1)[1][0];field=lambda s:(bytes.fromhex(s)[:143]+b'\0').ljust(144,b'\0');raw=field(a['file'])+skill.to_bytes(4,'little')+field(a['team']);self.assertEqual(p['settings'],[raw.hex()]);self.assertEqual(p['lookups'],[b'characterfile'.hex(),b'skill'.hex(),b'team'.hex()]);calls=[dict(op='userinfo',slot=3),dict(op='setup',slot=3,restart=a['restart'])]
10
+ if not a['answer']:calls.append(dict(op='drop',slot=3,message=b'BotAISetupClient failed'.hex()))
11
+ self.assertEqual(p['calls'],calls);self.assertEqual(p['result'],int(bool(a['answer'])));self.assertEqual(p['ring'],1)
12
+
13
+ if __name__=='__main__':unittest.main()
xtask/checks.tsv CHANGED
@@ -3005,3 +3005,9 @@ report scripts/analyze_rust_connect_complete.py docs/research/rust-connect-compl
3005
  edge docs/research/rust-connect-complete.json scripts/test_rust_connect_complete.py
3006
  group rust-connect-complete scripts/analyze_rust_connect_complete.py
3007
  edge scripts/analyze_rust_connect_complete.py scripts/analyze_qvm_resumer_audit.py
 
 
 
 
 
 
 
3005
  edge docs/research/rust-connect-complete.json scripts/test_rust_connect_complete.py
3006
  group rust-connect-complete scripts/analyze_rust_connect_complete.py
3007
  edge scripts/analyze_rust_connect_complete.py scripts/analyze_qvm_resumer_audit.py
3008
+ edge scripts/qvm_scan_oracle.py scripts/test_qvm_bot_settings.py
3009
+ report scripts/analyze_qvm_bot_settings.py docs/research/qvm-bot-settings.json
3010
+ edge docs/research/qvm-bot-settings.json scripts/test_qvm_bot_settings.py
3011
+ group qvm-bot-settings scripts/analyze_qvm_bot_settings.py
3012
+ edge scripts/analyze_qvm_bot_settings.py scripts/analyze_qvm_resumer_audit.py
3013
+ edge scripts/qvm_connect_callback_support.py scripts/analyze_qvm_resumer_audit.py