qvm: compose normal map command and reset flow
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_NORMAL_MAP_FLOW.md +7 -0
- docs/research/README.md +3 -0
- docs/research/qvm-normal-map-flow.json +0 -0
- scripts/analyze_qvm_normal_map_flow.py +18 -0
- scripts/qvm_map_commands_support.py +16 -0
- scripts/test_qvm_normal_map_flow.py +23 -0
- xtask/checks.tsv +4 -0
docs/FINDINGS.md
CHANGED
|
@@ -1613,3 +1613,6 @@ RE-813–822 replaces the scoreboard decimal assumption with actual37914 executi
|
|
| 1613 |
|
| 1614 |
|
| 1615 |
**RE-871:** Rust matches90 original map-selection cases with empty/NUL mirror gates,127-byte engine-mapname truncation, raw non-UTF8 bytes, unchanged VM mirror and exact truncated-override mode2 map command text. The typed effect order matches source cvar/read/command requests. Engine callbacks, native copy and actual command dispatch remain outside the port. [Evidence](research/RUST_MAP_SELECT.md).
|
|
|
|
|
|
|
|
|
|
|
|
| 1613 |
|
| 1614 |
|
| 1615 |
**RE-871:** Rust matches90 original map-selection cases with empty/NUL mirror gates,127-byte engine-mapname truncation, raw non-UTF8 bytes, unchanged VM mirror and exact truncated-override mode2 map command text. The typed effect order matches source cvar/read/command requests. Engine callbacks, native copy and actual command dispatch remain outside the port. [Evidence](research/RUST_MAP_SELECT.md).
|
| 1616 |
+
|
| 1617 |
+
|
| 1618 |
+
**RE-872:** 192 actual6939 normal-path cases compose recovered rotation, map selection, mode classification, copy and formatter bodies on shared state. Optional supplied249007 connection changes prove the final scan sees child mutations. Cvar/engine bytes, native copy and lower callback/runtime effects remain explicit boundaries. [Evidence](research/QVM_NORMAL_MAP_FLOW.md).
|
docs/PROVISIONAL_TODO.md
CHANGED
|
@@ -1638,3 +1638,6 @@ RE-870: 90 original7188 cases compose actual strlen, bounded-copy wrapper and or
|
|
| 1638 |
|
| 1639 |
|
| 1640 |
RE-871: Rust matches90 original map-selection cases with empty/NUL mirror gates,127-byte engine-mapname truncation, raw non-UTF8 bytes, unchanged VM mirror and exact truncated-override mode2 map command text. The typed effect order matches source cvar/read/command requests. Engine callbacks, native copy and actual command dispatch remain outside the port. Full runtime completion remains open. [Evidence](research/RUST_MAP_SELECT.md).
|
|
|
|
|
|
|
|
|
|
|
|
| 1638 |
|
| 1639 |
|
| 1640 |
RE-871: Rust matches90 original map-selection cases with empty/NUL mirror gates,127-byte engine-mapname truncation, raw non-UTF8 bytes, unchanged VM mirror and exact truncated-override mode2 map command text. The typed effect order matches source cvar/read/command requests. Engine callbacks, native copy and actual command dispatch remain outside the port. Full runtime completion remains open. [Evidence](research/RUST_MAP_SELECT.md).
|
| 1641 |
+
|
| 1642 |
+
|
| 1643 |
+
RE-872: 192 actual6939 normal-path cases compose recovered rotation, map selection, mode classification, copy and formatter bodies on shared state. Optional supplied249007 connection changes prove the final scan sees child mutations. Cvar/engine bytes, native copy and lower callback/runtime effects remain explicit boundaries. Full runtime completion remains open. [Evidence](research/QVM_NORMAL_MAP_FLOW.md).
|
docs/RESEARCH_LEDGER.md
CHANGED
|
@@ -2056,3 +2056,8 @@ Rust matches192 original rotation cases, preserving signed cursor wrap, enable/t
|
|
| 2056 |
## 2026-10-27 — RE-871 Rust cycle-mirror map command policy
|
| 2057 |
|
| 2058 |
Rust matches90 original map-selection cases with empty/NUL mirror gates,127-byte engine-mapname truncation, raw non-UTF8 bytes, unchanged VM mirror and exact truncated-override mode2 map command text. The typed effect order matches source cvar/read/command requests. Engine callbacks, native copy and actual command dispatch remain outside the port. Focused `cargo xtask test-group rust-map-select` 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.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 2056 |
## 2026-10-27 — RE-871 Rust cycle-mirror map command policy
|
| 2057 |
|
| 2058 |
Rust matches90 original map-selection cases with empty/NUL mirror gates,127-byte engine-mapname truncation, raw non-UTF8 bytes, unchanged VM mirror and exact truncated-override mode2 map command text. The typed effect order matches source cvar/read/command requests. Engine callbacks, native copy and actual command dispatch remain outside the port. Focused `cargo xtask test-group rust-map-select` 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.
|
| 2059 |
+
|
| 2060 |
+
|
| 2061 |
+
## 2026-10-27 — RE-872 Original normal next-map flow with recovered command children
|
| 2062 |
+
|
| 2063 |
+
192 actual6939 normal-path cases compose recovered rotation, map selection, mode classification, copy and formatter bodies on shared state. Optional supplied249007 connection changes prove the final scan sees child mutations. Cvar/engine bytes, native copy and lower callback/runtime effects remain explicit boundaries. Focused `cargo xtask test-group normal-map-flow` passes (5 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
|
@@ -1675,3 +1675,6 @@ Purpose: turn the supplied installation into an evidence-backed specification of
|
|
| 1675 |
|
| 1676 |
|
| 1677 |
- [x] RE-871 Rust cycle-mirror map command policy ([evidence](research/RUST_MAP_SELECT.md)).
|
|
|
|
|
|
|
|
|
|
|
|
| 1675 |
|
| 1676 |
|
| 1677 |
- [x] RE-871 Rust cycle-mirror map command policy ([evidence](research/RUST_MAP_SELECT.md)).
|
| 1678 |
+
|
| 1679 |
+
|
| 1680 |
+
- [x] RE-872 Original normal next-map flow with recovered command children ([evidence](research/QVM_NORMAL_MAP_FLOW.md)).
|
docs/research/QVM_NORMAL_MAP_FLOW.md
ADDED
|
@@ -0,0 +1,7 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
# Original normal next-map flow with recovered command children
|
| 2 |
+
|
| 3 |
+
RE-872. Reproduce with `python3 scripts/analyze_qvm_normal_map_flow.py`; focused validation: `cargo xtask test-group normal-map-flow`. [Machine report](qvm-normal-map-flow.json).
|
| 4 |
+
|
| 5 |
+
192 actual6939 normal-path cases compose recovered rotation, map selection, mode classification, copy and formatter bodies on shared state. Optional supplied249007 connection changes prove the final scan sees child mutations. Cvar/engine bytes, native copy and lower callback/runtime effects remain explicit boundaries.
|
| 6 |
+
|
| 7 |
+
Original executable/native runtime and complete Linux/macOS Rust/Bevy/Solari acceptance remain unverified.
|
docs/research/README.md
CHANGED
|
@@ -1211,3 +1211,6 @@ The extension collector adds five focused tests for native tail calls, command-r
|
|
| 1211 |
|
| 1212 |
|
| 1213 |
[RE-871: Rust cycle-mirror map command policy](RUST_MAP_SELECT.md).
|
|
|
|
|
|
|
|
|
|
|
|
| 1211 |
|
| 1212 |
|
| 1213 |
[RE-871: Rust cycle-mirror map command policy](RUST_MAP_SELECT.md).
|
| 1214 |
+
|
| 1215 |
+
|
| 1216 |
+
[RE-872: Original normal next-map flow with recovered command children](QVM_NORMAL_MAP_FLOW.md).
|
docs/research/qvm-normal-map-flow.json
ADDED
|
The diff for this file is too large to render.
See raw diff
|
|
|
scripts/analyze_qvm_normal_map_flow.py
ADDED
|
@@ -0,0 +1,18 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
#!/usr/bin/env python3
|
| 2 |
+
import itertools
|
| 3 |
+
from pathlib import Path
|
| 4 |
+
from qvm_research_support import source
|
| 5 |
+
from qvm_map_commands_support import map_seed,normal_flow,put_string,CURSOR,ENABLED,LIMIT,WRITE,MIRROR
|
| 6 |
+
from qvm_transition_support import state_seed,state_words,CPOOL
|
| 7 |
+
from qvm_string_memory_support import cstring
|
| 8 |
+
from analyze_qvm import write_json
|
| 9 |
+
FIELDS=[248,304,308,468,696]
|
| 10 |
+
def main():
|
| 11 |
+
q,raw,h,ins=source();rows=[]
|
| 12 |
+
for mode,enabled,cursor,updated,mirror,disconnect,count in itertools.product([0,9,11],[0,1],[0,1],[b'',b'out.cfg'],[b'',b'cycle'],[False,True],[0,4]):
|
| 13 |
+
m,b=map_seed(raw,h,mirror);m.update(state_seed(mode=mode,phase=2,first=5,second=-7));m.update({CURSOR:cursor,ENABLED:enabled,LIMIT:2,34089604:count,34992496:CPOOL});put_string(m,b,WRITE,b'previous.cfg',128)
|
| 14 |
+
for j in range(4):
|
| 15 |
+
for o in FIELDS:m[CPOOL+6336*j+o]=[2,1,2,0][j] if o==468 else (j+1)*100+o
|
| 16 |
+
before=state_words(m);clients=[{str(o):m[CPOOL+6336*j+o]&0xffffffff for o in FIELDS} for j in range(4)];m,p,b=normal_flow(ins,m,b,updated,b'current_map',0,disconnect);p.update(input=dict(mode=mode,enabled=enabled,cursor=cursor,updated=updated.hex(),mirror=mirror.hex(),disconnect=disconnect,max_clients=count),before=before,clients_before=clients,state=state_words(m),cursor=m[CURSOR]&0xffffffff,filename=cstring(m,b,WRITE).hex(),mirror=cstring(m,b,MIRROR).hex());rows.append(p)
|
| 17 |
+
write_json(Path('docs/research/qvm-normal-map-flow.json'),{'source':q['source'],'sha256':q['sha256'],'probes':rows,'limits':'192 actual6939 normal-path cases compose actual122230/7188/33715/strlen/copy/formatter with shared state.249007 callback is captured with an optional supplied connection0 override, demonstrating post-child connection-scan timing. Engine buffer/cvar refresh and native strncpy remain supplied/modeled; lower callbacks/dispatch/native runtime remain open.'})
|
| 18 |
+
if __name__=='__main__':main()
|
scripts/qvm_map_commands_support.py
CHANGED
|
@@ -44,3 +44,19 @@ def select_map(ins,m,b,current,fallback=0):
|
|
| 44 |
def command(i,m,a,bs):requests.append({'target':-15,'arguments':a});operations.append({'op':'command','mode':a[8],'text':cstring(m,bs,a[12]).hex()});return m,0,{'command_captured':True}
|
| 45 |
def choose(i,m,a,bs):requests.append({'target':221662,'arguments':a});operations.append({'op':'fallback'});return m,fallback,{'selection_return_supplied':True}
|
| 46 |
m,v,p,b=run(ins,m,7188,7257,156,b=b,handlers={36038:strlen,-8:read,-6:set_cvar,69338:copy,70458:format,-15:command,221662:choose},base=D+0x2000);p.update(requests=requests,operations=operations,format_traces=formatted);return m,p,b
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 44 |
def command(i,m,a,bs):requests.append({'target':-15,'arguments':a});operations.append({'op':'command','mode':a[8],'text':cstring(m,bs,a[12]).hex()});return m,0,{'command_captured':True}
|
| 45 |
def choose(i,m,a,bs):requests.append({'target':221662,'arguments':a});operations.append({'op':'fallback'});return m,fallback,{'selection_return_supplied':True}
|
| 46 |
m,v,p,b=run(ins,m,7188,7257,156,b=b,handlers={36038:strlen,-8:read,-6:set_cvar,69338:copy,70458:format,-15:command,221662:choose},base=D+0x2000);p.update(requests=requests,operations=operations,format_traces=formatted);return m,p,b
|
| 47 |
+
|
| 48 |
+
def normal_flow(ins,m,b,updated,current,fallback,disconnect=False):
|
| 49 |
+
from qvm_transition_support import CPOOL
|
| 50 |
+
parts={};middle=[];roots=[]
|
| 51 |
+
def snapshot(m):return [{str(o):m[CPOOL+6336*j+o]&0xffffffff for o in [248,304,308,468,696]} for j in range(4)]
|
| 52 |
+
def rotate(i,m,a,bs):
|
| 53 |
+
roots.append(122230);m,p,b=rotation(i,m,dict(bs),updated);parts['rotation']=p;return m,0,{'actual_source_child':122230}
|
| 54 |
+
def choose(i,m,a,bs):
|
| 55 |
+
roots.append(7188);m,p,b=select_map(i,m,dict(bs),current,fallback);parts['map']=p;return m,0,{'actual_source_child':7188}
|
| 56 |
+
def after(i,m,a,bs):
|
| 57 |
+
roots.append(249007);middle.extend(snapshot(m))
|
| 58 |
+
if disconnect:m[CPOOL+468]=0
|
| 59 |
+
return m,0,{'connection_change_supplied':True}
|
| 60 |
+
def classify(i,m,a,bs):
|
| 61 |
+
m,v,p,b=run(i,m,33715,33740,12,a,bs,base=D+0x6000);return m,v,{'actual_source_child':33715}
|
| 62 |
+
m,v,p,b=run(ins,m,6939,7186,48,b=b,handlers={122230:rotate,7188:choose,249007:after,33715:classify},base=D+0x4000);p.update(parts=parts,middle=middle,clients=snapshot(m),roots=roots);return m,p,b
|
scripts/test_qvm_normal_map_flow.py
ADDED
|
@@ -0,0 +1,23 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
import json,unittest
|
| 2 |
+
from pathlib import Path
|
| 3 |
+
class NormalFlowTests(unittest.TestCase):
|
| 4 |
+
def test_commands_counter_and_shared_global_state(self):
|
| 5 |
+
rows=json.loads(Path('docs/research/qvm-normal-map-flow.json').read_text())['probes'];self.assertEqual(len(rows),192)
|
| 6 |
+
for p in rows:
|
| 7 |
+
a=p['input'];wrapped=bool(a['enabled']) and a['cursor']+1>=2;name=bytes.fromhex(a['updated']) if wrapped else b'previous.cfg';ops=[]
|
| 8 |
+
if wrapped:ops=[{'op':'refresh'}]+([{'op':'write','text':name.hex()},{'op':'clear'}] if name else [])+[{'op':'reset'}]
|
| 9 |
+
self.assertEqual(p['cursor'],0 if wrapped else a['cursor']+int(bool(a['enabled'])));self.assertEqual(p['filename'],name.hex());self.assertEqual(p['parts']['rotation']['operations'],ops);self.assertEqual(p['mirror'],a['mirror']);self.assertEqual(p['roots'],[122230,7188,249007]);state=dict(p['before']);state.update(round=0,blocked=0,first=0,second=0);self.assertEqual(p['state'],state)
|
| 10 |
+
expected=[{'op':'read-map','text':b'current_map'.hex()},{'op':'set-cycle','value':b'current_map'.hex()},{'op':'clear-next'},{'op':'command','mode':2,'text':b'map cycle\n'.hex()}] if a['mirror'] else [{'op':'fallback'}];self.assertEqual(p['parts']['map']['operations'],expected)
|
| 11 |
+
def test_post_callback_connections_and_mode9_clear(self):
|
| 12 |
+
for p in json.loads(Path('docs/research/qvm-normal-map-flow.json').read_text())['probes']:
|
| 13 |
+
a=p['input'];middle=[dict(v) for v in p['clients_before']]
|
| 14 |
+
for c in middle[:a['max_clients']]:
|
| 15 |
+
if c['468']==2:
|
| 16 |
+
c['248']=0
|
| 17 |
+
if a['mode']==9:c['304']=c['308']=0
|
| 18 |
+
self.assertEqual(p['middle'],middle);end=[dict(v) for v in middle]
|
| 19 |
+
if a['disconnect']:end[0]['468']=0
|
| 20 |
+
for c in end[:a['max_clients']]:
|
| 21 |
+
if c['468']==2:c['468']=1
|
| 22 |
+
self.assertEqual(p['clients'],end)
|
| 23 |
+
if __name__=='__main__':unittest.main()
|
xtask/checks.tsv
CHANGED
|
@@ -2497,3 +2497,7 @@ report scripts/analyze_rust_map_select.py docs/research/rust-map-select.json
|
|
| 2497 |
edge docs/research/rust-map-select.json scripts/test_rust_map_select.py
|
| 2498 |
group rust-map-select scripts/analyze_rust_map_select.py
|
| 2499 |
edge scripts/analyze_rust_map_select.py scripts/analyze_qvm_resumer_audit.py
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 2497 |
edge docs/research/rust-map-select.json scripts/test_rust_map_select.py
|
| 2498 |
group rust-map-select scripts/analyze_rust_map_select.py
|
| 2499 |
edge scripts/analyze_rust_map_select.py scripts/analyze_qvm_resumer_audit.py
|
| 2500 |
+
report scripts/analyze_qvm_normal_map_flow.py docs/research/qvm-normal-map-flow.json
|
| 2501 |
+
edge docs/research/qvm-normal-map-flow.json scripts/test_qvm_normal_map_flow.py
|
| 2502 |
+
group normal-map-flow scripts/analyze_qvm_normal_map_flow.py
|
| 2503 |
+
edge scripts/analyze_qvm_normal_map_flow.py scripts/analyze_qvm_resumer_audit.py
|