nmarshall commited on
Commit
d376de0
·
1 Parent(s): 6b78bec

qvm: walking wish basis

Browse files
docs/ASSET_PIPELINE_TODO.md CHANGED
@@ -361,3 +361,6 @@ Research progress: RE-554 [report](research/QVM_WATER_ROUTE.md); remaining nativ
361
 
362
 
363
  Research progress: RE-555 [report](research/QVM_SWIM_MODE.md); remaining native/content/runtime/platform scope stays open.
 
 
 
 
361
 
362
 
363
  Research progress: RE-555 [report](research/QVM_SWIM_MODE.md); remaining native/content/runtime/platform scope stays open.
364
+
365
+
366
+ Research progress: RE-556 [report](research/QVM_WALK_WISH.md); remaining native/content/runtime/platform scope stays open.
docs/FINDINGS.md CHANGED
@@ -719,3 +719,6 @@ Bounded qagame paths recover bomb-plant/inactivity correction requests, direct f
719
 
720
 
721
  **RE-555 — Recover complete ordinary41848 swimming and main handoff:** Ordinary swimming uses idle Z−60 or scaled three-axis wish, caps speed by PS52 times source21172, accelerates with21196, projects only into-plane velocity while restoring speed, then uses gravity-off57714 return to set or clear32. [Evidence](research/QVM_SWIM_MODE.md).
 
 
 
 
719
 
720
 
721
  **RE-555 — Recover complete ordinary41848 swimming and main handoff:** Ordinary swimming uses idle Z−60 or scaled three-axis wish, caps speed by PS52 times source21172, accelerates with21196, projects only into-plane velocity while restoring speed, then uses gravity-off57714 return to set or clear32. [Evidence](research/QVM_SWIM_MODE.md).
722
+
723
+
724
+ **RE-556 — Recover ordinary walking direction and slope wish producer:** Walking friction and copied-command scaling precede actual40679, flattening and clipping each live basis vector against the ground normal, normalizing them and building a three-axis slope-aligned wish. [Evidence](research/QVM_WALK_WISH.md).
docs/PROVISIONAL_TODO.md CHANGED
@@ -673,3 +673,6 @@ Research progress: RE-554 [report](research/QVM_WATER_ROUTE.md); remaining nativ
673
 
674
 
675
  Research progress: RE-555 [report](research/QVM_SWIM_MODE.md); remaining native/content/runtime/platform scope stays open.
 
 
 
 
673
 
674
 
675
  Research progress: RE-555 [report](research/QVM_SWIM_MODE.md); remaining native/content/runtime/platform scope stays open.
676
+
677
+
678
+ Research progress: RE-556 [report](research/QVM_WALK_WISH.md); remaining native/content/runtime/platform scope stays open.
docs/RESEARCH_LEDGER.md CHANGED
@@ -477,3 +477,8 @@ Actual41486 return determines whether41848 enters ordinary swimming at41862 or e
477
  ## 2026-10-19 — RE-555 Recover complete ordinary41848 swimming and main handoff (separate task commit)
478
 
479
  Ordinary swimming uses idle Z−60 or scaled three-axis wish, caps speed by PS52 times source21172, accelerates with21196, projects only into-plane velocity while restoring speed, then uses gravity-off57714 return to set or clear32. 12 normal fixtures, four actual main water paths and four independent tests validate exact helper arithmetic, projection/slide results, idle sink, result-dependent flags and exclusive fallback versus swim effects. Full suite: 747 tests pass. Report regenerates byte-identically (801470 bytes). Storage/filter, links and whitespace checks pass. No assets/Rust runtime/shared VM evaluator changed; native/reference/legal/full platform scope remains open.
 
 
 
 
 
 
477
  ## 2026-10-19 — RE-555 Recover complete ordinary41848 swimming and main handoff (separate task commit)
478
 
479
  Ordinary swimming uses idle Z−60 or scaled three-axis wish, caps speed by PS52 times source21172, accelerates with21196, projects only into-plane velocity while restoring speed, then uses gravity-off57714 return to set or clear32. 12 normal fixtures, four actual main water paths and four independent tests validate exact helper arithmetic, projection/slide results, idle sink, result-dependent flags and exclusive fallback versus swim effects. Full suite: 747 tests pass. Report regenerates byte-identically (801470 bytes). Storage/filter, links and whitespace checks pass. No assets/Rust runtime/shared VM evaluator changed; native/reference/legal/full platform scope remains open.
