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

qvm: slide planes

Browse files
docs/ASSET_PIPELINE_TODO.md CHANGED
@@ -280,3 +280,5 @@ Research progress: [QVM side-hull and conditional gravity recovery](research/QVM
280
  Research progress: [QVM step/wrapper collision policy](research/QVM_STEP_COLLISION.md) completes bounded RE-469–471: raised/down/overlap traces and clipping, fallback/height stores, evaluated wrapper-to-gravity composition. RE-468/472 retain actual slide/native collision/producers/full state/runtime/platform work; broad game/rendering milestones remain open.
281
 
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.
 
 
 
280
  Research progress: [QVM step/wrapper collision policy](research/QVM_STEP_COLLISION.md) completes bounded RE-469–471: raised/down/overlap traces and clipping, fallback/height stores, evaluated wrapper-to-gravity composition. RE-468/472 retain actual slide/native collision/producers/full state/runtime/platform work; broad game/rendering milestones remain open.
281
 
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.
docs/FINDINGS.md CHANGED
@@ -570,3 +570,9 @@ Bounded qagame paths recover bomb-plant/inactivity correction requests, direct f
570
  **F-215 — First trace split:** first-clear exits with0 through end/saved-velocity and flag2048 cleanup; allsolid returns1 after zeroing only Z and bypasses that cleanup. Partial contacts set2048/normal XY behind strict normal/gravity/surface/contents gates, evaluate touch registration and shrink remaining time; probes stop before plane solving. [SLIDE-002](research/QVM_SLIDE_PREFIX.md).
571
 
572
  **F-216 — Actual clear-slide caller chain:**20 chains replace supplied slide return/position/velocity with evaluated57714 clear results inside60091 bypass and41768 tail. Contact/step/native/main effects and full gameplay remain open. [SLIDECHAIN-001](research/QVM_SLIDE_PREFIX.md).
 
 
 
 
 
 
 
570
  **F-215 — First trace split:** first-clear exits with0 through end/saved-velocity and flag2048 cleanup; allsolid returns1 after zeroing only Z and bypasses that cleanup. Partial contacts set2048/normal XY behind strict normal/gravity/surface/contents gates, evaluate touch registration and shrink remaining time; probes stop before plane solving. [SLIDE-002](research/QVM_SLIDE_PREFIX.md).
571
 
572
  **F-216 — Actual clear-slide caller chain:**20 chains replace supplied slide return/position/velocity with evaluated57714 clear results inside60091 bypass and41768 tail. Contact/step/native/main effects and full gameplay remain open. [SLIDECHAIN-001](research/QVM_SLIDE_PREFIX.md).
573
+
574
+ **F-217 — Plane gate:**count>=5 zeros velocity and returns before dedup; otherwise the first dot>binary32 0.99 nudges velocity by the raw incoming normal without appending. No match appends the normal/count. Synthetic standalone counts/normals do not establish runtime legality. [PLANE-001](research/QVM_SLIDE_PLANES.md).
575
+
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).
docs/PROVISIONAL_TODO.md CHANGED
@@ -592,3 +592,5 @@ Research progress: [QVM side-hull and conditional gravity recovery](research/QVM
592
  Research progress: [QVM step/wrapper collision policy](research/QVM_STEP_COLLISION.md) completes bounded RE-469–471: raised/down/overlap traces and clipping, fallback/height stores, evaluated wrapper-to-gravity composition. RE-468/472 retain actual slide/native collision/producers/full state/runtime/platform work; broad game/rendering milestones remain open.
593
 
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.
 
 
 
592
  Research progress: [QVM step/wrapper collision policy](research/QVM_STEP_COLLISION.md) completes bounded RE-469–471: raised/down/overlap traces and clipping, fallback/height stores, evaluated wrapper-to-gravity composition. RE-468/472 retain actual slide/native collision/producers/full state/runtime/platform work; broad game/rendering milestones remain open.
593
 
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.
docs/RESEARCH_LEDGER.md CHANGED
@@ -359,3 +359,7 @@ Completed bounded RE-469–471 with `analyze_qvm_step_collision.py`: verifies co
359
  ## 2026-10-16 — Game-QVM slide preparation, first trace and clear caller chain
360
 
361
  Completed bounded RE-473–475 with `analyze_qvm_slide_prefix.py`: verifies complete57714 instruction partition,384 complete first-trace exit probes,122 explicitly partial contact probes and20 evaluated clear slide/wrapper/mode chains. SLIDE-001–002/SLIDECHAIN-001/F-214–216 recover gravity end/saved-Z and working midpoint, optional ground clip, norm/current-direction/ground plane seeds, float remaining time and initial bump state; first callback endpoint/arguments, allsolid Z-only return1 versus fraction1 common-exit return0, gravity/saved-vector ordering and flag2048 cleanup; strict hit-normal/gravity/surface/contents contact flags/normal XY stores, evaluated39253 entity touch registration and remaining-time reduction. Contacts stop at58312 before plane solving/remaining bumps and have no claimed return. Native sqrt and one trace record/interpolated endpoint remain supplied; contact legality, real normal/configuration/native effects are unverified. Clear57714 origin/velocity/return now compose into actual60091 first-result bypass and41768 gravity tail without supplied slide output, using disjoint live local frames and selected shared PS/frame state. Contact/step/main-loop/global/entity/exceptional/alias/runtime effects remain uncomposed. No original executable/full QVM/native collision/physics/rendering executes. Eight independent tests verify all prefix vectors/planes/root arguments, trace endpoint/bounds/ABI,384 complete exits/suffix distinctions,122 contact-prefix words/touch counts/strict thresholds,20 caller chains, provenance/partition and scope. All559 tests pass. Direct step-collision report regenerates byte-identically; new report reproduces twice byte-identically (2021856 bytes, below normal-Git2MiB limit). Storage/filter setup, documentation links and whitespace checks pass. No assets or existing analyzer/evaluator code changed. RE-472 remains open; RE-476 tracks post58312 dedup/plane cap/clipping/crease/end-vector/repeated-bump behavior and remaining returns, actual native collision/legal records/producers and full contact/step/wrapper/mode/main shared-state/gameplay/macOS/Linux/Rust/Bevy/Solari validation. Other modes/actions/suffix/resource/playback/packet/entity/player/snapshot/rendering milestones remain open.
 
 
 
 
 
359
  ## 2026-10-16 — Game-QVM slide preparation, first trace and clear caller chain
360
 
361
  Completed bounded RE-473–475 with `analyze_qvm_slide_prefix.py`: verifies complete57714 instruction partition,384 complete first-trace exit probes,122 explicitly partial contact probes and20 evaluated clear slide/wrapper/mode chains. SLIDE-001–002/SLIDECHAIN-001/F-214–216 recover gravity end/saved-Z and working midpoint, optional ground clip, norm/current-direction/ground plane seeds, float remaining time and initial bump state; first callback endpoint/arguments, allsolid Z-only return1 versus fraction1 common-exit return0, gravity/saved-vector ordering and flag2048 cleanup; strict hit-normal/gravity/surface/contents contact flags/normal XY stores, evaluated39253 entity touch registration and remaining-time reduction. Contacts stop at58312 before plane solving/remaining bumps and have no claimed return. Native sqrt and one trace record/interpolated endpoint remain supplied; contact legality, real normal/configuration/native effects are unverified. Clear57714 origin/velocity/return now compose into actual60091 first-result bypass and41768 gravity tail without supplied slide output, using disjoint live local frames and selected shared PS/frame state. Contact/step/main-loop/global/entity/exceptional/alias/runtime effects remain uncomposed. No original executable/full QVM/native collision/physics/rendering executes. Eight independent tests verify all prefix vectors/planes/root arguments, trace endpoint/bounds/ABI,384 complete exits/suffix distinctions,122 contact-prefix words/touch counts/strict thresholds,20 caller chains, provenance/partition and scope. All559 tests pass. Direct step-collision report regenerates byte-identically; new report reproduces twice byte-identically (2021856 bytes, below normal-Git2MiB limit). Storage/filter setup, documentation links and whitespace checks pass. No assets or existing analyzer/evaluator code changed. RE-472 remains open; RE-476 tracks post58312 dedup/plane cap/clipping/crease/end-vector/repeated-bump behavior and remaining returns, actual native collision/legal records/producers and full contact/step/wrapper/mode/main shared-state/gameplay/macOS/Linux/Rust/Bevy/Solari validation. Other modes/actions/suffix/resource/playback/packet/entity/player/snapshot/rendering milestones remain open.
362
+
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.
docs/REVERSE_ENGINEERING_TODO.md CHANGED
@@ -577,3 +577,8 @@ Purpose: turn the supplied installation into an evidence-backed specification of
577
  - [x] RE-474 Recover complete first-clear/allsolid exits and partial first-contact flag/normal/touch/time policy up to58312, explicitly excluding plane solving ([SLIDE-002](research/QVM_SLIDE_PREFIX.md)).
578
  - [x] RE-475 Compose evaluated clear57714 output/return through60091 bypass and41768 gravity tail with shared selected state/disjoint frames ([SLIDECHAIN-001](research/QVM_SLIDE_PREFIX.md)).
579
  - [ ] RE-476 Recover post58312 plane dedup/capacity/clipping/crease/gravity/end-vector behavior, repeated bumps/time/contact mutations/remaining returns; native collision/ABI/legal records/producers 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.
 
 
 
 
 
 
577
  - [x] RE-474 Recover complete first-clear/allsolid exits and partial first-contact flag/normal/touch/time policy up to58312, explicitly excluding plane solving ([SLIDE-002](research/QVM_SLIDE_PREFIX.md)).
578
  - [x] RE-475 Compose evaluated clear57714 output/return through60091 bypass and41768 gravity tail with shared selected state/disjoint frames ([SLIDECHAIN-001](research/QVM_SLIDE_PREFIX.md)).
579
  - [ ] RE-476 Recover post58312 plane dedup/capacity/clipping/crease/gravity/end-vector behavior, repeated bumps/time/contact mutations/remaining returns; native collision/ABI/legal records/producers 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.
580
+
581
+ - [x] RE-477 Recover58312 plane capacity return, strict duplicate-dot gate/ordered scan, normal nudge and append/count behavior ([PLANE-001](research/QVM_SLIDE_PLANES.md)).
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.
docs/research/QVM_SLIDE_PLANES.md ADDED
@@ -0,0 +1,48 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ # Game-QVM plane registration and first velocity candidates
2
+
3
+ RE-477–479 / F-217–219. [qvm-slide-planes.json](qvm-slide-planes.json) retains plane-gate/candidate/scan-loop instruction slices,61 gate probes,135 candidate probes and40 first-contact continuations. Reproduce with `python3 scripts/analyze_qvm_slide_planes.py`; check with `python3 scripts/test_qvm_slide_planes.py`.
4
+
5
+ This continues [slide preparation and first contact](QVM_SLIDE_PREFIX.md) from its explicit stop at58312. The new work evaluates capacity, duplicate handling, plane append and the first selected candidate only. It does not execute secondary-plane rejection, crease solving, candidate commit or later bumps. Native trace/root inputs remain supplied in contact chains. No original executable, complete QVM, native collision, physics or rendering executes. Synthetic array/normal/velocity domains and complete gameplay/platform behavior remain open.
6
+
7
+ ## PLANE-001 — Capacity, duplicate threshold and nudge (RE-477)
8
+
9
+ At58312 the slide checks signed plane count against5. Count>=5 zeros all PS velocity components and returns1 immediately, before duplicate search or normal insertion. This branch bypasses the slide's normal common exit. It is recovered as an early return at this boundary, not as a claim that every seeded standalone count is reachable in real movement.
10
+
11
+ Below capacity, it scans the existing plane array in order and computes rounded dot(incoming trace normal, stored plane). The first value **strictly greater than binary32 0.99** selects the duplicate path. It adds the incoming normal component-wise to PS velocity, leaves the array/count unchanged and jumps to59637, immediately before the bump counter advances. This is an unscaled normal addition; there is no extra epsilon coefficient in this source branch.
12
+
13
+ With no match, the helper appends the raw incoming normal and increments count, then starts the candidate scan. It does not normalize that incoming normal here. A count4 can append to5; another contact at count5 would take the capacity return before even checking for a duplicate. Exact0.99 does not match;0.9901 does in the isolated fixtures.
14
+
15
+ The61 gate probes combine counts0/1/4/5, five normal X values and three velocities, plus a two-plane example whose match is at index1. Empty arrays and non-unit threshold vectors are synthetic control probes, not legal-domain evidence. Tests verify exact order, capacity priority, array/count retention or insertion, nudge words and return/continuation boundary.
16
+
17
+ ## PLANE-002 — First approach gate, impact maximum and two clips (RE-478)
18
+
19
+ After append, the source scans stored planes from index0. For each plane it computes rounded dot(current PS velocity, plane). Values greater than or equal to binary32 0.1 are skipped. The **first value strictly below0.1** selects candidate generation. No eligible plane ends the outer scan at59637 without generating a candidate.
20
+
21
+ For a selected plane, global35024000 is updated only when the negated approach dot exceeds its supplied current value. The report calls this the impact maximum as a candidate role; actual scratch reset, meaning and later consumers are not composed. Standalone probes supply initial values0/5/100. Contact chains explicitly supply0 rather than claiming an evaluated reset.
22
+
23
+ The helper clips two vectors independently against the selected plane:
24
+
25
+ - Current PS velocity produces local candidate116/120/124.
26
+ - End velocity148/152/156 produces local candidate128/132/136.
27
+
28
+ Each clip recomputes its own rounded dot. Negative dot uses exact coefficient word1065361605 (approximately1.00100005); nonnegative dot uses1065336456 (approximately0.999001026). Each resulting component is `round32(component - round32(normal_component * biased_dot))`. The end clip does not reuse the current vector's sign/coefficient choice.
29
+
30
+ The analyzer stops at58790, before the inner secondary-plane scan. These are **local candidates**, not committed PS velocity. A skipped scan likewise stops before bump advance. Tests verify PS velocity remains unchanged by this candidate slice, maximum retention/update, independent clipping signs and exact float words. They cover exact0.1 versus0.099, selected later planes and exhausted scans.
31
+
32
+ The135 standalone fixtures combine three plane arrays, five velocities, three end vectors and three initial maximum values. Legal contact normals, complete solver acceptance and exceptional/alias/control-state domains remain open.
33
+
34
+ ## PLANECHAIN-001 — Actual first-contact state to plane/candidate slices (RE-479)
35
+
36
+ Forty chains evaluate the preceding slide preparation, supplied first native trace, contact flag/normal stores, actual39253 touch registration and remaining-time update, then continue its resulting memory from58312 through the plane gate. They use gravity0/1, supplied ground-plane0/1, five incoming normals and moving/zero velocity.
37
+
38
+ The gate receives the actual working velocity and seeded plane array from that earlier prefix, plus the normal from its supplied trace. A duplicate leaves the chain at the bump-advance boundary with nudged PS velocity and no candidate. An appended plane continues the actual scan, preserving array order, until the first candidate or scan exhaustion. End-velocity data comes directly from the evaluated gravity prefix. This connects three producer/consumer regions rather than re-seeding their vectors independently.
39
+
40
+ The selected plane need not be the newly appended contact plane. For example, a supplied ground plane may be the first plane with approach below0.1 after the earlier ground clip, while other cases skip prior separating planes and select a later one. Tests check source order and exact data flow without asserting final acceptance by the unrecovered inner solver.
41
+
42
+ Every chain reports `completed_slide=false` and `return_word=null`. Capacity's isolated early return is tested separately; these first-contact chains begin with the previously recovered one/two seed planes and do not reach capacity. They do not complete repeated bumps, committed clipping, crease motion, native contacts or a full step/wrapper/mode/main simulation.
43
+
44
+ ## Validation and next tasks
45
+
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.
docs/research/QVM_SLIDE_PREFIX.md CHANGED
@@ -56,3 +56,5 @@ Fixtures vary initial vertical velocity-1/0/12.8/30/100, movement timer0/16 and
56
  Eight tests independently verify all preparation/plane words and sqrt requests, first endpoint/bounds/ABI,384 full exit policies,122 explicitly partial contact results and touch-list effects, strict normal thresholds,20 actual clear caller chains, source hash/complete partition and scope. The direct step-collision report regenerates unchanged; the new report reproduces twice byte-identically. Full-suite/storage/link/whitespace outcomes are recorded in the ledger.
57
 
58
  RE-472 remains open for full slide physics. RE-476 tracks post58312 plane deduplication/capacity/clipping/crease/gravity/end-vector behavior, repeated bumps/time/contact mutations and all remaining returns; actual native collision/ABI/legal records and producers; complete contact/step/wrapper/mode/main shared state and gameplay/macOS/Linux/Rust/Bevy/Solari validation. Other modes/actions/suffix/resource/playback/packet/entity/player/snapshot/rendering milestones remain open.
 
 
 
56
  Eight tests independently verify all preparation/plane words and sqrt requests, first endpoint/bounds/ABI,384 full exit policies,122 explicitly partial contact results and touch-list effects, strict normal thresholds,20 actual clear caller chains, source hash/complete partition and scope. The direct step-collision report regenerates unchanged; the new report reproduces twice byte-identically. Full-suite/storage/link/whitespace outcomes are recorded in the ledger.
57
 
58
  RE-472 remains open for full slide physics. RE-476 tracks post58312 plane deduplication/capacity/clipping/crease/gravity/end-vector behavior, repeated bumps/time/contact mutations and all remaining returns; actual native collision/ABI/legal records and producers; complete contact/step/wrapper/mode/main shared state and gameplay/macOS/Linux/Rust/Bevy/Solari validation. Other modes/actions/suffix/resource/playback/packet/entity/player/snapshot/rendering milestones remain open.
59
+
60
+ Follow-up: [plane gate/candidate recovery](QVM_SLIDE_PLANES.md) continues40 contact-prefix states beyond58312 through capacity/dedup/append and first approach-selected candidates. No crease/secondary-plane resolution, velocity commit or subsequent bump is claimed (RE-477–480).
docs/research/README.md CHANGED
@@ -193,3 +193,5 @@ The extension collector adds five focused tests for native tail calls, command-r
193
  [QVM step attempt, fallback wrapper and gravity-mode composition](QVM_STEP_COLLISION.md) adds RE-469–471. Reproduce with `python3 scripts/analyze_qvm_step_collision.py`; check with `python3 scripts/test_qvm_step_collision.py`. Step/wrapper/mode policies are evaluated;57714 and native traces still supply physical results.
194
 
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.
 
 
 
193
  [QVM step attempt, fallback wrapper and gravity-mode composition](QVM_STEP_COLLISION.md) adds RE-469–471. Reproduce with `python3 scripts/analyze_qvm_step_collision.py`; check with `python3 scripts/test_qvm_step_collision.py`. Step/wrapper/mode policies are evaluated;57714 and native traces still supply physical results.
194
 
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.
docs/research/qvm-slide-planes.json ADDED
The diff for this file is too large to render. See raw diff
 
scripts/analyze_qvm_slide_planes.py ADDED
@@ -0,0 +1,51 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ #!/usr/bin/env python3
2
+ """Bounded slide plane registration and first candidate; no crease solver."""
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 FRAME,PS,word
9
+ from analyze_qvm_slide_prefix import LOCAL,seed,slide_effect,vec,put
10
+ from analyze_vm_extensions import verified
11
+
12
+
13
+ def planes(m):return [vec(m,LOCAL+36+i*12) for i in range(m[LOCAL+144])]
14
+
15
+
16
+ def gate_effect(ins,m):
17
+ initial_planes=planes(m);initial_velocity=vec(m,PS+32);incoming=vec(m,LOCAL+188);t=trace_slice(ins,57715,59708,m,{},resume_at=58312,stop_targets=[58476,59637],local_base=LOCAL,halt_on_leave=True,capture_stack=True,limit=512);m=t['memory'];status='capacity_return' if ins[t['trace'][-1]]['opcode']=='LEAVE' else 'duplicate' if t['stop']==59637 else 'appended'
18
+ return m,{'initial_plane_float_words':initial_planes,'initial_velocity_float_words':initial_velocity,'incoming_normal_float_words':incoming,'status':status,'return_word':t['stack'][-1] if status=='capacity_return' else None,'stop_instruction':t['stop'],'duplicate_index':m[LOCAL+112] if status=='duplicate' else None,'result_plane_float_words':planes(m),'result_velocity_float_words':vec(m,PS+32),'calls':t['calls'],**trace_fields(t,False)}
19
+
20
+
21
+ def gate_probe(ins,count,normal,velocity,custom=None):
22
+ m=seed(velocity=velocity);m[LOCAL+144]=count
23
+ for i,v in enumerate(custom or [(1,0,0)]*count):put(m,LOCAL+36+i*12,v)
24
+ put(m,LOCAL+188,normal);return gate_effect(ins,m)[1]
25
+
26
+
27
+ def candidate_effect(ins,m,impact=0):
28
+ m=dict(m);m[35024000]=word(impact);original_planes=planes(m);velocity=vec(m,PS+32);end=vec(m,LOCAL+148);t=trace_slice(ins,57715,59708,m,{},resume_at=58476,stop_targets=[58790,59637],local_base=LOCAL,limit=2048);m=t['memory'];selected=t['stop']==58790
29
+ return m,{'planes_float_words':original_planes,'initial_velocity_float_words':velocity,'initial_end_velocity_float_words':end,'initial_impact_float_word':word(impact),'selected':selected,'selected_index':m[LOCAL+112] if selected else None,'result_impact_float_word':m[35024000]&0xffffffff,'candidate_velocity_float_words':vec(m,LOCAL+116) if selected else None,'candidate_end_velocity_float_words':vec(m,LOCAL+128) if selected else None,'unchanged_ps_velocity_float_words':vec(m,PS+32),'stop_instruction':t['stop'],'calls':t['calls'],**trace_fields(t,False)}
30
+
31
+
32
+ def candidate_probe(ins,array,velocity,end,impact):
33
+ m=seed(velocity=velocity);m[LOCAL+144]=len(array)
34
+ for i,v in enumerate(array):put(m,LOCAL+36+i*12,v)
35
+ put(m,LOCAL+148,end);return candidate_effect(ins,m,impact)[1]
36
+
37
+
38
+ def contact_chain(ins,gravity,plane,normal,velocity):
39
+ m,prefix=slide_effect(ins,seed(velocity=velocity,flags=0,plane=plane),gravity_on=gravity,fraction=.5,hit_normal=normal);assert not prefix['completed'];m,gate=gate_effect(ins,m);candidate=None
40
+ if gate['status']=='appended':m,candidate=candidate_effect(ins,m)
41
+ return {'contact_prefix':prefix,'plane_gate':gate,'first_candidate':candidate,'completed_slide':False,'return_word':None}
42
+
43
+
44
+ def main():
45
+ 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)
46
+ gates=[gate_probe(ins,*v) for v in itertools.product([0,1,4,5],[(.9899,0,0),(.99,0,0),(.9901,0,0),(1,0,0),(-1,0,0)],[(1,2,3),(-1,0,0),(0,0,0)])];gates.append(gate_probe(ins,2,(1,0,0),(1,2,3),custom=[(-1,0,0),(1,0,0)]))
47
+ candidates=[candidate_probe(ins,*v) for v in itertools.product([[(1,0,0)],[(1,0,0),(0,1,0)],[(-1,0,0)]],[(.099,0,0),(.1,0,0),(-10,5,2),(10,-5,2),(0,0,0)],[(1,2,3),(-4,5,-6),(0,0,0)],[0,5,100])]
48
+ out={'source':q['source'],'sha256':q['sha256'],'gate_instructions':ins[58312:58476],'candidate_instructions':ins[58476:58790],'candidate_loop_instructions':ins[59626:59637],'gate_probes':gates,'candidate_probes':candidates,'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. Standalone plane arrays/counts/velocities/end vectors/impact are supplied; empty/capacity fixtures do not establish reachability or legal normals. Contact chains evaluate prior first-contact prefix with supplied native root/trace and recovered touch registration, then actual plane gate and first selected candidate. Duplicate paths stop before bump advance; appended paths stop before candidate secondary-plane/crease tests or at scan exhaustion. Candidates are local outputs, not committed PS velocity; no complete slide return, repeated bumps or full shared-state/gameplay/macOS/Linux/Rust/Bevy/Solari compatibility is claimed. Impact initial0 in chains is supplied, not composed scratch reset.'};write_json(Path('docs/research/qvm-slide-planes.json'),out);print('Recovered plane capacity/dedup, first candidate clipping and contact-prefix continuations')
49
+
50
+
51
+ if __name__=='__main__':main()
scripts/test_qvm_slide_planes.py ADDED
@@ -0,0 +1,77 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ #!/usr/bin/env python3
2
+ """Independent plane gate, candidate clipping and contact continuation checks."""
3
+ import hashlib,json
4
+ from pathlib import Path
5
+ import unittest
6
+ from test_qvm_ground import word,n,f
7
+
8
+
9
+ def dot(a,b):return f(f(f(a[0]*b[0])+f(a[1]*b[1]))+f(a[2]*b[2]))
10
+ def clip(v,normal):
11
+ d=dot(v,normal);amount=f(d*n(1065361605 if d<0 else 1065336456));return [word(f(x-f(y*amount))) for x,y in zip(v,normal)]
12
+
13
+
14
+ def gate_oracle(p):
15
+ array=p['initial_plane_float_words'];velocity=p['initial_velocity_float_words'];normal=list(map(n,p['incoming_normal_float_words']))
16
+ if len(array)>=5:return 'capacity_return',None,array,[0,0,0]
17
+ for i,v in enumerate(array):
18
+ if dot(normal,list(map(n,v)))>n(word(.99)):return 'duplicate',i,array,[word(f(n(x)+y)) for x,y in zip(velocity,normal)]
19
+ return 'appended',None,array+[p['incoming_normal_float_words']],velocity
20
+
21
+
22
+ def candidate_oracle(p):
23
+ v=list(map(n,p['initial_velocity_float_words']));end=list(map(n,p['initial_end_velocity_float_words']));impact=n(p['initial_impact_float_word'])
24
+ for i,plane in enumerate(p['planes_float_words']):
25
+ normal=list(map(n,plane));d=dot(v,normal)
26
+ if d<n(word(.1)):return True,i,word(max(impact,f(-d))),clip(v,normal),clip(end,normal)
27
+ return False,None,p['initial_impact_float_word'],None,None
28
+
29
+
30
+ class QvmSlidePlaneTests(unittest.TestCase):
31
+ @classmethod
32
+ def setUpClass(cls):cls.r=json.loads(Path('docs/research/qvm-slide-planes.json').read_text())
33
+
34
+ def test_plane_capacity_duplicate_append_and_exact_nudge(self):
35
+ self.assertEqual(len(self.r['gate_probes']),61)
36
+ for p in self.r['gate_probes']:
37
+ status,index,array,velocity=gate_oracle(p);self.assertEqual([p['status'],p['duplicate_index'],p['result_plane_float_words'],p['result_velocity_float_words']],[status,index,array,velocity]);self.assertEqual(p['return_word'],1 if status=='capacity_return' else None);self.assertEqual(p['calls'],[])
38
+
39
+ def test_strict_duplicate_threshold_order_and_capacity_priority(self):
40
+ rows=self.r['gate_probes']
41
+ for x,status in [(.9899,'appended'),(.99,'appended'),(.9901,'duplicate'),(1,'duplicate')]:self.assertTrue(any(len(p['initial_plane_float_words'])==1 and p['incoming_normal_float_words'][0]==word(x) and p['status']==status for p in rows))
42
+ self.assertTrue(any(p['duplicate_index']==1 for p in rows));self.assertTrue(any(len(p['initial_plane_float_words'])==4 and len(p['result_plane_float_words'])==5 and p['status']=='appended' for p in rows))
43
+ for p in rows:
44
+ if len(p['initial_plane_float_words'])==5:self.assertEqual(p['status'],'capacity_return');self.assertEqual(p['result_velocity_float_words'],[0,0,0])
45
+
46
+ def test_every_candidate_order_impact_and_both_clip_vectors(self):
47
+ self.assertEqual(len(self.r['candidate_probes']),135)
48
+ for p in self.r['candidate_probes']:
49
+ self.assertEqual([p['selected'],p['selected_index'],p['result_impact_float_word'],p['candidate_velocity_float_words'],p['candidate_end_velocity_float_words']],list(candidate_oracle(p)));self.assertEqual(p['unchanged_ps_velocity_float_words'],p['initial_velocity_float_words']);self.assertEqual(p['calls'],[])
50
+
51
+ def test_approach_threshold_equality_scan_and_impact_retention(self):
52
+ rows=self.r['candidate_probes']
53
+ for x,selected in [(.099,True),(.1,False)]:self.assertTrue(any(len(p['planes_float_words'])==1 and p['planes_float_words'][0][0]==word(1) and p['initial_velocity_float_words'][0]==word(x) and p['selected']==selected for p in rows))
54
+ self.assertTrue(any(p['selected_index']==1 for p in rows));self.assertTrue(any(p['initial_impact_float_word']==word(100) and p['selected'] and p['result_impact_float_word']==word(100) for p in rows));self.assertTrue(any(n(p['result_impact_float_word'])>n(p['initial_impact_float_word']) for p in rows))
55
+
56
+ def test_contact_prefix_state_flows_into_actual_plane_gate(self):
57
+ self.assertEqual(len(self.r['contact_chains']),40)
58
+ for p in self.r['contact_chains']:
59
+ prefix,gate=p['contact_prefix'],p['plane_gate'];self.assertFalse(prefix['completed']);self.assertEqual(prefix['stop_instruction'],58312);self.assertEqual(gate['initial_velocity_float_words'],prefix['result_velocity_float_words']);self.assertEqual(gate['initial_plane_float_words'],prefix['prefix']['plane_float_words']);self.assertEqual(gate['incoming_normal_float_words'],prefix['supplied_trace_words'][6:9]);self.assertEqual([gate['status'],gate['duplicate_index'],gate['result_plane_float_words'],gate['result_velocity_float_words']],list(gate_oracle(gate)));self.assertFalse(p['completed_slide']);self.assertIsNone(p['return_word'])
60
+
61
+ def test_append_only_candidate_continuation_and_no_velocity_commit(self):
62
+ selected=duplicate=0
63
+ for p in self.r['contact_chains']:
64
+ g,c=p['plane_gate'],p['first_candidate']
65
+ if g['status']=='appended':
66
+ self.assertIsNotNone(c);self.assertEqual(c['planes_float_words'],g['result_plane_float_words']);self.assertEqual(c['initial_velocity_float_words'],g['result_velocity_float_words']);self.assertEqual(c['initial_end_velocity_float_words'],p['contact_prefix']['prefix']['end_velocity_float_words']);self.assertEqual([c['selected'],c['selected_index'],c['result_impact_float_word'],c['candidate_velocity_float_words'],c['candidate_end_velocity_float_words']],list(candidate_oracle(c)));self.assertEqual(c['unchanged_ps_velocity_float_words'],g['result_velocity_float_words']);selected+=int(c['selected'])
67
+ else:duplicate+=1;self.assertIsNone(c);self.assertEqual(g['stop_instruction'],59637)
68
+ self.assertTrue(selected and duplicate)
69
+
70
+ def test_source_identity_and_retained_slice_boundaries(self):
71
+ 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['gate_instructions'][0]['index'],58312);self.assertEqual(self.r['gate_instructions'][-1]['index'],58475);self.assertEqual(self.r['candidate_instructions'][-1]['index'],58789);self.assertEqual(self.r['candidate_loop_instructions'][-1]['index'],59636)
72
+
73
+ def test_partial_candidate_and_native_scope_are_explicit(self):
74
+ for text in ['no original executable/full QVM/native collision/physics/rendering executes','Candidates are local outputs, not committed PS velocity','no complete slide return','Impact initial0 in chains is supplied']:self.assertIn(text,self.r['limitations'])
75
+
76
+
77
+ if __name__=='__main__':unittest.main()