nmarshall commited on
Commit
96b1c5f
·
1 Parent(s): 29279fd

qvm: grenade trajectory event prelude

Browse files
docs/ASSET_PIPELINE_TODO.md CHANGED
@@ -709,3 +709,6 @@ Research progress: RE-677 [report](research/QVM_FREE_REALLOCATE.md); remaining n
709
 
710
 
711
  Research progress: RE-678 [report](research/QVM_BASIC_TRAJECTORY.md); remaining native/content/runtime/platform scope stays open.
 
 
 
 
709
 
710
 
711
  Research progress: RE-678 [report](research/QVM_BASIC_TRAJECTORY.md); remaining native/content/runtime/platform scope stays open.
712
+
713
+
714
+ Research progress: RE-679 [report](research/QVM_GRENADE_EVENT_PREFIX.md); remaining native/content/runtime/platform scope stays open.
docs/FINDINGS.md CHANGED
@@ -1055,3 +1055,6 @@ Bounded qagame paths recover bomb-plant/inactivity correction requests, direct f
1055
 
1056
 
1057
  **RE-678 — Basic source trajectory position branches:** 27168 types0/1 copy base,2 advances linearly,3 clamps time to duration and nonnegative elapsed, and5 subtracts400×elapsed² from z. [Evidence](research/QVM_BASIC_TRAJECTORY.md).
 
 
 
 
1055
 
1056
 
1057
  **RE-678 — Basic source trajectory position branches:** 27168 types0/1 copy base,2 advances linearly,3 clamps time to duration and nonnegative elapsed, and5 subtracts400×elapsed² from z. [Evidence](research/QVM_BASIC_TRAJECTORY.md).
1058
+
1059
+
1060
+ **RE-679 — Constructed grenade through trajectory and event prelude:** Actual queried/allocated grenade enters223156, evaluates source trajectory, truncates/rebases origin and emits event55 through actual direction encoding/event writes before damage branching. [Evidence](research/QVM_GRENADE_EVENT_PREFIX.md).
docs/PROVISIONAL_TODO.md CHANGED
@@ -1035,3 +1035,9 @@ Research progress: RE-677 [report](research/QVM_FREE_REALLOCATE.md); remaining n
1035
 
1036
 
1037
  Research progress: RE-678 [report](research/QVM_BASIC_TRAJECTORY.md); remaining native/content/runtime/platform scope stays open.
 
 
 
 
 
 
 
1035
 
1036
 
1037
  Research progress: RE-678 [report](research/QVM_BASIC_TRAJECTORY.md); remaining native/content/runtime/platform scope stays open.
1038
+
1039
+
1040
+ Research progress: RE-679 [report](research/QVM_GRENADE_EVENT_PREFIX.md); remaining native/content/runtime/platform scope stays open.
1041
+
1042
+
1043
+ RE-670–679 batch complete: [model transforms, resources and grenade prelude](research/QVM_MODEL_RESOURCE_BATCH.md). RE-680 tracks continued geometry/trace/damage/lifecycle recovery; original/native parity and playable Rust/Bevy/Solari integration remain open.
docs/RESEARCH_LEDGER.md CHANGED
@@ -1047,3 +1047,8 @@ Actual277400 free-time and used state now feed277165 reuse policy; age1000 is el
1047
  ## 2026-10-21 — RE-678 Basic source trajectory position branches (separate task commit)
1048
 
1049
  27168 types0/1 copy base,2 advances linearly,3 clamps time to duration and nonnegative elapsed, and5 subtracts400×elapsed² from z. 240 independent float32 fixtures check before/at/after timestamps, zero/nonzero duration, signed velocities and exact base/output aliasing. Full suite: 1173 tests pass. Report regenerates byte-identically (181365 bytes). Storage/filter, links and whitespace checks pass. No assets/Rust runtime/shared VM evaluator changed; native/reference/legal/full platform scope remains open.
 
 
 
 
 
 
