nmarshall commited on
Commit
59e33ea
·
1 Parent(s): 6d72837

qvm: recover temporary event constructor

Browse files
docs/FINDINGS.md CHANGED
@@ -1553,3 +1553,6 @@ RE-813–822 replaces the scoreboard decimal assumption with actual37914 executi
1553
 
1554
 
1555
  **RE-851:** Rust matches 48 original normal-reset cases with separate pre-map score reset and post-map connection transition APIs. The adapter captures a no-op map child; production callers can apply its real mutations between stages. Safe count errors preserve state, and pending/phase/series data remain unchanged. [Evidence](research/RUST_NEXTMAP_RESET.md).
 
 
 
 
1553
 
1554
 
1555
  **RE-851:** Rust matches 48 original normal-reset cases with separate pre-map score reset and post-map connection transition APIs. The adapter captures a no-op map child; production callers can apply its real mutations between stages. Safe count errors preserve state, and pending/phase/series data remain unchanged. [Evidence](research/RUST_NEXTMAP_RESET.md).
1556
+
1557
+
1558
+ **RE-852:** 144 original 277695/278138 cases recover tempEntity metadata, wrapped event kind+19, CVFI/CVIF origin snapping, trajectory/current-origin writes and link order. Five invalid float domains reject. Allocator flags424 and caller-owned84/140 are preserved; allocation277165 and native linking remain supplied/captured. [Evidence](research/QVM_EVENT_CONSTRUCT.md).
docs/PROVISIONAL_TODO.md CHANGED
@@ -1572,3 +1572,6 @@ RE-850: 48 original 6939 suffix cases recover round/blocked/global score clears,
1572
 
1573
 
1574
  RE-851: Rust matches 48 original normal-reset cases with separate pre-map score reset and post-map connection transition APIs. The adapter captures a no-op map child; production callers can apply its real mutations between stages. Safe count errors preserve state, and pending/phase/series data remain unchanged. Full runtime completion remains open. [Evidence](research/RUST_NEXTMAP_RESET.md).
 
 
 
 
1572
 
1573
 
1574
  RE-851: Rust matches 48 original normal-reset cases with separate pre-map score reset and post-map connection transition APIs. The adapter captures a no-op map child; production callers can apply its real mutations between stages. Safe count errors preserve state, and pending/phase/series data remain unchanged. Full runtime completion remains open. [Evidence](research/RUST_NEXTMAP_RESET.md).
1575
+
1576
+
1577
+ RE-852: 144 original 277695/278138 cases recover tempEntity metadata, wrapped event kind+19, CVFI/CVIF origin snapping, trajectory/current-origin writes and link order. Five invalid float domains reject. Allocator flags424 and caller-owned84/140 are preserved; allocation277165 and native linking remain supplied/captured. Full runtime completion remains open. [Evidence](research/QVM_EVENT_CONSTRUCT.md).
docs/RESEARCH_LEDGER.md CHANGED
@@ -1933,3 +1933,8 @@ Rust matches 300 original series-branch cases, reusing the verified mode classif
1933
  ## 2026-10-27 — RE-851 Rust staged normal map reset policy
1934
 
1935
  Rust matches 48 original normal-reset cases with separate pre-map score reset and post-map connection transition APIs. The adapter captures a no-op map child; production callers can apply its real mutations between stages. Safe count errors preserve state, and pending/phase/series data remain unchanged. Focused `cargo xtask test-group rust-nextmap-reset` 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.
 
 
 
 
 
 
1933
  ## 2026-10-27 — RE-851 Rust staged normal map reset policy
1934
 
1935
  Rust matches 48 original normal-reset cases with separate pre-map score reset and post-map connection transition APIs. The adapter captures a no-op map child; production callers can apply its real mutations between stages. Safe count errors preserve state, and pending/phase/series data remain unchanged. Focused `cargo xtask test-group rust-nextmap-reset` 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.
1936
+
1937
+
1938
+ ## 2026-10-27 — RE-852 Original temporary event construction and origin snapping
1939
+
1940
+ 144 original 277695/278138 cases recover tempEntity metadata, wrapped event kind+19, CVFI/CVIF origin snapping, trajectory/current-origin writes and link order. Five invalid float domains reject. Allocator flags424 and caller-owned84/140 are preserved; allocation277165 and native linking remain supplied/captured. Focused `cargo xtask test-group event-construct` 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
@@ -1609,3 +1609,6 @@ Purpose: turn the supplied installation into an evidence-backed specification of
1609
 
