nmarshall commited on
Commit
26cfc68
·
1 Parent(s): a239eb1

gameplay: port assistance replay snapshots

Browse files
crates/urt-gameplay/src/assistance.rs CHANGED
@@ -488,3 +488,124 @@ mod complete_tests {
488
  assert_eq!(s, old);
489
  }
490
  }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
488
  assert_eq!(s, old);
489
  }
490
  }
491
+
492
+ #[derive(Clone, Debug, PartialEq, Eq)]
493
+ pub struct AssistanceFrame {
494
+ pub state: AssistanceState,
495
+ pub outcome: AssistanceOutcome,
496
+ }
497
+ /// Bounded research replay of complete152792. Each snapshot retains the state
498
+ /// after its call; effect plans do not execute IO. The replay batch is atomic
499
+ /// on typed errors, an adapter guarantee beyond the original single-call body.
500
+ pub fn replay_assistance(
501
+ state: &mut AssistanceState,
502
+ input: AssistanceInput,
503
+ ticks: &[u32],
504
+ ) -> Result<Vec<AssistanceFrame>, Error> {
505
+ if ticks.len() > 256 {
506
+ return Err(Error::InvalidCount);
507
+ }
508
+ let mut next = state.clone();
509
+ let mut frames = vec![];
510
+ for &tick in ticks {
511
+ let outcome = complete_assistance(&mut next, AssistanceInput { tick, ..input })?;
512
+ frames.push(AssistanceFrame {
513
+ state: next.clone(),
514
+ outcome,
515
+ });
516
+ }
517
+ *state = next;
518
+ Ok(frames)
519
+ }
520
+ #[cfg(test)]
521
+ mod sequence_tests {
522
+ use super::*;
523
+ use crate::move_callbacks::{CallbackEffect, MeterState};
524
+ fn state() -> AssistanceState {
525
+ let agent = |j: usize| {
526
+ let flags = if j == 0 { 16384 } else { 0 };
527
+ AssistanceAgent {
528
+ connection: if j == 1 { 0 } else { 2 },
529
+ health: 1,
530
+ follow: 0,
531
+ team: 1,
532
+ helper: HelperState {
533
+ flags,
534
+ active: 0,
535
+ target: None,
536
+ last: 0,
537
+ },
538
+ meter: MeterState {
539
+ meter: 0,
540
+ carry: 0,
541
+ flags220: flags,
542
+ flags104: 16,
543
+ pm_type: if j == 0 { 4 } else { 0 },
544
+ receiver: 0,
545
+ event_entity: [7, 1],
546
+ },
547
+ point: [0; 3],
548
+ entity_id: 100 + j as u32,
549
+ owner: 0x1000 + j as u32,
550
+ }
551
+ };
552
+ AssistanceState {
553
+ clients: (0..3).map(agent).collect(),
554
+ event_entity: [7, 1],
555
+ }
556
+ }
557
+ fn input() -> AssistanceInput {
558
+ AssistanceInput {
559
+ entity: true,
560
+ client: true,
561
+ mode: 10,
562
+ count: 3,
563
+ slot: 2,
564
+ tick: 0,
565
+ seconds: 2f32.to_bits(),
566
+ }
567
+ }
568
+ #[test]
569
+ fn acquisition_progress_completion_and_cancel_emit_once() {
570
+ let mut s = state();
571
+ let f = replay_assistance(&mut s, input(), &[10000, 10100, 12100, 12200]).unwrap();
572
+ assert_eq!(
573
+ f.iter()
574
+ .map(|f| f.outcome.effects.len())
575
+ .collect::<Vec<_>>(),
576
+ [2, 0, 4, 1]
577
+ );
578
+ assert!(matches!(
579
+ f[0].outcome.effects[0],
580
+ AssistEffect::Publish { event: 104, .. }
581
+ ));
582
+ assert!(matches!(
583
+ f[2].outcome.effects[2],
584
+ AssistEffect::Nested(CallbackEffect::Event { event: 108 })
585
+ ));
586
+ assert!(matches!(
587
+ f[3].outcome.effects[0],
588
+ AssistEffect::Publish { event: 105, .. }
589
+ ));
590
+ assert_eq!(s.clients[2].helper.target, None);
591
+ assert_eq!(s.clients[0].meter.pm_type, 0);
592
+ assert_eq!(f[1].state.clients[0].meter.meter, 1600);
593
+ }
594
+ #[test]
595
+ fn later_error_rolls_back_prior_replay_frames() {
596
+ let mut s = state();
597
+ let old = s.clone();
598
+ assert!(
599
+ replay_assistance(
600
+ &mut s,
601
+ AssistanceInput {
602
+ seconds: f32::NAN.to_bits(),
603
+ ..input()
604
+ },
605
+ &[10000, 10100]
606
+ )
607
+ .is_err()
608
+ );
609
+ assert_eq!(s, old);
610
+ }
611
+ }
crates/urt-gameplay/src/bin/urt-assistance.rs CHANGED
@@ -81,6 +81,7 @@ fn main() {
81
  }