480
+
481
+
482
+ ## 2026-10-19 — RE-556 Recover ordinary walking direction and slope wish producer (separate task commit)
483
+
484
+ Walking friction and copied-command scaling precede actual40679, flattening and clipping each live basis vector against the ground normal, normalizing them and building a three-axis slope-aligned wish. 16 command/normal/prior-direction fixtures and four independent tests validate exact clip/normalize arithmetic, raw wish/root, classifier temporal order and copied pointer. Full suite: 751 tests pass. Report regenerates byte-identically (116042 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
@@ -710,3 +710,6 @@ Purpose: turn the supplied installation into an evidence-backed specification of
710
 
711
 
712
  - [x] RE-555 Recover complete ordinary41848 swimming and main handoff ([report](research/QVM_SWIM_MODE.md)).
 
 
 
 
710
 
711
 
712
  - [x] RE-555 Recover complete ordinary41848 swimming and main handoff ([report](research/QVM_SWIM_MODE.md)).
713
+
714
+
715
+ - [x] RE-556 Recover ordinary walking direction and slope wish producer ([report](research/QVM_WALK_WISH.md)).
docs/research/QVM_WALK_WISH.md ADDED
@@ -0,0 +1,7 @@
 
 
 
 
 
 
 
 
1
+ # Recover ordinary walking direction and slope wish producer
2
+
3
+ RE-556. Reproduce with `python3 scripts/analyze_qvm_walk_wish.py`; check with `python3 scripts/test_qvm_walk_wish.py`. The [machine report](qvm-walk-wish.json) retains source identity and bounded fixtures.
4
+
5
+ The43683..44109 segment now evaluates39988,40397 and40679 as children. It copies24 command bytes, uses the copied pointer for scale, zeroes basis Z before clipping each vector into the current normal, normalizes the resulting live globals and combines signed forward/right input into all three wish components. Up is not directly added. Flat-ground controls retain planar basis while the supplied slope creates vertical wish components. This task stops after the raw wish root and before speed-policy normalization/caps and acceleration; those follow in RE-557. Native roots, normal and input configuration remain supplied.
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
@@ -274,3 +274,6 @@ The extension collector adds five focused tests for native tail calls, command-r
274
 
275
 
276
  [RE-555: Recover complete ordinary41848 swimming and main handoff](QVM_SWIM_MODE.md). Reproduce with `python3 scripts/analyze_qvm_swim_mode.py`; check with `python3 scripts/test_qvm_swim_mode.py`.
 
 
 
 
274
 
275
 
276
  [RE-555: Recover complete ordinary41848 swimming and main handoff](QVM_SWIM_MODE.md). Reproduce with `python3 scripts/analyze_qvm_swim_mode.py`; check with `python3 scripts/test_qvm_swim_mode.py`.
277
+
278
+
279
+ [RE-556: Recover ordinary walking direction and slope wish producer](QVM_WALK_WISH.md). Reproduce with `python3 scripts/analyze_qvm_walk_wish.py`; check with `python3 scripts/test_qvm_walk_wish.py`.
docs/research/qvm-walk-wish.json ADDED
The diff for this file is too large to render. See raw diff
 
scripts/analyze_qvm_walk_wish.py ADDED
@@ -0,0 +1,41 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ #!/usr/bin/env python3
2
+ """43626 ordinary walking friction/direction/slope basis and raw wish producer."""
3
+ import itertools
4
+ from pathlib import Path
5
+ from qvm_research_support import source,memory,execute
6
+ from analyze_qvm_acceleration import PS,word
7
+ from analyze_qvm_active_mode import command_scale
8
+ from analyze_qvm_friction import friction_probe
9
+ from analyze_qvm_move_direction import direction
10
+ from analyze_qvm_jump_entry import snapshot
11
+ from analyze_qvm_slide_prefix import vec
12
+ from analyze_qvm import write_json
13
+
14
+ LOCAL=0x69000000
15
+
16
+
17
+ def wish(ins,m,cmd):
18
+ initial=snapshot(m);before_basis=[vec(m,a) for a in [35023892,35023904]];fr=None;sp=None;dr=None
19
+ def friction(i,m,a,c):
20
+ nonlocal fr
21
+ m,fr=friction_probe(i,{},(0,0,0),initial_memory=m,return_memory=True);return m,c,0,{}
22
+ def scale(i,m,a,c):
23
+ nonlocal sp
24
+ m,sp=command_scale(i,m,c,a[8]);return m,c,sp['result_scale_float_word'],{}
25
+ def classify(i,m,a,c):
26
+ nonlocal dr
27
+ m,dr=direction(i,m,c);return m,c,0,{}
28
+ m,cmd,r=execute(ins,43683,44110,m,cmd,LOCAL,{39988:friction,40397:scale,40679:classify})
29
+ return m,{'initial':initial,'normal':vec(m,35023968),'basis_before':before_basis,'basis_after':[vec(m,a) for a in [35023892,35023904]],'friction':fr,'scale':sp,'direction':dr,'wish':vec(m,LOCAL+20),'root':m[LOCAL+120]&0xffffffff,'execution':r,'final':snapshot(m)}
30
+
31
+
32
+ def main():
33
+ q,raw,h,ins=source();rows=[]
34
+ for cmd,normal,old in itertools.product([(0,0,0),(100,0,0),(-128,127,0),(0,-127,0)],[(0,0,1),(.6,0,.8)],[2,6]):
35
+ m=memory(raw,h,cmd);m[PS+88]=old;m[PS+220]=0
36
+ for i,v in enumerate(normal):m[35023968+4*i]=word(v)
37
+ rows.append(wish(ins,m,cmd)[1])
38
+ write_json(Path('docs/research/qvm-walk-wish.json'),{'source':q['source'],'sha256':q['sha256'],'probes':rows,'limits':'Actual43683..44109 including recovered friction/scale/40679; no acceleration or walking suffix yet. Initial plane/normal/basis/commands and native roots supplied. No original executable/full QVM/native physics/rendering executes; legal/native/runtime scope remains open.'})
39
+
40
+
41
+ if __name__=='__main__':main()
scripts/test_qvm_walk_wish.py ADDED
@@ -0,0 +1,33 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ import json,math,unittest
2
+ from pathlib import Path
3
+ from test_qvm_ground import n,f,word
4
+ from test_qvm_slide_planes import clip
5
+ from test_qvm_acceleration import s8,scale_oracle
6
+ from test_qvm_move_direction import oracle
7
+ from test_qvm_friction import friction_oracle
8
+
9
+
10
+ def length(v):return f(math.sqrt(f(f(f(v[0]*v[0])+f(v[1]*v[1]))+f(v[2]*v[2]))))
11
+
12
+
13
+ def check(test,p):
14
+ normal=list(map(n,p['normal']));basis=[]
15
+ for old in p['basis_before']:
16
+ v=[n(old[0]),n(old[1]),0];v=list(map(n,clip(v,normal)));size=length(v);v=[f(x*f(1/size)) for x in v] if size else v;basis.append(list(map(word,v)))
17
+ test.assertEqual(p['basis_after'],basis);sp=p['scale'];test.assertEqual(sp['result_scale_float_word'],scale_oracle(sp));fw,rt,up=map(s8,sp['movement_bytes']);v=[f(f(n(a)*fw)+f(n(b)*rt)) for a,b in zip(*basis)];test.assertEqual(p['wish'],list(map(word,v)));test.assertEqual(p['root'],word(length(v)));d=p['direction'];test.assertEqual(d['after'],oracle(fw,rt,d['before']));fr=p['friction'];root,drop,ratio,velocity=friction_oracle(fr,{21160:100,21208:4,21212:1,21224:3000,21220:5});test.assertEqual([fr['supplied_sqrt_word'],fr['drop_float_word'],fr['ratio_float_word'],fr['result_velocity_float_words']],[root,drop,ratio,velocity]);test.assertEqual(p['final']['velocity'],velocity)
18
+
19
+
20
+ class WalkWishTests(unittest.TestCase):
21
+ @classmethod
22
+ def setUpClass(cls):cls.r=json.loads(Path('docs/research/qvm-walk-wish.json').read_text())
23
+ def test_all16_exact_basis_wish_and_friction(self):
24
+ self.assertEqual(len(self.r['probes']),16)
25
+ for p in self.r['probes']:check(self,p)
26
+ def test_actual_copy_pointer_and_classifier_order(self):
27
+ for p in self.r['probes']:
28
+ cs=p['execution']['calls'];self.assertEqual([c['target'] for c in cs[:3]],[39988,40397,40679]);self.assertEqual(cs[1]['args'],{'8':0x69000054})
29
+ def test_slope_basis_has_vertical_component_flat_does_not(self):
30
+ for p in self.r['probes']:
31
+ flat=n(p['normal'][2])==1;self.assertEqual(all(n(v[2])==0 for v in p['basis_after']),flat)
32
+ def test_idle_old2_and6_feed_real_direction_child(self):
33
+ idle=[p for p in self.r['probes'] if p['scale']['movement_bytes']==[0,0,0]];self.assertEqual({p['direction']['after'] for p in idle},{1,7})