nmarshall commited on
Commit
52aca4a
·
1 Parent(s): 6740a9c

qvm: history reset writer

Browse files
docs/ASSET_PIPELINE_TODO.md CHANGED
@@ -622,3 +622,6 @@ The [RE-637–646 history/pellet batch](research/QVM_HISTORY_PELLET_BATCH.md) re
622
 
623
 
624
  Research progress: RE-646 [report](research/QVM_EVENT57_WORLD_RETURN.md); remaining native/content/runtime/platform scope stays open.
 
 
 
 
622
 
623
 
624
  Research progress: RE-646 [report](research/QVM_EVENT57_WORLD_RETURN.md); remaining native/content/runtime/platform scope stays open.
625
+
626
+
627
+ Research progress: RE-648 [report](research/QVM_HISTORY_RESET.md); remaining native/content/runtime/platform scope stays open.
docs/FINDINGS.md CHANGED
@@ -968,3 +968,6 @@ Bounded qagame paths recover bomb-plant/inactivity correction requests, direct f
968
 
969
 
970
  **RE-646 — Allocated event57 twenty-world-pellet bookkeeping and caller continuation:** Direct285840 now composes actual allocation, event57, quantized direction/global RNG, all20 supplied-world pellets, real no-target bookkeeping and void caller continuation. [Evidence](research/QVM_EVENT57_WORLD_RETURN.md).
 
 
 
 
968
 
969
 
970
  **RE-646 — Allocated event57 twenty-world-pellet bookkeeping and caller continuation:** Direct285840 now composes actual allocation, event57, quantized direction/global RNG, all20 supplied-world pellets, real no-target bookkeeping and void caller continuation. [Evidence](research/QVM_EVENT57_WORLD_RETURN.md).
971
+
972
+
973
+ **RE-648 — History reset writer and preserved row fields:** 142502 resets all20 history rows from live state/time and clears4408, but does not initialize row72/76 or header words. [Evidence](research/QVM_HISTORY_RESET.md).
docs/PROVISIONAL_TODO.md CHANGED
@@ -942,3 +942,6 @@ The [RE-637–646 history/pellet batch](research/QVM_HISTORY_PELLET_BATCH.md) re
942
 
943
 
944
  Research progress: RE-646 [report](research/QVM_EVENT57_WORLD_RETURN.md); remaining native/content/runtime/platform scope stays open.
 
 
 
 
942
 
943
 
944
  Research progress: RE-646 [report](research/QVM_EVENT57_WORLD_RETURN.md); remaining native/content/runtime/platform scope stays open.
945
+
946
+
947
+ Research progress: RE-648 [report](research/QVM_HISTORY_RESET.md); remaining native/content/runtime/platform scope stays open.
docs/RESEARCH_LEDGER.md CHANGED
@@ -902,3 +902,8 @@ Whole291641 now executes recovered rewind/configured/restore children before and
902
  ## 2026-10-20 — RE-646 Allocated event57 twenty-world-pellet bookkeeping and caller continuation (separate task commit)
903
 
904
  Direct285840 now composes actual allocation, event57, quantized direction/global RNG, all20 supplied-world pellets, real no-target bookkeeping and void caller continuation. Four complete chains plus a zero-direction boundary independently check every event word/global seed, twenty trace calls, actual bookkeeping ABI, all stats rows and suspended invalid input. Full suite: 1059 tests pass. Report regenerates byte-identically (1683006 bytes). Storage/filter, links and whitespace checks pass. No assets/Rust runtime/shared VM evaluator changed; native/reference/legal/full platform scope remains open.
 
 
 
 
 
 
902
  ## 2026-10-20 — RE-646 Allocated event57 twenty-world-pellet bookkeeping and caller continuation (separate task commit)
903
 
904
  Direct285840 now composes actual allocation, event57, quantized direction/global RNG, all20 supplied-world pellets, real no-target bookkeeping and void caller continuation. Four complete chains plus a zero-direction boundary independently check every event word/global seed, twenty trace calls, actual bookkeeping ABI, all stats rows and suspended invalid input. Full suite: 1059 tests pass. Report regenerates byte-identically (1683006 bytes). Storage/filter, links and whitespace checks pass. No assets/Rust runtime/shared VM evaluator changed; native/reference/legal/full platform scope remains open.
