nmarshall commited on
Commit
5de3e22
·
1 Parent(s): dcdd22a

qvm: recover session and ignore-list serialization

Browse files
docs/FINDINGS.md CHANGED
@@ -1661,3 +1661,6 @@ RE-813–822 replaces the scoreboard decimal assumption with actual37914 executi
1661
 
1662
 
1663
  **RE-887:** Rust matches128 original continuous camera/queried-fallback/placement cases, including exact query order and primary-camera bypass. Spatial callbacks use the same recovered box/filter policy as standalone fallback. Existing camera/spawn APIs retain their contracts; native broadphase/math and complete respawn/intermission remain open. [Evidence](research/RUST_QUERIED_CAMERA.md).
 
 
 
 
1661
 
1662
 
1663
  **RE-887:** Rust matches128 original continuous camera/queried-fallback/placement cases, including exact query order and primary-camera bypass. Spatial callbacks use the same recovered box/filter policy as standalone fallback. Existing camera/spawn APIs retain their contracts; native broadphase/math and complete respawn/intermission remain open. [Evidence](research/RUST_QUERIED_CAMERA.md).
1664
+
1665
+
1666
+ **RE-888:** 60 actual246963 cases execute original70458/37914 integer formatting and70031/36038/69338 bounded concatenation. Five raw integers and four normalized booleans populate sessionN; sessIgnoreN follows entity client-pointer indirection, accepts flag exactly1, keeps duplicates, caps scan64 and truncates to127 bytes. Includes negative/oversized counts, two slots, INT_MIN formatter behavior and saturation. Native memset/strncpy are modeled and engine cvar writes captured; restore/engine persistence remain open. [Evidence](research/QVM_SESSION_WRITE.md).
docs/PROVISIONAL_TODO.md CHANGED
@@ -1692,3 +1692,6 @@ RE-886: 128 coherent6717/168114/167638/6575 cases execute box construction and c
1692
 
1693
 
1694
  RE-887: Rust matches128 original continuous camera/queried-fallback/placement cases, including exact query order and primary-camera bypass. Spatial callbacks use the same recovered box/filter policy as standalone fallback. Existing camera/spawn APIs retain their contracts; native broadphase/math and complete respawn/intermission remain open. Full runtime completion remains open. [Evidence](research/RUST_QUERIED_CAMERA.md).
 
 
 
 
1692
 
1693
 
1694
  RE-887: Rust matches128 original continuous camera/queried-fallback/placement cases, including exact query order and primary-camera bypass. Spatial callbacks use the same recovered box/filter policy as standalone fallback. Existing camera/spawn APIs retain their contracts; native broadphase/math and complete respawn/intermission remain open. Full runtime completion remains open. [Evidence](research/RUST_QUERIED_CAMERA.md).
1695
+
1696
+
1697
+ RE-888: 60 actual246963 cases execute original70458/37914 integer formatting and70031/36038/69338 bounded concatenation. Five raw integers and four normalized booleans populate sessionN; sessIgnoreN follows entity client-pointer indirection, accepts flag exactly1, keeps duplicates, caps scan64 and truncates to127 bytes. Includes negative/oversized counts, two slots, INT_MIN formatter behavior and saturation. Native memset/strncpy are modeled and engine cvar writes captured; restore/engine persistence remain open. Full runtime completion remains open. [Evidence](research/QVM_SESSION_WRITE.md).
docs/RESEARCH_LEDGER.md CHANGED
@@ -2145,3 +2145,8 @@ Rust matches64 original168114/167638 compositions and their ordered box query tr
2145
  ## 2026-10-28 — RE-887 Rust camera with lazy spatial queries
2146
 
2147
  Rust matches128 original continuous camera/queried-fallback/placement cases, including exact query order and primary-camera bypass. Spatial callbacks use the same recovered box/filter policy as standalone fallback. Existing camera/spawn APIs retain their contracts; native broadphase/math and complete respawn/intermission remain open. Focused `cargo xtask test-group rust-queried-camera` 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.
 
 
 
 
 
 
2145
  ## 2026-10-28 — RE-887 Rust camera with lazy spatial queries
2146
 
2147
  Rust matches128 original continuous camera/queried-fallback/placement cases, including exact query order and primary-camera bypass. Spatial callbacks use the same recovered box/filter policy as standalone fallback. Existing camera/spawn APIs retain their contracts; native broadphase/math and complete respawn/intermission remain open. Focused `cargo xtask test-group rust-queried-camera` 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.
