nmarshall commited on
Commit
3c27f25
·
1 Parent(s): 20d7c36

qvm: recover spawn overlap query policy

Browse files
docs/FINDINGS.md CHANGED
@@ -1637,3 +1637,6 @@ RE-813–822 replaces the scoreboard decimal assumption with actual37914 executi
1637
 
1638
 
1639
  **RE-879:** Rust matches all72 original249007 schedules and state snapshots, including disconnect-before-second-child and activation-before-later-scan cases. The bounded API accepts typed callbacks and validates the count before invoking them. Count/base remain stable; actual246746/246963 child bodies and engine integration remain open. [Evidence](research/RUST_POST_MAP_CLIENTS.md).
 
 
 
 
1637
 
1638
 
1639
  **RE-879:** Rust matches all72 original249007 schedules and state snapshots, including disconnect-before-second-child and activation-before-later-scan cases. The bounded API accepts typed callbacks and validates the count before invoking them. Count/base remain stable; actual246746/246963 child bodies and engine integration remain open. [Evidence](research/RUST_POST_MAP_CLIENTS.md).
1640
+
1641
+
1642
+ **RE-880:** 32 actual167638 cases recover f32 origin-plus-six-source-bounds construction, native -33 box query with capacity1024 and returned-index iteration. Any entity with nonzero client pointer at offset520 blocks the spawn; other activity/health/team flags are not tested here. Covers duplicate indices, negative/zero query counts, signed/nonzero client words, f32 rounding and a client at result1024. Engine spatial query answers remain supplied; invalid engine counts/indices and nonfinite bounds are excluded. [Evidence](research/QVM_SPAWN_OVERLAP.md).
docs/PROVISIONAL_TODO.md CHANGED
@@ -1665,3 +1665,6 @@ RE-878: 72 actual249007 cases recover signed live client-count iteration and con
1665
 
1666
 
1667
  RE-879: Rust matches all72 original249007 schedules and state snapshots, including disconnect-before-second-child and activation-before-later-scan cases. The bounded API accepts typed callbacks and validates the count before invoking them. Count/base remain stable; actual246746/246963 child bodies and engine integration remain open. Full runtime completion remains open. [Evidence](research/RUST_POST_MAP_CLIENTS.md).
 
 
 
 
1665
 
1666
 
1667
  RE-879: Rust matches all72 original249007 schedules and state snapshots, including disconnect-before-second-child and activation-before-later-scan cases. The bounded API accepts typed callbacks and validates the count before invoking them. Count/base remain stable; actual246746/246963 child bodies and engine integration remain open. Full runtime completion remains open. [Evidence](research/RUST_POST_MAP_CLIENTS.md).
1668
+
1669
+
1670
+ RE-880: 32 actual167638 cases recover f32 origin-plus-six-source-bounds construction, native -33 box query with capacity1024 and returned-index iteration. Any entity with nonzero client pointer at offset520 blocks the spawn; other activity/health/team flags are not tested here. Covers duplicate indices, negative/zero query counts, signed/nonzero client words, f32 rounding and a client at result1024. Engine spatial query answers remain supplied; invalid engine counts/indices and nonfinite bounds are excluded. Full runtime completion remains open. [Evidence](research/QVM_SPAWN_OVERLAP.md).
docs/RESEARCH_LEDGER.md CHANGED
@@ -2100,3 +2100,8 @@ Rust matches all64 actual121987 fitness/selection/interbreed/mutation/reset tran
2100
  ## 2026-10-28 — RE-879 Rust post-map callback scheduling
2101
 
2102
  Rust matches all72 original249007 schedules and state snapshots, including disconnect-before-second-child and activation-before-later-scan cases. The bounded API accepts typed callbacks and validates the count before invoking them. Count/base remain stable; actual246746/246963 child bodies and engine integration remain open. Focused `cargo xtask test-group rust-post-map-clients` 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.
 
 
 
 
 
 
2100
  ## 2026-10-28 — RE-879 Rust post-map callback scheduling
2101
 