905
+
906
+
907
+ ## 2026-10-20 — RE-648 History reset writer and preserved row fields (separate task commit)
908
+
909
+ 142502 resets all20 history rows from live state/time and clears4408, but does not initialize row72/76 or header words. 12 time/animation fixtures independently compare every row word, byte packing, omitted-field preservation and client guard effects. Full suite: 1062 tests pass. Report regenerates byte-identically (380952 bytes). Storage/filter, links and whitespace checks pass. No assets/Rust runtime/shared VM evaluator changed; native/reference/legal/full platform scope remains open.
docs/REVERSE_ENGINEERING_TODO.md CHANGED
@@ -985,3 +985,6 @@ Purpose: turn the supplied installation into an evidence-backed specification of
985
 
986
 
987
  - [x] RE-646 Allocated event57 twenty-world-pellet bookkeeping and caller continuation ([report](research/QVM_EVENT57_WORLD_RETURN.md)).
 
 
 
 
985
 
986
 
987
  - [x] RE-646 Allocated event57 twenty-world-pellet bookkeeping and caller continuation ([report](research/QVM_EVENT57_WORLD_RETURN.md)).
988
+
989
+
990
+ - [x] RE-648 History reset writer and preserved row fields ([report](research/QVM_HISTORY_RESET.md)).
docs/research/QVM_HISTORY_RESET.md ADDED
@@ -0,0 +1,7 @@
 
 
 
 
 
 
 
 
1
+ # History reset writer and preserved row fields
2
+
3
+ RE-648. Reproduce with `python3 scripts/analyze_qvm_history_reset.py`; check with `python3 scripts/test_qvm_history_reset.py`. The [machine report](qvm-history-reset.json) retains source identity and bounded fixtures.
4
+
5
+ Complete142503–142770 fills20 records at client4492 with80-byte stride. It copies entity position24,angles60,velocity36, packs low animation bytes200/196, copies four selected client words and writes timestamp68 from34992532. It clears client4408. Row0/4/8 and72/76 are preserved from previous memory, unlike the later append writer; the report retains those per-row values rather than assuming reset clears the whole table. STORE1 effects are reconciled with packed word memory. The caller must provide a non-null client; no guard or invocation timing is invented, and no native code executes.
6
+
7
+ No original executable/full QVM/native collision/physics/rendering executes. Native responses and legal input domains are supplied or unverified where stated; full runtime/macOS/Linux Rust/Bevy/Solari gameplay remains open.
docs/research/README.md CHANGED
@@ -543,3 +543,6 @@ The extension collector adds five focused tests for native tail calls, command-r
543
 
544
 
545
  [RE-646: Allocated event57 twenty-world-pellet bookkeeping and caller continuation](QVM_EVENT57_WORLD_RETURN.md). Reproduce with `python3 scripts/analyze_qvm_event57_world_return.py`; check with `python3 scripts/test_qvm_event57_world_return.py`.
 
 
 
 
543
 
544
 
545
  [RE-646: Allocated event57 twenty-world-pellet bookkeeping and caller continuation](QVM_EVENT57_WORLD_RETURN.md). Reproduce with `python3 scripts/analyze_qvm_event57_world_return.py`; check with `python3 scripts/test_qvm_event57_world_return.py`.
546
+
547
+
548
+ [RE-648: History reset writer and preserved row fields](QVM_HISTORY_RESET.md). Reproduce with `python3 scripts/analyze_qvm_history_reset.py`; check with `python3 scripts/test_qvm_history_reset.py`.
docs/research/qvm-history-reset.json ADDED
The diff for this file is too large to render. See raw diff
 
