qvm: original model tag hierarchy
Browse files- docs/ASSET_PIPELINE_TODO.md +3 -0
- 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/MD3_ORIGINAL_HIERARCHY.md +7 -0
- docs/research/README.md +3 -0
- docs/research/md3-original-hierarchy.json +0 -0
- scripts/analyze_md3_original_hierarchy.py +59 -0
- scripts/test_md3_original_hierarchy.py +23 -0
docs/ASSET_PIPELINE_TODO.md
CHANGED
|
@@ -757,3 +757,6 @@ Research progress: RE-695 [report](research/MD3_VM_BRIDGE.md); remaining native/
|
|
| 757 |
|
| 758 |
|
| 759 |
Research progress: RE-696 [report](research/MD3_ORIGINAL_LEAF.md); remaining native/content/runtime/platform scope stays open.
|
|
|
|
|
|
|
|
|
|
|
|
| 757 |
|
| 758 |
|
| 759 |
Research progress: RE-696 [report](research/MD3_ORIGINAL_LEAF.md); remaining native/content/runtime/platform scope stays open.
|
| 760 |
+
|
| 761 |
+
|
| 762 |
+
Research progress: RE-697 [report](research/MD3_ORIGINAL_HIERARCHY.md); remaining native/content/runtime/platform scope stays open.
|
docs/FINDINGS.md
CHANGED
|
@@ -1103,3 +1103,6 @@ Bounded qagame paths recover bomb-plant/inactivity correction requests, direct f
|
|
| 1103 |
|
| 1104 |
|
| 1105 |
**RE-696 — Complete QVM leaf geometry on original player models:** Complete23092 processes all eight original selected MD3 models; aimed rays produce real source hit records and distant rays miss across first/last animation frames. [Evidence](research/MD3_ORIGINAL_LEAF.md).
|
|
|
|
|
|
|
|
|
|
|
|
| 1103 |
|
| 1104 |
|
| 1105 |
**RE-696 — Complete QVM leaf geometry on original player models:** Complete23092 processes all eight original selected MD3 models; aimed rays produce real source hit records and distant rays miss across first/last animation frames. [Evidence](research/MD3_ORIGINAL_LEAF.md).
|
| 1106 |
+
|
| 1107 |
+
|
| 1108 |
+
**RE-697 — Original tag attachment through complete hierarchy geometry:** Actual21770 attaches original tag_torso/tag_head chains and25341 processes all four original model parts for both characters and first/last frame fixtures. [Evidence](research/MD3_ORIGINAL_HIERARCHY.md).
|
docs/PROVISIONAL_TODO.md
CHANGED
|
@@ -1089,3 +1089,6 @@ Research progress: RE-695 [report](research/MD3_VM_BRIDGE.md); remaining native/
|
|
| 1089 |
|
| 1090 |
|
| 1091 |
Research progress: RE-696 [report](research/MD3_ORIGINAL_LEAF.md); remaining native/content/runtime/platform scope stays open.
|
|
|
|
|
|
|
|
|
|
|
|
| 1089 |
|
| 1090 |
|
| 1091 |
Research progress: RE-696 [report](research/MD3_ORIGINAL_LEAF.md); remaining native/content/runtime/platform scope stays open.
|
| 1092 |
+
|
| 1093 |
+
|
| 1094 |
+
Research progress: RE-697 [report](research/MD3_ORIGINAL_HIERARCHY.md); remaining native/content/runtime/platform scope stays open.
|
docs/RESEARCH_LEDGER.md
CHANGED
|
@@ -1127,3 +1127,8 @@ Verbatim original MD3 headers/surfaces/indices/frame bytes execute through23929
|
|
| 1127 |
## 2026-10-21 — RE-696 Complete QVM leaf geometry on original player models (separate task commit)
|
| 1128 |
|
| 1129 |
Complete23092 processes all eight original selected MD3 models; aimed rays produce real source hit records and distant rays miss across first/last animation frames. 24 independent whole-context oracles check original packed surfaces, all source geometry/classification/publication, original hashes and frames835/978. Full suite: 1239 tests pass. Report regenerates byte-identically (978713 bytes). Storage/filter, links and whitespace checks pass. No assets/Rust runtime/shared VM evaluator changed; native/reference/legal/full platform scope remains open.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1127 |
## 2026-10-21 — RE-696 Complete QVM leaf geometry on original player models (separate task commit)
|
| 1128 |
|
| 1129 |
Complete23092 processes all eight original selected MD3 models; aimed rays produce real source hit records and distant rays miss across first/last animation frames. 24 independent whole-context oracles check original packed surfaces, all source geometry/classification/publication, original hashes and frames835/978. Full suite: 1239 tests pass. Report regenerates byte-identically (978713 bytes). Storage/filter, links and whitespace checks pass. No assets/Rust runtime/shared VM evaluator changed; native/reference/legal/full platform scope remains open.
|
| 1130 |
+
|
| 1131 |
+
|
| 1132 |
+
## 2026-10-21 — RE-697 Original tag attachment through complete hierarchy geometry (separate task commit)
|
| 1133 |
+
|
| 1134 |
+
Actual21770 attaches original tag_torso/tag_head chains and25341 processes all four original model parts for both characters and first/last frame fixtures. Four complete hierarchy probes independently check all twelve tag transforms, every full leaf context, source postorder and bounded recognized hit records. Full suite: 1243 tests pass. Report regenerates byte-identically (874680 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
|
@@ -1132,3 +1132,6 @@ Purpose: turn the supplied installation into an evidence-backed specification of
|
|
| 1132 |
|
| 1133 |
|
| 1134 |
- [x] RE-696 Complete QVM leaf geometry on original player models ([report](research/MD3_ORIGINAL_LEAF.md)).
|
|
|
|
|
|
|
|
|
|
|
|
| 1132 |
|
| 1133 |
|
| 1134 |
- [x] RE-696 Complete QVM leaf geometry on original player models ([report](research/MD3_ORIGINAL_LEAF.md)).
|
| 1135 |
+
|
| 1136 |
+
|
| 1137 |
+
- [x] RE-697 Original tag attachment through complete hierarchy geometry ([report](research/MD3_ORIGINAL_HIERARCHY.md)).
|
docs/research/MD3_ORIGINAL_HIERARCHY.md
ADDED
|
@@ -0,0 +1,7 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
# Original tag attachment through complete hierarchy geometry
|
| 2 |
+
|
| 3 |
+
RE-697. Reproduce with `python3 scripts/analyze_md3_original_hierarchy.py`; check with `python3 scripts/test_md3_original_hierarchy.py`. The [machine report](md3-original-hierarchy.json) retains source identity and bounded fixtures.
|
| 4 |
+
|
| 5 |
+
Original lower/upper/head/helmet bytes are mapped at distinct addresses. Actual21770 searches original first-frame tag names with source36306, allocates explicit bounded child arrays and sets parent pointers; all three attachments succeed for both characters. Actual25341/22009 interpolate original tag matrices and execute complete23092 geometry. Independent transform/leaf oracles check full records and context continuity in helmet/head/upper/lower order. First and last lower/upper animation frames are included. Heap allocation/zero fill and finite sqrt remain models; actual loader18183 and original process/native parity are not claimed.
|
| 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
|
@@ -690,3 +690,6 @@ The extension collector adds five focused tests for native tail calls, command-r
|
|
| 690 |
|
| 691 |
|
| 692 |
[RE-696: Complete QVM leaf geometry on original player models](MD3_ORIGINAL_LEAF.md). Reproduce with `python3 scripts/analyze_md3_original_leaf.py`; check with `python3 scripts/test_md3_original_leaf.py`.
|
|
|
|
|
|
|
|
|
|
|
|
| 690 |
|
| 691 |
|
| 692 |
[RE-696: Complete QVM leaf geometry on original player models](MD3_ORIGINAL_LEAF.md). Reproduce with `python3 scripts/analyze_md3_original_leaf.py`; check with `python3 scripts/test_md3_original_leaf.py`.
|
| 693 |
+
|
| 694 |
+
|
| 695 |
+
[RE-697: Original tag attachment through complete hierarchy geometry](MD3_ORIGINAL_HIERARCHY.md). Reproduce with `python3 scripts/analyze_md3_original_hierarchy.py`; check with `python3 scripts/test_md3_original_hierarchy.py`.
|
docs/research/md3-original-hierarchy.json
ADDED
|
The diff for this file is too large to render.
See raw diff
|
|
|
scripts/analyze_md3_original_hierarchy.py
ADDED
|
@@ -0,0 +1,59 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
#!/usr/bin/env python3
|
| 2 |
+
"""Original model hierarchy through actual21770 attachment and25341 geometry."""
|
| 3 |
+
from pathlib import Path
|
| 4 |
+
from qvm_research_support import source,execute
|
| 5 |
+
from analyze_md3_inventory import paths,virtual
|
| 6 |
+
from md3 import MD3
|
| 7 |
+
from md3_vm import map_md3
|
| 8 |
+
from md3_qvm_support import node_record,describe
|
| 9 |
+
from analyze_qvm_surface_category import support,put_text
|
| 10 |
+
from analyze_qvm_model_hierarchy import walk
|
| 11 |
+
from analyze_qvm_complete_leaf import leaf,words,CONTEXT,ORIGIN,DIRECTION
|
| 12 |
+
from analyze_qvm_acceleration import word
|
| 13 |
+
from analyze_qvm import write_json
|
| 14 |
+
NODES=[0x79b00000+256*j for j in range(4)]
|
| 15 |
+
ROLES=['lower','upper','head','helmet']
|
| 16 |
+
ATTACH=0x79b30000
|
| 17 |
+
COMPARE=ATTACH+4096
|
| 18 |
+
TEXT=ATTACH+8192
|
| 19 |
+
|
| 20 |
+
def attach(ins,m,bs,parent,child,tag,allocator):
|
| 21 |
+
m=dict(m);put_text(m,bs,TEXT,tag.encode());m[ATTACH+44]=parent;m[ATTACH+48]=child;m[ATTACH+52]=TEXT
|
| 22 |
+
def alloc(i,m,a,c):p=allocator[0];allocator[0]+=256;return m,c,p,{'supplied_allocation':p,'bytes':a[8],'heap_not_executed':True}
|
| 23 |
+
def zero(i,m,a,c):
|
| 24 |
+
assert a[12]==0 and a[16]%4==0
|
| 25 |
+
for o in range(0,a[16],4):m[a[8]+o]=0
|
| 26 |
+
return m,c,0,{'bounded_zero_fill':a}
|
| 27 |
+
def strcmp(i,m,a,c):
|
| 28 |
+
m[COMPARE+44]=a[8];m[COMPARE+48]=a[12];m,_,e=execute(i,36307,36487,m,c,COMPARE);return m,c,e['return'],e
|
| 29 |
+
m,_,e=execute(ins,21771,21918,m,(0,0,0),ATTACH,{16817:alloc,-101:zero,36306:strcmp},byte_inputs=bs)
|
| 30 |
+
return m,{'parent':parent,'child':child,'tag':tag,'result':e['return'],'execution':e}
|
| 31 |
+
|
| 32 |
+
def scene(raw,h,ins,character,last=False):
|
| 33 |
+
files={virtual(p).casefold():p for p in paths()};m,bs=support(raw,h);models={};bindings=[]
|
| 34 |
+
for j,role in enumerate(ROLES):
|
| 35 |
+
p=files[f'models/players/{character}/{role}_3.md3'];model=MD3(p.read_bytes());address=0x70000000+0x1000000*j;frame=model.frames-1 if last else 0;map_md3(m,bs,model,address,[0,frame]);node_record(m,NODES[j],address,frame);models[NODES[j]]=model;bindings.append({'role':role,'path':str(p),'node':NODES[j],'address':address,'frame':frame})
|
| 36 |
+
allocator=[0x79b10000];attachments=[]
|
| 37 |
+
for parent,child,tag in [(0,1,'tag_torso'),(1,2,'tag_head'),(2,3,'tag_head')]:m,r=attach(ins,m,bs,NODES[parent],NODES[child],tag,allocator);attachments.append(r)
|
| 38 |
+
return m,bs,models,bindings,attachments
|
| 39 |
+
|
| 40 |
+
def geometry(ins,m,bs,models,args):
|
| 41 |
+
def resolved(i,m,a):inputs=describe(m,a,models[a[8]]);m,r=leaf(i,m,bs,a,limit=1000000);r['input']=inputs;return m,r
|
| 42 |
+
m,r=walk(ins,m,args,leaf_resolver=resolved)
|
| 43 |
+
transforms=[]
|
| 44 |
+
def collect(node):
|
| 45 |
+
transforms.extend(node['transforms'])
|
| 46 |
+
for child in node['nested']:collect(child)
|
| 47 |
+
collect(r);return m,{'arguments':args,'leaf_reports':r['leaf_requests'],'transforms':transforms,'execution':{k:v for k,v in r['execution'].items() if k!='children'},'final_context':words(m,args[20])}
|
| 48 |
+
|
| 49 |
+
def main():
|
| 50 |
+
q,raw,h,ins=source();rows=[]
|
| 51 |
+
for character in ['athena','orion']:
|
| 52 |
+
for last in [False,True]:
|
| 53 |
+
m,bs,models,bindings,attachments=scene(raw,h,ins,character,last)
|
| 54 |
+
for o in range(0,308,4):m[CONTEXT+o]=0
|
| 55 |
+
for p,v in [(ORIGIN,(0,0,100)),(DIRECTION,(0,0,-1))]:
|
| 56 |
+
for j,x in enumerate(v):m[p+4*j]=word(x)
|
| 57 |
+
m,r=geometry(ins,m,bs,models,{8:NODES[0],12:ORIGIN,16:DIRECTION,20:CONTEXT});r.update({'character':character,'last_frame_fixture':last,'bindings':bindings,'attachments':attachments});rows.append(r)
|
| 58 |
+
write_json(Path('docs/research/md3-original-hierarchy.json'),{'source':q['source'],'sha256':q['sha256'],'probes':rows,'limits':'Actual21770/36306 attach original tags and actual25341/22009/23092 process original hierarchy. Heap allocation/zero fill and finite math modeled. Frame selections/rays are fixtures; no native loader/process/live character parity.'})
|
| 59 |
+
if __name__=='__main__':main()
|
scripts/test_md3_original_hierarchy.py
ADDED
|
@@ -0,0 +1,23 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
import json,unittest
|
| 2 |
+
from pathlib import Path
|
| 3 |
+
from test_qvm_complete_leaf import expected as leaf
|
| 4 |
+
from test_qvm_child_transform import expected as transform
|
| 5 |
+
class OriginalHierarchyTests(unittest.TestCase):
|
| 6 |
+
@classmethod
|
| 7 |
+
def setUpClass(cls):cls.rows=json.loads(Path('docs/research/md3-original-hierarchy.json').read_text())['probes']
|
| 8 |
+
def test_source_tag_attachment_succeeds_for_both_characters_and_frames(self):
|
| 9 |
+
self.assertEqual(len(self.rows),4)
|
| 10 |
+
for p in self.rows:self.assertEqual([a['result'] for a in p['attachments']],[1,1,1]);self.assertEqual([a['tag'] for a in p['attachments']],['tag_torso','tag_head','tag_head'])
|
| 11 |
+
def test_every_original_tag_transform_record(self):
|
| 12 |
+
for p in self.rows:
|
| 13 |
+
self.assertEqual(len(p['transforms']),3)
|
| 14 |
+
for t in p['transforms']:self.assertEqual(t['final_record'],transform(t))
|
| 15 |
+
def test_complete_original_leafs_and_postorder_context(self):
|
| 16 |
+
for p in self.rows:
|
| 17 |
+
previous=[0]*77
|
| 18 |
+
for request in p['leaf_reports']:
|
| 19 |
+
r=request['effect'];self.assertEqual(r['before'],previous);self.assertEqual(r['after'],leaf(r));previous=r['after']
|
| 20 |
+
self.assertEqual(p['final_context'],previous);self.assertEqual([r['node'] for r in p['leaf_reports']],[r['node'] for r in reversed(p['bindings'])])
|
| 21 |
+
def test_actual_geometry_produces_bounded_recognized_hits(self):
|
| 22 |
+
for p in self.rows:self.assertGreater(p['final_context'][16],0);self.assertLessEqual(p['final_context'][16],10);self.assertTrue(all(1<=p['final_context'][17+5*j]<=14 for j in range(p['final_context'][16])))
|
| 23 |
+
if __name__=='__main__':unittest.main()
|