|
Download docs/research/QVM_LOCATION_ALLOCATION_BATCH.md from nmarshall/urt-rs: direct link, hf CLI and curl.
- Browser
- Download file 9.57 kB
-
https://huggingface.co/nmarshall/urt-rs/resolve/main/docs/research/QVM_LOCATION_ALLOCATION_BATCH.md
- Command line
-
hf download hf://nmarshall/urt-rs/docs/research/QVM_LOCATION_ALLOCATION_BATCH.md
-
curl -L -o QVM_LOCATION_ALLOCATION_BATCH.md https://huggingface.co/nmarshall/urt-rs/resolve/main/docs/research/QVM_LOCATION_ALLOCATION_BATCH.md
9.57 kB
| # Location, formatting and objective allocation: RE-1034–1043 | |
| Ten tasks recover five source/Rust contracts across **115 paired scenarios**. They extend the [resolved effect-feedback batch](QVM_EFFECT_FEEDBACK_BATCH.md) by executing location selection/text and the actual radio formatting chain, then connecting successful pool allocation to defuse event construction. Every task has its own commit and focused validation. | |
| | Tasks | Contract | Paired scenarios | | |
| | --- | --- | ---: | | |
| | RE-1034 / RE-1035 | [Source location selection](QVM_LOCATION_NEAREST.md) / [Rust selection](RUST_LOCATION_NEAREST.md) | 16 | | |
| | RE-1036 / RE-1037 | [Source bounded location text](QVM_LOCATION_TEXT.md) / [Rust text](RUST_LOCATION_TEXT.md) | 24 | | |
| | RE-1038 / RE-1039 | [Source located radio](QVM_LOCATION_RADIO.md) / [Rust radio](RUST_LOCATION_RADIO.md) | 35 | | |
| | RE-1040 / RE-1041 | [Source allocator](QVM_LOCATION_ALLOCATION.md) / [Rust allocator](RUST_LOCATION_ALLOCATION.md) | 16 | | |
| | RE-1042 / RE-1043 | [Source allocated defuse event](QVM_LOCATION_ALLOCATED_DEFUSE.md) / [Rust composition](RUST_LOCATION_ALLOCATED_DEFUSE.md) | 24 | | |
| ## Cached, trigger and nearest location268248 | |
| An existing actor848 pointer returns immediately only while signed current tick is strictly before cached entity596 expiry. Equality is expired. No query, classname comparison or fallback geometry is evaluated on a live cache hit. The function does not update the actor's cache field on any recovered path. | |
| On a miss, engine-33 receives an origin-centered query box with extents40/40/52 and a1024-entry response buffer. The first returned entity whose classname compares case-insensitively equal to `trigger_location` wins immediately. Actual69386 performs the comparison. Query results and their order are supplied engine evidence; the routine does not independently prove geometric trigger containment. | |
| Otherwise it traverses the list at34999640. Each entity524 points to a structure whose24 field holds the next location. Squared f32 distance must be at most the current best, initially201326592. Engine-27 PVS is queried only within that bound. A visible candidate replaces the best, including equal distances, so later visible ties win. Supplied identity/order, finite positions and native box/PVS responses bound this contract. Tests include cache equality/wrap, trigger precedence, hidden locations, empty lists and distance-bound rejection. | |
| ## Location text268637 and actual formatting | |
| The wrapper always calls selection once. A null result returns0 without clearing the destination. A selected location formats its592 string through actual70386/37914 and bounded-copy helpers, then returns1 regardless of empty text or clipping. The original warning5123 occurs when formatted length reaches capacity. The destination is zero-padded within capacity; neighboring bytes survive. | |
| Twenty-four cases cover missing/found location, empty/quoted text and capacities1/4/16/150. Rust uses the existing recovered bounded formatter. A missing location can bypass otherwise unused zero-capacity input; a found unsupported capacity rejects without mutation. This wrapper contract supplies the selected pointer; the next composition executes actual selection. | |
| ## Radio location/formatting composition | |
| Thirty-five scenarios execute193620,268637,268248,70386,70458,37914 and their recovered comparison/classification/formatting helpers. The location label now derives from actual cache/trigger/list/PVS selection instead of a supplied text response. A missing location reaches the original caller's first-byte clearing path and produces empty radio text. | |
| The actual ring formatter alternates buffers and advances its counter for each recipient. Source/Rust cases cover counter wrapping, mode/team/sender gates, no recipients and64-entry tables. Quotes remain literal bytes. A160-byte location label clips to149 bytes in the150-byte location buffer, emits one warning and is then inserted into the radio command. Marker deadlines change only after sends as established in the prior batch. | |
| Rust stages marker/ring updates and reuses the existing formatting and radio policies. Engine box/PVS responses and native network sends remain boundaries. The downstream client interpretation/audio behavior of radio messages is not exercised. | |
| ## Allocator277165 and initializer277125 | |
| The allocator scans non-client entities from slot64. A first-pass free record is skipped when its signed free timestamp is later than start+2000 and its wrapped signed age is below1000. A pool with count1024 retries once without the recent-free gate. Successful reuse preserves count and requests no registration. | |
| Extension increments count, requests native-16 registration and initializes the selected slot. At count1022 with no reusable record, the source resets its scan index to0 and reaches the diagnostic-loop boundary. At a full1024-entry pool with no reusable record, it retries, increments count to1025 and reaches the fatal boundary before registration/initialization. These prefixes are preserved rather than clamped or invented as successful allocations. | |
| Initialization writes index0, in-use532, class536/hash540 and field512=1023. It does not zero the record. Sixteen cases compare initialization and retained canary/free-time fields, exact age/start thresholds, signed wraps, extension/reuse/retry and terminal prefixes. Initial bytes outside the current count are explicitly supplied; the64-entry fixture already seeds slot64 with free-time0, which initialization preserves. | |
| Rust uses caller-supplied fixed pool records. Terminal outcomes expose the preceding source count/scan writes and do not execute diagnostic/fatal effects. A subsequent allocation with terminal count1025 rejects. Native registration/lifetime and allocation concurrency remain external. | |
| ## Allocated defuse start through153917 | |
| Twenty-four source cases compose153774 with actual277695→277165→277125 and278138. Successful reuse, extension, recent-free extension and full-pool retry return real selected records to the constructor and caller. The constructor snaps origin and initializes event metadata; the caller then writes configured duration to184 and ORs mask32 into424. | |
| Reports compare the initialized record separately from the final event, registration counts, selected slots, link requests, caller flags/clock/animation and retained neighboring words. Raw old record flags feed the caller event state; they are not replaced with synthetic fixed flags. Source execution stops at153917 before radio routing. Located radio is verified separately above; a complete combined allocator/radio/client path remains future work. | |
| The Rust composition stages defuse and pool state until allocation/construction succeeds. Its successful-allocation source domain excludes allocator terminal prefixes, which are separately exposed by the generic allocator. Unsupported composition inputs reject atomically; that typed adapter guarantee does not assert rollback behavior for original fatal/undefined domains. Native linking and registration remain plans. | |
| ## Validation and remaining boundaries | |
| Every task runs the matching `cargo xtask test-group qvm-location-*` or `rust-location-*` before committing. Selected reports regenerate twice identically. Source reports retain verified QVM identity and trace summaries; independent cache/format/arithmetic/pool expectations check results. Rust reports retain source-report SHA256 and compare all projected fields. Ten additional Rust tests cover ties, cache/trigger bypass, missing/clipped text, radio ring state, terminal allocator counts, preserved records and atomic composition errors. | |
| Dependency mappings include the location module/CLI, formatter, radio, defuse and event-constructor consumers plus gameplay test-count metadata. The registry regression verifies selection. One full-suite check follows task ten: `cargo xtask test-full --since a1fd4e2b`. Python uses only the flake-declared Nix runtime, including Git hooks. Original assets are unchanged. | |
| Native engine box/PVS, linking, registration, sending, allocation lifecycle and full ranking/log feedback remain explicit boundaries. These are finite QVM/Rust policies, not native runtime/platform conformance. | |
| The single `cargo xtask test-full --since a1fd4e2b` run at the tenth-commit boundary passed: **2,018 Python tests** across559 modules, **339 Rust tests** (assets10, gameplay299, xtask30), **146 deterministic affected report producers**, storage policy, links across **623 documentation files** and whitespace guards. Regeneration left no changes, including earlier radio consumers. Focused dependency-registry regression passed. Validation notes are amended into task ten, preserving ten commits. | |
| ## Next work: RE-1044 | |
| - [ ] Combine allocated objective events and located radio with the complete defuse callback and longer lifecycle sequences, including allocation-terminal caller prefixes. | |
| - [ ] Connect remaining ranking/log feedback and native box/PVS/link/register/send adapters, reusing existing engine research where applicable. | |
| - [ ] Verify location/cache ownership, real spatial candidate generation and entity/linked identity/aliasing through allocation/free cycles. | |
| - [ ] Migrate historical effect labels to semantic APIs while retaining evidence compatibility; connect radio/objective client rendering/audio consumers. | |
| - [ ] Compose full154089 preparation, assistance/self recovery, defusing, movement54475 and timer155714; continue asset conversion, Bevy/Solari rendering and macOS/Linux acceptance. | |