qvm: compose rotation with bot genome callbacks
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_BOT_ROTATION.md +7 -0
- docs/research/README.md +3 -0
- docs/research/qvm-bot-rotation.json +0 -0
- scripts/analyze_qvm_bot_rotation.py +35 -0
- scripts/qvm_map_commands_support.py +2 -1
- scripts/test_qvm_bot_rotation.py +26 -0
- xtask/checks.tsv +6 -0
docs/FINDINGS.md
CHANGED
|
@@ -1643,3 +1643,6 @@ RE-813–822 replaces the scoreboard decimal assumption with actual37914 executi
|
|
| 1643 |
|
| 1644 |
|
| 1645 |
**RE-881:** Rust matches all32 original167638 box/query/filter cases, including the full1024-result scan and f32 rounding. The API separates box construction from supplied engine indices, rejects nonfinite/overflow bounds and malformed positive counts/indices, and tests client-pointer nonzero alone. Actual collision broadphase and integration into fallback selection remain open. [Evidence](research/RUST_SPAWN_OVERLAP.md).
|
|
|
|
|
|
|
|
|
|
|
|
| 1643 |
|
| 1644 |
|
| 1645 |
**RE-881:** Rust matches all32 original167638 box/query/filter cases, including the full1024-result scan and f32 rounding. The API separates box construction from supplied engine indices, rejects nonfinite/overflow bounds and malformed positive counts/indices, and tests client-pointer nonzero alone. Actual collision broadphase and integration into fallback selection remain open. [Evidence](research/RUST_SPAWN_OVERLAP.md).
|
| 1646 |
+
|
| 1647 |
+
|
| 1648 |
+
**RE-882:** 96 actual122230 compositions execute actual122143/121987/36038 with shared population/cvar state. Engine refresh bytes and native genetic selection are supplied, while writes/interbreed/mutation are captured. Nonempty refreshed filename requests best-genome write before breeding; an empty filename still breeds and resets. Disabled/below-threshold paths preserve population. A supplied selection callback activates slot63 before reset. Native algorithm/file/engine/runtime parity remains open. [Evidence](research/QVM_BOT_ROTATION.md).
|
docs/PROVISIONAL_TODO.md
CHANGED
|
@@ -1671,3 +1671,6 @@ RE-880: 32 actual167638 cases recover f32 origin-plus-six-source-bounds construc
|
|
| 1671 |
|
| 1672 |
|
| 1673 |
RE-881: Rust matches all32 original167638 box/query/filter cases, including the full1024-result scan and f32 rounding. The API separates box construction from supplied engine indices, rejects nonfinite/overflow bounds and malformed positive counts/indices, and tests client-pointer nonzero alone. Actual collision broadphase and integration into fallback selection remain open. Full runtime completion remains open. [Evidence](research/RUST_SPAWN_OVERLAP.md).
|
|
|
|
|
|
|
|
|
|
|
|
| 1671 |
|
| 1672 |
|
| 1673 |
RE-881: Rust matches all32 original167638 box/query/filter cases, including the full1024-result scan and f32 rounding. The API separates box construction from supplied engine indices, rejects nonfinite/overflow bounds and malformed positive counts/indices, and tests client-pointer nonzero alone. Actual collision broadphase and integration into fallback selection remain open. Full runtime completion remains open. [Evidence](research/RUST_SPAWN_OVERLAP.md).
|
| 1674 |
+
|
| 1675 |
+
|
| 1676 |
+
RE-882: 96 actual122230 compositions execute actual122143/121987/36038 with shared population/cvar state. Engine refresh bytes and native genetic selection are supplied, while writes/interbreed/mutation are captured. Nonempty refreshed filename requests best-genome write before breeding; an empty filename still breeds and resets. Disabled/below-threshold paths preserve population. A supplied selection callback activates slot63 before reset. Native algorithm/file/engine/runtime parity remains open. Full runtime completion remains open. [Evidence](research/QVM_BOT_ROTATION.md).
|
docs/RESEARCH_LEDGER.md
CHANGED
|
@@ -2110,3 +2110,8 @@ Rust matches all72 original249007 schedules and state snapshots, including disco
|
|
| 2110 |
## 2026-10-28 — RE-881 Rust spawn overlap boundary
|
| 2111 |
|
| 2112 |
Rust matches all32 original167638 box/query/filter cases, including the full1024-result scan and f32 rounding. The API separates box construction from supplied engine indices, rejects nonfinite/overflow bounds and malformed positive counts/indices, and tests client-pointer nonzero alone. Actual collision broadphase and integration into fallback selection remain open. Focused `cargo xtask test-group rust-spawn-overlap` 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.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 2110 |
## 2026-10-28 — RE-881 Rust spawn overlap boundary
|
| 2111 |
|
| 2112 |
Rust matches all32 original167638 box/query/filter cases, including the full1024-result scan and f32 rounding. The API separates box construction from supplied engine indices, rejects nonfinite/overflow bounds and malformed positive counts/indices, and tests client-pointer nonzero alone. Actual collision broadphase and integration into fallback selection remain open. Focused `cargo xtask test-group rust-spawn-overlap` 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.
|
| 2113 |
+
|
| 2114 |
+
|
| 2115 |
+
## 2026-10-28 — RE-882 Original rotation with recovered bot write and breeding children
|
| 2116 |
+
|
| 2117 |
+
96 actual122230 compositions execute actual122143/121987/36038 with shared population/cvar state. Engine refresh bytes and native genetic selection are supplied, while writes/interbreed/mutation are captured. Nonempty refreshed filename requests best-genome write before breeding; an empty filename still breeds and resets. Disabled/below-threshold paths preserve population. A supplied selection callback activates slot63 before reset. Native algorithm/file/engine/runtime parity remains open. Focused `cargo xtask test-group qvm-bot-rotation` 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
|
@@ -1708,3 +1708,6 @@ Purpose: turn the supplied installation into an evidence-backed specification of
|
|
| 1708 |
|
| 1709 |
|
| 1710 |
- [x] RE-881 Rust spawn overlap boundary ([evidence](research/RUST_SPAWN_OVERLAP.md)).
|
|
|
|
|
|
|
|
|
|
|
|
| 1708 |
|
| 1709 |
|
| 1710 |
- [x] RE-881 Rust spawn overlap boundary ([evidence](research/RUST_SPAWN_OVERLAP.md)).
|
| 1711 |
+
|
| 1712 |
+
|
| 1713 |
+
- [x] RE-882 Original rotation with recovered bot write and breeding children ([evidence](research/QVM_BOT_ROTATION.md)).
|
docs/research/QVM_BOT_ROTATION.md
ADDED
|
@@ -0,0 +1,7 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
# Original rotation with recovered bot write and breeding children
|
| 2 |
+
|
| 3 |
+
RE-882. Reproduce with `python3 scripts/analyze_qvm_bot_rotation.py`; focused validation: `cargo xtask test-group qvm-bot-rotation`. [Machine report](qvm-bot-rotation.json).
|
| 4 |
+
|
| 5 |
+
96 actual122230 compositions execute actual122143/121987/36038 with shared population/cvar state. Engine refresh bytes and native genetic selection are supplied, while writes/interbreed/mutation are captured. Nonempty refreshed filename requests best-genome write before breeding; an empty filename still breeds and resets. Disabled/below-threshold paths preserve population. A supplied selection callback activates slot63 before reset. Native algorithm/file/engine/runtime parity remains open.
|
| 6 |
+
|
| 7 |
+
Original executable/native runtime and complete Linux/macOS Rust/Bevy/Solari acceptance remain unverified.
|
docs/research/README.md
CHANGED
|
@@ -1243,3 +1243,6 @@ The extension collector adds five focused tests for native tail calls, command-r
|
|
| 1243 |
|
| 1244 |
|
| 1245 |
[RE-881: Rust spawn overlap boundary](RUST_SPAWN_OVERLAP.md).
|
|
|
|
|
|
|
|
|
|
|
|
| 1243 |
|
| 1244 |
|
| 1245 |
[RE-881: Rust spawn overlap boundary](RUST_SPAWN_OVERLAP.md).
|
| 1246 |
+
|
| 1247 |
+
|
| 1248 |
+
[RE-882: Original rotation with recovered bot write and breeding children](QVM_BOT_ROTATION.md).
|
docs/research/qvm-bot-rotation.json
ADDED
|
The diff for this file is too large to render.
See raw diff
|
|
|
scripts/analyze_qvm_bot_rotation.py
ADDED
|
@@ -0,0 +1,35 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 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_map_commands_support import rotation,put_string,CURSOR,ENABLED,LIMIT,WRITE
|
| 14 |
+
from qvm_string_memory_support import cstring
|
| 15 |
+
for enabled,cursor,updated,active,response in itertools.product([0,1],[0,1],[b'',b'out.cfg',b'x\0tail'],[0,1,4,64],[0,1]):
|
| 16 |
+
m={CURSOR:cursor,ENABLED:enabled,LIMIT:2};b={};put_string(m,b,WRITE,b'previous.cfg',128);records=[];calls=[];scores=[];writes=[];children=[]
|
| 17 |
+
for j in range(64):
|
| 18 |
+
row=[int(j<active),[0,2,2147483647,16777217][j%4],[0,1,-2,0][j%4],700+j];records.append(row)
|
| 19 |
+
for address,value in zip([35145324,35151356,35151352,35151852],row):m[address+9108*j]=value
|
| 20 |
+
def write(i,m,a,bs):calls.append([-546,a[8]]);writes.append([a[8],cstring(m,bs,a[12]).hex()]);return m,0,{'native_write_captured':True}
|
| 21 |
+
def best(i,m,a,bs):
|
| 22 |
+
m,v,p,bs=run(i,m,122143,122228,36,a,dict(bs),{-546:write},base=B+0x1000);children.append([122143,p['execution']['trace_sha256']]);return m,0,{'actual_source_child':122143}
|
| 23 |
+
def select(i,m,a,bs):
|
| 24 |
+
scores.extend(m[a[12]+4*j]&0xffffffff for j in range(64));calls.append([-565,a[8]]);m[35145324+9108*63]=1;cells={}
|
| 25 |
+
for o,j in zip([16,20,24],[0,1,63]):cells.update({a[o]+k:(j>>(8*k))&255 for k in range(4)})
|
| 26 |
+
return m,response,{'selection_supplied':True,'child_memory_bytes':cells}
|
| 27 |
+
def capture(t):
|
| 28 |
+
def call(i,m,a,bs):calls.append([t,*[a[o]&0xffffffff for o in ([8,12,16] if t==-566 else [8,12])]]);return m,0,{'native_effect_captured':True}
|
| 29 |
+
return call
|
| 30 |
+
def breed(i,m,a,bs):
|
| 31 |
+
m,v,p,bs=run(i,m,121987,122141,304,a,dict(bs),{-565:select,-566:capture(-566),-567:capture(-567)},base=B+0x4000);children.append([121987,p['execution']['trace_sha256']]);return m,0,{'actual_source_child':121987}
|
| 32 |
+
m,p,b=rotation(ins,m,b,updated,{122143:best,121987:breed});p.update(input=dict(enabled=enabled,cursor=cursor,updated=updated.hex(),records=records,response=response),children=children,calls=calls,scores=scores,writes=writes,cursor=m[CURSOR]&0xffffffff,filename=cstring(m,b,WRITE).hex(),after=[[m[address+9108*j]&0xffffffff for address in [35145324,35151356,35151352,35151852]] for j in range(64)]);rows.append(p)
|
| 33 |
+
|
| 34 |
+
write_json(Path('docs/research/qvm-bot-rotation.json'),{'source':q['source'],'sha256':q['sha256'],'root':122230,'probes':rows,'limits':'96 actual122230 compositions execute actual122143/121987/36038 with shared population/cvar state. Engine refresh bytes and native genetic selection are supplied, while writes/interbreed/mutation are captured. Nonempty refreshed filename requests best-genome write before breeding; an empty filename still breeds and resets. Disabled/below-threshold paths preserve population. A supplied selection callback activates slot63 before reset. Native algorithm/file/engine/runtime parity remains open.'})
|
| 35 |
+
if __name__=='__main__':main()
|
scripts/qvm_map_commands_support.py
CHANGED
|
@@ -15,7 +15,7 @@ def put_string(m,b,address,data,capacity=0):
|
|
| 15 |
data=bytes(data)+b'\0';data=data.ljust(max(capacity,len(data)+8),b'\0');write_bytes(m,b,{address+j:v for j,v in enumerate(data)})
|
| 16 |
def strlen(ins,m,a,b):
|
| 17 |
m,v,p,b=run(ins,m,36038,36121,20,a,b,base=D+0x1000);return m,v,{'actual_source_child':36038}
|
| 18 |
-
def rotation(ins,m,b,updated):
|
| 19 |
requests=[];operations=[]
|
| 20 |
def refresh(i,m,a,bs):
|
| 21 |
requests.append({'target':-5,'arguments':a});data=(updated+b'\0').ljust(128,b'\0');cells={WRITE+j:v for j,v in enumerate(data)};operations.append({'op':'refresh'});return m,0,{'engine_update_supplied':True,'child_memory_bytes':cells}
|
|
@@ -25,6 +25,7 @@ def rotation(ins,m,b,updated):
|
|
| 25 |
if t==122143:operations.append({'op':'write','text':cstring(m,bs,a[8]).hex()})
|
| 26 |
if t==-6:operations.append({'op':'clear'})
|
| 27 |
if t==121987:operations.append({'op':'reset'})
|
|
|
|
| 28 |
return m,0,{'external_effect_captured':True}
|
| 29 |
return call
|
| 30 |
m,v,p,b=run(ins,m,122230,122286,24,b=b,handlers={-5:refresh,36038:strlen,122143:capture(122143),-6:capture(-6),121987:capture(121987)},base=D);p.update(requests=requests,operations=operations);return m,p,b
|
|
|
|
| 15 |
data=bytes(data)+b'\0';data=data.ljust(max(capacity,len(data)+8),b'\0');write_bytes(m,b,{address+j:v for j,v in enumerate(data)})
|
| 16 |
def strlen(ins,m,a,b):
|
| 17 |
m,v,p,b=run(ins,m,36038,36121,20,a,b,base=D+0x1000);return m,v,{'actual_source_child':36038}
|
| 18 |
+
def rotation(ins,m,b,updated,children=None):
|
| 19 |
requests=[];operations=[]
|
| 20 |
def refresh(i,m,a,bs):
|
| 21 |
requests.append({'target':-5,'arguments':a});data=(updated+b'\0').ljust(128,b'\0');cells={WRITE+j:v for j,v in enumerate(data)};operations.append({'op':'refresh'});return m,0,{'engine_update_supplied':True,'child_memory_bytes':cells}
|
|
|
|
| 25 |
if t==122143:operations.append({'op':'write','text':cstring(m,bs,a[8]).hex()})
|
| 26 |
if t==-6:operations.append({'op':'clear'})
|
| 27 |
if t==121987:operations.append({'op':'reset'})
|
| 28 |
+
if children and t in children:return children[t](i,m,a,bs)
|
| 29 |
return m,0,{'external_effect_captured':True}
|
| 30 |
return call
|
| 31 |
m,v,p,b=run(ins,m,122230,122286,24,b=b,handlers={-5:refresh,36038:strlen,122143:capture(122143),-6:capture(-6),121987:capture(121987)},base=D);p.update(requests=requests,operations=operations);return m,p,b
|
scripts/test_qvm_bot_rotation.py
ADDED
|
@@ -0,0 +1,26 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 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-rotation.json').read_text())['probes']
|
| 6 |
+
self.assertEqual(len(rows),96)
|
| 7 |
+
import struct
|
| 8 |
+
f=lambda v:struct.unpack('<f',struct.pack('<f',v))[0]
|
| 9 |
+
w=lambda v:int.from_bytes(struct.pack('<f',v),'little')
|
| 10 |
+
for p in rows:
|
| 11 |
+
a=p['input'];boundary=bool(a['enabled'] and a['cursor']==1);name=bytes.fromhex(a['updated']).split(b'\0')[0] if boundary else b'previous.cfg';records=a['records'];calls=[];writes=[];scores=[];end=[[(v&0xffffffff) for v in row] for row in records];children=[];ops=[]
|
| 12 |
+
if boundary:
|
| 13 |
+
ops=[{'op':'refresh'}];best=0.;idx=None
|
| 14 |
+
for j,(live,win,loss,handle) in enumerate(records):
|
| 15 |
+
value=((win<<1)-loss)&0xffffffff;value=value-2**32 if value>=2**31 else value;score=f(value) if live else -1.;scores.append(w(score))
|
| 16 |
+
if score>best:best=score;idx=j
|
| 17 |
+
if name:
|
| 18 |
+
children.append(122143);ops.extend([{'op':'write','text':name.hex()},{'op':'clear'}])
|
| 19 |
+
if idx is not None:calls.append([-546,records[idx][3]]);writes.append([records[idx][3],name.hex()])
|
| 20 |
+
children.append(121987);ops.append({'op':'reset'});calls.append([-565,64]);end[63][0]=1
|
| 21 |
+
if a['response']:calls.extend([[-566,700,701,763],[-567,763,w(1.)]])
|
| 22 |
+
for row in end:
|
| 23 |
+
if row[0]:row[1]=row[2]=0
|
| 24 |
+
self.assertEqual(p['cursor'],0 if boundary else a['cursor']+a['enabled']);self.assertEqual(p['filename'],name.hex());self.assertEqual(p['operations'],ops);self.assertEqual(p['calls'],calls);self.assertEqual(p['writes'],writes);self.assertEqual(p['scores'],scores);self.assertEqual(p['after'],end);self.assertEqual([c[0] for c in p['children']],children)
|
| 25 |
+
|
| 26 |
+
if __name__=='__main__':unittest.main()
|
xtask/checks.tsv
CHANGED
|
@@ -2586,3 +2586,9 @@ report scripts/analyze_rust_spawn_overlap.py docs/research/rust-spawn-overlap.js
|
|
| 2586 |
edge docs/research/rust-spawn-overlap.json scripts/test_rust_spawn_overlap.py
|
| 2587 |
group rust-spawn-overlap scripts/analyze_rust_spawn_overlap.py
|
| 2588 |
edge scripts/analyze_rust_spawn_overlap.py scripts/analyze_qvm_resumer_audit.py
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 2586 |
edge docs/research/rust-spawn-overlap.json scripts/test_rust_spawn_overlap.py
|
| 2587 |
group rust-spawn-overlap scripts/analyze_rust_spawn_overlap.py
|
| 2588 |
edge scripts/analyze_rust_spawn_overlap.py scripts/analyze_qvm_resumer_audit.py
|
| 2589 |
+
report scripts/analyze_qvm_bot_rotation.py docs/research/qvm-bot-rotation.json
|
| 2590 |
+
edge docs/research/qvm-bot-rotation.json scripts/test_qvm_bot_rotation.py
|
| 2591 |
+
group qvm-bot-rotation scripts/analyze_qvm_bot_rotation.py
|
| 2592 |
+
edge scripts/analyze_qvm_bot_rotation.py scripts/analyze_qvm_resumer_audit.py
|
| 2593 |
+
group qvm-bot-rotation scripts/analyze_qvm_rotation_advance.py
|
| 2594 |
+
group qvm-bot-rotation scripts/analyze_qvm_normal_map_flow.py
|