82
  "progress" => println!("{}", progress(&w)),
83
  "full" => println!("{}", full(&w)),
 
84
  _ => panic!("unknown policy"),
85
  }
86
  }
@@ -209,3 +210,17 @@ fn full(w: &[u32]) -> String {
209
  let o = complete_assistance(&mut s, i).unwrap();
210
  format!("{{{}}}", full_fields(&s, &o))
211
  }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
81
  }
82
  "progress" => println!("{}", progress(&w)),
83
  "full" => println!("{}", full(&w)),
84
+ "sequence" => println!("{}", sequence(&w)),
85
  _ => panic!("unknown policy"),
86
  }
87
  }
 
210
  let o = complete_assistance(&mut s, i).unwrap();
211
  format!("{{{}}}", full_fields(&s, &o))
212
  }
213
+
214
+ fn sequence(w: &[u32]) -> String {
215
+ let (mut s, i) = decode(w);
216
+ let ticks = [0, 100, 200, 2200, 2300].map(|o| i.tick.wrapping_add(o));
217
+ let frames = replay_assistance(&mut s, i, &ticks).unwrap();
218
+ format!(
219
+ r#"{{"frames":[{}]}}"#,
220
+ frames
221
+ .iter()
222
+ .map(|f| format!("{{{}}}", full_fields(&f.state, &f.outcome)))
223
+ .collect::<Vec<_>>()
224
+ .join(",")
225
+ )
226
+ }
docs/FINDINGS.md CHANGED
@@ -1961,3 +1961,7 @@ RE-1010: Sixty coherent original-QVM cases execute complete152792 with actual di
1961
  RE-1011: Rust composes recovered admission/cleanup, finite f32 distance, acquisition/cancellation and actual target meter policies across60 complete source cases. Candidate order and strict radius75 are preserved; typed identity and shared flags are validated. All clients and effects stage atomically, including a late invalid distance after an earlier acquisition. Tests cover radius/order, ownership retention and rollback. Native completion/publication effects remain plans. [Evidence](research/RUST_ASSIST_COMPLETE.md).
1962
 
1963
  RE-1012: Twenty five-call source scenarios preserve one coherent memory state across acquisition, progress, thaw completion and later cancellation/reacquisition. Competing target order, wrapped ticks, positive/negative duration and64-slot traversal are checked across100 complete callback executions. Reports compare every client word, distance, event request and allocated event state at each call. Native teleport/reset/publication/log effects remain captured; the broader frame scheduler and self-recovery callback are excluded. [Evidence](research/QVM_ASSIST_SEQUENCE.md).
 
 
 
 
 
1961
  RE-1011: Rust composes recovered admission/cleanup, finite f32 distance, acquisition/cancellation and actual target meter policies across60 complete source cases. Candidate order and strict radius75 are preserved; typed identity and shared flags are validated. All clients and effects stage atomically, including a late invalid distance after an earlier acquisition. Tests cover radius/order, ownership retention and rollback. Native completion/publication effects remain plans. [Evidence](research/RUST_ASSIST_COMPLETE.md).
1962
 
1963
  RE-1012: Twenty five-call source scenarios preserve one coherent memory state across acquisition, progress, thaw completion and later cancellation/reacquisition. Competing target order, wrapped ticks, positive/negative duration and64-slot traversal are checked across100 complete callback executions. Reports compare every client word, distance, event request and allocated event state at each call. Native teleport/reset/publication/log effects remain captured; the broader frame scheduler and self-recovery callback are excluded. [Evidence](research/QVM_ASSIST_SEQUENCE.md).
1964
+
1965
+ RE-1013: Rust replays five recovered callback calls across20 source scenarios, comparing all100 state/effect snapshots. Acquisition, progress, completion, cancellation and target reacquisition preserve source order and clocks. Replay stores immutable snapshots and stages the batch on typed errors; unit tests verify exactly-on-transition requests and rollback when invalid duration becomes active only on a later call. Native IO and frame scheduling remain excluded. [Evidence](research/RUST_ASSIST_SEQUENCE.md).
1966
+
1967
+ RE-1004–1013 batch validation passed:1,958 Python tests,309 Rust tests,126 deterministic affected producers and590 documentation files. All ten tasks have separate commits and focused checks. [Assistance evidence and next work](research/QVM_ASSISTANCE_BATCH.md).
docs/PROVISIONAL_TODO.md CHANGED
@@ -2019,3 +2019,8 @@ RE-974–983 completed routing, command rewrite, inactivity, movement-parameter
2019
  - [x] RE-1011 Port complete mode10 assistance scan ([evidence](research/RUST_ASSIST_COMPLETE.md)).
2020
 
2021
  - [x] RE-1012 Recover assistance transitions across repeated calls ([evidence](research/QVM_ASSIST_SEQUENCE.md)).
 
 
 
 
 
 
2019
  - [x] RE-1011 Port complete mode10 assistance scan ([evidence](research/RUST_ASSIST_COMPLETE.md)).