2102
  Rust matches all72 original249007 schedules and state snapshots, including disconnect-before-second-child and activation-before-later-scan cases. The bounded API accepts typed callbacks and validates the count before invoking them. Count/base remain stable; actual246746/246963 child bodies and engine integration remain open. Focused `cargo xtask test-group rust-post-map-clients` 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.
2103
+
2104
+
2105
+ ## 2026-10-28 — RE-880 Original spawn overlap query and client filter
2106
+
2107
+ 32 actual167638 cases recover f32 origin-plus-six-source-bounds construction, native -33 box query with capacity1024 and returned-index iteration. Any entity with nonzero client pointer at offset520 blocks the spawn; other activity/health/team flags are not tested here. Covers duplicate indices, negative/zero query counts, signed/nonzero client words, f32 rounding and a client at result1024. Engine spatial query answers remain supplied; invalid engine counts/indices and nonfinite bounds are excluded. Focused `cargo xtask test-group qvm-spawn-overlap` 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
@@ -1702,3 +1702,6 @@ Purpose: turn the supplied installation into an evidence-backed specification of
1702
 
1703
 
1704
  - [x] RE-879 Rust post-map callback scheduling ([evidence](research/RUST_POST_MAP_CLIENTS.md)).
 
 
 
 
1702
 
1703
 
1704
  - [x] RE-879 Rust post-map callback scheduling ([evidence](research/RUST_POST_MAP_CLIENTS.md)).
1705
+
1706
+
1707
+ - [x] RE-880 Original spawn overlap query and client filter ([evidence](research/QVM_SPAWN_OVERLAP.md)).
docs/research/QVM_SPAWN_OVERLAP.md ADDED
@@ -0,0 +1,7 @@
 
 
 
 
 
 
 
 
1
+ # Original spawn overlap query and client filter
2
+
3
+ RE-880. Reproduce with `python3 scripts/analyze_qvm_spawn_overlap.py`; focused validation: `cargo xtask test-group qvm-spawn-overlap`. [Machine report](qvm-spawn-overlap.json).
4
+
5
+ 32 actual167638 cases recover f32 origin-plus-six-source-bounds construction, native -33 box query with capacity1024 and returned-index iteration. Any entity with nonzero client pointer at offset520 blocks the spawn; other activity/health/team flags are not tested here. Covers duplicate indices, negative/zero query counts, signed/nonzero client words, f32 rounding and a client at result1024. Engine spatial query answers remain supplied; invalid engine counts/indices and nonfinite bounds are excluded.
6
+
7
+ Original executable/native runtime and complete Linux/macOS Rust/Bevy/Solari acceptance remain unverified.
docs/research/README.md CHANGED
@@ -1237,3 +1237,6 @@ The extension collector adds five focused tests for native tail calls, command-r
1237
 
1238
 
1239
  [RE-879: Rust post-map callback scheduling](RUST_POST_MAP_CLIENTS.md).
 
 
 
 
1237
 
1238
 
1239
  [RE-879: Rust post-map callback scheduling](RUST_POST_MAP_CLIENTS.md).
1240
+
1241
+
1242
+ [RE-880: Original spawn overlap query and client filter](QVM_SPAWN_OVERLAP.md).
docs/research/qvm-spawn-overlap.json ADDED
The diff for this file is too large to render. See raw diff
 