1610
 
1611
  - [x] RE-851 Rust staged normal map reset policy ([evidence](research/RUST_NEXTMAP_RESET.md)).
 
 
 
 
1609
 
1610
 
1611
  - [x] RE-851 Rust staged normal map reset policy ([evidence](research/RUST_NEXTMAP_RESET.md)).
1612
+
1613
+
1614
+ - [x] RE-852 Original temporary event construction and origin snapping ([evidence](research/QVM_EVENT_CONSTRUCT.md)).
docs/research/QVM_EVENT_CONSTRUCT.md ADDED
@@ -0,0 +1,7 @@
 
 
 
 
 
 
 
 
1
+ # Original temporary event construction and origin snapping
2
+
3
+ RE-852. Reproduce with `python3 scripts/analyze_qvm_event_construct.py`; focused validation: `cargo xtask test-group event-construct`. [Machine report](qvm-event-construct.json).
4
+
5
+ 144 original 277695/278138 cases recover tempEntity metadata, wrapped event kind+19, CVFI/CVIF origin snapping, trajectory/current-origin writes and link order. Five invalid float domains reject. Allocator flags424 and caller-owned84/140 are preserved; allocation277165 and native linking remain supplied/captured.
6
+
7
+ Original executable/native runtime and complete Linux/macOS Rust/Bevy/Solari acceptance remain unverified.
docs/research/README.md CHANGED
@@ -1147,3 +1147,6 @@ The extension collector adds five focused tests for native tail calls, command-r
1147
 
1148
 
1149
  [RE-851: Rust staged normal map reset policy](RUST_NEXTMAP_RESET.md).
 
 
 
 
1147
 
1148
 
1149
  [RE-851: Rust staged normal map reset policy](RUST_NEXTMAP_RESET.md).
1150
+
1151
+
1152
+ [RE-852: Original temporary event construction and origin snapping](QVM_EVENT_CONSTRUCT.md).
docs/research/qvm-event-construct.json ADDED
The diff for this file is too large to render. See raw diff
 
