qvm: main environment
Browse files- docs/ASSET_PIPELINE_TODO.md +3 -0
- docs/FINDINGS.md +7 -0
- docs/PROVISIONAL_TODO.md +3 -0
- docs/RESEARCH_LEDGER.md +4 -0
- docs/REVERSE_ENGINEERING_TODO.md +6 -0
- docs/research/QVM_GROUND.md +3 -0
- docs/research/QVM_MAIN_CONTACT.md +3 -0
- docs/research/QVM_MAIN_ENVIRONMENT.md +37 -0
- docs/research/README.md +3 -0
- docs/research/qvm-main-environment.json +0 -0
- scripts/analyze_qvm_main_contact.py +12 -7
- scripts/analyze_qvm_main_environment.py +56 -0
- scripts/test_qvm_main_environment.py +91 -0
- scripts/test_qvm_slide_repeated.py +1 -1
docs/ASSET_PIPELINE_TODO.md
CHANGED
|
@@ -297,3 +297,6 @@ Research progress: [QVM contact slide caller composition](research/QVM_CONTACT_C
|
|
| 297 |
|
| 298 |
|
| 299 |
Research progress: [QVM clock/main/contact composition](research/QVM_MAIN_CONTACT.md) completes bounded RE-497–499: actual clock/timer state, exact-expiry source routing and selected contact chain back to main requests across48 fixtures. Native responses/other main effects remain supplied or omitted. RE-496/500 retain missing producers/native collision/full main/scheduler/runtime/platform work; broad game/rendering milestones remain open.
|
|
|
|
|
|
|
|
|
|
|
|
| 297 |
|
| 298 |
|
| 299 |
Research progress: [QVM clock/main/contact composition](research/QVM_MAIN_CONTACT.md) completes bounded RE-497–499: actual clock/timer state, exact-expiry source routing and selected contact chain back to main requests across48 fixtures. Native responses/other main effects remain supplied or omitted. RE-496/500 retain missing producers/native collision/full main/scheduler/runtime/platform work; broad game/rendering milestones remain open.
|
| 300 |
+
|
| 301 |
+
|
| 302 |
+
Research progress: [QVM pre/post main environment](research/QVM_MAIN_ENVIRONMENT.md) completes bounded RE-501–503: actual content/ground producers, ground touches/derived routing, normal-to-motion and post-resampling state across48 fixtures. Native responses/other callee effects remain supplied or omitted. RE-500/504 retain posture/ground callees/native collision/action/other modes/full main/runtime/platform work; broad game/rendering milestones remain open.
|
docs/FINDINGS.md
CHANGED
|
@@ -611,3 +611,10 @@ Bounded qagame paths recover bomb-plant/inactivity correction requests, direct f
|
|
| 611 |
**F-233 — Actual timer routing:**36 fixtures select41768; exact-expiry controls route six to43626 and six to55465. Alternative requests receive no41768 effects. Other environment/action/query/mode effects remain omitted. [MAINCONTACT-002](research/QVM_MAIN_CONTACT.md).
|
| 612 |
|
| 613 |
**F-234 — Selected main-to-contact chain:**actual aged main state flows into41768/60091/59710 and54 evaluated slide children, then back to bounded main suffix requests. Native responses remain supplied; full53418/scheduler/suffix/environment/native gameplay is unverified. [MAINCONTACT-003](research/QVM_MAIN_CONTACT.md).
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 611 |
**F-233 — Actual timer routing:**36 fixtures select41768; exact-expiry controls route six to43626 and six to55465. Alternative requests receive no41768 effects. Other environment/action/query/mode effects remain omitted. [MAINCONTACT-002](research/QVM_MAIN_CONTACT.md).
|
| 612 |
|
| 613 |
**F-234 — Selected main-to-contact chain:**actual aged main state flows into41768/60091/59710 and54 evaluated slide children, then back to bounded main suffix requests. Native responses remain supplied; full53418/scheduler/suffix/environment/native gameplay is unverified. [MAINCONTACT-003](research/QVM_MAIN_CONTACT.md).
|
| 614 |
+
|
| 615 |
+
|
| 616 |
+
**F-235 — Actual main content producers:**96 evaluated47217 invocations sample current pre/post movement positions and produce real shared contents/level words from supplied native responses. Main retains the first level separately while the final level is resampled. [MAINENV-001](research/QVM_MAIN_ENVIRONMENT.md).
|
| 617 |
+
|
| 618 |
+
**F-236 — Main ground producers:**96 evaluated46773 classifications copy actual supplied trace records, derive plane/walk/normal/surface/ground/flag/timer state and execute terminal touch registration. Pre-ground and real timer outputs drive source routing across four selected mode families; non41768 modes remain omitted. [MAINENV-002](research/QVM_MAIN_ENVIRONMENT.md).
|
| 619 |
+
|
| 620 |
+
**F-237 — Environment-to-motion-to-environment:**derived ground normals feed27 actual slide children in18 reached41768 fixtures. Post-movement ground classification runs before content resampling and therefore consumes the first level; its state changes survive into final output. Native collision/full main/platform runtime remain unverified. [MAINENV-003](research/QVM_MAIN_ENVIRONMENT.md).
|
docs/PROVISIONAL_TODO.md
CHANGED
|
@@ -609,3 +609,6 @@ Research progress: [QVM contact slide caller composition](research/QVM_CONTACT_C
|
|
| 609 |
|
| 610 |
|
| 611 |
Research progress: [QVM clock/main/contact composition](research/QVM_MAIN_CONTACT.md) completes bounded RE-497–499: actual clock/timer state, exact-expiry source routing and selected contact chain back to main requests across48 fixtures. Native responses/other main effects remain supplied or omitted. RE-496/500 retain missing producers/native collision/full main/scheduler/runtime/platform work; broad game/rendering milestones remain open.
|
|
|
|
|
|
|
|
|
|
|
|
| 609 |
|
| 610 |
|
| 611 |
Research progress: [QVM clock/main/contact composition](research/QVM_MAIN_CONTACT.md) completes bounded RE-497–499: actual clock/timer state, exact-expiry source routing and selected contact chain back to main requests across48 fixtures. Native responses/other main effects remain supplied or omitted. RE-496/500 retain missing producers/native collision/full main/scheduler/runtime/platform work; broad game/rendering milestones remain open.
|
| 612 |
+
|
| 613 |
+
|
| 614 |
+
Research progress: [QVM pre/post main environment](research/QVM_MAIN_ENVIRONMENT.md) completes bounded RE-501–503: actual content/ground producers, ground touches/derived routing, normal-to-motion and post-resampling state across48 fixtures. Native responses/other callee effects remain supplied or omitted. RE-500/504 retain posture/ground callees/native collision/action/other modes/full main/runtime/platform work; broad game/rendering milestones remain open.
|
docs/RESEARCH_LEDGER.md
CHANGED
|
@@ -383,3 +383,7 @@ Completed bounded RE-493–495 with `analyze_qvm_contact_callers.py`:22 mode/wra
|
|
| 383 |
## 2026-10-16 — Game-QVM actual clock, main timer routing and selected contact-mode state
|
| 384 |
|
| 385 |
Completed bounded RE-497–499 with `analyze_qvm_main_contact.py`:48 fixtures evaluate clock53723–53788 without reseeding source vectors, main54244–54472, actual53048 timer effects and selected41768/60091/59710/both57714 children in shared memory with disjoint live helper frames. MAINCONTACT-001–003/F-232–234 recover requested-time versus clamped1–200 interval, exact source vector snapshots/fraction, timer-derived equality-expiry routing and actual mode state back into bounded main suffix requests.36 fixtures select/evaluate41768 with54 slide child invocations; six route to43626 and six to55465 without attaching prepared contact-mode effects. Other main/query/alternative-mode/suffix/native requests retain omitted effects, query return0 and supplied environment/type/state inputs. Intervening clock-to-main instructions/earlier dispatch/scheduler/full53418 remain omitted. Initial impact0 and native roots/ordered slide/down/overlap trace records/interpolation remain supplied; native collision/legal domains/runtime unverified. No original executable/full QVM/native collision/physics/rendering executes. Caller composition now accepts optional initial/result memory with unchanged default report. Eight independent tests verify48 clock/timer/route cases and exact expiry,54 slide children and step/wrapper outputs, actual clock-fraction gravity/flag/timer tail, shared-state transfers/main call ordering/saved level, provenance and scope. All607 tests pass. Prior contact-caller report regenerates byte-identically; new report reproduces twice byte-identically (1107356 bytes). Storage/filter setup, documentation links and whitespace checks pass. No assets or shared instruction evaluator changed. RE-496 remains open for its broader scope; RE-500 tracks missing environment/view/basis/action/alternative-mode/suffix/native effects, trace/BSP collision/legal domains/impact reset-consumers, complete main/scheduler state and macOS/Linux Rust/Bevy/Solari gameplay. Broad game/assets/rendering/protocol milestones remain open.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 383 |
## 2026-10-16 — Game-QVM actual clock, main timer routing and selected contact-mode state
|
| 384 |
|
| 385 |
Completed bounded RE-497–499 with `analyze_qvm_main_contact.py`:48 fixtures evaluate clock53723–53788 without reseeding source vectors, main54244–54472, actual53048 timer effects and selected41768/60091/59710/both57714 children in shared memory with disjoint live helper frames. MAINCONTACT-001–003/F-232–234 recover requested-time versus clamped1–200 interval, exact source vector snapshots/fraction, timer-derived equality-expiry routing and actual mode state back into bounded main suffix requests.36 fixtures select/evaluate41768 with54 slide child invocations; six route to43626 and six to55465 without attaching prepared contact-mode effects. Other main/query/alternative-mode/suffix/native requests retain omitted effects, query return0 and supplied environment/type/state inputs. Intervening clock-to-main instructions/earlier dispatch/scheduler/full53418 remain omitted. Initial impact0 and native roots/ordered slide/down/overlap trace records/interpolation remain supplied; native collision/legal domains/runtime unverified. No original executable/full QVM/native collision/physics/rendering executes. Caller composition now accepts optional initial/result memory with unchanged default report. Eight independent tests verify48 clock/timer/route cases and exact expiry,54 slide children and step/wrapper outputs, actual clock-fraction gravity/flag/timer tail, shared-state transfers/main call ordering/saved level, provenance and scope. All607 tests pass. Prior contact-caller report regenerates byte-identically; new report reproduces twice byte-identically (1107356 bytes). Storage/filter setup, documentation links and whitespace checks pass. No assets or shared instruction evaluator changed. RE-496 remains open for its broader scope; RE-500 tracks missing environment/view/basis/action/alternative-mode/suffix/native effects, trace/BSP collision/legal domains/impact reset-consumers, complete main/scheduler state and macOS/Linux Rust/Bevy/Solari gameplay. Broad game/assets/rendering/protocol milestones remain open.
|
| 386 |
+
|
| 387 |
+
## 2026-10-16 — Game-QVM actual main content/ground producers and post-movement resampling
|
| 388 |
+
|
| 389 |
+
Completed bounded RE-501–503 with `analyze_qvm_main_environment.py`:48 main fixtures evaluate96 actual47217 content invocations and96 actual46773 ground classifications at reached pre/post movement boundaries. MAINENV-001–003/F-235–237 recover current-position ordered point coordinates/short-circuit contents/level, full56-byte ground trace copies/normal/surface/plane/walk/ground/flag/timer producers, terminal39253 touch effects, derived main selection and source-order post-ground then content resampling. Modes:18 evaluated41768 fixtures with27 actual slide children,14 recorded41848,8 recorded43626,8 recorded42838. Steep normal now reaches actual ground clipping/plane seeds rather than a seeded Z normal. Final content levels use reversed supplied response patterns while saved first level remains unchanged; post-ground consumes the first level before replacement and its state changes survive mode output. Native point returns/ground-slide-down-overlap records/roots/interpolation remain supplied; posture/bounds/viewheight, other ground recovery/lost/landing/animation/event/logging effects, action/query/alternative-mode/other suffix effects, legal/native collision/full main/scheduler/platform runtime remain unverified or omitted. No original executable/full QVM/native collision/physics/rendering executes. Main bridge accepts optional initial memory/reached environment effects; original no-hook report remains byte-identical. Independent slide oracle accepts entry ground normal with unchanged default. Eight independent tests verify every content/ground state/coordinate/copy/touch result, boundary order/timer handoff/route counts,27 child predictions and step/wrapper/mode outputs, final versus saved level/current positions, source hash and scope. All615 tests pass. Prior main-contact report regenerates byte-identically; new report reproduces twice byte-identically (1212879 bytes). Storage/filter setup, documentation links and whitespace checks pass. No assets or shared instruction evaluator changed. RE-500 remains open for broader scope; RE-504 tracks actual posture producers, remaining ground callees/native trace-content-BSP collision/legal domains/action/alternative-mode/suffix/impact effects and complete main/scheduler composition with macOS/Linux Rust/Bevy/Solari gameplay. Broad game/assets/rendering/protocol milestones remain open.
|
docs/REVERSE_ENGINEERING_TODO.md
CHANGED
|
@@ -612,3 +612,9 @@ Purpose: turn the supplied installation into an evidence-backed specification of
|
|
| 612 |
- [x] RE-498 Evaluate timer-derived main mode selection with exact-expiry controls and no unrequested contact-mode effects ([MAINCONTACT-002](research/QVM_MAIN_CONTACT.md)).
|
| 613 |
- [x] RE-499 Evaluate selected41768/60091/59710/both57714 children in actual main shared state, then resume bounded main suffix requests ([MAINCONTACT-003](research/QVM_MAIN_CONTACT.md)).
|
| 614 |
- [ ] RE-500 Recover missing main environment/view/basis/action/alternative-mode/suffix/native effects and trace/BSP collision/legal domains/impact reset-consumers; compose complete main/scheduler shared state and validate macOS/Linux Rust/Bevy/Solari gameplay. Continue broader game/assets/rendering/protocol work.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 612 |
- [x] RE-498 Evaluate timer-derived main mode selection with exact-expiry controls and no unrequested contact-mode effects ([MAINCONTACT-002](research/QVM_MAIN_CONTACT.md)).
|
| 613 |
- [x] RE-499 Evaluate selected41768/60091/59710/both57714 children in actual main shared state, then resume bounded main suffix requests ([MAINCONTACT-003](research/QVM_MAIN_CONTACT.md)).
|
| 614 |
- [ ] RE-500 Recover missing main environment/view/basis/action/alternative-mode/suffix/native effects and trace/BSP collision/legal domains/impact reset-consumers; compose complete main/scheduler shared state and validate macOS/Linux Rust/Bevy/Solari gameplay. Continue broader game/assets/rendering/protocol work.
|
| 615 |
+
|
| 616 |
+
|
| 617 |
+
- [x] RE-501 Evaluate both actual47217 main content invocations with current positions, ordered samples, short circuit and saved-versus-final level ([MAINENV-001](research/QVM_MAIN_ENVIRONMENT.md)).
|
| 618 |
+
- [x] RE-502 Evaluate both46773 ground classifiers/trace-global producers and terminal39253 touches in actual shared main state ([MAINENV-002](research/QVM_MAIN_ENVIRONMENT.md)).
|
| 619 |
+
- [x] RE-503 Carry derived ground plane/normal/level/flags/timer through reached contact children and post-ground/content resampling in source order ([MAINENV-003](research/QVM_MAIN_ENVIRONMENT.md)).
|
| 620 |
+
- [ ] RE-504 Compose actual posture/bounds/viewheight, ground recovery/lost/landing/animation/event callees, native trace/content/BSP collision/side effects/legal domains and action/alternative-mode/suffix effects/impact consumers; complete main/scheduler state and macOS/Linux Rust/Bevy/Solari gameplay. Continue broader game/assets/rendering/protocol work.
|
docs/research/QVM_GROUND.md
CHANGED
|
@@ -69,3 +69,6 @@ RE-436 remains open for complete policy/producers/runtime work. RE-440 must reco
|
|
| 69 |
Follow-up: [posture recovery](QVM_POSTURE.md) identifies helper47422 bounds/height producers and transfers selected outputs into content and ground fixtures (RE-441–443). Optional explicit bounds in the ground analyzer preserve default report bytes. Actual native collision and complete state composition remain open under RE-440/444.
|
| 70 |
|
| 71 |
Follow-up: [contact-list recovery](QVM_ANIMATION_CONTACTS.md) explains helper39253 sentinel/capacity/dedup/append behavior for bounded synthetic lists (RE-447). Native contact generation and complete ground/list/entity effects remain open.
|
|
|
|
|
|
|
|
|
|
|
|
| 69 |
Follow-up: [posture recovery](QVM_POSTURE.md) identifies helper47422 bounds/height producers and transfers selected outputs into content and ground fixtures (RE-441–443). Optional explicit bounds in the ground analyzer preserve default report bytes. Actual native collision and complete state composition remain open under RE-440/444.
|
| 70 |
|
| 71 |
Follow-up: [contact-list recovery](QVM_ANIMATION_CONTACTS.md) explains helper39253 sentinel/capacity/dedup/append behavior for bounded synthetic lists (RE-447). Native contact generation and complete ground/list/entity effects remain open.
|
| 72 |
+
|
| 73 |
+
|
| 74 |
+
Follow-up: [main environment shared-state recovery](QVM_MAIN_ENVIRONMENT.md) completes bounded RE-501–503, evaluating these content/ground bodies before and after selected movement with actual current vectors, terminal touch effects and derived mode inputs. Native/callee/legal/full runtime limits remain explicit.
|
docs/research/QVM_MAIN_CONTACT.md
CHANGED
|
@@ -33,3 +33,6 @@ The evaluated mode state returns to the original main frame, which continues the
|
|
| 33 |
Eight tests verify all48 clock/timer/selection cases, exact expiry,54 independent slide-child predictions, step/wrapper results, clock-fraction gravity tail, shared-state handoffs, main call order, saved level, source provenance and explicit omitted effects. The clock/timer/routing and motion formulas are independent of the shared instruction evaluator; prior child formulas are reused with actual entry snapshots. Reproducibility/full-suite/storage/link/whitespace results are recorded in the ledger.
|
| 34 |
|
| 35 |
Main coverage is54244–54472 plus the separate clock prefix, not complete53418. Earlier dispatch/scheduler, intervening environment/view/basis/action helpers, alternative modes, suffix/native effects, legal normal/state/record domains and collision-derived traces remain open. RE-496 retains its broader scope. RE-500 tracks those missing producers/callees and native trace/BSP collision, impact reset/consumers, complete main/scheduler shared state and macOS/Linux Rust/Bevy/Solari gameplay. Other game/assets/rendering/protocol milestones remain open.
|
|
|
|
|
|
|
|
|
|
|
|
| 33 |
Eight tests verify all48 clock/timer/selection cases, exact expiry,54 independent slide-child predictions, step/wrapper results, clock-fraction gravity tail, shared-state handoffs, main call order, saved level, source provenance and explicit omitted effects. The clock/timer/routing and motion formulas are independent of the shared instruction evaluator; prior child formulas are reused with actual entry snapshots. Reproducibility/full-suite/storage/link/whitespace results are recorded in the ledger.
|
| 34 |
|
| 35 |
Main coverage is54244–54472 plus the separate clock prefix, not complete53418. Earlier dispatch/scheduler, intervening environment/view/basis/action helpers, alternative modes, suffix/native effects, legal normal/state/record domains and collision-derived traces remain open. RE-496 retains its broader scope. RE-500 tracks those missing producers/callees and native trace/BSP collision, impact reset/consumers, complete main/scheduler shared state and macOS/Linux Rust/Bevy/Solari gameplay. Other game/assets/rendering/protocol milestones remain open.
|
| 36 |
+
|
| 37 |
+
|
| 38 |
+
Follow-up: [main environment producer composition](QVM_MAIN_ENVIRONMENT.md) completes bounded RE-501–503, evaluating pre/post content and ground bodies at actual main boundaries and carrying derived normals/state into selected motion. This report retains its original seeded-environment scope; native/full main/runtime work remains open under RE-500/504.
|
docs/research/QVM_MAIN_ENVIRONMENT.md
ADDED
|
@@ -0,0 +1,37 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
# QVM pre/post movement content and ground producers
|
| 2 |
+
|
| 3 |
+
This batch completes bounded RE-501–503 / F-235–237 by evaluating the main path's actual content and ground helpers before and after movement. It extends [clock/main/contact composition](QVM_MAIN_CONTACT.md), replacing its seeded level/walk/plane/normal inputs at the reached environment boundaries. Native content/trace responses and omitted helper effects remain explicit.
|
| 4 |
+
|
| 5 |
+
Reproduce with `python3 scripts/analyze_qvm_main_environment.py`; validate with `python3 scripts/test_qvm_main_environment.py`. The [machine report](qvm-main-environment.json) retains source identity, all four environment invocations per fixture, native requests/records, state snapshots, evaluated touch summaries and selected movement children. No original executable, full QVM, native collision, physics or rendering executes.
|
| 6 |
+
|
| 7 |
+
## MAINENV-001 — Actual content sampling on both sides of movement (RE-501)
|
| 8 |
+
|
| 9 |
+
Forty-eight fixtures vary first content level0–3, flat/steep/air ground record, timer0/16 and prepared clear/contact slide pattern. Source47217 runs at both reached main call boundaries. Supplied native point-content responses use a prefix of8 words followed by zeros to exercise mask56 short-circuiting. The after-movement response pattern reverses the first level to3-first_level; these are ordered supplied callback values, not geometry-derived content volumes.
|
| 10 |
+
|
| 11 |
+
Each invocation builds its actual sample positions from current PS origin and supplied viewheight38. The lower point uses ordered binary32 `originZ + (-24) + 1`; subsequent points use the source integer half-height and full height. X/Y follow current origin. The source retains the first raw masked response as contents and produces level0–3. Tests verify every sample coordinate, request count/arguments, short circuit and resulting state.
|
| 12 |
+
|
| 13 |
+
The first invocation completes before main stores level into global35024028. The second resamples after movement and after the second ground helper, so final level differs from the saved first level in all fixtures. Changed sample positions follow the actual evaluated movement origin; they are not copied from the earlier isolated-content fixture.
|
| 14 |
+
|
| 15 |
+
## MAINENV-002 — Actual ground trace/classification and producer handoff (RE-502)
|
| 16 |
+
|
| 17 |
+
Both46773 invocations run against current origin/velocity, content level, flags, timer, bounds and old ground field. Their supplied native trace records come from actual request start/end pointers: the source probes0.25 downward, and fixtures supply a half-fraction flat Z normal, half-fraction steep normal(0.8660254,0,0.5), or fraction1 air record. The full56-byte record is copied into the actual trace globals, including plane normal and surface word2.
|
| 18 |
+
|
| 19 |
+
Flat accepted ground with level<=2 establishes plane/walk, clears the source flag masks and can clear128/timer before timer aging and routing. Steep normal or level>2 establishes a plane without walk acceptance. Fraction1 clears plane/walk and requests ground-lost handling whose effects remain omitted. The source classifier also retains its upward-kick branch; tests predict its full three-component velocity/normal dot even though these fixture paths do not reach that branch.
|
| 20 |
+
|
| 21 |
+
Ground39253 touch registration is evaluated when requested. Its terminal call occurs immediately before the classifier's return boundary; applying the child there preserves observable caller order. Landing/event, animation, ground-lost, recovery and logging helper effects remain omitted. No allsolid recovery fixture is included. Supplied initial old-ground7 and clock snapshot Z velocity0 avoid an invented landing-timer producer.
|
| 22 |
+
|
| 23 |
+
The pre-ground outputs now drive actual timer aging, main selection and reached contact children. Across48 fixtures the source selects41768 eighteen times,41848 fourteen times,43626 eight times and42838 eight times. Only41768 is evaluated here; the alternative mode requests retain omitted effects. Thus flat-ground acceptance, steep-plane policy, level priority and timer expiry all participate in selection rather than being independent route seeds.
|
| 24 |
+
|
| 25 |
+
## MAINENV-003 — Ground normal into motion and post-movement resampling (RE-503)
|
| 26 |
+
|
| 27 |
+
The eighteen selected41768 fixtures evaluate27 slide children through actual mode/step/wrapper state. Their ground-plane indicator and normal come from the first evaluated46773, including the steep normal rather than an assumed Z normal. The independent slide oracle now accepts a ground-normal entry value while preserving its old default. Actual shared touch state, content level, flags and timer are retained through these children.
|
| 28 |
+
|
| 29 |
+
After selected movement or an omitted alternative-mode request, main evaluates46773 again, then47217 again, in that order. The second ground classification therefore consumes the **first content level**, before the final content resample replaces it. It uses a supplied flat record at the current origin, evaluates requested touch registration and can change flags/timer/ground/walk after the mode tail. The final record is not simply the earlier mode snapshot: environment changes remain live.
|
| 30 |
+
|
| 31 |
+
The main bridge exposes optional reached environment effects and initial memory. Its original no-hook report remains byte-identical. Other posture/action/query/alternative-mode/suffix effects remain omitted; query returns0. Bounds, viewheight, initial state and native trace/content/root responses are supplied. Collision-derived records, callback side effects, legal/reachable normal/state domains, complete53418/scheduler and platform gameplay remain unverified.
|
| 32 |
+
|
| 33 |
+
## Validation and remaining tasks
|
| 34 |
+
|
| 35 |
+
Eight tests check all96 content invocations and96 ground classifications, ordered coordinates/short circuits/full trace copies, exact environment state and ground-touch policy, four-boundary call order, live timer handoff and route counts,27 independent slide-child predictions, step/wrapper/mode outputs, post-ground flag/timer changes, saved-versus-final level and changed positions, source hash and supplied/omitted-effect scope. Reproducibility/full-suite/storage/link/whitespace results are recorded in the ledger.
|
| 36 |
+
|
| 37 |
+
RE-500 remains open for its broader missing-producer/native/main/runtime scope. RE-504 tracks actual47422 posture/bounds/viewheight producers at main boundaries, ground recovery/ground-lost/landing/animation/event callees, native trace/content/BSP collision and side effects/legal domains, action/alternative-mode/suffix effects, impact reset/consumers and complete main/scheduler composition; validate macOS/Linux Rust/Bevy/Solari gameplay. Other game/assets/rendering/protocol milestones remain open.
|
docs/research/README.md
CHANGED
|
@@ -210,3 +210,6 @@ The extension collector adds five focused tests for native tail calls, command-r
|
|
| 210 |
|
| 211 |
|
| 212 |
[QVM clock/main routing into selected contact mode](QVM_MAIN_CONTACT.md) adds RE-497–499. Reproduce with `python3 scripts/analyze_qvm_main_contact.py`; check with `python3 scripts/test_qvm_main_contact.py`. Actual clock/timer and selected contact children share state; intervening/other main/native effects remain omitted or supplied.
|
|
|
|
|
|
|
|
|
|
|
|
| 210 |
|
| 211 |
|
| 212 |
[QVM clock/main routing into selected contact mode](QVM_MAIN_CONTACT.md) adds RE-497–499. Reproduce with `python3 scripts/analyze_qvm_main_contact.py`; check with `python3 scripts/test_qvm_main_contact.py`. Actual clock/timer and selected contact children share state; intervening/other main/native effects remain omitted or supplied.
|
| 213 |
+
|
| 214 |
+
|
| 215 |
+
[QVM pre/post main content and ground](QVM_MAIN_ENVIRONMENT.md) adds RE-501–503. Reproduce with `python3 scripts/analyze_qvm_main_environment.py`; check with `python3 scripts/test_qvm_main_environment.py`. Actual environment producers feed reached contact children and post-resampling; native records and remaining main/callee effects stay supplied or omitted.
|
docs/research/qvm-main-environment.json
ADDED
|
The diff for this file is too large to render.
See raw diff
|
|
|
scripts/analyze_qvm_main_contact.py
CHANGED
|
@@ -15,21 +15,26 @@ from analyze_vm_extensions import verified
|
|
| 15 |
def timer_state(m):return {'flags':m[PS+12]&0xffffffff,'movement':m[PS+16],'leg':m[PS+72],'torso':m[PS+80],'dt':m[35023932]}
|
| 16 |
|
| 17 |
|
| 18 |
-
def probe(ins,requested,timer,flags,pattern):
|
| 19 |
-
m=seed(flags=flags,timer=timer);m.update({PS:1000,FRAME+4:requested,PS+4:0,PS+72:200,PS+80:17,PS+220:0,FRAME+212:0,35023936:1,35024000:word(0)});initial=snapshot(m)
|
| 20 |
clock=trace_slice(ins,53723,53789,m,{104:FRAME},local_base=MAIN_LOCAL);m=clock['memory'];clock_report={'old_time':1000,'requested':requested,'result_time':m[PS],'elapsed':m[35023932],'ps_elapsed':m[PS+284],'float_dt':m[35023928]&0xffffffff,'origin_snapshot':vec(m,35024004),'velocity_snapshot':vec(m,35024016),**trace_fields(clock,False)}
|
| 21 |
-
pc=54244;calls=[];trace=[];timers=None;mode=None;at_mode=None;policy='overlap_solid' if requested==1016 else 'clear'
|
| 22 |
while True:
|
| 23 |
-
t=trace_slice(ins,54244,54473,m,{104:FRAME},resume_at=pc,stop_targets=[s for s in [54274,54382,54438] if s!=pc],local_base=MAIN_LOCAL,call_results={54313:0},limit=1024);m=t['memory'];calls+=t['calls'];trace+=t['trace'];pc=t['stop']
|
| 24 |
-
if pc
|
|
|
|
|
|
|
| 25 |
before=timer_state(m);tt=trace_slice(ins,53049,53184,m,{},local_base=TIMER_LOCAL);m=tt['memory'];timers={'before':before,'after':timer_state(m),'calls':tt['calls'],**trace_fields(tt,False)}
|
| 26 |
elif pc==54382:
|
| 27 |
at_mode=snapshot(m);m,mode=composition(ins,pattern,m[PS+16],policy,'clear',initial_memory=m,return_memory=True)
|
| 28 |
elif pc==54438:
|
| 29 |
-
after_dispatch=snapshot(m)
|
|
|
|
| 30 |
else:raise AssertionError('Unexpected main slice stop')
|
| 31 |
selected=[c['target'] for c in calls if c['target'] in MODES];assert len(selected)==1
|
| 32 |
-
|
|
|
|
|
|
|
| 33 |
|
| 34 |
|
| 35 |
def main():
|
|
|
|
| 15 |
def timer_state(m):return {'flags':m[PS+12]&0xffffffff,'movement':m[PS+16],'leg':m[PS+72],'torso':m[PS+80],'dt':m[35023932]}
|
| 16 |
|
| 17 |
|
| 18 |
+
def probe(ins,requested,timer,flags,pattern,initial_memory=None,environment_effect=None):
|
| 19 |
+
m=seed(flags=flags,timer=timer) if initial_memory is None else dict(initial_memory);m.update({PS:1000,FRAME+4:requested,PS+4:0,PS+72:200,PS+80:17,PS+220:0,FRAME+212:0,35023936:1,35024000:word(0)});initial=snapshot(m)
|
| 20 |
clock=trace_slice(ins,53723,53789,m,{104:FRAME},local_base=MAIN_LOCAL);m=clock['memory'];clock_report={'old_time':1000,'requested':requested,'result_time':m[PS],'elapsed':m[35023932],'ps_elapsed':m[PS+284],'float_dt':m[35023928]&0xffffffff,'origin_snapshot':vec(m,35024004),'velocity_snapshot':vec(m,35024016),**trace_fields(clock,False)}
|
| 21 |
+
pc=54244;calls=[];trace=[];timers=None;mode=None;at_mode=None;environment=[];policy='overlap_solid' if requested==1016 else 'clear'
|
| 22 |
while True:
|
| 23 |
+
t=trace_slice(ins,54244,54473,m,{104:FRAME},resume_at=pc,stop_targets=[s for s in ([54274,54382,54438]+([54247,54260,54441,54444] if environment_effect else [])) if s!=pc],local_base=MAIN_LOCAL,call_results={54313:0},limit=1024);m=t['memory'];calls+=t['calls'];trace+=t['trace'];pc=t['stop']
|
| 24 |
+
if environment_effect and pc in [54247,54260,54441,54444]:
|
| 25 |
+
target=47217 if pc in [54247,54444] else 46773;phase='before' if pc<54438 else 'after';m,effect=environment_effect(ins,m,target,phase);environment.append(effect)
|
| 26 |
+
elif pc==54274:
|
| 27 |
before=timer_state(m);tt=trace_slice(ins,53049,53184,m,{},local_base=TIMER_LOCAL);m=tt['memory'];timers={'before':before,'after':timer_state(m),'calls':tt['calls'],**trace_fields(tt,False)}
|
| 28 |
elif pc==54382:
|
| 29 |
at_mode=snapshot(m);m,mode=composition(ins,pattern,m[PS+16],policy,'clear',initial_memory=m,return_memory=True)
|
| 30 |
elif pc==54438:
|
| 31 |
+
after_dispatch=snapshot(m)
|
| 32 |
+
elif pc==54473:break
|
| 33 |
else:raise AssertionError('Unexpected main slice stop')
|
| 34 |
selected=[c['target'] for c in calls if c['target'] in MODES];assert len(selected)==1
|
| 35 |
+
report={'requested':requested,'initial':initial,'pattern':pattern,'policy':policy,'clock':clock_report,'timer':timers,'selected_mode':selected[0],'at_mode':at_mode,'mode':mode,'after_dispatch':after_dispatch,'final':snapshot(m),'final_timers':timer_state(m),'final_time':m[PS],'saved_level':m[35024028],'calls':calls,**trace_fields({'trace':trace},False)}
|
| 36 |
+
if environment_effect:report['environment']=environment
|
| 37 |
+
return report
|
| 38 |
|
| 39 |
|
| 40 |
def main():
|
scripts/analyze_qvm_main_environment.py
ADDED
|
@@ -0,0 +1,56 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
#!/usr/bin/env python3
|
| 2 |
+
"""Main content/ground producers before and after selected movement."""
|
| 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,FRAME,word,number,f
|
| 9 |
+
from analyze_qvm_slide_prefix import seed,vec
|
| 10 |
+
from analyze_qvm_ground import POINT_LOCAL,GROUND_LOCAL
|
| 11 |
+
from analyze_qvm_main_contact import probe
|
| 12 |
+
from analyze_qvm_animation_contacts import evaluate as contact_effect
|
| 13 |
+
from analyze_vm_extensions import verified
|
| 14 |
+
|
| 15 |
+
|
| 16 |
+
def env_state(m):
|
| 17 |
+
return {'origin':vec(m,PS+20),'velocity':vec(m,PS+32),'height':m[PS+164],'contents':m.get(FRAME+208),'level':m[FRAME+212],'plane':m[35023940],'walk':m[35023936],'normal':vec(m,35023968),'surface':m.get(35023988),'ground':m[PS+68],'flags':m[PS+12]&0xffffffff,'timer':m[PS+16],'touches':[m[FRAME+56+4*i] for i in range(m[FRAME+52])]}
|
| 18 |
+
|
| 19 |
+
|
| 20 |
+
def contents(ins,m,returns):
|
| 21 |
+
before=env_state(m);pc=47218;trace=[];calls=[];points=[]
|
| 22 |
+
while True:
|
| 23 |
+
t=trace_slice(ins,47218,47420,m,{},resume_at=pc,stop_targets=[s for s in [47279,47353,47404] if s!=pc],local_base=POINT_LOCAL,call_results={47277:returns[0],47351:returns[1],47402:returns[2]},limit=512);m=t['memory'];trace+=t['trace'];calls+=t['calls'];pc=t['stop']
|
| 24 |
+
if t['calls']:points.append(vec(m,POINT_LOCAL+16))
|
| 25 |
+
if pc==47420:break
|
| 26 |
+
return m,{'target':47217,'before':before,'returns':returns,'points':points,'after':env_state(m),'calls':calls,**trace_fields({'trace':trace},False)}
|
| 27 |
+
|
| 28 |
+
|
| 29 |
+
def ground(ins,m,kind):
|
| 30 |
+
before=env_state(m);normal={'flat':(0,0,1),'steep':(.8660254,0,.5),'air':(0,0,1)}[kind];fraction=1 if kind=='air' else .5
|
| 31 |
+
pre=trace_slice(ins,46774,47215,m,{},stop_targets=[46847],local_base=GROUND_LOCAL,limit=512);m=pre['memory'];c=pre['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=[0,0,word(fraction),*point,*map(word,normal),0,0,2,0,8]
|
| 32 |
+
for i,v in enumerate(record):m[a[8]+i*4]=v
|
| 33 |
+
post=trace_slice(ins,46774,47215,m,{},resume_at=46847,byte_memory={FRAME+25:1},local_base=GROUND_LOCAL,limit=1024);m=post['memory'];touch=None
|
| 34 |
+
for call in post['calls']:
|
| 35 |
+
if call['target']==39253:
|
| 36 |
+
child=contact_effect(ins,39253,call['args'][8],m);m=child['memory'];touch={'calls':child['calls'],**trace_fields(child,False)}
|
| 37 |
+
return m,{'target':46773,'kind':kind,'before':before,'request':c,'start':start,'end':end,'record':record,'copied_trace':[m[35023944+i*4]&0xffffffff for i in range(14)],'after':env_state(m),'touch_child':touch,'calls':pre['calls']+post['calls'],**trace_fields({'trace':pre['trace']+post['trace']},False)}
|
| 38 |
+
|
| 39 |
+
|
| 40 |
+
def case(ins,level,kind,timer,pattern):
|
| 41 |
+
values=[8]*level+[0]*(3-level);after=[8]*(3-level)+[0]*level
|
| 42 |
+
def effect(ins,m,target,phase):
|
| 43 |
+
if target==47217:m,r=contents(ins,m,values if phase=='before' else after)
|
| 44 |
+
else:m,r=ground(ins,m,kind if phase=='before' else 'flat')
|
| 45 |
+
r['phase']=phase;return m,r
|
| 46 |
+
m=seed(velocity=(10,20,0),flags=2208,timer=timer);m.update({PS+164:38,PS+68:7,FRAME+228:-26,FRAME+208:99,FRAME+32:0,35023988:0})
|
| 47 |
+
p=probe(ins,1016,timer,2208,pattern,initial_memory=m,environment_effect=effect);p.update({'initial_level_pattern':level,'ground_pattern':kind});return p
|
| 48 |
+
|
| 49 |
+
|
| 50 |
+
def main():
|
| 51 |
+
q=json.loads(Path('docs/research/qvm/qagame.json').read_text());_,ins=decode(verified(Path(q['source']['member']['output']).read_bytes(),q['sha256']))
|
| 52 |
+
probes=[case(ins,*v) for v in itertools.product(range(4),['flat','steep','air'],[0,16],['clear','contacts'])]
|
| 53 |
+
out={'source':q['source'],'sha256':q['sha256'],'probes':probes,'limitations':'Bounded finite shipped-QVM main environment composition; no original executable/full QVM/native collision/physics/rendering executes. Both actual47217 content and46773 ground bodies run at reached pre/post main boundaries with actual shared origin/velocity/flags/timers/level/trace globals. Point contents and ground/slide/down/overlap trace records/native roots/interpolation are supplied, not collision-derived. Ground39253 touch registration executes; other ground recovery/ground-lost/landing/animation/event effects remain omitted. Posture47422/action/query/alternative modes/other suffix native effects remain omitted, query return0; bounds/viewheight/initial state are supplied. Clock/timer and selected contact callers evaluate as before; intervening clock-to-main/complete53418/scheduler remain omitted. Legal domains/native collision/full macOS/Linux/Rust/Bevy/Solari gameplay remain open.'};write_json(Path('docs/research/qvm-main-environment.json'),out);print('Composed main pre/post content and ground producers')
|
| 54 |
+
|
| 55 |
+
|
| 56 |
+
if __name__=='__main__':main()
|
scripts/test_qvm_main_environment.py
ADDED
|
@@ -0,0 +1,91 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
#!/usr/bin/env python3
|
| 2 |
+
"""Independent environment state formulas and reached main/child bridges."""
|
| 3 |
+
import hashlib,json
|
| 4 |
+
from pathlib import Path
|
| 5 |
+
import unittest
|
| 6 |
+
from test_qvm_ground import f,n,word
|
| 7 |
+
from test_qvm_slide_planes import dot
|
| 8 |
+
from test_qvm_slide_repeated import oracle as slide_oracle
|
| 9 |
+
from test_qvm_contact_callers import expected_step
|
| 10 |
+
from test_qvm_timers_dispatch import timer_oracle
|
| 11 |
+
|
| 12 |
+
|
| 13 |
+
def ground_expected(e):
|
| 14 |
+
s=dict(e['before']);s['touches']=s['touches'][:];r=e['record'];s.update({'normal':r[6:9],'surface':r[11]});calls=[-25]
|
| 15 |
+
if n(r[2])==1:s.update({'plane':0,'walk':0});calls.append(46527)
|
| 16 |
+
elif n(s['velocity'][2])>0 and dot(list(map(n,s['velocity'])),list(map(n,r[6:9])))>10:s.update({'plane':0,'walk':0,'ground':1023,'flags':s['flags']^4096});calls.append(39525)
|
| 17 |
+
elif n(r[8])<n(1060320051) or s['level']>2:s.update({'plane':1,'walk':0,'ground':1023})
|
| 18 |
+
else:
|
| 19 |
+
s.update({'plane':1,'walk':1,'flags':s['flags']&~18})
|
| 20 |
+
if s['flags']&128:s['flags']&=~128;s['timer']=0
|
| 21 |
+
if s['ground']==1023:calls.append(45912)
|
| 22 |
+
s['ground']=r[13];calls.append(39253)
|
| 23 |
+
if r[13]!=1022 and r[13] not in s['touches']:s['touches'].append(r[13])
|
| 24 |
+
return s,calls
|
| 25 |
+
|
| 26 |
+
|
| 27 |
+
class QvmMainEnvironmentTests(unittest.TestCase):
|
| 28 |
+
@classmethod
|
| 29 |
+
def setUpClass(cls):cls.r=json.loads(Path('docs/research/qvm-main-environment.json').read_text())
|
| 30 |
+
|
| 31 |
+
def test_all_content_samples_ordered_coordinates_mask_and_state(self):
|
| 32 |
+
self.assertEqual(len(self.r['probes']),48)
|
| 33 |
+
for p in self.r['probes']:
|
| 34 |
+
for e in [p['environment'][0],p['environment'][3]]:
|
| 35 |
+
a=e['before'];level=0
|
| 36 |
+
for v in e['returns']:
|
| 37 |
+
if not v&56:break
|
| 38 |
+
level+=1
|
| 39 |
+
expected=dict(a);expected.update({'level':level,'contents':e['returns'][0] if level else 0});self.assertEqual(e['after'],expected);z=n(a['origin'][2]);zs=[f(f(z-24)+1),f(f(z-24)+int((a['height']+24)/2)),f(z+f(a['height']))];points=[a['origin'][:2]+[word(v)] for v in zs[:min(level+1,3)]];self.assertEqual(e['points'],points);self.assertEqual(len(e['calls']),len(points))
|
| 40 |
+
for c in e['calls']:self.assertEqual(c['target'],-26);self.assertEqual(c['args'],{'8':0x45000010,'12':7})
|
| 41 |
+
|
| 42 |
+
def test_all_ground_classifications_actual_trace_copy_and_touch_effect(self):
|
| 43 |
+
for p in self.r['probes']:
|
| 44 |
+
for e in [p['environment'][1],p['environment'][2]]:
|
| 45 |
+
expected,calls=ground_expected(e);self.assertEqual(e['after'],expected);self.assertEqual([c['target'] for c in e['calls']],calls);self.assertEqual(e['copied_trace'],e['record']);self.assertEqual(e['start'],e['before']['origin']);self.assertEqual(e['end'],e['start'][:2]+[word(f(n(e['start'][2])-.25))]);self.assertEqual(e['touch_child'] is not None,39253 in calls)
|
| 46 |
+
point=[word(f(n(x)+f(f(n(y)-n(x))*n(e['record'][2])))) for x,y in zip(e['start'],e['end'])];self.assertEqual(e['record'][3:6],point)
|
| 47 |
+
|
| 48 |
+
def test_reached_environment_order_and_live_timer_handoff(self):
|
| 49 |
+
for p in self.r['probes']:
|
| 50 |
+
c,g,g2,c2=p['environment'];self.assertEqual([(e['target'],e['phase']) for e in p['environment']],[(47217,'before'),(46773,'before'),(46773,'after'),(47217,'after')]);self.assertEqual(g['before'],c['after']);self.assertEqual(c2['before'],g2['after']);self.assertEqual(p['timer']['before']['flags'],g['after']['flags']);self.assertEqual(p['timer']['before']['movement'],g['after']['timer'])
|
| 51 |
+
for k in ['origin','velocity','flags','timer','touches']:self.assertEqual(g2['before'][k],p['after_dispatch'][k])
|
| 52 |
+
|
| 53 |
+
def test_ground_content_and_real_timer_derive_mode_selection(self):
|
| 54 |
+
counts={41768:0,41848:0,43626:0,42838:0}
|
| 55 |
+
for p in self.r['probes']:
|
| 56 |
+
a=p['timer']['before'];flags,move,leg,torso=timer_oracle({'initial_flags_word':a['flags'],'initial_movement_timer_word':a['movement'],'initial_leg_timer_word':a['leg'],'initial_torso_timer_word':a['torso'],'dt_word':a['dt']});env=p['environment'][1]['after'];mode=41768 if flags&128 else 41848 if env['level']>1 else 43626 if env['walk'] else 42838;self.assertEqual(p['selected_mode'],mode);counts[mode]+=1;self.assertEqual(p['mode'] is not None,mode==41768);self.assertEqual(p['timer']['after']['movement'],move)
|
| 57 |
+
self.assertEqual(counts,{41768:18,41848:14,43626:8,42838:8})
|
| 58 |
+
|
| 59 |
+
def test_real_ground_normal_and_touch_state_reach_all_slide_children(self):
|
| 60 |
+
count=0
|
| 61 |
+
for p in self.r['probes']:
|
| 62 |
+
if not p['mode']:continue
|
| 63 |
+
normal=p['environment'][1]['after']['normal'];w=p['mode']['wrapper'];entry=dict(w['before']);entry['ground_normal']=normal;slide_oracle(self,w['first_slide'],entry);count+=1;self.assertEqual(w['first_slide']['ground'],p['environment'][1]['after']['plane'])
|
| 64 |
+
if w['step']:entry=dict(w['step']['at_slide']);entry['ground_normal']=normal;slide_oracle(self,w['step']['slide'],entry);count+=1
|
| 65 |
+
self.assertEqual(count,27)
|
| 66 |
+
|
| 67 |
+
def test_actual_step_wrapper_mode_outputs_with_environment_input(self):
|
| 68 |
+
for p in self.r['probes']:
|
| 69 |
+
if not p['mode']:continue
|
| 70 |
+
mode=p['mode'];w=mode['wrapper'];s=w['step'];first=w['first_slide']['final']
|
| 71 |
+
if s:
|
| 72 |
+
ret,origin,v,flags=expected_step(s);self.assertEqual([s['return_word'],s['final']['origin'],s['final']['velocity'],s['final']['flags']],[ret,origin,v,flags])
|
| 73 |
+
if not ret:origin,v,flags=first['origin'],first['velocity'],flags|32
|
| 74 |
+
delta=f(n(origin[2])-n(w['before']['origin'][2]));height=int(delta) if delta>2 else 99
|
| 75 |
+
else:origin,v,flags,height=first['origin'],first['velocity'],first['flags'],99
|
| 76 |
+
self.assertEqual([w['final']['origin'],w['final']['velocity'],w['final']['flags'],w['final']['height']],[origin,v,flags,height]);expected=dict(w['final']);vz=f(n(v[2])-f(f(800)*n(p['clock']['float_dt'])));expected['velocity']=v[:2]+[word(vz)]
|
| 77 |
+
if vz<0:expected['flags']&=~192;expected['timer']=0
|
| 78 |
+
self.assertEqual(mode['mode_final'],expected);self.assertEqual(p['after_dispatch'],expected)
|
| 79 |
+
|
| 80 |
+
def test_post_resampling_uses_current_position_and_preserves_first_level(self):
|
| 81 |
+
changed=False
|
| 82 |
+
for p in self.r['probes']:
|
| 83 |
+
c,g,g2,c2=p['environment'];self.assertEqual(p['saved_level'],p['initial_level_pattern']);self.assertEqual(c2['after']['level'],3-p['saved_level']);self.assertEqual(g2['before']['level'],p['saved_level']);expected=dict(p['after_dispatch']);expected.update({k:g2['after'][k] for k in ['flags','timer','touches']});self.assertEqual(p['final'],expected);self.assertEqual(p['final_timers']['movement'],g2['after']['timer']);changed|=c2['before']['origin']!=c['before']['origin']
|
| 84 |
+
self.assertTrue(changed)
|
| 85 |
+
|
| 86 |
+
def test_source_identity_and_supplied_native_omitted_effect_scope(self):
|
| 87 |
+
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())
|
| 88 |
+
for text in ['no original executable/full QVM/native collision/physics/rendering executes','Ground39253 touch registration executes','other ground recovery/ground-lost/landing/animation/event effects remain omitted','bounds/viewheight/initial state are supplied','complete53418/scheduler remain omitted']:self.assertIn(text,self.r['limitations'])
|
| 89 |
+
|
| 90 |
+
|
| 91 |
+
if __name__=='__main__':unittest.main()
|
scripts/test_qvm_slide_repeated.py
CHANGED
|
@@ -11,7 +11,7 @@ from test_qvm_slide_solver import solver_oracle
|
|
| 11 |
|
| 12 |
def oracle(test,p,seed_state=None):
|
| 13 |
seed_state=seed_state or {}
|
| 14 |
-
a={'velocity_float_words':seed_state.get('velocity',list(map(word,[10,20,30]))),'normal_float_words':list(map(word,[0,0,1])),'dt_float_word':p['dt'],'gravity_word':800,'plane_word':p['ground']}
|
| 15 |
v,end,saved,planes,_,_=prefix_oracle({'initial':a,'gravity_on_word':p['gravity']})
|
| 16 |
s={'origin':seed_state.get('origin',list(map(word,[100,200,300]))),'velocity':v,'end':end,'saved':saved,'planes':planes,'remaining':p['dt'],'impact':p['initial_impact'],'flags':seed_state.get('flags',2080),'normal_xy':seed_state.get('normal_xy',[0x12345678,0x23456789]),'keep':0,'bump':0,'touches':seed_state.get('touches',[])[:]}
|
| 17 |
def suffix():
|
|
|
|
| 11 |
|
| 12 |
def oracle(test,p,seed_state=None):
|
| 13 |
seed_state=seed_state or {}
|
| 14 |
+
a={'velocity_float_words':seed_state.get('velocity',list(map(word,[10,20,30]))),'normal_float_words':seed_state.get('ground_normal',list(map(word,[0,0,1]))),'dt_float_word':p['dt'],'gravity_word':800,'plane_word':p['ground']}
|
| 15 |
v,end,saved,planes,_,_=prefix_oracle({'initial':a,'gravity_on_word':p['gravity']})
|
| 16 |
s={'origin':seed_state.get('origin',list(map(word,[100,200,300]))),'velocity':v,'end':end,'saved':saved,'planes':planes,'remaining':p['dt'],'impact':p['initial_impact'],'flags':seed_state.get('flags',2080),'normal_xy':seed_state.get('normal_xy',[0x12345678,0x23456789]),'keep':0,'bump':0,'touches':seed_state.get('touches',[])[:]}
|
| 17 |
def suffix():
|