nmarshall commited on
Commit
03d6b2b
·
1 Parent(s): 615aedc

qvm: contact event header and prediction

Browse files
docs/ASSET_PIPELINE_TODO.md CHANGED
@@ -814,3 +814,6 @@ Research progress: RE-715 [report](research/QVM_CONTACT_SPECIAL.md); remaining n
814
 
815
 
816
  Research progress: RE-716 [report](research/QVM_CONTACT_ANNOUNCEMENT.md); remaining native/content/runtime/platform scope stays open.
 
 
 
 
814
 
815
 
816
  Research progress: RE-716 [report](research/QVM_CONTACT_ANNOUNCEMENT.md); remaining native/content/runtime/platform scope stays open.
817
+
818
+
819
+ Research progress: RE-717 [report](research/QVM_CONTACT_EVENT_HEADER.md); remaining native/content/runtime/platform scope stays open.
docs/FINDINGS.md CHANGED
@@ -1160,3 +1160,6 @@ RE-703–712 batch complete: [damage factor and contact dispatch](research/QVM_D
1160
 
1161
 
1162
  **RE-716 — Contact event and announcement gates:** Events require nonzero caller flag and scalar; announcement7259 additionally requires34081316 and clear victim client220 bit16384/entity552 bit16. [Evidence](research/QVM_CONTACT_ANNOUNCEMENT.md).
 
 
 
 
1160
 
1161
 
1162
  **RE-716 — Contact event and announcement gates:** Events require nonzero caller flag and scalar; announcement7259 additionally requires34081316 and clear victim client220 bit16384/entity552 bit16. [Evidence](research/QVM_CONTACT_ANNOUNCEMENT.md).
1163
+
1164
+
1165
+ **RE-717 — Contact event header and health prediction:** Contact allocates event62 through actual277695, encodes the normal through60317, publishes IDs/location/part and predicts lethality using float32 health−scalar≤0 without applying damage. [Evidence](research/QVM_CONTACT_EVENT_HEADER.md).
docs/PROVISIONAL_TODO.md CHANGED
@@ -1149,3 +1149,6 @@ Research progress: RE-715 [report](research/QVM_CONTACT_SPECIAL.md); remaining n
1149
 
1150
 
1151
  Research progress: RE-716 [report](research/QVM_CONTACT_ANNOUNCEMENT.md); remaining native/content/runtime/platform scope stays open.
 
 
 
 
1149
 
1150
 
1151
  Research progress: RE-716 [report](research/QVM_CONTACT_ANNOUNCEMENT.md); remaining native/content/runtime/platform scope stays open.
1152
+
1153
+
1154
+ Research progress: RE-717 [report](research/QVM_CONTACT_EVENT_HEADER.md); remaining native/content/runtime/platform scope stays open.
docs/RESEARCH_LEDGER.md CHANGED
@@ -1220,3 +1220,8 @@ The special contact path fixes scalar1, reads the first context category and rec
1220
  ## 2026-10-21 — RE-716 Contact event and announcement gates (separate task commit)
1221
 
1222
  Events require nonzero caller flag and scalar; announcement7259 additionally requires34081316 and clear victim client220 bit16384/entity552 bit16. 144 gate combinations check continuation, announcement truth table, original format and every call argument. Full suite: 1312 tests pass. Report regenerates byte-identically (123916 bytes). Storage/filter, links and whitespace checks pass. No assets/Rust runtime/shared VM evaluator changed; native/reference/legal/full platform scope remains open.
 
 
 
 
 
 
1220
  ## 2026-10-21 — RE-716 Contact event and announcement gates (separate task commit)
1221
 
1222
  Events require nonzero caller flag and scalar; announcement7259 additionally requires34081316 and clear victim client220 bit16384/entity552 bit16. 144 gate combinations check continuation, announcement truth table, original format and every call argument. Full suite: 1312 tests pass. Report regenerates byte-identically (123916 bytes). Storage/filter, links and whitespace checks pass. No assets/Rust runtime/shared VM evaluator changed; native/reference/legal/full platform scope remains open.
1223
+
1224
+
1225
+ ## 2026-10-21 — RE-717 Contact event header and health prediction (separate task commit)
1226
+
1227
+ Contact allocates event62 through actual277695, encodes the normal through60317, publishes IDs/location/part and predicts lethality using float32 health−scalar≤0 without applying damage. 72 health/scalar/normal/part fixtures verify all220 event words, actual child order and the earlier native-link snapshot. Full suite: 1316 tests pass. Report regenerates byte-identically (1919852 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
@@ -1192,3 +1192,6 @@ Purpose: turn the supplied installation into an evidence-backed specification of
1192
 
1193
 
1194
  - [x] RE-716 Contact event and announcement gates ([report](research/QVM_CONTACT_ANNOUNCEMENT.md)).
 
 
 
 
1192
 
1193
 
1194
  - [x] RE-716 Contact event and announcement gates ([report](research/QVM_CONTACT_ANNOUNCEMENT.md)).
1195
+
1196
+
1197
+ - [x] RE-717 Contact event header and health prediction ([report](research/QVM_CONTACT_EVENT_HEADER.md)).
docs/research/QVM_CONTACT_EVENT_HEADER.md ADDED
@@ -0,0 +1,7 @@
 
 
 
 
 
 
 
 
1
+ # Contact event header and health prediction
2
+
3
+ RE-717. Reproduce with `python3 scripts/analyze_qvm_contact_event_header.py`; check with `python3 scripts/test_qvm_contact_event_header.py`. The [machine report](qvm-contact-event-header.json) retains source identity and bounded fixtures.
4
+
5
+ Actual292917–293020 calls recovered277695/278138 with event62 and the trace point. Its allocation record is supplied and native link is captured; the actual constructor truncates point components before storing its origin. The contact header ORs32 into event424, stores actual60317 normal code at184, attacker/target IDs at140/144, location at88, context60 part index at84, and float32 health-minus-scalar≤0 at200. Independent constructor/codec oracles verify the entire880-byte event record. Constructor child effects are hashed to avoid duplicating large records; their execution traces and the complete initial/final/link records remain. The link request occurs inside the constructor, before these header mutations. Predicted lethality does not mutate target health. Scalar encoding/direction/feedback remain later stages.
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
@@ -750,3 +750,6 @@ The extension collector adds five focused tests for native tail calls, command-r
750
 
751
 
752
  [RE-716: Contact event and announcement gates](QVM_CONTACT_ANNOUNCEMENT.md). Reproduce with `python3 scripts/analyze_qvm_contact_announcement.py`; check with `python3 scripts/test_qvm_contact_announcement.py`.
 
 
 
 
750
 
751
 
752
  [RE-716: Contact event and announcement gates](QVM_CONTACT_ANNOUNCEMENT.md). Reproduce with `python3 scripts/analyze_qvm_contact_announcement.py`; check with `python3 scripts/test_qvm_contact_announcement.py`.
753
+
754
+
755
+ [RE-717: Contact event header and health prediction](QVM_CONTACT_EVENT_HEADER.md). Reproduce with `python3 scripts/analyze_qvm_contact_event_header.py`; check with `python3 scripts/test_qvm_contact_event_header.py`.
docs/research/qvm-contact-event-header.json ADDED
The diff for this file is too large to render. See raw diff
 
scripts/analyze_qvm_contact_event_header.py ADDED
@@ -0,0 +1,14 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ #!/usr/bin/env python3
2
+ """Actual temp event, normal codec, contact identifiers and predicted lethality."""
3
+ import itertools
4
+ from pathlib import Path
5
+ from qvm_research_support import source
6
+ from qvm_contact_support import seed,run,EVENT
7
+ from analyze_qvm import write_json
8
+
9
+ def main():
10
+ q,raw,h,ins=source();rows=[]
11
+ for health,scalar,normal,part in itertools.product([0,35,36],[0,0.9,35,35.9],[(0,0,0),(0,0,1),(1,-2,3)],[0,3]):
12
+ a=dict(health=health,scalar=scalar,normal=normal,part=part);m=seed(raw,h,**a);m[EVENT+424]=128;_,p=run(ins,m,292917,293021,include_event=True);p['input']=a;rows.append(p)
13
+ write_json(Path('docs/research/qvm-contact-event-header.json'),{'source':q['source'],'sha256':q['sha256'],'probes':rows,'limits':'Actual292917..293020,277695/278138 and60317. Allocator record supplied, native link captured. Header health prediction is not applied damage. Event scalar/direction suffix not run.'})
14
+ if __name__=='__main__':main()
scripts/qvm_contact_support.py CHANGED
@@ -1,5 +1,5 @@
1
  """Separated contact fixtures and explicit recovered children; no world runtime."""
2
- import math
3
  from qvm_research_support import constants
4
  from qvm_trace_support import resume,captured
5
  from analyze_qvm_acceleration import word,number
@@ -54,7 +54,13 @@ def feedback(i,m,a):
54
 
55
  def handlers(effects):
56
  def event(i,m,a):
57
- m,r=temp_event(i,m,a[8],a[12]);effects['events'].append(r);return m,EVENT,r
 
 
 
 
 
 
58
  def codec(i,m,a):
59
  m,r=encode(i,m,[m[a[8]+4*j] for j in range(3)],pointer=a[8]);return m,r['result'],r
60
  def trig(fn):
 
1
  """Separated contact fixtures and explicit recovered children; no world runtime."""
2
+ import hashlib,json,math
3
  from qvm_research_support import constants
4
  from qvm_trace_support import resume,captured
5
  from analyze_qvm_acceleration import word,number
 
54
 
55
  def handlers(effects):
56
  def event(i,m,a):
57
+ m,r=temp_event(i,m,a[8],a[12])
58
+ # Avoid repeating constructor records inside parent/child call trees.
59
+ for child in r['execution']['children']:
60
+ effect=child.pop('effect');child['effect_sha256']=hashlib.sha256(json.dumps(effect,sort_keys=True).encode()).hexdigest()
61
+ if 'execution' in effect:child['execution']=effect['execution']
62
+ effects['events'].append(r)
63
+ return m,EVENT,{'event':r['event'],'returned_pointer':EVENT,'execution':{k:v for k,v in r['execution'].items() if k!='children'}}
64
  def codec(i,m,a):
65
  m,r=encode(i,m,[m[a[8]+4*j] for j in range(3)],pointer=a[8]);return m,r['result'],r
66
  def trig(fn):
scripts/test_qvm_contact_event_header.py ADDED
@@ -0,0 +1,20 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ import json,unittest
2
+ from pathlib import Path
3
+ from test_qvm_ground import word,f
4
+ from test_qvm_temp_event import event_record
5
+ from test_qvm_direction_codec import best
6
+ class ContactEventHeaderTests(unittest.TestCase):
7
+ @classmethod
8
+ def setUpClass(cls):cls.ps=json.loads(Path('docs/research/qvm-contact-event-header.json').read_text())['probes'];cls.table=json.loads(Path('docs/research/qvm-direction-codec.json').read_text())['table']
9
+ def test_full_record_independent_temp_and_header_oracle(self):
10
+ for p in self.ps:
11
+ a=p['input'];e=p['effects']['events'][0];r=event_record(e);r.update({'424':160,'184':best(list(map(word,a['normal'])),self.table),'140':7,'144':65,'88':3,'84':a['part'],'200':int(f(f(a['health'])-f(a['scalar']))<=0)});self.assertEqual(p['event_record'],r)
12
+ def test_actual_child_order(self):
13
+ for p in self.ps:self.assertEqual([c['target'] for c in p['execution']['calls']],[277695,60317])
14
+ def test_link_snapshot_precedes_header_mutation(self):
15
+ for p in self.ps:
16
+ e=p['effects']['events'][0];self.assertEqual(e['link_requests'][0]['record_at_request'],e['final_record']);self.assertEqual(e['final_record']['424'],128);self.assertEqual(p['event_record']['424'],160)
17
+ def test_health_prediction_is_not_health_write(self):
18
+ self.assertEqual(len(self.ps),72)
19
+ for p in self.ps:self.assertEqual(p['target_health'],p['input']['health']);self.assertEqual(p['effects']['damage'],[])
20
+ if __name__=='__main__':unittest.main()