qvm: recover bot genome write selection
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_BEST.md +7 -0
- docs/research/README.md +3 -0
- docs/research/qvm-bot-best.json +0 -0
- scripts/analyze_qvm_bot_best.py +22 -0
- scripts/test_qvm_bot_best.py +17 -0
- xtask/checks.tsv +4 -0
docs/FINDINGS.md
CHANGED
|
@@ -1619,3 +1619,6 @@ RE-813–822 replaces the scoreboard decimal assumption with actual37914 executi
|
|
| 1619 |
|
| 1620 |
|
| 1621 |
**RE-873:** Rust matches192 original normal6939 cases, staging rotation, override map-command intentions, global/client resets and post-callback connection changes atomically. The API refuses team-series inputs and invalid callback indices. VM mirrors/pending/series data remain source-faithful; native callbacks, engine refresh and runtime integration remain open. [Evidence](research/RUST_NORMAL_MAP_FLOW.md).
|
|
|
|
|
|
|
|
|
|
|
|
| 1619 |
|
| 1620 |
|
| 1621 |
**RE-873:** Rust matches192 original normal6939 cases, staging rotation, override map-command intentions, global/client resets and post-callback connection changes atomically. The API refuses team-series inputs and invalid callback indices. VM mirrors/pending/series data remain source-faithful; native callbacks, engine refresh and runtime integration remain open. [Evidence](research/RUST_NORMAL_MAP_FLOW.md).
|
| 1622 |
+
|
| 1623 |
+
|
| 1624 |
+
**RE-874:** 64 actual122143 cases recover a 64-slot bot population scan, wrapping (wins<<1)-loss converted to f32, strict positive best score and first-wins ties. Only the winner handle and unchanged filename pointer reach captured native -546. Zero/negative fitness means no write. Extreme counters exercise signed wrap and f32 precision. Native botlib serialization remains open. [Evidence](research/QVM_BOT_BEST.md).
|
docs/PROVISIONAL_TODO.md
CHANGED
|
@@ -1647,3 +1647,6 @@ RE-873: Rust matches192 original normal6939 cases, staging rotation, override ma
|
|
| 1647 |
|
| 1648 |
|
| 1649 |
- [ ] RE-874: Recover telefrag/native math, respawn/slow setup, lower map/rotation callbacks, allocation/publication and actual macOS/Linux runtime integration. [Scope](research/QVM_SPAWN_MAP_COMMAND_BATCH.md).
|
|
|
|
|
|
|
|
|
|
|
|
| 1647 |
|
| 1648 |
|
| 1649 |
- [ ] RE-874: Recover telefrag/native math, respawn/slow setup, lower map/rotation callbacks, allocation/publication and actual macOS/Linux runtime integration. [Scope](research/QVM_SPAWN_MAP_COMMAND_BATCH.md).
|
| 1650 |
+
|
| 1651 |
+
|
| 1652 |
+
RE-874: 64 actual122143 cases recover a 64-slot bot population scan, wrapping (wins<<1)-loss converted to f32, strict positive best score and first-wins ties. Only the winner handle and unchanged filename pointer reach captured native -546. Zero/negative fitness means no write. Extreme counters exercise signed wrap and f32 precision. Native botlib serialization remains open. Full runtime completion remains open. [Evidence](research/QVM_BOT_BEST.md).
|
docs/RESEARCH_LEDGER.md
CHANGED
|
@@ -2070,3 +2070,8 @@ Rust matches192 original normal6939 cases, staging rotation, override map-comman
|
|
| 2070 |
RE-873 final review: targeted xtask dependency-registry regression passes for all five parity report edges and shared camera/transition/intermission/map module consumers. Added the batch findings and RE-874 native/runtime follow-ups.
|
| 2071 |
|
| 2072 |
Batch RE-864–873 boundary: the single `cargo xtask test-full --since 171bd705` run after commit ten passed with the flake-declared Nix Python: 1,708 Python tests, 169 Rust tests (assets 10, gameplay 129, xtask 30), 56 deterministic producers, storage policy, 436 documentation files and whitespace guards. No generated report drift. Validation notes were amended into task ten; original assets unchanged.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 2070 |
RE-873 final review: targeted xtask dependency-registry regression passes for all five parity report edges and shared camera/transition/intermission/map module consumers. Added the batch findings and RE-874 native/runtime follow-ups.
|
| 2071 |
|
| 2072 |
Batch RE-864–873 boundary: the single `cargo xtask test-full --since 171bd705` run after commit ten passed with the flake-declared Nix Python: 1,708 Python tests, 169 Rust tests (assets 10, gameplay 129, xtask 30), 56 deterministic producers, storage policy, 436 documentation files and whitespace guards. No generated report drift. Validation notes were amended into task ten; original assets unchanged.
|
| 2073 |
+
|
| 2074 |
+
|
| 2075 |
+
## 2026-10-28 — RE-874 Original bot genome write selection
|
| 2076 |
+
|
| 2077 |
+
64 actual122143 cases recover a 64-slot bot population scan, wrapping (wins<<1)-loss converted to f32, strict positive best score and first-wins ties. Only the winner handle and unchanged filename pointer reach captured native -546. Zero/negative fitness means no write. Extreme counters exercise signed wrap and f32 precision. Native botlib serialization remains open. Focused `cargo xtask test-group qvm-bot-best` 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
|
@@ -1684,3 +1684,6 @@ Purpose: turn the supplied installation into an evidence-backed specification of
|
|
| 1684 |
|
| 1685 |
|
| 1686 |
- [ ] RE-874: Recover telefrag/native math, respawn/slow setup, lower map/rotation callbacks, allocation/publication and actual macOS/Linux runtime integration. [Scope](research/QVM_SPAWN_MAP_COMMAND_BATCH.md).
|
|
|
|
|
|
|
|
|
|
|
|
| 1684 |
|
| 1685 |
|
| 1686 |
- [ ] RE-874: Recover telefrag/native math, respawn/slow setup, lower map/rotation callbacks, allocation/publication and actual macOS/Linux runtime integration. [Scope](research/QVM_SPAWN_MAP_COMMAND_BATCH.md).
|
| 1687 |
+
|
| 1688 |
+
|
| 1689 |
+
- [x] RE-874 Original bot genome write selection ([evidence](research/QVM_BOT_BEST.md)).
|
docs/research/QVM_BOT_BEST.md
ADDED
|
@@ -0,0 +1,7 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
# Original bot genome write selection
|
| 2 |
+
|
| 3 |
+
RE-874. Reproduce with `python3 scripts/analyze_qvm_bot_best.py`; focused validation: `cargo xtask test-group qvm-bot-best`. [Machine report](qvm-bot-best.json).
|
| 4 |
+
|
| 5 |
+
64 actual122143 cases recover a 64-slot bot population scan, wrapping (wins<<1)-loss converted to f32, strict positive best score and first-wins ties. Only the winner handle and unchanged filename pointer reach captured native -546. Zero/negative fitness means no write. Extreme counters exercise signed wrap and f32 precision. Native botlib serialization remains open.
|
| 6 |
+
|
| 7 |
+
Original executable/native runtime and complete Linux/macOS Rust/Bevy/Solari acceptance remain unverified.
|
docs/research/README.md
CHANGED
|
@@ -1219,3 +1219,6 @@ The extension collector adds five focused tests for native tail calls, command-r
|
|
| 1219 |
[RE-873: Rust recovered normal next-map command and reset composition](RUST_NORMAL_MAP_FLOW.md).
|
| 1220 |
|
| 1221 |
- [RE-864–873 fallback spawn and normal map command batch](QVM_SPAWN_MAP_COMMAND_BATCH.md).
|
|
|
|
|
|
|
|
|
|
|
|
| 1219 |
[RE-873: Rust recovered normal next-map command and reset composition](RUST_NORMAL_MAP_FLOW.md).
|
| 1220 |
|
| 1221 |
- [RE-864–873 fallback spawn and normal map command batch](QVM_SPAWN_MAP_COMMAND_BATCH.md).
|
| 1222 |
+
|
| 1223 |
+
|
| 1224 |
+
[RE-874: Original bot genome write selection](QVM_BOT_BEST.md).
|
docs/research/qvm-bot-best.json
ADDED
|
The diff for this file is too large to render.
See raw diff
|
|
|
scripts/analyze_qvm_bot_best.py
ADDED
|
@@ -0,0 +1,22 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 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,filename in itertools.product(range(8),[0,1,63,64],[9000,0]):
|
| 14 |
+
m={};records=[];calls=[]
|
| 15 |
+
for j in range(64):
|
| 16 |
+
live=j<active;wins=([0,1,2,-1,2147483647,-2147483648,16777216,16777217][(j+pattern)%8]);loss=([0,2,-2,2147483647][(j+pattern)%4]);handle=700+j
|
| 17 |
+
m.update({35145324+9108*j:int(live),35151356+9108*j:wins,35151352+9108*j:loss,35151852+9108*j:handle});records.append([int(live),wins,loss,handle])
|
| 18 |
+
def write(i,m,a,b):calls.append([a[8],a[12]]);return m,0,{'native_write_captured':True}
|
| 19 |
+
m,v,p,b=run(ins,m,122143,122228,36,{8:filename},handlers={-546:write});p.update(input={'records':records,'filename':filename},calls=calls);rows.append(p)
|
| 20 |
+
|
| 21 |
+
write_json(Path('docs/research/qvm-bot-best.json'),{'source':q['source'],'sha256':q['sha256'],'root':122143,'probes':rows,'limits':'64 actual122143 cases recover a 64-slot bot population scan, wrapping (wins<<1)-loss converted to f32, strict positive best score and first-wins ties. Only the winner handle and unchanged filename pointer reach captured native -546. Zero/negative fitness means no write. Extreme counters exercise signed wrap and f32 precision. Native botlib serialization remains open.'})
|
| 22 |
+
if __name__=='__main__':main()
|
scripts/test_qvm_bot_best.py
ADDED
|
@@ -0,0 +1,17 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 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-best.json').read_text())['probes']
|
| 6 |
+
self.assertEqual(len(rows),64)
|
| 7 |
+
import struct
|
| 8 |
+
f=lambda v:struct.unpack('<f',struct.pack('<f',v))[0]
|
| 9 |
+
for p in rows:
|
| 10 |
+
best=0.;idx=None
|
| 11 |
+
for j,(live,w,l,handle) in enumerate(p['input']['records']):
|
| 12 |
+
value=((w<<1)-l)&0xffffffff;value=value-2**32 if value>=2**31 else value;score=f(value) if live else -1.
|
| 13 |
+
if score>best:best=score;idx=j
|
| 14 |
+
self.assertEqual(p['calls'],[] if idx is None else [[p['input']['records'][idx][3],p['input']['filename']]])
|
| 15 |
+
self.assertTrue(any(not p['calls'] for p in rows));self.assertTrue(any(p['calls'] for p in rows))
|
| 16 |
+
|
| 17 |
+
if __name__=='__main__':unittest.main()
|
xtask/checks.tsv
CHANGED
|
@@ -2516,3 +2516,7 @@ report scripts/analyze_rust_normal_map_flow.py docs/research/rust-normal-map-flo
|
|
| 2516 |
edge docs/research/rust-normal-map-flow.json scripts/test_rust_normal_map_flow.py
|
| 2517 |
group rust-normal-map-flow scripts/analyze_rust_normal_map_flow.py
|
| 2518 |
edge scripts/analyze_rust_normal_map_flow.py scripts/analyze_qvm_resumer_audit.py
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 2516 |
edge docs/research/rust-normal-map-flow.json scripts/test_rust_normal_map_flow.py
|
| 2517 |
group rust-normal-map-flow scripts/analyze_rust_normal_map_flow.py
|
| 2518 |
edge scripts/analyze_rust_normal_map_flow.py scripts/analyze_qvm_resumer_audit.py
|
| 2519 |
+
report scripts/analyze_qvm_bot_best.py docs/research/qvm-bot-best.json
|
| 2520 |
+
edge docs/research/qvm-bot-best.json scripts/test_qvm_bot_best.py
|
| 2521 |
+
group qvm-bot-best scripts/analyze_qvm_bot_best.py
|
| 2522 |
+
edge scripts/analyze_qvm_bot_best.py scripts/analyze_qvm_resumer_audit.py
|