scripts/analyze_qvm_spawn_overlap.py ADDED
@@ -0,0 +1,25 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
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
+ layouts=[([],{},0),([0],{0:0},1),([0],{0:1},1),([3,1],{3:0,1:123},2),([1,1],{1:0},2),([2,0,3],{2:-1,0:0,3:0},3),(list(range(1024)),{1023:1},1024),([],{},-1)]
14
+ for origin,(indices,clients,response) in itertools.product([[0.,0.,0.],[100.,-100.,9.],[-0.5,0.25,-0.125],[16777216.,-16777216.,1.]],layouts):
15
+ m=constants(raw,h,list(range(29232,29256,4)));point=POOL+880*1030;queries=[]
16
+ for j,v in enumerate(origin):m[point+92+4*j]=word(v)
17
+ for j in set(indices):m[POOL+880*j+520]=clients.get(j,0)
18
+ def query(i,m,a,b):
19
+ queries.append({'mins':[m[a[8]+4*j]&0xffffffff for j in range(3)],'maxs':[m[a[12]+4*j]&0xffffffff for j in range(3)],'capacity':a[20]});cells={}
20
+ for j,v in enumerate(indices):cells.update({a[16]+4*j+k:(v>>(8*k))&255 for k in range(4)})
21
+ return m,response,{'box_query_supplied':True,'child_memory_bytes':cells}
22
+ initial=[m[a]&0xffffffff for a in range(29232,29256,4)];m,v,p,b=run(ins,m,167638,167765,4168,{8:point},handlers={-33:query});p.update(input=dict(origin=[word(v) for v in origin],bounds=initial,indices=indices,clients={str(j):clients.get(j,0)&0xffffffff for j in set(indices)},response=response),queries=queries,result=v);rows.append(p)
23
+
24
+ write_json(Path('docs/research/qvm-spawn-overlap.json'),{'source':q['source'],'sha256':q['sha256'],'root':167638,'probes':rows,'limits':'32 actual167638 cases recover f32 origin-plus-six-source-bounds construction, native -33 box query with capacity1024 and returned-index iteration. Any entity with nonzero client pointer at offset520 blocks the spawn; other activity/health/team flags are not tested here. Covers duplicate indices, negative/zero query counts, signed/nonzero client words, f32 rounding and a client at result1024. Engine spatial query answers remain supplied; invalid engine counts/indices and nonfinite bounds are excluded.'})
25
+ if __name__=='__main__':main()
scripts/test_qvm_spawn_overlap.py ADDED
@@ -0,0 +1,15 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
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-spawn-overlap.json').read_text())['probes']
6
+ self.assertEqual(len(rows),32)
7
+ import struct
8
+ f=lambda v:struct.unpack('<f',struct.pack('<I',v))[0]
9
+ w=lambda v:int.from_bytes(struct.pack('<f',v),'little')
10
+ for p in rows:
11
+ a=p['input'];bounds=[[w(f(a['origin'][j])+f(a['bounds'][half*3+j])) for j in range(3)] for half in range(2)]
12
+ self.assertEqual(p['queries'],[dict(mins=bounds[0],maxs=bounds[1],capacity=1024)]);self.assertEqual(p['result'],int(any(a['clients'][str(j)]!=0 for j in a['indices'][:max(0,a['response'])])))
13
+ self.assertTrue(any(len(p['input']['indices'])==1024 and p['result']==1 for p in rows));self.assertTrue(any(p['input']['response']<0 and not p['result'] for p in rows))
14
+
15
+ if __name__=='__main__':unittest.main()
xtask/checks.tsv CHANGED
@@ -2569,3 +2569,7 @@ report scripts/analyze_rust_post_map_clients.py docs/research/rust-post-map-clie
2569
  edge docs/research/rust-post-map-clients.json scripts/test_rust_post_map_clients.py
2570
  group rust-post-map-clients scripts/analyze_rust_post_map_clients.py
2571
  edge scripts/analyze_rust_post_map_clients.py scripts/analyze_qvm_resumer_audit.py
 
 
 
 
 
2569
  edge docs/research/rust-post-map-clients.json scripts/test_rust_post_map_clients.py
2570
  group rust-post-map-clients scripts/analyze_rust_post_map_clients.py
2571
  edge scripts/analyze_rust_post_map_clients.py scripts/analyze_qvm_resumer_audit.py
2572
+ report scripts/analyze_qvm_spawn_overlap.py docs/research/qvm-spawn-overlap.json
2573
+ edge docs/research/qvm-spawn-overlap.json scripts/test_qvm_spawn_overlap.py
2574
+ group qvm-spawn-overlap scripts/analyze_qvm_spawn_overlap.py
2575
+ edge scripts/analyze_qvm_spawn_overlap.py scripts/analyze_qvm_resumer_audit.py