2148
+
2149
+
2150
+ ## 2026-10-28 — RE-888 Original session and ignore-list cvar serialization
2151
+
2152
+ 60 actual246963 cases execute original70458/37914 integer formatting and70031/36038/69338 bounded concatenation. Five raw integers and four normalized booleans populate sessionN; sessIgnoreN follows entity client-pointer indirection, accepts flag exactly1, keeps duplicates, caps scan64 and truncates to127 bytes. Includes negative/oversized counts, two slots, INT_MIN formatter behavior and saturation. Native memset/strncpy are modeled and engine cvar writes captured; restore/engine persistence remain open. Focused `cargo xtask test-group qvm-session-write` 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
@@ -1729,3 +1729,6 @@ Purpose: turn the supplied installation into an evidence-backed specification of
1729
 
1730
 
1731
  - [x] RE-887 Rust camera with lazy spatial queries ([evidence](research/RUST_QUERIED_CAMERA.md)).
 
 
 
 
1729
 
1730
 
1731
  - [x] RE-887 Rust camera with lazy spatial queries ([evidence](research/RUST_QUERIED_CAMERA.md)).
1732
+
1733
+
1734
+ - [x] RE-888 Original session and ignore-list cvar serialization ([evidence](research/QVM_SESSION_WRITE.md)).
docs/research/QVM_SESSION_WRITE.md ADDED
@@ -0,0 +1,7 @@
 
 
 
 
 
 
 
 
1
+ # Original session and ignore-list cvar serialization
2
+
3
+ RE-888. Reproduce with `python3 scripts/analyze_qvm_session_write.py`; focused validation: `cargo xtask test-group qvm-session-write`. [Machine report](qvm-session-write.json).
4
+
5
+ 60 actual246963 cases execute original70458/37914 integer formatting and70031/36038/69338 bounded concatenation. Five raw integers and four normalized booleans populate sessionN; sessIgnoreN follows entity client-pointer indirection, accepts flag exactly1, keeps duplicates, caps scan64 and truncates to127 bytes. Includes negative/oversized counts, two slots, INT_MIN formatter behavior and saturation. Native memset/strncpy are modeled and engine cvar writes captured; restore/engine persistence remain open.
6
+
7
+ Original executable/native runtime and complete Linux/macOS Rust/Bevy/Solari acceptance remain unverified.
docs/research/README.md CHANGED
@@ -1264,3 +1264,6 @@ The extension collector adds five focused tests for native tail calls, command-r
1264
 
1265
 
1266
  [RE-887: Rust camera with lazy spatial queries](RUST_QUERIED_CAMERA.md).
 
 
 
 
1264
 
1265
 
1266
  [RE-887: Rust camera with lazy spatial queries](RUST_QUERIED_CAMERA.md).
1267
+
1268
+
1269
+ [RE-888: Original session and ignore-list cvar serialization](QVM_SESSION_WRITE.md).
docs/research/qvm-session-write.json ADDED
The diff for this file is too large to render. See raw diff
 