2020
 
2021
  - [x] RE-1012 Recover assistance transitions across repeated calls ([evidence](research/QVM_ASSIST_SEQUENCE.md)).
2022
+
2023
+ - [x] RE-1013 Port bounded assistance replay and transition snapshots ([evidence](research/RUST_ASSIST_SEQUENCE.md)).
2024
+
2025
+ - [x] RE-1004–1013 assistance search/replay batch:212 paired scenarios, including100 repeated-call snapshots ([evidence](research/QVM_ASSISTANCE_BATCH.md)).
2026
+ - [ ] RE-1014 recover mode8 objective transitions, actual nested effects and nonempty assistance/self/movement composition ([scope](research/QVM_ASSISTANCE_BATCH.md#next-work-re-1014)).
docs/RESEARCH_LEDGER.md CHANGED
@@ -2723,3 +2723,7 @@ Rust composes recovered admission/cleanup, finite f32 distance, acquisition/canc
2723
  ## 2026-10-29 — RE-1012 Recover assistance transitions across repeated calls
2724
 
2725
  Twenty five-call source scenarios preserve one coherent memory state across acquisition, progress, thaw completion and later cancellation/reacquisition. Competing target order, wrapped ticks, positive/negative duration and64-slot traversal are checked across100 complete callback executions. Reports compare every client word, distance, event request and allocated event state at each call. Native teleport/reset/publication/log effects remain captured; the broader frame scheduler and self-recovery callback are excluded. Focused `cargo xtask test-group qvm-assist-sequence` passes with deterministic report regeneration and selected regressions. Full suite deferred to task ten. Original assets unchanged; Python uses the flake-declared Nix runtime.
 
 
 
 
 
2723
  ## 2026-10-29 — RE-1012 Recover assistance transitions across repeated calls
2724
 
2725
  Twenty five-call source scenarios preserve one coherent memory state across acquisition, progress, thaw completion and later cancellation/reacquisition. Competing target order, wrapped ticks, positive/negative duration and64-slot traversal are checked across100 complete callback executions. Reports compare every client word, distance, event request and allocated event state at each call. Native teleport/reset/publication/log effects remain captured; the broader frame scheduler and self-recovery callback are excluded. Focused `cargo xtask test-group qvm-assist-sequence` passes with deterministic report regeneration and selected regressions. Full suite deferred to task ten. Original assets unchanged; Python uses the flake-declared Nix runtime.
2726
+
2727
+ ## 2026-10-29 — RE-1013 Port bounded assistance replay and transition snapshots
2728
+
2729
+ Rust replays five recovered callback calls across20 source scenarios, comparing all100 state/effect snapshots. Acquisition, progress, completion, cancellation and target reacquisition preserve source order and clocks. Replay stores immutable snapshots and stages the batch on typed errors; unit tests verify exactly-on-transition requests and rollback when invalid duration becomes active only on a later call. Native IO and frame scheduling remain excluded. Focused `cargo xtask test-group rust-assist-sequence` passes with deterministic report regeneration and selected regressions. The single `cargo xtask test-full --since 19fce7e8` run at the tenth-commit boundary passed: **1,958 Python tests** across529 modules, **309 Rust tests** (assets10, gameplay269, xtask30), **126 deterministic affected report producers**, storage policy, links across **590 documentation files** and whitespace guards. Regeneration left no changes. Focused dependency-registry regression passed. Validation notes are amended into task ten, preserving ten commits. Original assets unchanged; Python uses the flake-declared Nix runtime.
docs/REVERSE_ENGINEERING_TODO.md CHANGED
@@ -2056,3 +2056,8 @@ RE-974–983 recover routing, command rewriting, inactivity and composed setup t
2056
  - [x] RE-1011 Port complete mode10 assistance scan ([evidence](research/RUST_ASSIST_COMPLETE.md)).
2057
 
2058
  - [x] RE-1012 Recover assistance transitions across repeated calls ([evidence](research/QVM_ASSIST_SEQUENCE.md)).
 
 
 
 
 
 
2056
  - [x] RE-1011 Port complete mode10 assistance scan ([evidence](research/RUST_ASSIST_COMPLETE.md)).
2057
 
2058
  - [x] RE-1012 Recover assistance transitions across repeated calls ([evidence](research/QVM_ASSIST_SEQUENCE.md)).
2059
+
2060
+ - [x] RE-1013 Port bounded assistance replay and transition snapshots ([evidence](research/RUST_ASSIST_SEQUENCE.md)).
2061
+
2062
+ - [x] RE-1004–1013 assistance search/replay batch:212 paired scenarios, including100 repeated-call snapshots ([evidence](research/QVM_ASSISTANCE_BATCH.md)).
2063
+ - [ ] RE-1014 recover mode8 objective transitions, actual nested effects and nonempty assistance/self/movement composition ([scope](research/QVM_ASSISTANCE_BATCH.md#next-work-re-1014)).
docs/TESTING.md CHANGED
@@ -189,3 +189,5 @@ Client processing focused groups: `qvm-client-routing`, `rust-client-routing`, `
189
  Movement-context focused pairs: `qvm-client-move-scratch`/`rust-client-move-scratch`, `qvm-client-move-suppression`/`rust-client-move-suppression`, `qvm-client-move-mask`/`rust-client-move-mask`, `qvm-client-move-context`/`rust-client-move-context`, and `qvm-client-move-assembly`/`rust-client-move-assembly`. Run one group per invocation. Shared `client_move_context` and CLI changes select all five Rust producers plus gameplay test-count metadata. Source151954 executes in linked-mask probes; mode callbacks are captured with explicitly supplied feedback in composition. The batch full check is `cargo xtask test-full --since 99a6f51a` after ten commits. [Contracts and next work](research/QVM_MOVE_CONTEXT_BATCH.md).
190
 
191
  Movement-callback focused pairs: `qvm-move-meter`/`rust-move-meter`, `qvm-move-self-recovery`/`rust-move-self-recovery`, `qvm-move-assist-cleanup`/`rust-move-assist-cleanup`, `qvm-move-mode8-eligibility`/`rust-move-mode8-eligibility`, and `qvm-move-resolved-self`/`rust-move-resolved-self`. Use one group per invocation. Shared callback module/CLI changes select their Rust producers and gameplay test-count metadata; movement-context changes also select resolved self composition. One full check follows the tenth task: `cargo xtask test-full --since ad83778f`. [Evidence and boundaries](research/QVM_MOVE_CALLBACK_BATCH.md).
 
 
 
189
  Movement-context focused pairs: `qvm-client-move-scratch`/`rust-client-move-scratch`, `qvm-client-move-suppression`/`rust-client-move-suppression`, `qvm-client-move-mask`/`rust-client-move-mask`, `qvm-client-move-context`/`rust-client-move-context`, and `qvm-client-move-assembly`/`rust-client-move-assembly`. Run one group per invocation. Shared `client_move_context` and CLI changes select all five Rust producers plus gameplay test-count metadata. Source151954 executes in linked-mask probes; mode callbacks are captured with explicitly supplied feedback in composition. The batch full check is `cargo xtask test-full --since 99a6f51a` after ten commits. [Contracts and next work](research/QVM_MOVE_CONTEXT_BATCH.md).
190
 
191
  Movement-callback focused pairs: `qvm-move-meter`/`rust-move-meter`, `qvm-move-self-recovery`/`rust-move-self-recovery`, `qvm-move-assist-cleanup`/`rust-move-assist-cleanup`, `qvm-move-mode8-eligibility`/`rust-move-mode8-eligibility`, and `qvm-move-resolved-self`/`rust-move-resolved-self`. Use one group per invocation. Shared callback module/CLI changes select their Rust producers and gameplay test-count metadata; movement-context changes also select resolved self composition. One full check follows the tenth task: `cargo xtask test-full --since ad83778f`. [Evidence and boundaries](research/QVM_MOVE_CALLBACK_BATCH.md).
192
+
193
+ Assistance focused pairs: `qvm-assist-acquire`/`rust-assist-acquire`, `qvm-assist-cancel`/`rust-assist-cancel`, `qvm-assist-progress`/`rust-assist-progress`, `qvm-assist-complete`/`rust-assist-complete`, and `qvm-assist-sequence`/`rust-assist-sequence`. Use one group per invocation. Assistance module/CLI and recovered meter/cleanup inputs select affected Rust reports plus gameplay test-count metadata. Complete/replay probes execute actual152792/65655/152386 with modeled sqrt and captured/supplied native effects. The batch full check is `cargo xtask test-full --since 19fce7e8` after ten tasks. [Evidence and limits](research/QVM_ASSISTANCE_BATCH.md).
docs/research/QVM_ASSISTANCE_BATCH.md ADDED
@@ -0,0 +1,67 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ # Assistance search and replay: RE-1004–1013
2
+
3
+ Ten tasks recover five source/Rust contracts across **212 paired scenarios**, including100 snapshots from repeated calls. They extend the [callback batch](QVM_MOVE_CALLBACK_BATCH.md) through complete152792 assistance processing with nonempty client pools. Every task has its own commit and focused `cargo xtask` check. Native effect bodies and the larger client/frame scheduler remain outside this evidence.
4
+
5
+ | Tasks | Contract | Paired scenarios |
6
+ | --- | --- | ---: |
7
+ | RE-1004 / RE-1005 | [Source acquisition](QVM_ASSIST_ACQUIRE.md) / [Rust acquisition](RUST_ASSIST_ACQUIRE.md) | 36 |
8
+ | RE-1006 / RE-1007 | [Source cancellation](QVM_ASSIST_CANCEL.md) / [Rust cancellation](RUST_ASSIST_CANCEL.md) | 72 |
9
+ | RE-1008 / RE-1009 | [Source progress](QVM_ASSIST_PROGRESS.md) / [Rust progress](RUST_ASSIST_PROGRESS.md) | 24 |
10
+ | RE-1010 / RE-1011 | [Complete source callback](QVM_ASSIST_COMPLETE.md) / [Rust callback](RUST_ASSIST_COMPLETE.md) | 60 |
11
+ | RE-1012 / RE-1013 | [Repeated source calls](QVM_ASSIST_SEQUENCE.md) / [Rust replay](RUST_ASSIST_SEQUENCE.md) | 20 |
12
+
13
+ ## Acquisition and conditional ownership
14
+
15
+ The153177 fragment assumes caller routing has already selected a nearby protected target. Client220 mask8192, nonzero active6316 and target6320 together establish ownership. If the first two are set and the target differs, acquisition does nothing. Otherwise it sets mask8192, stores active1, target and clock6328, then requests event104 with the target entity word0 followed by the original thaw-start log.
16
+
17
+ Stale target state without both the flag and active word does not block replacement. Raw unrelated bits and wrapped tick words survive. Direct fragment cases also cover matching targets; the complete callback routes an existing matching owner to progress before this acquisition fragment, avoiding repeated start requests on normal successive calls.
18
+
19
+ ## Cancellation
20
+
21
+ Both153284 far-target and153346 unprotected-target branches require flagged active ownership of the current candidate. They clear mask8192, active6316 and target6320, preserve clock6328 and unrelated bits, then request event105 with parameter0xffffffff. Other ownership states remain unchanged. Cancellation after clearing is silent on repetition. Source probes cover both branches; publication278003 is captured rather than executed.
22
+
23
+ ## Assisted progress and actual target feedback
24
+
25
+ The153121 progress path uses staged f32 arithmetic:
26
+
27
+ `32000 / (global34062368 * 1000) * signed_word(global34992532 - helper6328)`
28
+
29
+ It adds progress to target carry6332 and executes actual152386 with target/helper entity pointers and assisted-completion mode. The target meter result mirrors into helper232. Helper clock6328 advances after the child. The original meter conversion, clamp, threshold and flag/movement changes are exercised directly.
30
+
31
+ Completion requests teleport205260, reset6369, event108 and the original thaw-finished log in order. The supplied event receives the target owner168 and mask32. Completed target meter and mirrored helper meter both become zero. Ownership is retained immediately after completion; a later candidate scan observes the now-unprotected target and cancels it.
32
+
33
+ Twenty-four progress cases cover negative and wrapped elapsed time, negative duration, fractional carry, f32 precision and exact/near threshold behavior. Rust rejects active invalid float/conversion domains before committing helper or target updates. Captured teleport/reset bodies do not change health or positions in these probes.
34
+
35
+ ## Complete152792 callback
36
+
37
+ Sixty cases execute the body from its entry through the153417 void-return boundary with actual distance65655 and meter152386. The earlier admission/cleanup policy now runs together with the proximity search. Self must have an entity/client, mode10, connection2, positive signed health and zero follow. Protected self clears its assistance and returns. The first loop removes assistance whose target is disconnected, dead or following.
38
+
39
+ The second loop visits entity slots in ascending order, excluding self and clients that are disconnected, dead, following or on another team. Protected candidates use actual65655 distance, with a supplied finite native sqrt model. Distance must be strictly less than75; equality is far. Matching nearby ownership advances progress. Unowned/stale nearby state can acquire; ownership of another candidate blocks switching. Far or unprotected matching candidates cancel.
40
+
41
+ Cases include competing candidates, existing ownership, cancellation then acquisition of a later candidate in the same scan, team filtering, exact radius, wrapped progress, zero/64 counts and a candidate at slot63. Distance fixtures here are axis-aligned finite inputs. Original entity/client identity is supplied through fixed880/6336 strides; allocation aliasing and stale-pointer lifecycle are not established by this table model.
42
+
43
+ Rust validates shared flag views, uses typed target indices and stages all clients/event plans before committing. A late invalid distance can therefore discard an acquisition planned earlier in the same scan. These typed domain/atomicity guarantees are adapter behavior, not additional original-game semantics.
44
+
45
+ ## Repeated coherent calls
46
+
47
+ Twenty scenarios execute five complete callbacks at offsets0/100/200/2200/2300 from the supplied starting tick, preserving one coherent memory state. They compare100 original/Rust snapshots containing every projected client word, distance result, effect request and allocated event state. Positive/negative duration, wrapped ticks, two candidates and64-slot pools are included.
48
+
49
+ The snapshots establish transition order across acquisition, progress, completion and later cancellation/reacquisition. A candidate visited earlier cannot retroactively acquire after a later candidate cancels ownership in the same scan. Rust replay stores separate immutable snapshots and stages the bounded replay on errors; the original callback remains a per-call source body. The unit regression where NaN duration becomes active only on a second call checks rollback after an earlier planned acquisition.
50
+
51
+ ## Validation and limits
52
+
53
+ Each task runs its corresponding `cargo xtask test-group qvm-assist-*` or `rust-assist-*` before its commit. Selected reports regenerate twice identically. Source reports retain verified QVM identity and trace summaries; independent arithmetic/state/order expectations check the source. Rust reports project every compared source field and retain source-report SHA256. Ten additional Rust tests cover ownership, order, clock preservation, idempotence, mirrored progress, completion, candidate selection and late-error rollback.
54
+
55
+ Dependency mappings include all five source/Rust pairs, the shared assistance module/CLI and recovered meter/cleanup module. Changes select affected parity producers and gameplay test-count metadata. The registry regression verifies those mappings. One full-suite run follows task ten: `cargo xtask test-full --since 19fce7e8`. Python uses only the flake-declared Nix runtime, including Git hooks. Assets and original binaries are unchanged.
56
+
57
+ Event publication278003, logs7259, teleport205260 and reset6369 remain captured plans; event allocation277695 is supplied. Native feedback, scheduler behavior, platform/runtime acceptance and complete game behavior are not established by these fixtures.
58
+
59
+ The single `cargo xtask test-full --since 19fce7e8` run at the tenth-commit boundary passed: **1,958 Python tests** across529 modules, **309 Rust tests** (assets10, gameplay269, xtask30), **126 deterministic affected report producers**, storage policy, links across **590 documentation files** and whitespace guards. Regeneration left no changes. Focused dependency-registry regression passed. Validation notes are amended into task ten, preserving ten commits.
60
+
61
+ ## Next work: RE-1014
62
+
63
+ - [ ] Recover153596 onward mode8 objective lookup, distance/progress/clock transitions, weapon/animation changes and completion effects.
64
+ - [ ] Resolve actual event publication278003, teleport205260, reset6369 and allocation277695 for assistance consumers; replace captured native feedback and verify field ownership.
65
+ - [ ] Compose nonempty assistance, self-recovery152673 and movement setup in the same full154089 client path, then integrate actual physics54475 and timer155714.
66
+ - [ ] Expand distance fixtures to varied3D geometry and finite extremes, plus client identity/aliasing, larger time/configuration domains and source-backed longer replays.
67
+ - [ ] Continue post-movement events/linking/health feedback, native time/file/network adapters, assets/rendering/Bevy/Solari integration and native macOS/Linux acceptance.
docs/research/QVM_MOVE_CALLBACK_BATCH.md CHANGED
@@ -54,7 +54,9 @@ The dependency registry includes all five source/Rust pairs and the shared callb
54
 
55
  The single `cargo xtask test-full --since ad83778f` run at the tenth-commit boundary passed: **1,938 Python tests** across519 modules, **299 Rust tests** (assets10, gameplay259, xtask30), **121 deterministic affected report producers**, storage policy, links across **579 documentation files** and whitespace guards. Regeneration left no changes. Focused dependency-registry regression also passed. These validation notes are amended into task ten, preserving ten commits.
56
 
57
- ## Next work: RE-1004
 
 
58
 
59
  - [ ] Recover152994..153417 assistance proximity search with multiple clients, distance helper65655, target ownership, progress34062368, events104/105 and actual152386 target feedback.
60
  - [ ] Recover153596 onward mode8 objective lookup276433, distance checks, progress6164, shared clock35000484, completion, weapon/animation and event/native effects.
 
54
 
55
  The single `cargo xtask test-full --since ad83778f` run at the tenth-commit boundary passed: **1,938 Python tests** across519 modules, **299 Rust tests** (assets10, gameplay259, xtask30), **121 deterministic affected report producers**, storage policy, links across **579 documentation files** and whitespace guards. Regeneration left no changes. Focused dependency-registry regression also passed. These validation notes are amended into task ten, preserving ten commits.
56
 
57
+ ## Follow-up from RE-1004
58
+
59
+ The [RE-1004–1013 assistance batch](QVM_ASSISTANCE_BATCH.md) now covers nonempty complete152792, actual distance/target meter and repeated-call transitions. Mode8 objective mutation, actual nested effects and full client/physics integration remain open. The original follow-up scope was:
60
 
61
  - [ ] Recover152994..153417 assistance proximity search with multiple clients, distance helper65655, target ownership, progress34062368, events104/105 and actual152386 target feedback.
62
  - [ ] Recover153596 onward mode8 objective lookup276433, distance checks, progress6164, shared clock35000484, completion, weapon/animation and event/native effects.
docs/research/README.md CHANGED
@@ -1589,3 +1589,7 @@ The extension collector adds five focused tests for native tail calls, command-r
1589
  - [RE-1011: Port complete mode10 assistance scan](RUST_ASSIST_COMPLETE.md).
1590
 
1591
  - [RE-1012: Recover assistance transitions across repeated calls](QVM_ASSIST_SEQUENCE.md).
 
 
 
 
 
1589
  - [RE-1011: Port complete mode10 assistance scan](RUST_ASSIST_COMPLETE.md).
1590
 
1591
  - [RE-1012: Recover assistance transitions across repeated calls](QVM_ASSIST_SEQUENCE.md).
1592
+
1593
+ - [RE-1013: Port bounded assistance replay and transition snapshots](RUST_ASSIST_SEQUENCE.md).
1594
+
1595
+ - [Assistance search and replay: RE-1004–1013](QVM_ASSISTANCE_BATCH.md).
docs/research/RUST_ASSIST_SEQUENCE.md ADDED
@@ -0,0 +1,5 @@
 
 
 
 
 
 
1
+ # Port bounded assistance replay and transition snapshots
2
+
3
+ RE-1013. Focused validation: `cargo xtask test-group rust-assist-sequence`. [Machine report](rust-assist-sequence.json).
4
+
5
+ Rust replays five recovered callback calls across20 source scenarios, comparing all100 state/effect snapshots. Acquisition, progress, completion, cancellation and target reacquisition preserve source order and clocks. Replay stores immutable snapshots and stages the batch on typed errors; unit tests verify exactly-on-transition requests and rollback when invalid duration becomes active only on a later call. Native IO and frame scheduling remain excluded.
docs/research/rust-assist-sequence.json ADDED
The diff for this file is too large to render. See raw diff
 
docs/research/rust-health-impulse.json CHANGED
@@ -2985,7 +2985,7 @@
2985
  "exit_code": 2
2986
  }
2987
  ],
2988
- "rust_unit_tests": 267,
2989
  "source_report": "docs/research/qvm-health-impulse.json",
2990
  "source_report_sha256": "625fd8064004ea6dbdf398d51d0af844d9c635ff04c0a0790886dddb6ab81e71"
2991
  }
 
2985
  "exit_code": 2
2986
  }
2987
  ],
2988
+ "rust_unit_tests": 269,
2989
  "source_report": "docs/research/qvm-health-impulse.json",
2990
  "source_report_sha256": "625fd8064004ea6dbdf398d51d0af844d9c635ff04c0a0790886dddb6ab81e71"
2991
  }
scripts/analyze_rust_assist_sequence.py ADDED
@@ -0,0 +1,16 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ """Compare recovered Rust policy with original QVM fixtures."""
2
+ import hashlib,json,os,subprocess
3
+ from pathlib import Path
4
+ from analyze_qvm import write_json
5
+ from rust_lifecycle_support import result
6
+
7
+ def main():
8
+ subprocess.run(['cargo','build','--offline','--package','urt-gameplay','--bin','urt-assistance'],check=True,capture_output=True)
9
+ binary=Path(os.environ.get('CARGO_TARGET_DIR','target'))/'debug'/'urt-assistance'
10
+ path=Path('docs/research/qvm-assist-sequence.json');data=path.read_bytes();probes=[]
11
+ for p in json.loads(data)['probes']:
12
+ probes.append(dict(source={k:p[k] for k in ['frames']},rust=result(binary,'sequence',encode(p['input']))))
13
+ write_json(Path('docs/research/rust-assist-sequence.json'),dict(source_report=str(path),source_report_sha256=hashlib.sha256(data).hexdigest(),probes=probes,limits='Finite source/Rust contract parity; native time/file/network replies remain supplied or captured.'))
14
+
15
+ from analyze_rust_assist_complete import encode
16
+ if __name__=='__main__':main()
scripts/test_rust_assist_sequence.py ADDED
@@ -0,0 +1,9 @@
 
 
 
 
 
 
 
 
 
 
1
+ import hashlib,json,unittest
2
+ from pathlib import Path
3
+ class PortTests(unittest.TestCase):
4
+ def test_original_parity(self):
5
+ r=json.loads(Path('docs/research/rust-assist-sequence.json').read_text());self.assertGreaterEqual(len(r['probes']),12)
6
+ for p in r['probes']:self.assertEqual(p['source'],p['rust'])
7
+ def test_identity(self):
8
+ r=json.loads(Path('docs/research/rust-assist-sequence.json').read_text());self.assertEqual(hashlib.sha256(Path(r['source_report']).read_bytes()).hexdigest(),r['source_report_sha256'])
9
+ if __name__=='__main__':unittest.main()
xtask/checks.tsv CHANGED
@@ -4103,3 +4103,32 @@ report scripts/analyze_qvm_assist_sequence.py docs/research/qvm-assist-sequence.
4103
  edge docs/research/qvm-assist-sequence.json scripts/test_qvm_assist_sequence.py
4104
  group qvm-assist-sequence scripts/analyze_qvm_assist_sequence.py
4105
  edge scripts/analyze_qvm_assist_sequence.py scripts/analyze_qvm_resumer_audit.py
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
4103
  edge docs/research/qvm-assist-sequence.json scripts/test_qvm_assist_sequence.py
4104
  group qvm-assist-sequence scripts/analyze_qvm_assist_sequence.py
4105
  edge scripts/analyze_qvm_assist_sequence.py scripts/analyze_qvm_resumer_audit.py
4106
+ report scripts/analyze_rust_assist_sequence.py docs/research/rust-assist-sequence.json
4107
+ edge docs/research/rust-assist-sequence.json scripts/test_rust_assist_sequence.py
4108
+ group rust-assist-sequence scripts/analyze_rust_assist_sequence.py
4109
+ edge scripts/analyze_rust_assist_sequence.py scripts/analyze_qvm_resumer_audit.py
4110
+ edge Cargo.toml scripts/analyze_rust_assist_sequence.py
4111
+ edge Cargo.lock scripts/analyze_rust_assist_sequence.py
4112
+ edge crates/urt-gameplay/Cargo.toml scripts/analyze_rust_assist_sequence.py
4113
+ edge crates/urt-gameplay/src/lib.rs scripts/analyze_rust_assist_sequence.py
4114
+ edge crates/urt-gameplay/src/filter_loading.rs scripts/analyze_rust_assist_sequence.py
4115
+ edge crates/urt-gameplay/src/filter_lifecycle.rs scripts/analyze_rust_assist_sequence.py
4116
+ edge crates/urt-gameplay/src/native_policy.rs scripts/analyze_rust_assist_sequence.py
4117
+ edge crates/urt-gameplay/src/bin/urt-filter-loading.rs scripts/analyze_rust_assist_sequence.py
4118
+ edge crates/urt-gameplay/src/qvm_format.rs scripts/analyze_rust_assist_sequence.py
4119
+ edge docs/research/qvm-assist-sequence.json scripts/analyze_rust_assist_sequence.py
4120
+ group rust-assist-sequence scripts/analyze_rust_health_impulse.py
4121
+ group gameplay scripts/analyze_rust_assist_sequence.py
4122
+ edge crates/urt-gameplay/src/filter_commands.rs scripts/analyze_rust_assist_sequence.py
4123
+ edge crates/urt-gameplay/src/bin/urt-filter-commands.rs scripts/analyze_rust_assist_sequence.py
4124
+ edge crates/urt-gameplay/src/client_timer.rs scripts/analyze_rust_assist_sequence.py
4125
+ edge crates/urt-gameplay/src/bin/urt-client-timer.rs scripts/analyze_rust_assist_sequence.py
4126
+ edge crates/urt-gameplay/src/client_processing.rs scripts/analyze_rust_assist_sequence.py
4127
+ edge crates/urt-gameplay/src/bin/urt-client-processing.rs scripts/analyze_rust_assist_sequence.py
4128
+ edge crates/urt-gameplay/src/client_move_context.rs scripts/analyze_rust_assist_sequence.py
4129
+ edge crates/urt-gameplay/src/bin/urt-client-move-context.rs scripts/analyze_rust_assist_sequence.py
4130
+ edge crates/urt-gameplay/src/move_callbacks.rs scripts/analyze_rust_assist_sequence.py
4131
+ edge crates/urt-gameplay/src/bin/urt-move-callbacks.rs scripts/analyze_rust_assist_sequence.py
4132
+ edge crates/urt-gameplay/src/assistance.rs scripts/analyze_rust_assist_sequence.py
4133
+ edge crates/urt-gameplay/src/bin/urt-assistance.rs scripts/analyze_rust_assist_sequence.py
4134
+ edge crates/urt-gameplay/src/move_callbacks.rs scripts/analyze_rust_assist_sequence.py
xtask/src/lib.rs CHANGED
@@ -1150,6 +1150,8 @@ mod integration_tests {
1150
  ("move_callbacks", "assist_progress"),
1151
  ("assistance", "assist_complete"),
1152
  ("move_callbacks", "assist_complete"),
 
 
1153
  ("client_move_context", "client_move_scratch"),
1154
  ("client_processing", "client_routing"),
1155
  ("client_timer", "client_routing"),
@@ -1377,6 +1379,7 @@ mod integration_tests {
1377
  ("qvm-assist-cancel", "assist_cancel"),
1378
  ("qvm-assist-progress", "assist_progress"),
1379
  ("qvm-assist-complete", "assist_complete"),
 
1380
  ("qvm-client-move-scratch", "client_move_scratch"),
1381
  ("qvm-client-routing", "client_routing"),
1382
  ("qvm-client-command-rewrite", "client_command_rewrite"),
 
1150
  ("move_callbacks", "assist_progress"),
1151
  ("assistance", "assist_complete"),
1152
  ("move_callbacks", "assist_complete"),
1153
+ ("assistance", "assist_sequence"),
1154
+ ("move_callbacks", "assist_sequence"),
1155
  ("client_move_context", "client_move_scratch"),
1156
  ("client_processing", "client_routing"),
1157
  ("client_timer", "client_routing"),
 
1379
  ("qvm-assist-cancel", "assist_cancel"),
1380
  ("qvm-assist-progress", "assist_progress"),
1381
  ("qvm-assist-complete", "assist_complete"),
1382
+ ("qvm-assist-sequence", "assist_sequence"),
1383
  ("qvm-client-move-scratch", "client_move_scratch"),
1384
  ("qvm-client-routing", "client_routing"),
1385
  ("qvm-client-command-rewrite", "client_command_rewrite"),