nmarshall commited on
Commit
b452d03
·
1 Parent(s): 136f298

qvm: slide solver

Browse files
docs/ASSET_PIPELINE_TODO.md CHANGED
@@ -282,3 +282,6 @@ Research progress: [QVM step/wrapper collision policy](research/QVM_STEP_COLLISI
282
  Research progress: [QVM slide preparation/first trace](research/QVM_SLIDE_PREFIX.md) completes bounded RE-473–475: gravity/planes, complete first exits and partial contact/touch policy, actual clear-slide caller chain. RE-472/476 retain multi-plane/repeated-bump/native collision/full state/runtime/platform work; broad game/rendering milestones remain open.
283
 
284
  Research progress: [QVM slide plane gate/candidates](research/QVM_SLIDE_PLANES.md) completes bounded RE-477–479: capacity/dedup/nudge, first candidate/impact/both clips and real contact-prefix continuations. RE-476/480 retain secondary planes/crease/commit/repeated bumps/native collision/full state/runtime/platform work; broad game/rendering milestones remain open.
 
 
 
 
282
  Research progress: [QVM slide preparation/first trace](research/QVM_SLIDE_PREFIX.md) completes bounded RE-473–475: gravity/planes, complete first exits and partial contact/touch policy, actual clear-slide caller chain. RE-472/476 retain multi-plane/repeated-bump/native collision/full state/runtime/platform work; broad game/rendering milestones remain open.
283
 
284
  Research progress: [QVM slide plane gate/candidates](research/QVM_SLIDE_PLANES.md) completes bounded RE-477–479: capacity/dedup/nudge, first candidate/impact/both clips and real contact-prefix continuations. RE-476/480 retain secondary planes/crease/commit/repeated bumps/native collision/full state/runtime/platform work; broad game/rendering milestones remain open.
285
+
286
+
287
+ Research progress: [QVM secondary-plane solver](research/QVM_SLIDE_SOLVER.md) completes bounded RE-481–483: independent reclip/commit, original-vector crease projections/two supplied roots/third-plane return and40 contact continuations. Three chains complete an early slide return; normal paths remain partial before bump advance. RE-480/484 retain repeated bumps/native collision/full state/runtime/platform work; broad game/rendering milestones remain open.
docs/FINDINGS.md CHANGED
@@ -576,3 +576,10 @@ Bounded qagame paths recover bomb-plant/inactivity correction requests, direct f
576
  **F-218 — Candidate scan:**the first plane with current velocity dot<binary32 0.1 updates a supplied impact maximum and independently clips working/end vectors into locals. Exact0.1 skips; candidate vectors are not yet committed to PS. Secondary-plane/crease acceptance remains open. [PLANE-002](research/QVM_SLIDE_PLANES.md).
577
 
578
  **F-219 — Contact-to-plane connection:**40 chains continue evaluated first-contact/touch/gravity state into actual plane insertion/dedup and first candidate selection. Plane order and end-vector flow are verified; duplicate/scan/candidate boundaries remain partial with no claimed complete slide return. [PLANECHAIN-001](research/QVM_SLIDE_PLANES.md).
 
 
 
 
 
 
 
 
576
  **F-218 — Candidate scan:**the first plane with current velocity dot<binary32 0.1 updates a supplied impact maximum and independently clips working/end vectors into locals. Exact0.1 skips; candidate vectors are not yet committed to PS. Secondary-plane/crease acceptance remains open. [PLANE-002](research/QVM_SLIDE_PLANES.md).
577
 
578
  **F-219 — Contact-to-plane connection:**40 chains continue evaluated first-contact/touch/gravity state into actual plane insertion/dedup and first candidate selection. Plane order and end-vector flow are verified; duplicate/scan/candidate boundaries remain partial with no claimed complete slide return. [PLANECHAIN-001](research/QVM_SLIDE_PLANES.md).
579
+
580
+
581
+ **F-220 — Secondary-plane commit:**57714 reclips working/end candidates independently when a secondary dot is below binary32 0.1. A nonnegative reclip dot against the primary continues scanning; successful scan commits both vectors. No qualifying primary leaves vectors unchanged. [SOLVER-001](research/QVM_SLIDE_SOLVER.md).
582
+
583
+ **F-221 — Crease and rejection:**negative reclip/primary dot projects original working/end vectors onto a cross-product crease, recomputing normalization with two supplied native roots. A third-plane working dot<binary32 0.1 zeros PS velocity and returns1 without committing end velocity. Signed zeros survive successful projection. Legal contacts/native services remain unverified. [SOLVER-002](research/QVM_SLIDE_SOLVER.md).
584
+
585
+ **F-222 — Contact solver connection:**40 chains carry actual evaluated prefix/gate state into the solver. Three complete57714 via third-plane return; the remaining37 stop before bump advance. Full repeated collisions and caller/mode/main composition remain open. [SOLVERCHAIN-001](research/QVM_SLIDE_SOLVER.md).
docs/PROVISIONAL_TODO.md CHANGED
@@ -594,3 +594,6 @@ Research progress: [QVM step/wrapper collision policy](research/QVM_STEP_COLLISI
594
  Research progress: [QVM slide preparation/first trace](research/QVM_SLIDE_PREFIX.md) completes bounded RE-473–475: gravity/planes, complete first exits and partial contact/touch policy, actual clear-slide caller chain. RE-472/476 retain multi-plane/repeated-bump/native collision/full state/runtime/platform work; broad game/rendering milestones remain open.
595
 
596
  Research progress: [QVM slide plane gate/candidates](research/QVM_SLIDE_PLANES.md) completes bounded RE-477–479: capacity/dedup/nudge, first candidate/impact/both clips and real contact-prefix continuations. RE-476/480 retain secondary planes/crease/commit/repeated bumps/native collision/full state/runtime/platform work; broad game/rendering milestones remain open.
 
 
 
 
594
  Research progress: [QVM slide preparation/first trace](research/QVM_SLIDE_PREFIX.md) completes bounded RE-473–475: gravity/planes, complete first exits and partial contact/touch policy, actual clear-slide caller chain. RE-472/476 retain multi-plane/repeated-bump/native collision/full state/runtime/platform work; broad game/rendering milestones remain open.
595
 
596
  Research progress: [QVM slide plane gate/candidates](research/QVM_SLIDE_PLANES.md) completes bounded RE-477–479: capacity/dedup/nudge, first candidate/impact/both clips and real contact-prefix continuations. RE-476/480 retain secondary planes/crease/commit/repeated bumps/native collision/full state/runtime/platform work; broad game/rendering milestones remain open.
597
+
598
+
599
+ Research progress: [QVM secondary-plane solver](research/QVM_SLIDE_SOLVER.md) completes bounded RE-481–483: independent reclip/commit, original-vector crease projections/two supplied roots/third-plane return and40 contact continuations. Three chains complete an early slide return; normal paths remain partial before bump advance. RE-480/484 retain repeated bumps/native collision/full state/runtime/platform work; broad game/rendering milestones remain open.
docs/RESEARCH_LEDGER.md CHANGED
@@ -363,3 +363,7 @@ Completed bounded RE-473–475 with `analyze_qvm_slide_prefix.py`: verifies comp
363
  ## 2026-10-16 — Game-QVM slide plane registration and first candidates
364
 
365
  Completed bounded RE-477–479 with `analyze_qvm_slide_planes.py`: verifies plane-gate/candidate/scan-loop slices,61 registration probes,135 candidate probes and40 actual first-contact continuations. PLANE-001–002/PLANECHAIN-001/F-217–219 recover count>=5 velocity-zero early return before dedup; ordered strict dot>binary32 0.99 duplicate nudge without append; raw normal insertion/count; ordered first velocity dot<binary32 0.1 selection, supplied impact maximum update and independent sign-biased working/end vector clip candidates. Candidates remain local and PS velocity is not committed by the evaluated slice. Standalone empty/capacity/non-unit input fixtures do not establish runtime reachability or legal plane domains. Contact chains carry actual prior gravity/plane/touch/time/velocity/normal state beyond58312; duplicate cases stop before bump advance and appended cases stop before secondary-plane/crease acceptance or at scan exhaustion. No complete slide return or repeated-bump/mode/main composition is claimed. Native roots/traces remain supplied in earlier prefix; chain impact initial0 is supplied, not an evaluated scratch reset. No original executable/full QVM/native collision/physics/rendering executes. Eight independent tests verify61 gate outcomes/strict boundaries/order/capacity priority,135 candidate/max/clip outputs and unchanged PS velocity,40 source-state continuations, provenance/slice boundaries and scope. All567 tests pass. Direct slide-prefix report regenerates byte-identically; new report reproduces twice byte-identically (498571 bytes). Storage/filter setup, documentation links and whitespace checks pass. No assets or existing analyzer/evaluator code changed. RE-476 remains open; RE-480 tracks secondary planes/reclip/crease/cross normalization/additional-plane rejection, actual candidate/end-vector commit and repeated bumps/time/returns, impact reset/consumers/legal/native collision and complete contact/step/wrapper/mode/main state/gameplay/macOS/Linux/Rust/Bevy/Solari validation. Other modes/actions/suffix/resource/playback/packet/entity/player/snapshot/rendering milestones remain open.
 
 
 
 
 
363
  ## 2026-10-16 — Game-QVM slide plane registration and first candidates
364
 
365
  Completed bounded RE-477–479 with `analyze_qvm_slide_planes.py`: verifies plane-gate/candidate/scan-loop slices,61 registration probes,135 candidate probes and40 actual first-contact continuations. PLANE-001–002/PLANECHAIN-001/F-217–219 recover count>=5 velocity-zero early return before dedup; ordered strict dot>binary32 0.99 duplicate nudge without append; raw normal insertion/count; ordered first velocity dot<binary32 0.1 selection, supplied impact maximum update and independent sign-biased working/end vector clip candidates. Candidates remain local and PS velocity is not committed by the evaluated slice. Standalone empty/capacity/non-unit input fixtures do not establish runtime reachability or legal plane domains. Contact chains carry actual prior gravity/plane/touch/time/velocity/normal state beyond58312; duplicate cases stop before bump advance and appended cases stop before secondary-plane/crease acceptance or at scan exhaustion. No complete slide return or repeated-bump/mode/main composition is claimed. Native roots/traces remain supplied in earlier prefix; chain impact initial0 is supplied, not an evaluated scratch reset. No original executable/full QVM/native collision/physics/rendering executes. Eight independent tests verify61 gate outcomes/strict boundaries/order/capacity priority,135 candidate/max/clip outputs and unchanged PS velocity,40 source-state continuations, provenance/slice boundaries and scope. All567 tests pass. Direct slide-prefix report regenerates byte-identically; new report reproduces twice byte-identically (498571 bytes). Storage/filter setup, documentation links and whitespace checks pass. No assets or existing analyzer/evaluator code changed. RE-476 remains open; RE-480 tracks secondary planes/reclip/crease/cross normalization/additional-plane rejection, actual candidate/end-vector commit and repeated bumps/time/returns, impact reset/consumers/legal/native collision and complete contact/step/wrapper/mode/main state/gameplay/macOS/Linux/Rust/Bevy/Solari validation. Other modes/actions/suffix/resource/playback/packet/entity/player/snapshot/rendering milestones remain open.
366
+
367
+ ## 2026-10-16 — Game-QVM secondary-plane solver, crease projection and contact continuations
368
+
369
+ Completed bounded RE-481–483 with `analyze_qvm_slide_solver.py`: verifies shipped57714 instructions58476–59636,213 solver probes and40 actual first-contact/plane-gate continuations. SOLVER-001–002/SOLVERCHAIN-001/F-220–222 recover independent working/end secondary-plane reclip, strict primary re-entry test, original-vector projections onto twice-computed/normalized cross products, third-plane strict dot<binary32 0.1 literal-zero return1 and actual working/end commits. Signed-zero projection words remain exact; zero cross skips reciprocal normalization. Standalone outcomes:170 commits,25 third-plane returns,18 exhausted scans. Three contact chains complete57714 via early return;37 remain partial before bump advance. Native roots/trace records and initial impact0 remain supplied, legal/reachable plane/contact domains unverified, repeated bumps/common exit/contact caller/mode/main effects uncomposed. No original executable/full QVM/native collision/physics/rendering executes. Eight independent tests verify all exact result/candidate/impact words against an ordered-float oracle, reclip/commit, both root requests/raw crosses/original projections, degenerate/signed-zero/strict threshold cases,40 source-state chains, source hash/boundaries and scope. All575 tests pass. Direct slide-plane report regenerates byte-identically; new report reproduces twice byte-identically (745379 bytes). Storage/filter setup, documentation links and whitespace checks pass. No assets or existing analyzer/evaluator code changed. RE-480 remains open; RE-484 tracks repeated bumps/time/traces/common exit, impact reset/consumers/legal native collision domains and complete contact/step/wrapper/mode/main shared state/gameplay/macOS/Linux/Rust/Bevy/Solari validation. Other modes/actions/resource/playback/packet/entity/player/snapshot/rendering milestones remain open.
docs/REVERSE_ENGINEERING_TODO.md CHANGED
@@ -582,3 +582,9 @@ Purpose: turn the supplied installation into an evidence-backed specification of
582
  - [x] RE-478 Recover first approach<0.1 candidate selection, impact maximum and separate working/end velocity clip candidates without PS commit ([PLANE-002](research/QVM_SLIDE_PLANES.md)).
583
  - [x] RE-479 Continue actual first-contact prefix state through plane gate and first candidate scan, preserving order and explicit partial stops ([PLANECHAIN-001](research/QVM_SLIDE_PLANES.md)).
584
  - [ ] RE-480 Recover secondary-plane acceptance/reclip, crease/cross normalization/additional-plane rejection, candidate/end-vector commit and repeated bumps/time/returns; impact reset/consumers, legal plane domains/native collision and full contact/step/wrapper/mode/main state. Validate gameplay/macOS/Linux/Rust/Bevy/Solari; continue other modes/actions/suffix/resource/playback/packet/entity/player/snapshot/rendering work.
 
 
 
 
 
 
 
582
  - [x] RE-478 Recover first approach<0.1 candidate selection, impact maximum and separate working/end velocity clip candidates without PS commit ([PLANE-002](research/QVM_SLIDE_PLANES.md)).
583
  - [x] RE-479 Continue actual first-contact prefix state through plane gate and first candidate scan, preserving order and explicit partial stops ([PLANECHAIN-001](research/QVM_SLIDE_PLANES.md)).
584
  - [ ] RE-480 Recover secondary-plane acceptance/reclip, crease/cross normalization/additional-plane rejection, candidate/end-vector commit and repeated bumps/time/returns; impact reset/consumers, legal plane domains/native collision and full contact/step/wrapper/mode/main state. Validate gameplay/macOS/Linux/Rust/Bevy/Solari; continue other modes/actions/suffix/resource/playback/packet/entity/player/snapshot/rendering work.
585
+
586
+
587
+ - [x] RE-481 Recover secondary-plane acceptance/reclip and actual working/end candidate commit, retaining no-candidate boundary ([SOLVER-001](research/QVM_SLIDE_SOLVER.md)).
588
+ - [x] RE-482 Recover two cross-normalization requests, original-vector crease projections, third-plane strict rejection/early return and signed-zero behavior ([SOLVER-002](research/QVM_SLIDE_SOLVER.md)).
589
+ - [x] RE-483 Continue actual first-contact/plane-gate state through solver commits or complete third-plane returns, distinguishing partial bump boundaries ([SOLVERCHAIN-001](research/QVM_SLIDE_SOLVER.md)).
590
+ - [ ] RE-484 Recover repeated bumps/time/native traces and common exit after contacts, impact reset/consumers/legal plane domains/native collision; compose complete contact/step/wrapper/mode/main shared state and validate gameplay/macOS/Linux/Rust/Bevy/Solari. Continue other modes/actions/resource/playback/packet/entity/player/snapshot/rendering work.
docs/research/QVM_SLIDE_PLANES.md CHANGED
@@ -46,3 +46,6 @@ Every chain reports `completed_slide=false` and `return_word=null`. Capacity's i
46
  Eight independent tests verify61 gate outputs and strict thresholds/order/capacity priority,135 candidate scans/maximums/both clipped vectors, unchanged PS velocity,40 real prefix-to-gate/scan transfers, source hash/slice boundaries and explicit scope. The direct slide-prefix report regenerates unchanged; the new report reproduces twice byte-identically. Full-suite/storage/link/whitespace outcomes are recorded in the ledger.
47
 
48
  RE-476 remains open for the complete solver. RE-480 tracks secondary-plane acceptance/reclipping, cross-product/crease normalization and additional-plane rejection, candidate commit/end-velocity updates, repeat-bump loop/time/returns; impact maximum reset/consumers, legal normal/count/basis domains and native collision/ABI; complete contact/step/wrapper/mode/main state and gameplay/macOS/Linux/Rust/Bevy/Solari. Other modes/actions/suffix/resource/playback/packet/entity/player/snapshot/rendering milestones remain open.
 
 
 
 
46
  Eight independent tests verify61 gate outputs and strict thresholds/order/capacity priority,135 candidate scans/maximums/both clipped vectors, unchanged PS velocity,40 real prefix-to-gate/scan transfers, source hash/slice boundaries and explicit scope. The direct slide-prefix report regenerates unchanged; the new report reproduces twice byte-identically. Full-suite/storage/link/whitespace outcomes are recorded in the ledger.
47
 
48
  RE-476 remains open for the complete solver. RE-480 tracks secondary-plane acceptance/reclipping, cross-product/crease normalization and additional-plane rejection, candidate commit/end-velocity updates, repeat-bump loop/time/returns; impact maximum reset/consumers, legal normal/count/basis domains and native collision/ABI; complete contact/step/wrapper/mode/main state and gameplay/macOS/Linux/Rust/Bevy/Solari. Other modes/actions/suffix/resource/playback/packet/entity/player/snapshot/rendering milestones remain open.
49
+
50
+
51
+ Follow-up: [secondary-plane solver](QVM_SLIDE_SOLVER.md) completes bounded RE-481–483, extending the earlier partial candidates through reclip, crease projection and commit or third-plane return. Its new40 contact chains include three complete early returns; this report retains its original partial boundaries. Repeated bumps/native collision/full runtime remain open under RE-480/484.
docs/research/QVM_SLIDE_SOLVER.md ADDED
@@ -0,0 +1,35 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ # QVM secondary-plane solver and crease projection
2
+
3
+ This batch completes bounded RE-481–483 / F-220–222 in shipped qagame helper57714, continuing [plane registration and first candidates](QVM_SLIDE_PLANES.md). It evaluates instructions58476–59636 through candidate commit, scan exhaustion or a third-plane early return. Normal continuation stops at59637 before bump advance. This is source recovery with synthetic finite inputs, not a running collision system.
4
+
5
+ Reproduce with `python3 scripts/analyze_qvm_slide_solver.py`; validate with `python3 scripts/test_qvm_slide_solver.py`. The [machine report](qvm-slide-solver.json) retains verified source identity, instruction records, exact binary32 words, supplied root requests and trace hashes. No original executable, full QVM or native physics/rendering code executes.
6
+
7
+ ## SOLVER-001 — Secondary-plane reclip and candidate commit (RE-481)
8
+
9
+ The outer scan selects the first plane whose rounded dot with current PS velocity is strictly below binary32 0.1. It updates the supplied impact maximum and creates independent working/end candidates as recovered previously. If no plane qualifies, PS velocity and the end vector remain unchanged.
10
+
11
+ The inner scan skips the selected primary plane. A secondary plane with candidate dot at least binary32 0.1 is also skipped. Otherwise both candidates are clipped against that secondary plane, independently recomputing their dot and sign-dependent bias. Negative dot multiplies by coefficient word1065361605; nonnegative dot uses1065336456. Products, sums and component subtractions round to binary32 in source order.
12
+
13
+ After reclip, a working candidate whose dot with the primary plane is nonnegative continues the secondary scan. A strictly negative dot enters crease handling. At successful inner-scan completion the source copies working candidate locals116/120/124 into PS+32/36/40 and end candidate locals128/132/136 into local148/152/156. Commit occurs at59620/59623; normal paths stop before the following bump advance. The end vector has its own clipping/projection history; it is not separately required to pass every acceptance test applied to the working vector.
14
+
15
+ ## SOLVER-002 — Cross product, original-vector projection and third-plane return (RE-482)
16
+
17
+ Crease handling forms primary-normal cross secondary-normal in ordered binary32 arithmetic. The source computes its squared length and requests native square root at CALL59215. The analyzer supplies a finite math result at that actual request; native service behavior is unverified. Nonzero length scales the cross by a rounded reciprocal. Zero length skips reciprocal scaling.
18
+
19
+ The normalized cross is projected against the **original current PS velocity**, not the twice-clipped candidate. Each output component is the rounded product of that crease component and the rounded projection dot. The source then recomputes the cross and requests a second square root at CALL59429 before projecting the **original end vector**. The two requests are recorded independently. Signed zero survives these multiplications; exact-word tests retain it rather than canonicalizing it.
20
+
21
+ For every remaining plane other than the current primary/secondary pair, a projected working dot strictly below binary32 0.1 forces an early return. The source writes literal positive-zero words into PS velocity and returns1 before the common slide exit. It leaves the original end vector uncommitted. Candidate locals can still hold the projected values, including signed zeros. PS flags are unchanged by this solver slice.
22
+
23
+ Targeted three-plane probes with normals X,(-0.6,0.8,0),Z and working velocity(-10,-10,z) reject z=0.099, but commit at binary32 z=0.1 and0.101. Opposed X/-X fixtures expose zero-length cross products: two planes can commit a numerically zero vector with signed-zero components, whereas another plane can trigger the literal-zero early return. These deliberately supplied fixtures establish branch behavior, not physical reachability or valid collision-normal domains.
24
+
25
+ ## SOLVERCHAIN-001 — Actual first-contact state through the solver (RE-483)
26
+
27
+ Forty chains carry the evaluated slide prefix, gravity/end vectors, touch registration, remaining-time update and plane gate directly into the solver. They vary gravity, optional initial ground plane, five supplied contact normals and moving/zero initial velocity. A duplicate plane stops at the bump boundary without invoking the solver. An appended plane supplies its actual resulting array/current/end state to the new slice; the impact initial value0 remains supplied.
28
+
29
+ Three chains reach the third-plane return and therefore complete helper57714 on that early-return path. The other37 remain partial at the bump boundary, including duplicate, committed and no-candidate paths. A completed early return does not establish later wrapper/mode behavior: this batch does not compose these contact results into59710/60091/41768 or main movement. Native trace records, roots and contact consistency remain supplied/unverified.
30
+
31
+ ## Validation and remaining tasks
32
+
33
+ An independent ordered-float oracle checks all213 standalone solver probes:170 committed,25 third-plane returns and18 no-candidate outcomes. Eight tests cover exact state/candidate/impact words, two-plane reclip, both root request arguments and cross products, original-vector projections, degenerate cross products, strict third-plane thresholds, literal versus signed zeros,40 contact-chain state transfers, source hash/boundaries and scope. The direct plane report and new report reproduce byte-identically; full-suite/storage/link/whitespace results are recorded in the ledger.
34
+
35
+ RE-480 remains open for its wider repeated-bump and runtime scope. RE-484 tracks bump advance/remaining time/repeated native traces, common-exit gravity/saved-vector behavior after contacts, impact reset/consumers and legal plane/native collision domains; complete contact/step/wrapper/mode/main shared state and gameplay validation on macOS/Linux with Rust/Bevy/Solari. Other modes/actions/resource/playback/packet/entity/player/snapshot/rendering milestones remain open.
docs/research/README.md CHANGED
@@ -195,3 +195,6 @@ The extension collector adds five focused tests for native tail calls, command-r
195
  [QVM slide preparation, first trace and clear caller chain](QVM_SLIDE_PREFIX.md) adds RE-473–475. Reproduce with `python3 scripts/analyze_qvm_slide_prefix.py`; check with `python3 scripts/test_qvm_slide_prefix.py`. Clear/allsolid paths finish; contact probes stop before plane solving. Native roots/one trace record remain supplied.
196
 
197
  [QVM plane registration and first velocity candidates](QVM_SLIDE_PLANES.md) adds RE-477–479. Reproduce with `python3 scripts/analyze_qvm_slide_planes.py`; check with `python3 scripts/test_qvm_slide_planes.py`. Contacts continue through plane gate/first candidate only; secondary planes, commit and repeated bumps remain open.
 
 
 
 
195
  [QVM slide preparation, first trace and clear caller chain](QVM_SLIDE_PREFIX.md) adds RE-473–475. Reproduce with `python3 scripts/analyze_qvm_slide_prefix.py`; check with `python3 scripts/test_qvm_slide_prefix.py`. Clear/allsolid paths finish; contact probes stop before plane solving. Native roots/one trace record remain supplied.
196
 
197
  [QVM plane registration and first velocity candidates](QVM_SLIDE_PLANES.md) adds RE-477–479. Reproduce with `python3 scripts/analyze_qvm_slide_planes.py`; check with `python3 scripts/test_qvm_slide_planes.py`. Contacts continue through plane gate/first candidate only; secondary planes, commit and repeated bumps remain open.
198
+
199
+
200
+ [QVM secondary-plane solver and crease projection](QVM_SLIDE_SOLVER.md) adds RE-481–483. Reproduce with `python3 scripts/analyze_qvm_slide_solver.py`; check with `python3 scripts/test_qvm_slide_solver.py`. Solver commits/third-plane returns are evaluated; native roots/traces remain supplied and normal paths stop before repeated bumps.
docs/research/qvm-slide-solver.json ADDED
The diff for this file is too large to render. See raw diff
 
scripts/analyze_qvm_slide_solver.py ADDED
@@ -0,0 +1,48 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ #!/usr/bin/env python3
2
+ """Bounded secondary-plane/crease solver through commit or early return."""
3
+ import itertools,json
4
+ from pathlib import Path
5
+ from analyze_bsp_references import trace_fields
6
+ from analyze_deferred_auth import trace_slice
7
+ from analyze_qvm import decode,write_json
8
+ from analyze_qvm_acceleration import PS,word,number
9
+ from analyze_qvm_slide_prefix import LOCAL,seed,slide_effect,vec,put
10
+ from analyze_qvm_slide_planes import gate_effect,planes
11
+ from analyze_qvm_traversal_query import root_word
12
+ from analyze_vm_extensions import verified
13
+
14
+
15
+ def solver_effect(ins,m,impact=0):
16
+ m=dict(m);m[35024000]=word(impact);initial={'planes_float_words':planes(m),'velocity_float_words':vec(m,PS+32),'end_velocity_float_words':vec(m,LOCAL+148),'flags_word':m[PS+12]&0xffffffff,'impact_float_word':word(impact)};pc=58476;root=0;roots=[];trace=[];calls=[];returned=None
17
+ while True:
18
+ t=trace_slice(ins,57715,59708,m,{},resume_at=pc,stop_targets=[s for s in [59191,59405,59637] if s!=pc],local_base=LOCAL,call_results={59215:root,59429:root},halt_on_leave=True,capture_stack=True,limit=4096);m=t['memory'];calls+=t['calls'];trace+=t['trace'];pc=t['stop']
19
+ if pc in [59191,59405]:
20
+ raw=vec(m,LOCAL+100);root=root_word([number(v) for v in raw]);roots.append({'call_instruction':59215 if pc==59191 else 59429,'raw_cross_float_words':raw,'supplied_sqrt_word':root,'primary_index':m[LOCAL+112],'secondary_index':m[LOCAL+96]})
21
+ elif pc==59637:break
22
+ elif t['trace'] and ins[t['trace'][-1]]['opcode']=='LEAVE':returned=t['stack'][-1];break
23
+ selected=58535 in trace;status='third_plane_return' if returned is not None else 'committed' if 59620 in trace else 'no_candidate'
24
+ return m,{'initial':initial,'status':status,'return_word':returned,'stop_instruction':pc,'primary_index':m[LOCAL+112] if selected else None,'result_velocity_float_words':vec(m,PS+32),'result_end_velocity_float_words':vec(m,LOCAL+148),'result_flags_word':m[PS+12]&0xffffffff,'result_impact_float_word':m[35024000]&0xffffffff,'last_candidate_velocity_float_words':vec(m,LOCAL+116) if selected else None,'last_candidate_end_velocity_float_words':vec(m,LOCAL+128) if selected else None,'crease_roots':roots,'calls':calls,**trace_fields({'trace':trace},False)}
25
+
26
+
27
+ def solver_probe(ins,array,velocity,end,impact=0):
28
+ m=seed(velocity=velocity);m[LOCAL+144]=len(array)
29
+ for i,v in enumerate(array):put(m,LOCAL+36+i*12,v)
30
+ put(m,LOCAL+148,end);return solver_effect(ins,m,impact)[1]
31
+
32
+
33
+ def contact_chain(ins,gravity,plane,normal,velocity):
34
+ m,prefix=slide_effect(ins,seed(velocity=velocity,flags=0,plane=plane),gravity_on=gravity,fraction=.5,hit_normal=normal);m,gate=gate_effect(ins,m);solver=None
35
+ if gate['status']=='appended':m,solver=solver_effect(ins,m)
36
+ ret=gate['return_word'] if gate['return_word'] is not None else solver['return_word'] if solver else None
37
+ return {'contact_prefix':prefix,'plane_gate':gate,'solver_probe':solver,'completed_slide':ret is not None,'return_word':ret}
38
+
39
+
40
+ def main():
41
+ q=json.loads(Path('docs/research/qvm/qagame.json').read_text());raw=verified(Path(q['source']['member']['output']).read_bytes(),q['sha256']);_,ins=decode(raw)
42
+ arrays=[[(1,0,0)],[(1,0,0),(0,1,0)],[(1,0,0),(-.6,.8,0)],[(1,0,0),(-.6,.8,0),(0,0,1)],[(1,0,0),(-1,0,0)],[(1,0,0),(-1,0,0),(0,1,0)],[(.6,0,.8),(0,1,0),(-1,0,0)]]
43
+ probes=[solver_probe(ins,*v) for v in itertools.product(arrays,[(-10,-10,3),(-10,5,-2),(10,-5,2),(0,0,0),(.1,.1,.1)],[(1,2,3),(-4,5,-6),(0,0,0)],[0,100])]
44
+ probes += [solver_probe(ins,[(1,0,0),(-.6,.8,0),(0,0,1)],(-10,-10,z),(1,2,3)) for z in [.099,.1,.101]]
45
+ out={'source':q['source'],'sha256':q['sha256'],'solver_instructions':ins[58476:59637],'solver_probes':probes,'contact_chains':[contact_chain(ins,*v) for v in itertools.product([0,1],[0,1],[(1,0,0),(-1,0,0),(0,0,1),(0,0,-1),(.6,0,.8)],[(10,20,30),(0,0,0)])],'limitations':'Bounded finite synthetic shipped-QVM slices only; no original executable/full QVM/native collision/physics/rendering executes. Plane arrays/velocities/end vectors/impact supplied for standalone cases; these do not establish legal/reachable contact domains. Cross-product sqrt returns supplied from finite math at actual call boundaries, including zero norm. Working/end candidates are evaluated through secondary planes, crease checks and commit or third-plane early return. Normal paths stop59637 before bump advance; repeated bumps/common exit/main state not composed. Contact chains carry prior evaluated prefix/touch/plane gate with supplied native trace/root inputs, then actual solver state. Impact initial0 in chains supplied. Full contact/step/wrapper/mode/native/gameplay/macOS/Linux/Rust/Bevy/Solari compatibility remains open.'};write_json(Path('docs/research/qvm-slide-solver.json'),out);print('Recovered secondary-plane reclip, crease/third-plane policy and actual candidate commits')
46
+
47
+
48
+ if __name__=='__main__':main()
scripts/test_qvm_slide_solver.py ADDED
@@ -0,0 +1,88 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ #!/usr/bin/env python3
2
+ """Independent ordered reclip/crease/commit oracle for bounded solver slices."""
3
+ import hashlib,json,math
4
+ from pathlib import Path
5
+ import unittest
6
+ from test_qvm_ground import word,n,f
7
+ from test_qvm_slide_planes import dot,clip,gate_oracle
8
+
9
+
10
+ def cross(a,b):return [f(f(a[1]*b[2])-f(a[2]*b[1])),f(f(a[2]*b[0])-f(a[0]*b[2])),f(f(a[0]*b[1])-f(a[1]*b[0]))]
11
+ def normalized(c):
12
+ root=f(math.sqrt(dot(c,c)));return [f(v*f(1/root)) for v in c] if root else c
13
+
14
+
15
+ def solver_oracle(p):
16
+ a=p['initial'];array=[list(map(n,v)) for v in a['planes_float_words']];v=list(map(n,a['velocity_float_words']));end=list(map(n,a['end_velocity_float_words']));impact=n(a['impact_float_word']);threshold=n(word(.1))
17
+ for i,plane in enumerate(array):
18
+ d=dot(v,plane)
19
+ if d>=threshold:continue
20
+ impact=max(impact,f(-d));cv=list(map(n,clip(v,plane)));ce=list(map(n,clip(end,plane)))
21
+ for j,other in enumerate(array):
22
+ if j==i or dot(cv,other)>=threshold:continue
23
+ cv=list(map(n,clip(cv,other)));ce=list(map(n,clip(ce,other)))
24
+ if dot(cv,plane)>=0:continue
25
+ crease=normalized(cross(plane,other));cv=[f(x*dot(crease,v)) for x in crease];ce=[f(x*dot(crease,end)) for x in crease]
26
+ for k,last in enumerate(array):
27
+ if k not in (i,j) and dot(cv,last)<threshold:return 'third_plane_return',1,i,[0,0,0],a['end_velocity_float_words'],word(impact),list(map(word,cv)),list(map(word,ce))
28
+ return 'committed',None,i,list(map(word,cv)),list(map(word,ce)),word(impact),list(map(word,cv)),list(map(word,ce))
29
+ return 'no_candidate',None,None,a['velocity_float_words'],a['end_velocity_float_words'],a['impact_float_word'],None,None
30
+
31
+
32
+ def check_result(test,p):
33
+ test.assertEqual([p['status'],p['return_word'],p['primary_index'],p['result_velocity_float_words'],p['result_end_velocity_float_words'],p['result_impact_float_word'],p['last_candidate_velocity_float_words'],p['last_candidate_end_velocity_float_words']],list(solver_oracle(p)));test.assertEqual(p['result_flags_word'],p['initial']['flags_word'])
34
+
35
+
36
+ class QvmSlideSolverTests(unittest.TestCase):
37
+ @classmethod
38
+ def setUpClass(cls):cls.r=json.loads(Path('docs/research/qvm-slide-solver.json').read_text())
39
+
40
+ def test_all_secondary_plane_commit_and_return_words(self):
41
+ self.assertEqual(len(self.r['solver_probes']),213)
42
+ for p in self.r['solver_probes']:check_result(self,p)
43
+ self.assertEqual({p['status'] for p in self.r['solver_probes']},{'committed','third_plane_return','no_candidate'})
44
+ for p in self.r['solver_probes']:
45
+ if p['status']=='no_candidate':self.assertEqual(p['stop_instruction'],59637);self.assertIsNone(p['last_candidate_velocity_float_words'])
46
+
47
+ def test_ordinary_two_plane_reclip_commits_both_vectors_without_crease(self):
48
+ p=next(p for p in self.r['solver_probes'] if p['initial']['planes_float_words']==[list(map(word,[1,0,0])),list(map(word,[0,1,0]))] and p['initial']['velocity_float_words']==list(map(word,[-10,-10,3])) and p['initial']['end_velocity_float_words']==list(map(word,[1,2,3])));self.assertEqual(p['status'],'committed');self.assertEqual(p['crease_roots'],[]);self.assertTrue(0<n(p['result_velocity_float_words'][0])<.1);self.assertTrue(0<n(p['result_velocity_float_words'][1])<.1);self.assertNotEqual(p['result_end_velocity_float_words'],p['initial']['end_velocity_float_words'])
49
+
50
+ def test_each_crease_uses_two_actual_sqrt_requests_and_original_projections(self):
51
+ all_probes=self.r['solver_probes']+[c['solver_probe'] for c in self.r['contact_chains'] if c['solver_probe']]
52
+ self.assertTrue(any(p['crease_roots'] for p in all_probes))
53
+ for p in all_probes:
54
+ self.assertEqual(len(p['calls']),len(p['crease_roots']));self.assertEqual(len(p['crease_roots'])%2,0)
55
+ for index,(r,c) in enumerate(zip(p['crease_roots'],p['calls'])):
56
+ array=p['initial']['planes_float_words'];raw=cross(list(map(n,array[r['primary_index']])),list(map(n,array[r['secondary_index']])));square=dot(raw,raw);self.assertEqual(r['raw_cross_float_words'],list(map(word,raw)));self.assertEqual(r['supplied_sqrt_word'],word(math.sqrt(square)));self.assertEqual(c,{'instruction':59215 if index%2==0 else 59429,'target':-107,'args':{'8':word(square)}})
57
+ p=next(p for p in self.r['solver_probes'] if p['crease_roots'] and p['status']=='committed' and p['initial']['velocity_float_words']==list(map(word,[-10,-10,3])) and p['initial']['end_velocity_float_words']==list(map(word,[-4,5,-6])));check_result(self,p)
58
+
59
+ def test_zero_cross_two_planes_commit_but_third_plane_can_force_return(self):
60
+ zero=[p for p in self.r['solver_probes'] if p['crease_roots'] and all(r['supplied_sqrt_word']==0 for r in p['crease_roots'])];self.assertTrue(zero);self.assertTrue(any(p['status']=='committed' and all(n(v)==0 for v in p['result_velocity_float_words']) for p in zero));self.assertTrue(any(p['status']=='third_plane_return' for p in zero))
61
+ for p in self.r['solver_probes']:
62
+ if p['status']=='third_plane_return':self.assertEqual(p['result_velocity_float_words'],[0,0,0]);self.assertEqual(p['result_end_velocity_float_words'],p['initial']['end_velocity_float_words'])
63
+
64
+ def test_third_plane_strict_threshold_and_committed_end_projection(self):
65
+ array=[list(map(word,v)) for v in [(1,0,0),(-.6,.8,0),(0,0,1)]]
66
+ for z,status in [(.099,'third_plane_return'),(.1,'committed'),(.101,'committed')]:
67
+ p=next(p for p in self.r['solver_probes'] if p['initial']['planes_float_words']==array and p['initial']['velocity_float_words']==list(map(word,[-10,-10,z])));self.assertEqual(p['status'],status)
68
+ if status=='committed':
69
+ self.assertEqual(list(map(n,p['result_velocity_float_words'][:2])),[0,0]);self.assertEqual(p['result_velocity_float_words'][2],word(z));self.assertEqual(list(map(n,p['result_end_velocity_float_words'][:2])),[0,0]);self.assertEqual(p['result_end_velocity_float_words'][2],word(3));self.assertIn(0x80000000,p['result_velocity_float_words'][:2])
70
+
71
+ def test_real_contact_gate_to_solver_state_and_completion_boundary(self):
72
+ self.assertEqual(len(self.r['contact_chains']),40);complete=partial=0
73
+ for c in self.r['contact_chains']:
74
+ prefix,gate,p=c['contact_prefix'],c['plane_gate'],c['solver_probe'];self.assertEqual([gate['status'],gate['duplicate_index'],gate['result_plane_float_words'],gate['result_velocity_float_words']],list(gate_oracle(gate)))
75
+ if p:
76
+ self.assertEqual(p['initial']['planes_float_words'],gate['result_plane_float_words']);self.assertEqual(p['initial']['velocity_float_words'],gate['result_velocity_float_words']);self.assertEqual(p['initial']['end_velocity_float_words'],prefix['prefix']['end_velocity_float_words']);check_result(self,p);self.assertEqual(c['return_word'],p['return_word'])
77
+ else:self.assertEqual(gate['status'],'duplicate');self.assertIsNone(c['return_word'])
78
+ self.assertEqual(c['completed_slide'],c['return_word'] is not None);complete+=int(c['completed_slide']);partial+=int(not c['completed_slide'])
79
+ self.assertTrue(complete and partial)
80
+
81
+ def test_verified_source_and_solver_slice_boundaries(self):
82
+ q=json.loads(Path('docs/research/qvm/qagame.json').read_text());self.assertEqual(self.r['source'],q['source']);self.assertEqual(self.r['sha256'],hashlib.sha256(Path(q['source']['member']['output']).read_bytes()).hexdigest());self.assertEqual(self.r['solver_instructions'][0]['index'],58476);self.assertEqual(self.r['solver_instructions'][-1]['index'],59636)
83
+
84
+ def test_native_root_bump_and_full_runtime_scope_explicit(self):
85
+ for text in ['no original executable/full QVM/native collision/physics/rendering executes','Cross-product sqrt returns supplied','Normal paths stop59637 before bump advance','repeated bumps/common exit/main state not composed']:self.assertIn(text,self.r['limitations'])
86
+
87
+
88
+ if __name__=='__main__':unittest.main()