scripts/analyze_qvm_session_write.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_session_support import environment,records,session
14
+ for count,slot,profile,mapping in itertools.product([-1,0,8,64,80],[0,3],range(3),range(2)):
15
+ m,b=environment(raw,h);values,indices,flags=records(m,slot,count,profile,mapping);m,p,b=session(ins,m,b,CPOOL+6336*slot);p.update(input=dict(count=count,slot=slot,profile=profile,mapping=mapping,values=values,indices=indices,flags=flags),ring=m[23708]&0xffffffff);rows.append(p)
16
+
17
+ write_json(Path('docs/research/qvm-session-write.json'),{'source':q['source'],'sha256':q['sha256'],'root':246963,'probes':rows,'limits':'60 actual246963 cases execute original70458/37914 integer formatting and70031/36038/69338 bounded concatenation. Five raw integers and four normalized booleans populate sessionN; sessIgnoreN follows entity client-pointer indirection, accepts flag exactly1, keeps duplicates, caps scan64 and truncates to127 bytes. Includes negative/oversized counts, two slots, INT_MIN formatter behavior and saturation. Native memset/strncpy are modeled and engine cvar writes captured; restore/engine persistence remain open.'})
18
+ if __name__=='__main__':main()
scripts/qvm_session_support.py ADDED
@@ -0,0 +1,32 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ """Actual246963 session cvars, formatter and bounded ignore-list concatenation."""
2
+ from qvm_camera_world_support import B,POOL,run
3
+ from qvm_exit_rules_support import CPOOL
4
+ from qvm_formatter_support import formatter_env,formatter,image_bytes
5
+ from qvm_scoreboard_wire_support import final_format
6
+ from qvm_string_memory_support import cstring,strlen,copy_bounded
7
+ from qvm_map_commands_support import put_string
8
+ FIELDS=[3096,3156,3144,3140,3148,3152,3708,3712,3740]
9
+ BASE=B+0x18000
10
+ def environment(raw,h):
11
+ m,b=formatter_env(raw,h);m[23708]=0
12
+ from qvm_byte_memory_support import write_bytes
13
+ write_bytes(m,b,{a:raw[h['data_offset']+a] for a in range(83632,83728)})
14
+ return m,b
15
+ def records(m,slot,count,profile,mapping):
16
+ values=[[0]*9,[-2147483648,2147483647,-1,17,-21,-1,0,2,-2147483648],[3,-7,99,101,-103,0,1,-1,4]][profile];p=CPOOL+6336*slot;m.update({34992496:CPOOL,34992524:count})
17
+ for o,v in zip(FIELDS,values):m[p+o]=v
18
+ indices=[j if mapping==0 else j%3 for j in range(64)];flags=[1 if profile==0 else [0,1,2,-1][j%4] for j in range(64)]
19
+ for j in range(64):m[POOL+880*j+520]=CPOOL+6336*indices[j];m[p+3780+4*j]=flags[j]
20
+ return values,indices,flags
21
+ def session(ins,m,b,pointer):
22
+ sets=[];formats=[];warnings=[]
23
+ def fmt(i,m,a,bs):
24
+ m,v,p=final_format(i,m,a,dict(bs),formatter);formats.append(p['wrapper_trace_sha256']);return m,v,p
25
+ def set_cvar(i,m,a,bs):sets.append([cstring(m,bs,a[8]).hex(),cstring(m,bs,a[12]).hex()]);return m,0,{'engine_cvar_set_captured':True}
26
+ def zero(i,m,a,bs):
27
+ assert a[12]==0 and a[16]==128
28
+ return m,a[8],{'native_memset_modeled':True,'child_memory_bytes':{a[8]+j:0 for j in range(a[16])}}
29
+ def warning(i,m,a,bs):warnings.append(a);return m,0,{'diagnostic_captured':True}
30
+ def append(i,m,a,bs):
31
+ m,v,p,b=run(i,m,70031,70073,32,a,dict(bs),{36038:strlen,69338:copy_bounded,5096:warning},base=B+0x1a000);return m,0,{'actual_source_child':70031}
32
+ m,v,p,b=run(ins,m,246963,247217,224,{8:pointer},b,{70458:fmt,-6:set_cvar,-101:zero,70031:append},base=BASE);p.update(sets=sets,formats=formats,warnings=warnings);return m,p,b
scripts/test_qvm_session_write.py ADDED
@@ -0,0 +1,14 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
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-session-write.json').read_text())['probes']
6
+ self.assertEqual(len(rows),60)
7
+ def dec(v):
8
+ if v!=-2147483648:return str(v).encode()
9
+ return b'-./,),(-*,('
10
+ for p in rows:
11
+ a=p['input'];fields=a['values'][:5]+[int(v!=0) for v in a['values'][5:]];value=b','.join(dec(v) for v in fields);ignored=[j for j in a['indices'][:max(0,min(a['count'],64))] if a['flags'][j]==1];text=b''.join(str(j).encode()+b',' for j in ignored)[:127];self.assertEqual(p['sets'],[[f"session{a['slot']}".encode().hex(),value.hex()],[f"sessIgnore{a['slot']}".encode().hex(),text.hex()]]);self.assertEqual(p['ring'],3+len(ignored));self.assertEqual(len(p['formats']),p['ring']);self.assertFalse(p['warnings'])
12
+ self.assertTrue(any(len(bytes.fromhex(p['sets'][1][1]))==127 for p in rows))
13
+
14
+ if __name__=='__main__':unittest.main()
xtask/checks.tsv CHANGED
@@ -2648,3 +2648,8 @@ report scripts/analyze_rust_queried_camera.py docs/research/rust-queried-camera.
2648
  edge docs/research/rust-queried-camera.json scripts/test_rust_queried_camera.py
2649
  group rust-queried-camera scripts/analyze_rust_queried_camera.py
2650
  edge scripts/analyze_rust_queried_camera.py scripts/analyze_qvm_resumer_audit.py
 
 
 
 
 
 
2648
  edge docs/research/rust-queried-camera.json scripts/test_rust_queried_camera.py
2649
  group rust-queried-camera scripts/analyze_rust_queried_camera.py
2650
  edge scripts/analyze_rust_queried_camera.py scripts/analyze_qvm_resumer_audit.py
2651
+ report scripts/analyze_qvm_session_write.py docs/research/qvm-session-write.json
2652
+ edge docs/research/qvm-session-write.json scripts/test_qvm_session_write.py
2653
+ group qvm-session-write scripts/analyze_qvm_session_write.py
2654
+ edge scripts/analyze_qvm_session_write.py scripts/analyze_qvm_resumer_audit.py
2655
+ edge scripts/qvm_session_support.py scripts/analyze_qvm_resumer_audit.py