urt-rs / docs /research /QVM_CAMERA_MAP_EVENT_BATCH.md
nmarshall's picture
gameplay: port temporary event construction
cedc6d0
|
Raw History Blame Contribute Delete
5.98 kB
# Camera, next-map and event construction: RE-844–853
Five original source contracts now have matching Rust ports. This batch recovers concrete world-record mutations and ordered intentions; complete runtime, renderer and native side-effect parity remain open.
| Task | Evidence |
| --- | --- |
| RE-844 | [6575 intermission camera placement](QVM_CAMERA_PLACE.md) |
| RE-845 | [Rust camera placement](RUST_CAMERA_PLACE.md) |
| RE-846 | [6717 camera selection and target direction](QVM_CAMERA_SELECT.md) |
| RE-847 | [Rust view selection](RUST_CAMERA_SELECT.md) |
| RE-848 | [6939 team-series branch](QVM_NEXTMAP_SERIES.md) |
| RE-849 | [Rust series policy](RUST_NEXTMAP_SERIES.md) |
| RE-850 | [6939 normal reset suffix](QVM_NEXTMAP_RESET.md) |
| RE-851 | [Rust staged normal reset](RUST_NEXTMAP_RESET.md) |
| RE-852 | [277695 temporary event and 278138 origin setter](QVM_EVENT_CONSTRUCT.md) |
| RE-853 | [Rust temporary event construction](RUST_EVENT_CONSTRUCT.md) |
## Findings and evidence limits
Camera placement has 72 coherent byte/word fixtures. It copies the camera position into entity and resolved-player origins, copies view angles, zeros velocity, sets movement type 5 and clears the observed entity/player fields. Both apparent mode/field 4324 gates reach the same body. Raw NaN payloads, infinities and signed zero copy exactly. Two distinct entity-to-client pointers exercise indirection; the Rust API accepts a resolved mutable client. This does not establish arbitrary pointer alias behavior or renderer integration.
View selection has 36 fixtures covering absent selection, absent target key, failed target lookup and found target. Original source copies selected or supplied-fallback view vectors and computes f32 target-minus-origin. Rust returns ordered search/fallback/aim intentions and exact finite direction words. The selector results and fallback 168114 writes are supplied. The original 62944 angle converter is captured without modifying angles, so this is not complete aiming or camera setup.
The series branch has 300 cases. It handles only positive phase and team-classified modes. A nonzero option requests restart unless both flag bits 2 and 4 are set. Otherwise it saves second then first score, clears active scores/pending/blocked/phase, removes those flags, and requests formatted configstrings 1005 and 2 plus downstream work. Actual 33715 mode classification executes. The original format strings are `%d` and `1 %i %i`; 70458 output is supplied as distinct pointers. The normal branch stops at 7070 in this report.
The normal suffix has 48 cases. After captured 122230/7188 calls, it clears round/blocked/global scores and connected-client scores; mode 9 additionally clears fields 304/308. A snapshot at captured 249007 proves those changes happen before the second loop changes connected state 2 to 1. Pending, phase, series flags and saved scores remain untouched. Rust exposes separate preparation and post-map connection APIs so real map-child mutations can occur between stages. Fixture parity assumes those captured children do not mutate state.
The temporary-event constructor has 144 valid cases and five invalid float-domain rejections. Actual 277695 and 278138 execute against a supplied allocator record. Origin components truncate through CVFI/CVIF, normalizing negative zero, and feed both trajectory base and current origin. The constructor zeros trajectory time/type/duration and velocity, writes wrapped kind + 19, the `tempEntity` class token/hash, clock 568 and free flag 572, then requests syscall−31. It preserves allocator flags 424 and caller-owned fields 84/140. This does not prove the real allocator supplies flags 16. Rust validates conversion before changing its record, then returns a link intention; invalid-domain atomic rejection is a deliberate safe boundary. Original class token 97191 is source metadata, not a portable native pointer.
## Validation
Each task used its focused cargo xtask group before its own commit; affected reports regenerated twice and relevant Python plus scoped gameplay Rust tests passed. Storage, documentation links and whitespace guards ran throughout. The registry regression verifies all five source-report-to-Rust edges, transition module selection and the shared intermission mode-classifier dependency. The single full-suite run after commit ten, `cargo xtask test-full --since 15d7fcac`, passed: 1,668 Python tests and 147 Rust tests (assets 10, gameplay 109, xtask 28). All 46 affected report producers regenerated twice deterministically. Storage policy, links across 414 documentation files and whitespace checks passed. No generated reports changed. Validation notes were amended into task ten.
Use `cargo xtask test-group <name>` with `camera-place`, `rust-camera-place`, `camera-select`, `rust-camera-select`, `nextmap-series`, `rust-nextmap-series`, `nextmap-reset`, `rust-nextmap-reset`, `event-construct` or `rust-event-construct`.
## Next work: RE-854
- [ ] Recover actual 276433/276586 searches, 168114 fallback selection and 62944 direction-to-angle conversion.
- [ ] Compose 6717 and 6575 into begin-intermission source/Rust flows, including client-pointer alias fixtures and actual camera/respawn state ownership.
- [ ] Recover 122230/7188/249007 and 256248/256651 command/map effects, then compose complete 6939 into readiness and runtime handling.
- [ ] Recover 277165 allocation/initialization, resolve class metadata portably and integrate 277695 with mode 9 caller fields and real linking/event lifetime.
- [ ] Recover respawn 175123 and slow setup 156523, and execute publication 6328 with verified formatter/configstring/network ownership.
- [ ] Integrate ranking→exit/intermission→camera/map/event→scoreboard state, compare real game/native traces, and continue legacy trace audits.
- [ ] Validate actual macOS/Linux Bevy/Solari gameplay and rendering. These bounded Rust policies do not establish full-game completion.