1047
  ## 2026-10-21 — RE-678 Basic source trajectory position branches (separate task commit)
1048
 
1049
  27168 types0/1 copy base,2 advances linearly,3 clamps time to duration and nonnegative elapsed, and5 subtracts400×elapsed² from z. 240 independent float32 fixtures check before/at/after timestamps, zero/nonzero duration, signed velocities and exact base/output aliasing. Full suite: 1173 tests pass. Report regenerates byte-identically (181365 bytes). Storage/filter, links and whitespace checks pass. No assets/Rust runtime/shared VM evaluator changed; native/reference/legal/full platform scope remains open.
1050
+
1051
+
1052
+ ## 2026-10-21 — RE-679 Constructed grenade through trajectory and event prelude (separate task commit)
1053
+
1054
+ Actual queried/allocated grenade enters223156, evaluates source trajectory, truncates/rebases origin and emits event55 through actual direction encoding/event writes before damage branching. 12 complete prelude compositions independently check every entity word, optional client event mask/parameter/time, source child ordering and unexecuted damage boundary. Full suite: 1177 tests pass. Report regenerates byte-identically (758560 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
@@ -1050,7 +1050,7 @@ Purpose: turn the supplied installation into an evidence-backed specification of
1050
  - [x] RE-668 Model-child traversal and frame-sample interpolation ([report](research/QVM_MODEL_CHILD_SAMPLES.md)).
1051
 
1052
 
1053
- - [ ] RE-669 Compose complete pose into model-hit processing, recover transform/hierarchy/leaf geometry and actual hit records, then continue trace/contact/damage, scheduling and lifecycle parity toward a verified Rust gameplay slice. See the [next ten tasks](research/QVM_POSE_LIFECYCLE_BATCH.md#next-ten-concrete-tasks).
1054
 
1055
 
1056
  - [x] RE-670 Model ray through actual pose and transform construction ([report](research/QVM_POSED_MODEL.md)).
@@ -1078,3 +1078,9 @@ Purpose: turn the supplied installation into an evidence-backed specification of
1078
 
1079
 
1080
  - [x] RE-678 Basic source trajectory position branches ([report](research/QVM_BASIC_TRAJECTORY.md)).
 
 
 
 
 
 
 
1050
  - [x] RE-668 Model-child traversal and frame-sample interpolation ([report](research/QVM_MODEL_CHILD_SAMPLES.md)).
1051
 
1052
 
1053
+ - [ ] RE-669 Partially advanced by RE-670–679: actual pose/model preparation, child transforms/hierarchy traversal, leaf ancestry matrices, resource-list release, free/reallocation timing and grenade trajectory/event prelude are recovered on bounded fixtures. Full leaf geometry/hit records, trace/contact/damage, native heap/reference parity, live scheduling and Rust gameplay remain open. See the [batch and next ten tasks](research/QVM_MODEL_RESOURCE_BATCH.md).
1054
 
1055
 
1056
  - [x] RE-670 Model ray through actual pose and transform construction ([report](research/QVM_POSED_MODEL.md)).
 
1078
 
1079
 
1080
  - [x] RE-678 Basic source trajectory position branches ([report](research/QVM_BASIC_TRAJECTORY.md)).
1081
+
1082
+
1083
+ - [x] RE-679 Constructed grenade through trajectory and event prelude ([report](research/QVM_GRENADE_EVENT_PREFIX.md)).
1084
+
1085
+
1086
+ - [ ] RE-680 Recover leaf primitive decoding/intersection and actual hit records, compose full model/trace cleanup, then continue damage, grenade completion, heap ownership and live scheduling toward a verified Rust gameplay slice. See the [next ten tasks](research/QVM_MODEL_RESOURCE_BATCH.md#next-ten-concrete-tasks).
docs/research/QVM_GRENADE_EVENT_PREFIX.md ADDED
@@ -0,0 +1,7 @@
 
 
 
 
 
 
 
 
1
+ # Constructed grenade through trajectory and event prelude
2
+
3
+ RE-679. Reproduce with `python3 scripts/analyze_qvm_grenade_event_prefix.py`; check with `python3 scripts/test_qvm_grenade_event_prefix.py`. The [machine report](qvm-grenade-event-prefix.json) retains source identity and bounded fixtures.
4
+
5
+ Actual285971 construction with277165/277125 allocation and276433 query feeds223157–223252. Actual27168 computes motion at explicit fixture clocks, source truncates each coordinate toward zero, and278138 rebases origin while clearing trajectory/delta. The callback sets type0 and flag32, encodes up through60317 (index5), publishes event55 via278003 and sets572. Independent whole-record/client-event oracles cover both event storage branches and both constructor modes. Optional client bindings and early/mid/fuse clock offsets are branch fixtures, not proven live callback scheduling. The run stops before223253 special damage selection; full explosion/damage and native collision remain unexecuted.
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/QVM_MODEL_RESOURCE_BATCH.md ADDED
@@ -0,0 +1,49 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ # Model transforms, resources and grenade prelude: RE-670–679
2
+
3
+ Ten separately checked tasks extend the [pose/lifecycle batch](QVM_POSE_LIFECYCLE_BATCH.md). Actual pose outputs now reach model transform preparation. Hierarchy traversal and child transforms execute through explicit leaf boundaries. Resource-list detach, free/reallocation timing and the grenade trajectory/event prelude also have independent source-based checks.
4
+
5
+ | Task | Recovered scope | Evidence |
6
+ | --- | --- | --- |
7
+ | RE-670 | Actual complete pose inside model-ray/transform preparation | [Posed model](QVM_POSED_MODEL.md) |
8
+ | RE-671 | Child sample origin through ordered parent rotations | [Child origin](QVM_CHILD_ORIGIN.md) |
9
+ | RE-672 | Complete child transform and exact fourth-row arithmetic | [Child transform](QVM_CHILD_TRANSFORM.md) |
10
+ | RE-673 | Complete bounded hierarchy traversal with actual transforms | [Hierarchy](QVM_MODEL_HIERARCHY.md) |
11
+ | RE-674 | Leaf ancestry matrix accumulation | [Leaf basis](QVM_LEAF_BASIS.md) |
12
+ | RE-675 | Packed-word string length used by resource release | [String length](QVM_WORD_STRLEN.md) |
13
+ | RE-676 | Resource-list detach, actual length and bounded wipe | [String release](QVM_STRING_RELEASE.md) |
14
+ | RE-677 | Actual entity free state consumed by allocator timing | [Free/reallocate](QVM_FREE_REALLOCATE.md) |
15
+ | RE-678 | Stationary, linear, clamped-linear and gravity position branches | [Trajectory](QVM_BASIC_TRAJECTORY.md) |
16
+ | RE-679 | Constructed grenade through actual trajectory, origin and event prelude | [Grenade prelude](QVM_GRENADE_EVENT_PREFIX.md) |
17
+
18
+ ## Findings for the rewrite
19
+
20
+ Model helper144766 now executes complete32254 with its actual target/client arguments and shooter elapsed calculation. All nine generated pose angles feed the four88-byte transform records. Independent whole-buffer oracles check this composition; pose outputs are no longer supplied fixtures in the new report. Model pointers and timing remain explicit inputs, and25341 intersection is still outside this composed run.
21
+
22
+ Child transform22009 copies sample origin, rotates through the parent chain and adds the immediate parent origin. A null parent exits before basis composition. Its fourth multiplication row reads local40/60/48/68, yielding sample100,0,sample108,1 rather than a conventional homogeneous row. Exact child/sample alias fixtures confirm the read-before-write behavior. Leaf23092 repeats analogous fourth-row indexing: an identity ancestry chain of positive depth yields fourth row0,0,1,1. These are retained as decoded source arithmetic, with no claim about intended mathematical design or original live parity.
23
+
24
+ Hierarchy25341 now executes actual22009 and recursive traversal with isolated caller frames, skips null children and requests leaf processing after child visits. All reached child records pass independent whole-record oracles. Leaf23092 requests are captured without geometry effects in this traversal report; no successful intersection is supplied. Its ancestry matrix stage executes separately, while primitive decoding/intersection and hit-record production remain open.
25
+
26
+ String helper36038 scans packed words for the first zero byte. Resource release249639 searches global30004, detaches a matching header, computes actual string length, wipes length+8 bytes and requests heap release16934. Independent byte-level checks cover head/middle/tail/only/missing entries and partial-word wipe ends. The wipe excludes the already-zero terminating NUL. Native heap release/coalescing remains unexecuted.
27
+
28
+ Entity free277400 now feeds actual allocator277165/initializer277125. An unprotected freed slot can be reused at age1000, or immediately if free time is at most start+2000. Protected records retain their used flag and force extension in these fixtures. Whole selected and unselected records verify that initialization updates its known fields without introducing another clear. Fixture clocks establish the contract, not live server scheduling.
29
+
30
+ Trajectory27168 types0/1 copy base,2 advances linearly,3 clamps the upper time and nonnegative elapsed, and5 subtracts400×elapsed² from z after linear movement. Other types remain explicitly unsupported in this research wrapper. Actual allocated/queried grenade construction feeds callback223156 through those trajectory branches, coordinate truncation, origin rebasing, up-vector encoding and event55 publication. Both entity and client event-storage branches are checked. The prelude stops before special damage selection at223253; damage/explosion completion is not claimed.
31
+
32
+ ## Validation and limits
33
+
34
+ The1137-test baseline gains40 checks, ending at1177 passing tests. Every new report regenerates byte-identically and stays below2MiB. The existing complete-pose report remains byte-identical after generalizing its state-pointer snapshot. Storage/filter, documentation-link and whitespace checks pass. No assets, Rust runtime or shared evaluator changes occur in this batch.
35
+
36
+ Model data, acyclic hierarchies, entity pools, resource backing memory, clocks and optional client bindings remain finite fixtures. Native math, zero fill and byte wipe are explicit models; registration, unlink, heap-free and unresolved leaf calls are captured requests. No original executable/full VM, native heap/collision, successful complete model intersection/contact/damage, live server tick, networking/rendering or macOS/Linux Rust/Bevy/Solari gameplay runs here. RE-669 remains partially complete; RE-680 tracks the next work.
37
+
38
+ ## Next ten concrete tasks
39
+
40
+ 1. Recover23092 primitive-list/frame/vertex ownership, packed coordinate decoding and source data bounds after the ancestry matrix stage.
41
+ 2. Recover its triangle/ray tests, degeneracy/parallel/behind-ray conditions and nearest-hit arithmetic with independent geometry oracles.
42
+ 3. Recover actual hit-context vector/record production, type tags, key/count limits and source36038/21493 name/category consumers.
43
+ 4. Compose actual leaf processing into25341 and model144766; validate no-hit and recovered-hit publication without supplied outcomes.
44
+ 5. Resume the complete rewound trace through model returns and all cleanup paths, preserving exact link/unlink requests and caller state.
45
+ 6. Recover contact292545 and reached damage211239, penetration/retry, aggregation and event64 encoding; capture original/native reference traces.
46
+ 7. Continue grenade223156 after223253 through special damage, remaining callbacks, expiry/free and complete explosion behavior; recover other trajectory types as reached.
47
+ 8. Recover heap release16934 and supporting free-list/coalescing helpers; connect resource release249639 to actual entity-free ownership transitions.
48
+ 9. Recover history caller conditions and frame sequencing inside156173/174399/203011/219630, validating reset/append scheduling and shooter target times.
49
+ 10. Implement a verified Rust gameplay slice from recovered contracts and original reference evidence. Continue all assets/models/maps/shaders/audio/network findings and macOS/Linux Bevy/Solari runtime/rendering validation.
docs/research/README.md CHANGED
@@ -636,3 +636,9 @@ The extension collector adds five focused tests for native tail calls, command-r
636
 
637
 
638
  [RE-678: Basic source trajectory position branches](QVM_BASIC_TRAJECTORY.md). Reproduce with `python3 scripts/analyze_qvm_basic_trajectory.py`; check with `python3 scripts/test_qvm_basic_trajectory.py`.
 
 
 
 
 
 
 
636
 
637
 
638
  [RE-678: Basic source trajectory position branches](QVM_BASIC_TRAJECTORY.md). Reproduce with `python3 scripts/analyze_qvm_basic_trajectory.py`; check with `python3 scripts/test_qvm_basic_trajectory.py`.
639
+
640
+
641
+ [RE-679: Constructed grenade through trajectory and event prelude](QVM_GRENADE_EVENT_PREFIX.md). Reproduce with `python3 scripts/analyze_qvm_grenade_event_prefix.py`; check with `python3 scripts/test_qvm_grenade_event_prefix.py`.
642
+
643
+
644
+ [RE-670–679: Model transforms, resources and grenade prelude](QVM_MODEL_RESOURCE_BATCH.md), with validation limits and the next ten concrete tasks.
docs/research/qvm-grenade-event-prefix.json ADDED
The diff for this file is too large to render. See raw diff
 
scripts/analyze_qvm_grenade_event_prefix.py ADDED
@@ -0,0 +1,43 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ #!/usr/bin/env python3
2
+ """Actual constructed grenade through223156 trajectory/origin/event55 prelude."""
3
+ import itertools
4
+ from pathlib import Path
5
+ from qvm_research_support import source,execute,constants
6
+ from qvm_server_fire_support import BASES
7
+ from analyze_qvm_allocated_event import setup
8
+ from analyze_qvm_grenade_setup import grenade
9
+ from analyze_qvm_entity_allocate import allocate
10
+ from analyze_qvm_entity_query import query
11
+ from analyze_qvm_entity_init import POOL,STRIDE
12
+ from analyze_qvm_basic_trajectory import trajectory
13
+ from analyze_qvm_temp_event import set_origin,record
14
+ from analyze_qvm_direction_codec import table,encode
15
+ from analyze_qvm_slide_prefix import vec
16
+ from analyze_qvm_acceleration import PS
17
+ from analyze_qvm import write_json
18
+ LOCAL=0x78800000
19
+ EVENT=LOCAL+4096
20
+ CLIENT=LOCAL+8192
21
+
22
+ def prefix(ins,m,pointer):
23
+ m=dict(m);m[LOCAL+100]=pointer;before=record(m,pointer);initial_client=[m[CLIENT+o]&0xffffffff for o in [128,132,136]]
24
+ def position(i,m,a,c):m,r=trajectory(i,m,a);return m,c,0,r
25
+ def origin(i,m,a,c):m,r=set_origin(i,m,a);return m,c,0,r
26
+ def codec(i,m,a,c):m,r=encode(i,m,vec(m,a[8]),a[8]);return m,c,r['result'],r
27
+ def event(i,m,a,c):
28
+ for o,v in a.items():m[EVENT+20+o]=v
29
+ m,_,r=execute(i,278004,278122,m,c,EVENT);return m,c,0,r
30
+ m,_,e=execute(ins,223157,223253,m,(0,0,0),LOCAL,{27168:position,278138:origin,60317:codec,278003:event})
31
+ return {'pointer':pointer,'time':m[34992532],'initial_record':before,'final_record':record(m,pointer),'initial_client':initial_client,'final_client':[m[CLIENT+o]&0xffffffff for o in [128,132,136]],'execution':e,'status':'before-special-damage-branch223253'}
32
+
33
+ def main():
34
+ q,raw,h,ins=source();rows=[];support=constants(raw,h,range(20464,20512,4));support.update(table(raw,h))
35
+ for mode,offset,client in itertools.product([0,1],[0,500,2500],[False,True]):
36
+ m=setup(raw,h,False);m.update(support);m[0x90000+192]=7;m[PS+312]=7|(mode<<16)
37
+ for o in range(0,880,4):m[BASES+o]=0
38
+ for j in range(64):m[POOL+j*STRIDE+532]=0
39
+ m,construction=grenade(ins,m,allocator=allocate,query_resolver=query);pointer=construction['execution']['children'][2]['effect']['selected'];m[pointer+520]=CLIENT if client else 0;m[34992532]=5000+offset
40
+ for o,v in [(128,0x12345678),(132,0xabcdef),(136,99)]:m[CLIENT+o]=v
41
+ r=prefix(ins,m,pointer);r.update({'mode':mode,'offset':offset,'client_event_branch':client,'construction_execution':construction['execution']});rows.append(r)
42
+ write_json(Path('docs/research/qvm-grenade-event-prefix.json'),{'source':q['source'],'sha256':q['sha256'],'probes':rows,'limits':'Actual allocated/queried285971 then223157–223252 with actual supported27168,278138,60317,278003. Stops before special damage223253; no damage/explosion completion/native collision. Clock offsets and optional client bindings are explicit branch fixtures.'})
43
+ if __name__=='__main__':main()
scripts/test_qvm_grenade_event_prefix.py ADDED
@@ -0,0 +1,25 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ import json,unittest
2
+ from pathlib import Path
3
+ from test_qvm_ground import word,n
4
+ from test_qvm_basic_trajectory import expected as trajectory
5
+ class GrenadeEventPrefixTests(unittest.TestCase):
6
+ @classmethod
7
+ def setUpClass(cls):cls.rows=json.loads(Path('docs/research/qvm-grenade-event-prefix.json').read_text())['probes']
8
+ def test_independent_entire_grenade_record(self):
9
+ self.assertEqual(len(self.rows),12)
10
+ for p in self.rows:
11
+ r=p['initial_record'].copy();position=[word(float(int(n(v)))) for v in trajectory(p['execution']['children'][0]['effect'])]
12
+ for o in [12,16,20,36,40,44]:r[str(o)]=0
13
+ for base in [24,488]:
14
+ for j,v in enumerate(position):r[str(base+4*j)]=v
15
+ r.update({'4':0,'424':r['424']|32,'568':p['time'],'572':1})
16
+ if not p['client_event_branch']:r['180']=55|(((r['180']&768)+256)&768);r['184']=5
17
+ self.assertEqual(p['final_record'],r)
18
+ def test_actual_client_event_mask_parameter_time(self):
19
+ for p in self.rows:
20
+ old=p['initial_client'];expected=[55|(((old[0]&768)+256)&768),5,p['time']] if p['client_event_branch'] else old;self.assertEqual(p['final_client'],expected)
21
+ def test_recovered_source_call_order_and_constructor(self):
22
+ for p in self.rows:self.assertEqual([c['target'] for c in p['execution']['calls']],[27168,278138,60317,278003]);self.assertEqual([c['target'] for c in p['construction_execution']['calls']],[31691,-107,277165,276433]);self.assertEqual(p['execution']['children'][2]['effect']['vector'],[0,0,word(1)])
23
+ def test_unexecuted_damage_and_fixture_schedule_explicit(self):
24
+ for p in self.rows:self.assertEqual(p['status'],'before-special-damage-branch223253');self.assertNotIn(211239,[c['target'] for c in p['execution']['calls']])
25
+ if __name__=='__main__':unittest.main()