nmarshall commited on
Commit
a297661
·
1 Parent(s): 51cf791

qvm: slide prefix

Browse files
docs/ASSET_PIPELINE_TODO.md CHANGED
@@ -278,3 +278,5 @@ Research progress: [QVM traversal-query recovery](research/QVM_TRAVERSAL_QUERY.m
278
  Research progress: [QVM side-hull and conditional gravity recovery](research/QVM_CLEARANCE_MODE.md) completes bounded RE-465–467:56335 geometry/acceptance, derived query/main Boolean chains and41768 tail/main handoffs. RE-464/468 retain actual collision/native effects/producers/full state/runtime/platform work; broad game/rendering milestones remain open.
279
 
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.
 
 
 
278
  Research progress: [QVM side-hull and conditional gravity recovery](research/QVM_CLEARANCE_MODE.md) completes bounded RE-465–467:56335 geometry/acceptance, derived query/main Boolean chains and41768 tail/main handoffs. RE-464/468 retain actual collision/native effects/producers/full state/runtime/platform work; broad game/rendering milestones remain open.
279
 
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.
docs/FINDINGS.md CHANGED
@@ -564,3 +564,9 @@ Bounded qagame paths recover bomb-plant/inactivity correction requests, direct f
564
  **F-212 — Step wrapper fallback:**60091 bypasses stepping on zero first-slide return, otherwise evaluates59710 and restores the saved first-attempt position/velocity plus flag32 on failure. DeltaZ>2 writes truncated frame+48; all sampled branches return1. Full slide/state semantics remain open. [STEPWRAP-001](research/QVM_STEP_COLLISION.md).
565
 
566
  **F-213 — Concrete flag restoration path:**14 mode compositions apply evaluated60091/59710 effects before41768 gravity. Conditional step/wrapper stores can restore flag32 after its prefix clear, and a negative gravity-tail Z clears192/timer while preserving32. Triggering slide/native effects and full simulation remain open. [STEPCHAIN-001](research/QVM_STEP_COLLISION.md).
 
 
 
 
 
 
 
564
  **F-212 — Step wrapper fallback:**60091 bypasses stepping on zero first-slide return, otherwise evaluates59710 and restores the saved first-attempt position/velocity plus flag32 on failure. DeltaZ>2 writes truncated frame+48; all sampled branches return1. Full slide/state semantics remain open. [STEPWRAP-001](research/QVM_STEP_COLLISION.md).
565
 
566
  **F-213 — Concrete flag restoration path:**14 mode compositions apply evaluated60091/59710 effects before41768 gravity. Conditional step/wrapper stores can restore flag32 after its prefix clear, and a negative gravity-tail Z clears192/timer while preserving32. Triggering slide/native effects and full simulation remain open. [STEPCHAIN-001](research/QVM_STEP_COLLISION.md).
567
+
568
+ **F-214 — Slide gravity/plane preparation:**57714 uses midpoint Z for tracing, retains end Z in both end/saved vectors, conditionally clips working velocity against a supplied ground normal and seeds ground/current-direction planes. Native sqrt and legal plane/configuration inputs remain supplied. [SLIDE-001](research/QVM_SLIDE_PREFIX.md).
569
+
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).
docs/PROVISIONAL_TODO.md CHANGED
@@ -590,3 +590,5 @@ Research progress: [QVM traversal-query recovery](research/QVM_TRAVERSAL_QUERY.m
590
  Research progress: [QVM side-hull and conditional gravity recovery](research/QVM_CLEARANCE_MODE.md) completes bounded RE-465–467:56335 geometry/acceptance, derived query/main Boolean chains and41768 tail/main handoffs. RE-464/468 retain actual collision/native effects/producers/full state/runtime/platform work; broad game/rendering milestones remain open.
591
 
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.
 
 
 
590
  Research progress: [QVM side-hull and conditional gravity recovery](research/QVM_CLEARANCE_MODE.md) completes bounded RE-465–467:56335 geometry/acceptance, derived query/main Boolean chains and41768 tail/main handoffs. RE-464/468 retain actual collision/native effects/producers/full state/runtime/platform work; broad game/rendering milestones remain open.
591
 
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.
docs/RESEARCH_LEDGER.md CHANGED
@@ -355,3 +355,7 @@ Completed bounded RE-465–467 with `analyze_qvm_clearance_mode.py`: verifies co
355
  ## 2026-10-16 — Game-QVM step traces, fallback wrapper and gravity-mode composition
356
 
357
  Completed bounded RE-469–471 with `analyze_qvm_step_collision.py`: verifies complete59710/60091 partitions,117 step probes,20 wrapper probes and14 compositions through41768. STEPTRACE-001/STEPWRAP-001/STEPCHAIN-001/F-211–213 recover literal18 origin raise/upper-bound shrink, supplied slide call, down trace/solid-word rejection, sign-biased finite normal clipping, restored-bound overlap request and partial state retained on failure;60091 first-slide zero-return bypass, actual evaluated step/fallback copies/flag32, strict deltaZ>2 then integer truncation/frame+48 store and sampled return1 policy. Disjoint local frames preserve original and first-attempt snapshots. Step child mutations and actual result replace the wrapper call-result local before caller continuation. Composed60091/59710 state now feeds41768 gravity directly for selected fixtures, identifying conditional source stores that restore32 after its prefix clear; later negative Z clears192/timer and preserves32. Native trace records and57714 return/origin/velocity are supplied with other effects omitted; trace consistency/contact legality, full slide/global/entity/collision/runtime behavior remain open. No original executable/full QVM/native collision/physics/rendering executes. Eight independent tests verify117 step outputs/clipping/geometry/bounds/requests, failure-without-rollback/fraction bypass,20 wrapper requests/fallback/height records,14 mode compositions/flag restoration, provenance/complete partitions/literal height and scope. All551 tests pass. Direct clearance-mode report regenerates byte-identically; new report reproduces twice byte-identically (548975 bytes). Storage/filter setup, documentation links and whitespace checks pass. No assets or existing analyzer/evaluator code changed. RE-468 remains open; RE-472 tracks57714's full slide/contact/plane/gravity loop, native collision ABI/legal records, frame+48 consumers, other callers/flag producers and complete environment/mode/shared state/gameplay/macOS/Linux/Rust/Bevy/Solari validation. Other actions/modes/suffix/contact/resource/playback/packet/entity/player/snapshot/rendering milestones remain open.
 
 
 
 
 
355
  ## 2026-10-16 — Game-QVM step traces, fallback wrapper and gravity-mode composition
356
 
357
  Completed bounded RE-469–471 with `analyze_qvm_step_collision.py`: verifies complete59710/60091 partitions,117 step probes,20 wrapper probes and14 compositions through41768. STEPTRACE-001/STEPWRAP-001/STEPCHAIN-001/F-211–213 recover literal18 origin raise/upper-bound shrink, supplied slide call, down trace/solid-word rejection, sign-biased finite normal clipping, restored-bound overlap request and partial state retained on failure;60091 first-slide zero-return bypass, actual evaluated step/fallback copies/flag32, strict deltaZ>2 then integer truncation/frame+48 store and sampled return1 policy. Disjoint local frames preserve original and first-attempt snapshots. Step child mutations and actual result replace the wrapper call-result local before caller continuation. Composed60091/59710 state now feeds41768 gravity directly for selected fixtures, identifying conditional source stores that restore32 after its prefix clear; later negative Z clears192/timer and preserves32. Native trace records and57714 return/origin/velocity are supplied with other effects omitted; trace consistency/contact legality, full slide/global/entity/collision/runtime behavior remain open. No original executable/full QVM/native collision/physics/rendering executes. Eight independent tests verify117 step outputs/clipping/geometry/bounds/requests, failure-without-rollback/fraction bypass,20 wrapper requests/fallback/height records,14 mode compositions/flag restoration, provenance/complete partitions/literal height and scope. All551 tests pass. Direct clearance-mode report regenerates byte-identically; new report reproduces twice byte-identically (548975 bytes). Storage/filter setup, documentation links and whitespace checks pass. No assets or existing analyzer/evaluator code changed. RE-468 remains open; RE-472 tracks57714's full slide/contact/plane/gravity loop, native collision ABI/legal records, frame+48 consumers, other callers/flag producers and complete environment/mode/shared state/gameplay/macOS/Linux/Rust/Bevy/Solari validation. Other actions/modes/suffix/contact/resource/playback/packet/entity/player/snapshot/rendering milestones remain open.
358
+
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.
docs/REVERSE_ENGINEERING_TODO.md CHANGED
@@ -572,3 +572,8 @@ Purpose: turn the supplied installation into an evidence-backed specification of
572
  - [x] RE-470 Recover60091 first-attempt bypass, evaluated step fallback/flag stores, strict height threshold/truncation and return policy ([STEPWRAP-001](research/QVM_STEP_COLLISION.md)).
573
  - [x] RE-471 Compose evaluated60091/59710 PS/frame effects inside41768 prefix/gravity tail, explaining concrete conditional flag32 restoration ([STEPCHAIN-001](research/QVM_STEP_COLLISION.md)).
574
  - [ ] RE-472 Recover57714 full slide/contact/plane/gravity loop, native trace/collision ABI/legal records, frame+48 consumers, other step callers/flag producers and complete mode/environment/shared state; validate gameplay/macOS/Linux/Rust/Bevy/Solari. Continue other actions/modes/suffix/contact/resource/playback/packet/entity/player/snapshot/rendering work.
 
 
 
 
 
 
572
  - [x] RE-470 Recover60091 first-attempt bypass, evaluated step fallback/flag stores, strict height threshold/truncation and return policy ([STEPWRAP-001](research/QVM_STEP_COLLISION.md)).
573
  - [x] RE-471 Compose evaluated60091/59710 PS/frame effects inside41768 prefix/gravity tail, explaining concrete conditional flag32 restoration ([STEPCHAIN-001](research/QVM_STEP_COLLISION.md)).
574
  - [ ] RE-472 Recover57714 full slide/contact/plane/gravity loop, native trace/collision ABI/legal records, frame+48 consumers, other step callers/flag producers and complete mode/environment/shared state; validate gameplay/macOS/Linux/Rust/Bevy/Solari. Continue other actions/modes/suffix/contact/resource/playback/packet/entity/player/snapshot/rendering work.
575
+
576
+ - [x] RE-473 Recover57714 gravity midpoint/end/saved vectors, optional ground clip and initialized plane/direction/time/bump state ([SLIDE-001](research/QVM_SLIDE_PREFIX.md)).
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.
docs/research/QVM_SLIDE_PREFIX.md ADDED
@@ -0,0 +1,58 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ # Game-QVM slide preparation, first trace and clear caller chain
2
+
3
+ RE-473–475 / F-214–216. [qvm-slide-prefix.json](qvm-slide-prefix.json) retains complete helper57714 instructions,384 first-trace exit probes,122 partial contact probes and20 clear slide/wrapper/mode chains. Reproduce with `python3 scripts/analyze_qvm_slide_prefix.py`; verify with `python3 scripts/test_qvm_slide_prefix.py`.
4
+
5
+ This follows [step/wrapper recovery](QVM_STEP_COLLISION.md), which supplied57714 outputs. The new batch evaluates its preparation and complete first-trace fraction1/allsolid branches. Contact cases stop at instruction58312, **before plane solving and subsequent bumps**, with no claimed function return. A supplied finite sqrt and native trace record remain external. No original executable, full QVM, native collision, physics or rendering executes. Native trace legality/ABI, real configuration/state producers and full movement/runtime compatibility remain open.
6
+
7
+ ## SLIDE-001 — Gravity midpoint, ground clipping and seed planes (RE-473)
8
+
9
+ Helper57714 starts with zero auxiliary/end-velocity words, a four-bump limit, and a saved copy of PS velocity. With a nonzero incoming gravity argument:
10
+
11
+ 1. Copy initial velocity into an end-velocity vector and subtract rounded float(gravity PS+48) × float timestep global35023928 from its Z.
12
+ 2. Replace working PS velocity Z with the rounded midpoint of original and end Z.
13
+ 3. Replace the saved copy's Z with end Z as well. The saved vector is therefore not an untouched original velocity in gravity cases.
14
+ 4. If global35023940 is nonzero, clip the working velocity against supplied normal globals35023968/35023972/35023976 using the previously observed sign-dependent biased dot constants1.00100005/0.999001026.
15
+
16
+ All float operations round to binary32. With gravity disabled, the end vector stays zero, working velocity is unchanged, and no ground clip occurs here. A nonzero plane word still adds the supplied normal as a seed plane regardless of gravity.
17
+
18
+ The helper then measures the working full3D norm through encoded target-107 and appends the working unit direction to the seed-plane array; zero norm appends a zero vector. Initial plane count is1 without the supplied ground plane or2 with it. It initializes remaining time from the float timestep and enters bump0.
19
+
20
+ Independent tests verify every working/end/saved vector, root argument/return, normalized seed direction and plane count. Probes combine gravity0/1, plane0/1, four velocities, two ground normals, timestep0/0.016/0.125 and movement timer0/16. Ground normal/legal-domain and native sqrt behavior are supplied, not established by these synthetic finite cases.
21
+
22
+ ## SLIDE-002 — First trace exits and partial contact policy (RE-474)
23
+
24
+ The first endpoint is `origin + working_velocity × remaining_time`, rounded per component. The callback at frame+224 receives a local56-byte trace destination, PS origin pointer, frame min/max pointers, local endpoint, PS+140 and frame mask+28. In these fixtures bounds are min(-15,-15,-24)/max(15,15,45), identity7 and mask0x2010001.
25
+
26
+ The analyzer supplies one trace record. Its end position follows an explicit interpolation model from origin toward that requested endpoint; this is not native trace generation. Complete exit branches are:
27
+
28
+ | Supplied trace | Evaluated effects |
29
+ | --- | --- |
30
+ | allsolid nonzero | Set working velocity Z=0, retain X/Y and origin; return1 immediately |
31
+ | allsolid zero, fraction1 | Copy supplied trace end to origin, leave bump loop before bump count increments, then execute common exit; return0 |
32
+
33
+ Allsolid bypasses the common exit: it does not apply the end-velocity copy, movement-timer restoration or flag2048 cleanup. For the clear path, gravity copies the end vector into PS velocity; a nonzero PS+16 movement timer then copies the saved vector over it. In these first-clear cases those two gravity vectors have identical values, but the source ordering matters for future contact cases. The clear exit clears flag2048 because no qualifying contact was recorded. It does not clear the stored normal words or alter the movement timer itself.
34
+
35
+ For fraction0/0.5 contact probes, positive fraction copies the supplied trace endpoint to origin. The first-contact prefix sets PS flag2048 and stores hit normal X/Y at PS+96/+100 only when all conditions hold:
36
+
37
+ - Hit normal Z is strictly between binary32-0.3 and+0.3.
38
+ - The gravity argument is nonzero.
39
+ - Trace surface word at offset44 has neither bit2 nor4.
40
+ - Trace contents word at offset48 lacks33554432.
41
+
42
+ It records39253(trace entity at offset52); this batch evaluates that recovered touch-list helper, including the1022 sentinel versus accepted1023. It then computes rounded remaining time `time - time × fraction`. Contact cases stop at58312 before plane-count checks/clipping, so the reported words describe this prefix, not final slide results. Their `completed` field is false and `return_word` is null.
43
+
44
+ The122 contact fixtures isolate exact±0.3 boundaries, inside values, gravity/surface/contents gates, zero/half fraction and entity sentinels. Some supplied normals intentionally isolate flag arithmetic rather than represent legal unit contact normals. Plane solving, repeated contacts, real contact callbacks and later flag/timer behavior remain unresolved.
45
+
46
+ ## SLIDECHAIN-001 — Evaluated clear slide through60091 and41768 (RE-475)
47
+
48
+ Twenty chains execute41768's flag32-clear prefix,60091's original-state snapshots and first57714 request, the actual evaluated clear-slide path,60091's zero-result bypass, and41768's gravity tail. Shared selected PS/frame words and separate synthetic local frames preserve caller data. The actual slide return replaces the wrapper's call-result local before its branch; no supplied slide return/position/velocity is used in this clear path.
49
+
50
+ As recovered above, the slide returns0 after its first clear trace, so60091 returns1 without requesting59710. Its origin/velocity/flags match the evaluated slide result. The later41768 tail applies its own gravity subtraction to that resulting velocity and clears mask192/movement timer only if the new Z is negative. Thus the slide end vector already reflects one source gravity subtraction before the separate mode tail applies another; this describes the conditional source sequence, not an asserted gameplay bug or complete physics implementation.
51
+
52
+ Fixtures vary initial vertical velocity-1/0/12.8/30/100, movement timer0/16 and initial mode flags160/2208. The mode prefix removes32, and the clear slide removes2048 if present. Supplied plane word0, gravity800, timestep0.016 and a native first-clear record define this chain's domain. The surrounding main loop, contact/step branches, entity/global/native effects and exceptional/alias/legal domains remain uncomposed.
53
+
54
+ ## Validation and next tasks
55
+
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.
docs/research/QVM_STEP_COLLISION.md CHANGED
@@ -45,3 +45,5 @@ The composition checks first-slide bypass, early/final step failure, step-slide
45
  Eight independent tests verify117 step returns/clip words/bounds/trace geometry and ABI requests; failure-without-rollback/fraction bypass;20 wrapper request/fallback/height results;14 wrapper-to-mode outputs and actual flag32 restoration; source hash/complete partitions/literal height policy and explicit limitations. Direct clearance-mode report regenerates unchanged; the new report reproduces twice byte-identically. Full-suite/storage/link/whitespace outcomes are recorded in the ledger.
46
 
47
  RE-468 remains open for the missing physical slide effects. RE-472 tracks helper57714's complete slide/contact/plane/gravity loop, native trace/collision ABI and legal records, frame+48 meaning/consumers, other step callers/arguments/flag producers, full mode/environment/shared-state composition and gameplay/macOS/Linux/Rust/Bevy/Solari validation. Other actions/modes/suffix, contact/resource/playback/packet/entity/player/snapshot/rendering milestones remain open.
 
 
 
45
  Eight independent tests verify117 step returns/clip words/bounds/trace geometry and ABI requests; failure-without-rollback/fraction bypass;20 wrapper request/fallback/height results;14 wrapper-to-mode outputs and actual flag32 restoration; source hash/complete partitions/literal height policy and explicit limitations. Direct clearance-mode report regenerates unchanged; the new report reproduces twice byte-identically. Full-suite/storage/link/whitespace outcomes are recorded in the ledger.
46
 
47
  RE-468 remains open for the missing physical slide effects. RE-472 tracks helper57714's complete slide/contact/plane/gravity loop, native trace/collision ABI and legal records, frame+48 meaning/consumers, other step callers/arguments/flag producers, full mode/environment/shared-state composition and gameplay/macOS/Linux/Rust/Bevy/Solari validation. Other actions/modes/suffix, contact/resource/playback/packet/entity/player/snapshot/rendering milestones remain open.
48
+
49
+ Follow-up: [slide57714 prefix recovery](QVM_SLIDE_PREFIX.md) replaces supplied first-slide results in20 clear-path wrapper/mode chains. First gravity/plane preparation, clear/allsolid exits and partial touch/contact handling are evaluated; later plane solving, repeated bumps and actual native collision remain open (RE-473–476).
docs/research/README.md CHANGED
@@ -191,3 +191,5 @@ The extension collector adds five focused tests for native tail calls, command-r
191
  [QVM side-hull acceptance and conditional gravity mode](QVM_CLEARANCE_MODE.md) adds RE-465–467. Reproduce with `python3 scripts/analyze_qvm_clearance_mode.py`; check with `python3 scripts/test_qvm_clearance_mode.py`. Side-helper QVM logic is evaluated with supplied native traces/roots;60091 remains omitted and mode tail inputs supplied.
192
 
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.
 
 
 
191
  [QVM side-hull acceptance and conditional gravity mode](QVM_CLEARANCE_MODE.md) adds RE-465–467. Reproduce with `python3 scripts/analyze_qvm_clearance_mode.py`; check with `python3 scripts/test_qvm_clearance_mode.py`. Side-helper QVM logic is evaluated with supplied native traces/roots;60091 remains omitted and mode tail inputs supplied.
192
 
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.
docs/research/qvm-slide-prefix.json ADDED
The diff for this file is too large to render. See raw diff
 
scripts/analyze_qvm_slide_prefix.py ADDED
@@ -0,0 +1,60 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ #!/usr/bin/env python3
2
+ """Slide gravity/plane prefix, first trace exits/contact prefix and clear caller chain."""
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,number,f
9
+ from analyze_qvm_traversal_query import root_word
10
+ from analyze_qvm_animation_contacts import evaluate as contact_effect
11
+ from analyze_vm_extensions import verified
12
+
13
+ LOCAL=0x55000000
14
+ WRAP=0x56000000
15
+ MODE=0x57000000
16
+
17
+
18
+ def vec(m,p):return [m[p+i*4]&0xffffffff for i in range(3)]
19
+ def put(m,p,v):
20
+ for i,x in enumerate(v):m[p+i*4]=word(x)
21
+
22
+
23
+ def seed(velocity=(10,20,30),flags=2080,timer=0,dt=.016,gravity=800,plane=0,normal=(0,0,1)):
24
+ m={35024032:FRAME,FRAME:PS,PS+12:flags,PS+16:timer,PS+48:gravity,PS+96:0x12345678,PS+100:0x23456789,PS+140:7,35023928:word(dt),35023940:plane,FRAME+224:-25,FRAME+28:0x2010001,FRAME+52:0,FRAME+48:99};put(m,PS+20,[100,200,300]);put(m,PS+32,velocity);put(m,FRAME+184,[-15,-15,-24,15,15,45]);put(m,35023968,normal)
25
+ for i in range(32):m[FRAME+56+i*4]=-777
26
+ return m
27
+
28
+
29
+ def slide_effect(ins,m,gravity_on=1,solid=0,fraction=1,hit_normal=(0,0,1),surface=0,contents=0,entity=8):
30
+ m=dict(m);initial={'velocity_float_words':vec(m,PS+32),'origin_float_words':vec(m,PS+20),'flags_word':m[PS+12],'timer_word':m[PS+16],'gravity_word':m[PS+48],'dt_float_word':m[35023928]&0xffffffff,'plane_word':m[35023940],'normal_float_words':vec(m,35023968)};m[LOCAL+352]=gravity_on;pc=57715;root=None;prefix=None;request=None;record=None;calls=[];trace=[];child=None;completed=False;returned=None
31
+ while True:
32
+ t=trace_slice(ins,57715,59708,m,{},resume_at=pc,stop_targets=[s for s in [57936,58086,58200,58302,58312] if s!=pc],local_base=LOCAL,call_results={57979:root or 0},halt_on_leave=True,capture_stack=True,limit=1024);m=t['memory'];trace+=t['trace'];calls+=t['calls'];pc=t['stop']
33
+ if pc==57936:root=root_word([number(x) for x in vec(m,PS+32)])
34
+ if pc==58086:
35
+ count=m[LOCAL+144];prefix={'working_velocity_float_words':vec(m,PS+32),'end_velocity_float_words':vec(m,LOCAL+148),'saved_velocity_float_words':vec(m,LOCAL+252),'plane_count_word':count,'plane_float_words':[vec(m,LOCAL+36+i*12) for i in range(count)],'time_left_float_word':m[LOCAL+224]&0xffffffff,'supplied_sqrt_word':root}
36
+ if pc==58200:
37
+ c=t['calls'][-1];a=c['args'];start=vec(m,a[12]);end=vec(m,a[24]);point=[word(f(number(x)+f(f(number(y)-number(x))*f(fraction)))) for x,y in zip(start,end)];record=[solid,0,word(fraction),*point,*map(word,hit_normal),0,0,surface,contents,entity]
38
+ for i,v in enumerate(record):m[LOCAL+164+i*4]=v
39
+ request={'instruction':c['instruction'],'args':a,'start_float_words':start,'end_float_words':end,'bounds_float_words':vec(m,a[16])+vec(m,a[20])}
40
+ if pc==58302:
41
+ c=t['calls'][-1];effect=contact_effect(ins,39253,c['args'][8],m);m=effect['memory'];child={'calls':effect['calls'],**trace_fields(effect,False)}
42
+ if pc==58312:break
43
+ if t['trace'] and ins[t['trace'][-1]]['opcode']=='LEAVE':completed=True;returned=t['stack'][-1];break
44
+ p={'initial':initial,'gravity_on_word':gravity_on,'prefix':prefix,'trace_request':request,'supplied_trace_words':record,'completed':completed,'return_word':returned,'stop_instruction':pc,'result_origin_float_words':vec(m,PS+20),'result_velocity_float_words':vec(m,PS+32),'result_flags_word':m[PS+12]&0xffffffff,'result_normal_xy_words':[m[PS+96]&0xffffffff,m[PS+100]&0xffffffff],'result_timer_word':m[PS+16],'remaining_time_float_word':m[LOCAL+224]&0xffffffff,'contact_count_word':m[FRAME+52],'contact_first_slots':[m[FRAME+56],m[FRAME+60]],'contact_child':child,'calls':calls,**trace_fields({'trace':trace},False)};return m,p
45
+
46
+
47
+ def caller_chain(ins,vz,timer,flags):
48
+ m=seed(velocity=(10,20,vz),timer=timer,flags=flags);pre=trace_slice(ins,41769,41846,m,{},stop_targets=[41789],local_base=MODE);wrap_pre=trace_slice(ins,60092,60213,pre['memory'],{92:1},stop_targets=[60113],local_base=WRAP);m,slide=slide_effect(ins,wrap_pre['memory']);assert slide['completed'] and slide['return_word']==0;m[WRAP+48]=slide['return_word'];wrap_post=trace_slice(ins,60092,60213,m,{},resume_at=60113,local_base=WRAP,halt_on_leave=True,capture_stack=True);m=wrap_post['memory'];wrapper={'return_word':wrap_post['stack'][-1],'result_origin_float_words':vec(m,PS+20),'result_velocity_float_words':vec(m,PS+32),'result_flags_word':m[PS+12]&0xffffffff,'calls':wrap_pre['calls']+wrap_post['calls']};post=trace_slice(ins,41769,41846,m,{},resume_at=41789,local_base=MODE)
49
+ return {'initial_mode_flags_word':flags,'slide_probe':slide,'wrapper_probe':wrapper,'mode_result_velocity_float_words':vec(post['memory'],PS+32),'mode_result_flags_word':post['memory'][PS+12]&0xffffffff,'mode_result_timer_word':post['memory'][PS+16],'mode_calls':pre['calls']+post['calls']}
50
+
51
+
52
+ def main():
53
+ 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)
54
+ probes=[slide_effect(ins,seed(velocity=v,plane=p,normal=n,dt=dt,timer=t),gravity_on=g,solid=s)[1] for g,p,v,n,dt,t,s in itertools.product([0,1],[0,1],[(0,0,0),(10,20,30),(100,0,0),(0,0,-10)],[(0,0,1),(.6,0,.8)],[0,.016,.125],[0,16],[0,1])]
55
+ contacts=[slide_effect(ins,seed(flags=0),gravity_on=g,fraction=fr,hit_normal=(1,2,z),surface=s,contents=c)[1] for g,z,s,c,fr in itertools.product([0,1],[-.3,-.2999,0,.2999,.3],[0,2,4],[0,33554432],[0,.5])]
56
+ contacts += [slide_effect(ins,seed(flags=0),fraction=.5,entity=e,hit_normal=(1,2,0))[1] for e in [1022,1023]]
57
+ out={'source':q['source'],'sha256':q['sha256'],'slide_instructions':ins[57714:59710],'first_trace_probes':probes,'contact_prefix_probes':contacts,'clear_caller_chains':[caller_chain(ins,*v) for v in itertools.product([-1,0,12.8,30,100],[0,16],[160,2208])],'limitations':'Bounded finite synthetic shipped-QVM evaluation only; no original executable/full QVM/native collision/physics/rendering executes. Native sqrt and one trace record are supplied; clear trace endpoint follows a supplied interpolation model. Complete first-trace fraction1/allsolid paths are evaluated; contacts stop at58312 before plane solving/remaining bumps and have no claimed return. Recovered39253 contact registration is evaluated. Ground normal/basis/PS/frame/configuration are supplied; trace legality/normal domains/native effects are unverified. Clear slide outputs compose into actual60091 zero-result bypass and41768 tail with disjoint frames, not the step/contact branches or complete main loop. Full multi-plane collision, contact/entity/global effects, exceptional/alias/control-state/gameplay/macOS/Linux/Rust/Bevy/Solari remain open.'};write_json(Path('docs/research/qvm-slide-prefix.json'),out);print('Recovered gravity/planes, first trace exits/contact prefix and clear wrapper/mode chain')
58
+
59
+
60
+ if __name__=='__main__':main()
scripts/test_qvm_slide_prefix.py ADDED
@@ -0,0 +1,78 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ #!/usr/bin/env python3
2
+ """Independent gravity/plane, first trace/contact-prefix and clear-chain checks."""
3
+ import hashlib,json,math
4
+ from pathlib import Path
5
+ import unittest
6
+ from test_qvm_ground import word,n,f
7
+
8
+
9
+ def prefix_oracle(p):
10
+ a=p['initial'];original=list(map(n,a['velocity_float_words']));working=original[:];end=[0,0,0];saved=original[:];gravity=p['gravity_on_word'];normal=list(map(n,a['normal_float_words']));dt=n(a['dt_float_word'])
11
+ if gravity:
12
+ end=original[:];end[2]=f(original[2]-f(f(a['gravity_word'])*dt));saved[2]=end[2];working[2]=f(f(original[2]+end[2])*.5)
13
+ if a['plane_word']:
14
+ dot=f(f(f(working[0]*normal[0])+f(working[1]*normal[1]))+f(working[2]*normal[2]));biased=f(dot*n(1065361605 if dot<0 else 1065336456));working=[f(x-f(y*biased)) for x,y in zip(working,normal)]
15
+ square=f(f(f(working[0]**2)+f(working[1]**2))+f(working[2]**2));root=f(math.sqrt(square));direction=[f(v*f(1/root)) for v in working] if root else [0,0,0];planes=([a['normal_float_words']] if a['plane_word'] else [])+[list(map(word,direction))]
16
+ return list(map(word,working)),list(map(word,end)),list(map(word,saved)),planes,word(root),word(square)
17
+
18
+
19
+ def result_oracle(p):
20
+ a=p['initial'];working,end,saved,_,_,_=prefix_oracle(p);record=p['supplied_trace_words'];flags=a['flags_word'];origin=a['origin_float_words'];normalxy=[0x12345678,0x23456789];contacts=0;slots=[-777,-777]
21
+ if record[0]:return origin,[working[0],working[1],0],flags,normalxy,contacts,slots,a['dt_float_word']
22
+ if n(record[2])>0:origin=record[3:6]
23
+ if n(record[2])==1:
24
+ velocity=end if p['gravity_on_word'] else working
25
+ if a['timer_word']:velocity=saved
26
+ return origin,velocity,flags&~2048,normalxy,contacts,slots,a['dt_float_word']
27
+ hit_z=n(record[8]);eligible=n(word(-.3))<hit_z<n(word(.3)) and p['gravity_on_word'] and not record[11]&6 and not record[12]&33554432
28
+ if eligible:flags|=2048;normalxy=record[6:8]
29
+ if record[13]!=1022:contacts=1;slots=[record[13],-777]
30
+ dt=n(a['dt_float_word']);remaining=word(f(dt-f(dt*n(record[2]))));return origin,working,flags,normalxy,contacts,slots,remaining
31
+
32
+
33
+ class QvmSlidePrefixTests(unittest.TestCase):
34
+ @classmethod
35
+ def setUpClass(cls):cls.r=json.loads(Path('docs/research/qvm-slide-prefix.json').read_text())
36
+
37
+ def test_all_gravity_midpoint_ground_clip_and_seeded_planes(self):
38
+ self.assertEqual(len(self.r['first_trace_probes']),384)
39
+ for p in self.r['first_trace_probes']+self.r['contact_prefix_probes']:
40
+ working,end,saved,planes,root,square=prefix_oracle(p);q=p['prefix'];self.assertEqual([q['working_velocity_float_words'],q['end_velocity_float_words'],q['saved_velocity_float_words'],q['plane_float_words'],q['supplied_sqrt_word']],[working,end,saved,planes,root]);self.assertEqual(q['plane_count_word'],len(planes));self.assertEqual(p['calls'][0],{'instruction':57979,'target':-107,'args':{'8':square}})
41
+
42
+ def test_first_trace_endpoint_arguments_and_supplied_record(self):
43
+ for p in self.r['first_trace_probes']+self.r['contact_prefix_probes']:
44
+ a=p['initial'];q=p['trace_request'];working=prefix_oracle(p)[0];dt=n(a['dt_float_word']);self.assertEqual(q['start_float_words'],a['origin_float_words']);self.assertEqual(q['end_float_words'],[word(f(n(x)+f(n(v)*dt))) for x,v in zip(a['origin_float_words'],working)]);self.assertEqual(q['args'],{'8':0x550000a4,'12':0x10014,'16':0x300b8,'20':0x300c4,'24':0x550000e4,'28':7,'32':0x2010001});self.assertEqual(q['bounds_float_words'],list(map(word,[-15,-15,-24,15,15,45])))
45
+
46
+ def test_complete_clear_and_allsolid_exits_and_suffix_bypass(self):
47
+ for p in self.r['first_trace_probes']:
48
+ expected=result_oracle(p);self.assertTrue(p['completed']);self.assertEqual(p['return_word'],1 if p['supplied_trace_words'][0] else 0);self.assertEqual([p['result_origin_float_words'],p['result_velocity_float_words'],p['result_flags_word'],p['result_normal_xy_words'],p['contact_count_word'],p['contact_first_slots'],p['remaining_time_float_word']],list(expected));self.assertEqual(p['result_timer_word'],p['initial']['timer_word']);self.assertEqual([c['target'] for c in p['calls']],[-107,-25])
49
+ self.assertTrue(any(p['supplied_trace_words'][0] and p['result_flags_word']&2048 for p in self.r['first_trace_probes']))
50
+ self.assertTrue(any(not p['supplied_trace_words'][0] and not p['result_flags_word']&2048 for p in self.r['first_trace_probes']))
51
+
52
+ def test_partial_contact_flag_masks_normal_stores_and_remaining_time(self):
53
+ self.assertEqual(len(self.r['contact_prefix_probes']),122)
54
+ for p in self.r['contact_prefix_probes']:
55
+ self.assertFalse(p['completed']);self.assertIsNone(p['return_word']);self.assertEqual(p['stop_instruction'],58312);self.assertEqual([p['result_origin_float_words'],p['result_velocity_float_words'],p['result_flags_word'],p['result_normal_xy_words'],p['contact_count_word'],p['contact_first_slots'],p['remaining_time_float_word']],list(result_oracle(p)));self.assertEqual([c['target'] for c in p['calls']],[-107,-25,39253]);self.assertIsNotNone(p['contact_child'])
56
+ self.assertTrue(any(p['result_flags_word']&2048 for p in self.r['contact_prefix_probes']))
57
+
58
+ def test_strict_normal_z_thresholds_and_contact_entity_sentinel(self):
59
+ rows=self.r['contact_prefix_probes']
60
+ for p in rows:
61
+ if p['supplied_trace_words'][8] in [word(-.3),word(.3)]:self.assertEqual(p['result_flags_word']&2048,0)
62
+ for entity,count in [(1022,0),(1023,1)]:self.assertTrue(any(p['supplied_trace_words'][13]==entity and p['contact_count_word']==count for p in rows))
63
+
64
+ def test_clear_slide_composes_into_wrapper_bypass_and_real_mode_gravity(self):
65
+ self.assertEqual(len(self.r['clear_caller_chains']),20)
66
+ for p in self.r['clear_caller_chains']:
67
+ s=p['slide_probe'];w=p['wrapper_probe'];origin,velocity,flags,_,_,_,_=result_oracle(s);self.assertEqual(s['initial']['flags_word'],p['initial_mode_flags_word']&~32);self.assertEqual(s['return_word'],0);self.assertEqual(w['return_word'],1);self.assertEqual([w['result_origin_float_words'],w['result_velocity_float_words'],w['result_flags_word']],[origin,velocity,flags]);self.assertEqual(w['calls'],[{'instruction':60111,'target':57714,'args':{'8':1}}]);a=s['initial'];vz=f(n(velocity[2])-f(f(a['gravity_word'])*n(a['dt_float_word'])));timer=a['timer_word']
68
+ if vz<0:flags&=~192;timer=0
69
+ self.assertEqual(p['mode_result_velocity_float_words'],[velocity[0],velocity[1],word(vz)]);self.assertEqual([p['mode_result_flags_word'],p['mode_result_timer_word']],[flags,timer]);self.assertEqual(p['mode_calls'],[{'instruction':41787,'target':60091,'args':{'8':1}}])
70
+
71
+ def test_verified_source_and_complete_slide_partition(self):
72
+ 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['slide_instructions'][0]['index'],57714);self.assertEqual(self.r['slide_instructions'][-1]['index'],59709)
73
+
74
+ def test_partial_contact_native_and_full_runtime_limits_explicit(self):
75
+ for text in ['no original executable/full QVM/native collision/physics/rendering executes','contacts stop at58312 before plane solving/remaining bumps','have no claimed return','not the step/contact branches or complete main loop']:self.assertIn(text,self.r['limitations'])
76
+
77
+
78
+ if __name__=='__main__':unittest.main()