scripts/analyze_qvm_event_construct.py ADDED
@@ -0,0 +1,29 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ #!/usr/bin/env python3
2
+ import itertools
3
+ from pathlib import Path
4
+ from qvm_research_support import source
5
+ from qvm_transition_support import run,vector,ENTITY,T
6
+ from analyze_qvm_acceleration import word
7
+ from analyze_qvm import write_json
8
+ FIELDS=[4,12,16,20,24,28,32,36,40,44,84,140,400,424,488,492,496,536,540,568,572]
9
+ S=T+0x7000
10
+ VECTORS=[[word(v) for v in row] for row in [[1.9,-1.9,-0.0],[0,0,0],[-2147483648,2147483520,16777215],[123.999,-.001,-1024.75]]]
11
+
12
+ def construct(ins,origin,kind,now,flags):
13
+ m={ENTITY+o:0x13579bdf for o in range(0,880,4)};m[ENTITY+424]=flags;m[34992532]=now;vector(m,S,origin);requests=[];child=None
14
+ def allocate(i,m,a):requests.append({'target':277165,'arguments':a});return m,ENTITY,{'allocation_supplied':True}
15
+ def set_origin(i,m,a):
16
+ nonlocal child
17
+ requests.append({'target':278138,'arguments':a});m,child=run(i,m,278138,278199,16,a,base=T+0x2000);return m,0,{'actual_source_child':278138,'execution':child['execution']}
18
+ def link(i,m,a):requests.append({'target':-31,'arguments':a});return m,0,{'link_captured':True}
19
+ m,p=run(ins,m,277695,277777,36,{8:S,12:kind},handlers={277165:allocate,278138:set_origin,-31:link});p.update(input=dict(origin=origin,kind=kind,now=now,flags=flags),fields={str(o):m[ENTITY+o]&0xffffffff for o in FIELDS},requests=requests,child_execution=child['execution']);return p
20
+
21
+ def main():
22
+ q,raw,h,ins=source();rows=[construct(ins,v,k,n,f) for v,k,n,f in itertools.product(VECTORS,[-1,0,69,2147483647],[-2147483648,0,2147483647],[0,16,0xffffffff])];rejected=[]
23
+ for bits in [0x7fc00000,0x7f800000,0xff800000,0x4f000000,0xcf000001]:
24
+ try:construct(ins,[bits,0,0],69,1000,16)
25
+ except ValueError as e:rejected.append({'origin':[bits,0,0],'error':str(e)})
26
+ else:raise AssertionError('unsupported CVFI domain accepted')
27
+ start=h['data_offset']+97191;name=raw[start:raw.index(b'\0',start)].decode('ascii')
28
+ write_json(Path('docs/research/qvm-event-construct.json'),{'source':q['source'],'sha256':q['sha256'],'classname':name,'probes':rows,'rejections':rejected,'limits':'Actual277695 and actual278138 over144 coherent cases plus5 rejected CVFI domains. Allocator277165 pointer supplied; syscall-31 linking captured. Constructor preserves allocator flags424 and caller-owned84/140. Origin snaps by CVFI/CVIF, metadata writes568 clock and572 one. Allocation/native linking and runtime ownership remain open.'})
29
+ if __name__=='__main__':main()
scripts/test_qvm_event_construct.py ADDED
@@ -0,0 +1,15 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ import json,math,unittest
2
+ from pathlib import Path
3
+ from analyze_qvm_acceleration import word,number
4
+ from qvm_transition_support import ENTITY,T
5
+ class EventTests(unittest.TestCase):
6
+ def test_exact_constructor_metadata_and_snapped_words(self):
7
+ r=json.loads(Path('docs/research/qvm-event-construct.json').read_text());self.assertEqual(len(r['probes']),144);self.assertEqual(r['classname'],'tempEntity')
8
+ for p in r['probes']:
9
+ a=p['input'];f={str(o):0 for o in [12,16,20,36,40,44]};snap=[word(math.trunc(number(v))) for v in a['origin']];f.update({str(o+4*j):v for o in [24,488] for j,v in enumerate(snap)});f.update({'4':(a['kind']+19)&0xffffffff,'536':97191,'540':662184166,'568':a['now']&0xffffffff,'572':1,'424':a['flags'],'84':0x13579bdf,'140':0x13579bdf,'400':0x13579bdf});self.assertEqual(p['fields'],f);self.assertEqual(p['return'],ENTITY)
10
+ def test_source_child_abi_write_scope_and_invalid_domains(self):
11
+ r=json.loads(Path('docs/research/qvm-event-construct.json').read_text());self.assertEqual(len(r['rejections']),5);allowed={4,12,16,20,24,28,32,36,40,44,488,492,496,536,540,568,572}
12
+ for v in r['rejections']:self.assertIn('conversion outside bounded float domain',v['error'])
13
+ for p in r['probes']:
14
+ self.assertEqual(p['requests'],[{'target':277165,'arguments':{}},{'target':278138,'arguments':{'8':ENTITY,'12':T+20}},{'target':-31,'arguments':{'8':ENTITY}}]);self.assertTrue(all(v['address']-ENTITY in allowed for v in p['changes']));self.assertEqual(p['child_execution']['stop'],278199)
15
+ if __name__=='__main__':unittest.main()
xtask/checks.tsv CHANGED
@@ -2316,3 +2316,7 @@ report scripts/analyze_rust_nextmap_reset.py docs/research/rust-nextmap-reset.js
2316
  edge docs/research/rust-nextmap-reset.json scripts/test_rust_nextmap_reset.py
2317
  group rust-nextmap-reset scripts/analyze_rust_nextmap_reset.py
2318
  edge scripts/analyze_rust_nextmap_reset.py scripts/analyze_qvm_resumer_audit.py
 
 
 
 
 
2316
  edge docs/research/rust-nextmap-reset.json scripts/test_rust_nextmap_reset.py
2317
  group rust-nextmap-reset scripts/analyze_rust_nextmap_reset.py
2318
  edge scripts/analyze_rust_nextmap_reset.py scripts/analyze_qvm_resumer_audit.py
2319
+ report scripts/analyze_qvm_event_construct.py docs/research/qvm-event-construct.json
2320
+ edge docs/research/qvm-event-construct.json scripts/test_qvm_event_construct.py
2321
+ group event-construct scripts/analyze_qvm_event_construct.py
2322
+ edge scripts/analyze_qvm_event_construct.py scripts/analyze_qvm_resumer_audit.py