nmarshall commited on
Commit
7bc6d15
·
1 Parent(s): ebc1faa

qvm: recover bot breeding and counter reset

Browse files
docs/FINDINGS.md CHANGED
@@ -1625,3 +1625,6 @@ RE-813–822 replaces the scoreboard decimal assumption with actual37914 executi
1625
 
1626
 
1627
  **RE-875:** Rust matches all64 original bot winner cases, with wrapping fitness arithmetic before f32 conversion, strict first-wins comparison and typed rejection of incomplete populations. Native botlib genome writes are returned as intentions, without assuming file serialization or runtime integration. [Evidence](research/RUST_BOT_BEST.md).
 
 
 
 
1625
 
1626
 
1627
  **RE-875:** Rust matches all64 original bot winner cases, with wrapping fitness arithmetic before f32 conversion, strict first-wins comparison and typed rejection of incomplete populations. Native botlib genome writes are returned as intentions, without assuming file serialization or runtime integration. [Evidence](research/RUST_BOT_BEST.md).
1628
+
1629
+
1630
+ **RE-876:** 64 actual121987 cases recover all64 native fitness words, supplied native -565 parent/child selection, ordered -566 interbreed and -567 mutation(handle,1.0), then zeroing both counters of currently active slots. A supplied selection callback activates slot63 to prove reset rereads live state after native calls. Selection algorithm and native genetic/file behavior remain open; invalid native indices are excluded. [Evidence](research/QVM_BOT_BREED.md).
docs/PROVISIONAL_TODO.md CHANGED
@@ -1653,3 +1653,6 @@ RE-874: 64 actual122143 cases recover a 64-slot bot population scan, wrapping (w
1653
 
1654
 
1655
  RE-875: Rust matches all64 original bot winner cases, with wrapping fitness arithmetic before f32 conversion, strict first-wins comparison and typed rejection of incomplete populations. Native botlib genome writes are returned as intentions, without assuming file serialization or runtime integration. Full runtime completion remains open. [Evidence](research/RUST_BOT_BEST.md).
 
 
 
 
1653
 
1654
 
1655
  RE-875: Rust matches all64 original bot winner cases, with wrapping fitness arithmetic before f32 conversion, strict first-wins comparison and typed rejection of incomplete populations. Native botlib genome writes are returned as intentions, without assuming file serialization or runtime integration. Full runtime completion remains open. [Evidence](research/RUST_BOT_BEST.md).
1656
+
1657
+
1658
+ RE-876: 64 actual121987 cases recover all64 native fitness words, supplied native -565 parent/child selection, ordered -566 interbreed and -567 mutation(handle,1.0), then zeroing both counters of currently active slots. A supplied selection callback activates slot63 to prove reset rereads live state after native calls. Selection algorithm and native genetic/file behavior remain open; invalid native indices are excluded. Full runtime completion remains open. [Evidence](research/QVM_BOT_BREED.md).
docs/RESEARCH_LEDGER.md CHANGED
@@ -2080,3 +2080,8 @@ Batch RE-864–873 boundary: the single `cargo xtask test-full --since 171bd705`
2080
  ## 2026-10-28 — RE-875 Rust bot genome winner policy
2081
 
2082
  Rust matches all64 original bot winner cases, with wrapping fitness arithmetic before f32 conversion, strict first-wins comparison and typed rejection of incomplete populations. Native botlib genome writes are returned as intentions, without assuming file serialization or runtime integration. Focused `cargo xtask test-group rust-bot-best` 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.
 
 
 
 
 
 
2080
  ## 2026-10-28 — RE-875 Rust bot genome winner policy
2081
 
2082
  Rust matches all64 original bot winner cases, with wrapping fitness arithmetic before f32 conversion, strict first-wins comparison and typed rejection of incomplete populations. Native botlib genome writes are returned as intentions, without assuming file serialization or runtime integration. Focused `cargo xtask test-group rust-bot-best` 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.
2083
+
2084
+
2085
+ ## 2026-10-28 — RE-876 Original bot breeding callback and counter reset
2086
+
2087
+ 64 actual121987 cases recover all64 native fitness words, supplied native -565 parent/child selection, ordered -566 interbreed and -567 mutation(handle,1.0), then zeroing both counters of currently active slots. A supplied selection callback activates slot63 to prove reset rereads live state after native calls. Selection algorithm and native genetic/file behavior remain open; invalid native indices are excluded. Focused `cargo xtask test-group qvm-bot-breed` 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
@@ -1690,3 +1690,6 @@ Purpose: turn the supplied installation into an evidence-backed specification of
1690
 
1691
 
1692
  - [x] RE-875 Rust bot genome winner policy ([evidence](research/RUST_BOT_BEST.md)).
 
 
 
 
1690
 
1691
 
1692
  - [x] RE-875 Rust bot genome winner policy ([evidence](research/RUST_BOT_BEST.md)).
1693
+
1694
+
1695
+ - [x] RE-876 Original bot breeding callback and counter reset ([evidence](research/QVM_BOT_BREED.md)).
docs/research/QVM_BOT_BREED.md ADDED
@@ -0,0 +1,7 @@
 
 
 
 
 
 
 
 
1
+ # Original bot breeding callback and counter reset
2
+
3
+ RE-876. Reproduce with `python3 scripts/analyze_qvm_bot_breed.py`; focused validation: `cargo xtask test-group qvm-bot-breed`. [Machine report](qvm-bot-breed.json).
4
+
5
+ 64 actual121987 cases recover all64 native fitness words, supplied native -565 parent/child selection, ordered -566 interbreed and -567 mutation(handle,1.0), then zeroing both counters of currently active slots. A supplied selection callback activates slot63 to prove reset rereads live state after native calls. Selection algorithm and native genetic/file behavior remain open; invalid native indices are excluded.
6
+
7
+ Original executable/native runtime and complete Linux/macOS Rust/Bevy/Solari acceptance remain unverified.
docs/research/README.md CHANGED
@@ -1225,3 +1225,6 @@ The extension collector adds five focused tests for native tail calls, command-r
1225
 
1226
 
1227
  [RE-875: Rust bot genome winner policy](RUST_BOT_BEST.md).
 
 
 
 
1225
 
1226
 
1227
  [RE-875: Rust bot genome winner policy](RUST_BOT_BEST.md).
1228
+
1229
+
1230
+ [RE-876: Original bot breeding callback and counter reset](QVM_BOT_BREED.md).
docs/research/qvm-bot-breed.json ADDED
The diff for this file is too large to render. See raw diff
 
scripts/analyze_qvm_bot_breed.py ADDED
@@ -0,0 +1,30 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
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
+ for pattern,active,response,selection,activate in itertools.product(range(2),[0,1,63,64],[0,1],[[0,1,2],[63,3,4]],[False,True]):
14
+ m={};records=[];calls=[];scores=[]
15
+ for j in range(64):
16
+ row=[int(j<active),[0,2147483647,-3,16777217][(j+pattern)%4],[1,-2,3,0][(j+pattern)%4],700+j];records.append(row)
17
+ for address,value in zip([35145324,35151356,35151352,35151852],row):m[address+9108*j]=value
18
+ def select(i,m,a,b):
19
+ scores.extend(m[a[12]+4*j]&0xffffffff for j in range(64));calls.append([-565,a[8]])
20
+ cells={}
21
+ for o,j in zip([16,20,24],selection):cells.update({a[o]+k:(j>>(8*k))&255 for k in range(4)})
22
+ if activate:m[35145324+9108*63]=1
23
+ return m,response,{'selection_supplied':True,'child_memory_bytes':cells}
24
+ def capture(t):
25
+ def call(i,m,a,b):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}
26
+ return call
27
+ m,v,p,b=run(ins,m,121987,122141,304,handlers={-565:select,-566:capture(-566),-567:capture(-567)});p.update(input=dict(records=records,response=response,selection=selection,activate=activate),scores=scores,calls=calls,after=[[m[address+9108*j]&0xffffffff for address in [35145324,35151356,35151352,35151852]] for j in range(64)]);rows.append(p)
28
+
29
+ write_json(Path('docs/research/qvm-bot-breed.json'),{'source':q['source'],'sha256':q['sha256'],'root':121987,'probes':rows,'limits':'64 actual121987 cases recover all64 native fitness words, supplied native -565 parent/child selection, ordered -566 interbreed and -567 mutation(handle,1.0), then zeroing both counters of currently active slots. A supplied selection callback activates slot63 to prove reset rereads live state after native calls. Selection algorithm and native genetic/file behavior remain open; invalid native indices are excluded.'})
30
+ if __name__=='__main__':main()
scripts/test_qvm_bot_breed.py ADDED
@@ -0,0 +1,19 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
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-breed.json').read_text())['probes']
6
+ self.assertEqual(len(rows),64)
7
+ import struct
8
+ f=lambda v:int.from_bytes(struct.pack('<f',v),'little')
9
+ for p in rows:
10
+ a=p['input'];expected=[];end=[]
11
+ for j,(live,w,l,h) in enumerate(a['records']):
12
+ value=((w<<1)-l)&0xffffffff;value=value-2**32 if value>=2**31 else value;expected.append(f(value if live else -1));live=int(bool(live or (j==63 and a['activate'])));end.append([live,0 if live else w&0xffffffff,0 if live else l&0xffffffff,h])
13
+ self.assertEqual(p['scores'],expected);self.assertEqual(p['after'],end)
14
+ calls=[[-565,64]]
15
+ if a['response']:
16
+ h=[a['records'][j][3] for j in a['selection']];calls.extend([[-566,*h],[-567,h[2],f(1)]])
17
+ self.assertEqual(p['calls'],calls)
18
+
19
+ if __name__=='__main__':unittest.main()
xtask/checks.tsv CHANGED
@@ -2535,3 +2535,7 @@ edge docs/research/rust-bot-best.json scripts/test_rust_bot_best.py
2535
  group rust-bot-best scripts/analyze_rust_bot_best.py
2536
  edge scripts/analyze_rust_bot_best.py scripts/analyze_qvm_resumer_audit.py
2537
  edge scripts/rust_native_policy_support.py scripts/analyze_qvm_resumer_audit.py
 
 
 
 
 
2535
  group rust-bot-best scripts/analyze_rust_bot_best.py
2536
  edge scripts/analyze_rust_bot_best.py scripts/analyze_qvm_resumer_audit.py
2537
  edge scripts/rust_native_policy_support.py scripts/analyze_qvm_resumer_audit.py
2538
+ report scripts/analyze_qvm_bot_breed.py docs/research/qvm-bot-breed.json
2539
+ edge docs/research/qvm-bot-breed.json scripts/test_qvm_bot_breed.py
2540
+ group qvm-bot-breed scripts/analyze_qvm_bot_breed.py
2541
+ edge scripts/analyze_qvm_bot_breed.py scripts/analyze_qvm_resumer_audit.py