scripts/analyze_qvm_history_reset.py ADDED
@@ -0,0 +1,23 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ #!/usr/bin/env python3
2
+ """Complete142502 twenty-entry history reset without inventing omitted fields."""
3
+ import itertools
4
+ from pathlib import Path
5
+ from qvm_research_support import source,execute
6
+ from qvm_history_support import history,merge_bytes
7
+ from analyze_qvm_rewind_history_select import history_fixture
8
+ from analyze_qvm_rewind_snapshot import client_state
9
+ from analyze_qvm_temp_event import record
10
+ from qvm_server_fire_support import ENTITY
11
+ from analyze_qvm import write_json
12
+ LOCAL=0x78000000
13
+
14
+ def reset(ins,m,pointer=ENTITY):
15
+ m=dict(m);client=m[pointer+520];before=history(m,client);entity=record(m,pointer);prior=client_state(m,client);m[LOCAL+60]=pointer;m,_,e=execute(ins,142503,142771,m,(0,0,0),LOCAL);merge_bytes(m,e['byte_writes'])
16
+ return m,{'pointer':pointer,'time':m[34992532],'entity':entity,'initial_client':prior,'final_client':client_state(m,client),'initial':before,'final':history(m,client),'execution':e}
17
+
18
+ def main():
19
+ q,raw,h,ins=source();rows=[]
20
+ for time,animation in itertools.product([0,5000,0x7fffffff],[0,255,256,0x12345678]):
21
+ m=history_fixture(raw,h,[2000-50*j for j in range(20)]);m[34992532]=time;m[ENTITY+200]=animation;m[ENTITY+196]=animation^255;rows.append(reset(ins,m)[1])
22
+ write_json(Path('docs/research/qvm-history-reset.json'),{'source':q['source'],'sha256':q['sha256'],'probes':rows,'limits':'Complete142503–142770; supplied non-null client required by caller, no null guard invented. Writes20 rows and clears client4408, preserving source-omitted fields. STORE1 merged with packed words; no native execution/history call timing inferred.'})
23
+ if __name__=='__main__':main()
scripts/qvm_history_support.py ADDED
@@ -0,0 +1,14 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ """Word/byte accounting for bounded history-producer source fixtures."""
2
+ def history(m,client):return [{str(o):m[client+4492+80*j+o]&0xffffffff for o in range(0,80,4)} for j in range(20)]
3
+
4
+ def merge_bytes(m,writes):
5
+ for w in writes:
6
+ a=w['address']&~3;shift=(w['address']&3)*8;m[a]=(m[a]&~(255<<shift))|(w['value']<<shift)
7
+ return m
8
+
9
+ def memcpy_words(ins,m,args):
10
+ dst,src,size=(args[o] for o in [8,12,16])
11
+ if dst%4 or src%4 or size%4 or not 0<=size<=1600:raise ValueError('Unsupported bounded history copy')
12
+ values=[m[src+o] for o in range(0,size,4)]
13
+ for o,value in zip(range(0,size,4),values):m[dst+o]=value
14
+ return m,0,{'arguments':args,'copied_words':len(values),'model':'explicit aligned native copy, original library not executed'}
scripts/test_qvm_history_reset.py ADDED
@@ -0,0 +1,24 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ import json,unittest
2
+ from pathlib import Path
3
+
4
+ def written(old,entity,client,time,tail=False):
5
+ r=dict(old)
6
+ for dst,src in [(12,24),(24,60),(40,36)]:
7
+ for j in range(3):r[str(dst+4*j)]=entity[str(src+4*j)]
8
+ r['36']=(r['36']&0xffff0000)|(entity['200']&255)|((entity['196']&255)<<8)
9
+ for dst,src in [(56,4380),(52,4384),(64,4388),(60,4392)]+([(72,6204),(76,6256)] if tail else []):r[str(dst)]=client[str(src)]
10
+ r['68']=time&0xffffffff;return r
11
+ class HistoryResetTests(unittest.TestCase):
12
+ @classmethod
13
+ def setUpClass(cls):cls.r=json.loads(Path('docs/research/qvm-history-reset.json').read_text())
14
+ def test_independent_all_twenty_rows(self):
15
+ self.assertEqual(len(self.r['probes']),12)
16
+ for p in self.r['probes']:self.assertEqual(p['final'],[written(old,p['entity'],p['initial_client'],p['time']) for old in p['initial']])
17
+ def test_omitted_fields_remain_per_row_canaries(self):
18
+ for p in self.r['probes']:
19
+ for before,after in zip(p['initial'],p['final']):
20
+ for o in ['0','4','8','72','76']:self.assertEqual(after[o],before[o])
21
+ def test_guard_and_no_native_calls(self):
22
+ for p in self.r['probes']:
23
+ want=dict(p['initial_client']);want['4408']=0;self.assertEqual(p['final_client'],want);self.assertEqual(p['execution']['calls'],[]);self.assertEqual(len(p['execution']['byte_writes']),40)
24
+ if __name__=='__main__':unittest.main()