nmarshall commited on
Commit
3e0175a
·
1 Parent(s): 5e20728

gameplay: port objective counters and document legacy tags

Browse files
crates/urt-gameplay/src/bin/urt-effect-feedback.rs ADDED
@@ -0,0 +1,31 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ use urt_gameplay::effect_feedback::*;
2
+ fn list(v: &[u32]) -> String {
3
+ format!(
4
+ "[{}]",
5
+ v.iter()
6
+ .map(|v| v.to_string())
7
+ .collect::<Vec<_>>()
8
+ .join(",")
9
+ )
10
+ }
11
+ fn hex(v: &[u8]) -> String {
12
+ v.iter().map(|v| format!("{v:02x}")).collect()
13
+ }
14
+ fn main() {
15
+ let mut args = std::env::args().skip(1);
16
+ let kind = args.next().unwrap();
17
+ let w: Vec<u32> = args.map(|v| v.parse().unwrap()).collect();
18
+ match kind.as_str() {
19
+ "counter" => {
20
+ assert_eq!(w.len(), 2);
21
+ let mut c: Vec<u32> = (100..115).collect();
22
+ c[w[0] as usize] = w[1];
23
+ increment_objective_counter(&mut c, w[0] as usize).unwrap();
24
+ println!(
25
+ r#"{{"counters":{},"guards":[2864434397,287454020]}}"#,
26
+ list(&c)
27
+ );
28
+ }
29
+ _ => panic!("unknown contract"),
30
+ }
31
+ }
crates/urt-gameplay/src/defuse.rs CHANGED
@@ -20,11 +20,27 @@ pub struct DefuseInput {
20
  }
21
  #[derive(Clone, Debug, PartialEq, Eq)]
22
  pub enum DefuseEffect {
23
- Allocate { event: u32 },
24
- Sound { slot: i32, sound: u32 },
25
- Log { format: Vec<u8>, slot: i32 },
26
- Teleport { slot: i32 },
27
- Award { slot: i32, value: u32 },
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
28
  }
29
  fn validate(input: DefuseInput) -> Result<(), Error> {
30
  if !(0..64).contains(&input.slot) || input.index >= 32 {
 
20
  }
21
  #[derive(Clone, Debug, PartialEq, Eq)]
22
  pub enum DefuseEffect {
23
+ Allocate {
24
+ event: u32,
25
+ },
26
+ /// Legacy tag:193620 is team radio, not audio playback.
27
+ Sound {
28
+ slot: i32,
29
+ sound: u32,
30
+ },
31
+ Log {
32
+ format: Vec<u8>,
33
+ slot: i32,
34
+ },
35
+ /// Legacy tag:205260 adds score; it does not teleport.
36
+ Teleport {
37
+ slot: i32,
38
+ },
39
+ /// Legacy tag:283463 increments the indexed counter by1.
40
+ Award {
41
+ slot: i32,
42
+ value: u32,
43
+ },
44
  }
45
  fn validate(input: DefuseInput) -> Result<(), Error> {
46
  if !(0..64).contains(&input.slot) || input.index >= 32 {
crates/urt-gameplay/src/effect_feedback.rs ADDED
@@ -0,0 +1,28 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ //! Resolved source effect bodies; legacy report tags are not native semantics.
2
+ use crate::native_policy::Error;
3
+ /// Original283463 increments one caller-selected counter by1. The typed slice
4
+ /// defines the supported research window; actual game enum ownership is separate.
5
+ pub fn increment_objective_counter(counters: &mut [u32], index: usize) -> Result<(), Error> {
6
+ let cell = counters.get_mut(index).ok_or(Error::InvalidIndex)?;
7
+ *cell = cell.wrapping_add(1);
8
+ Ok(())
9
+ }
10
+ #[cfg(test)]
11
+ mod counter_tests {
12
+ use super::*;
13
+ #[test]
14
+ fn index_five_increments_once_and_wraps() {
15
+ let mut c = [100; 15];
16
+ c[5] = u32::MAX;
17
+ increment_objective_counter(&mut c, 5).unwrap();
18
+ assert_eq!(c[5], 0);
19
+ assert!(c.iter().enumerate().all(|(i, v)| i == 5 || *v == 100));
20
+ }
21
+ #[test]
22
+ fn invalid_index_preserves_the_window() {
23
+ let mut c = [1; 15];
24
+ let old = c;
25
+ assert!(increment_objective_counter(&mut c, 15).is_err());
26
+ assert_eq!(c, old);
27
+ }
28
+ }
crates/urt-gameplay/src/lib.rs CHANGED
@@ -199,3 +199,5 @@ pub mod move_callbacks;
199
  pub mod assistance;
200
 
201
  pub mod defuse;
 
 
 
199
  pub mod assistance;
200
 
201
  pub mod defuse;
202
+
203
+ pub mod effect_feedback;
crates/urt-gameplay/src/move_callbacks.rs CHANGED
@@ -2,10 +2,20 @@
2
  use crate::native_policy::Error;
3
  #[derive(Clone, Debug, PartialEq, Eq)]
4
  pub enum CallbackEffect {
5
- Teleport { slot: i32 },
6
- Reset { slot: i32 },
7
- Event { event: u32 },
8
- Log { format: Vec<u8>, slots: Vec<i32> },
 
 
 
 
 
 
 
 
 
 
9
  }
10
  #[derive(Clone, Copy, Debug, PartialEq, Eq)]
11
  pub struct MeterState {
 
2
  use crate::native_policy::Error;
3
  #[derive(Clone, Debug, PartialEq, Eq)]
4
  pub enum CallbackEffect {
5
+ /// Legacy tag:205260 adds score; it does not teleport.
6
+ Teleport {
7
+ slot: i32,
8
+ },
9
+ Reset {
10
+ slot: i32,
11
+ },
12
+ Event {
13
+ event: u32,
14
+ },
15
+ Log {
16
+ format: Vec<u8>,
17
+ slots: Vec<i32>,
18
+ },
19
  }
20
  #[derive(Clone, Copy, Debug, PartialEq, Eq)]
21
  pub struct MeterState {
docs/FINDINGS.md CHANGED
@@ -1989,3 +1989,5 @@ RE-1023: Rust matches138 source snapshots across30 scripted sequences. Motion/bu
1989
  RE-1014–1023 batch validation passed:1,978 Python tests,319 Rust tests,131 deterministic affected producers and601 documentation files. All ten tasks have separate commits and focused checks. [Defuse evidence and next work](research/QVM_DEFUSE_BATCH.md).
1990
 
1991
  RE-1024: Twelve original-QVM cases prove283463 increments exactly client3036+4*index by1 with word wrapping; the supplied5 is a counter index, not a five-point score delta. Source205260 was already recovered as score update, and193620 emits team radio commands. Earlier defuse/assistance capture labels score/counter/sound were misleading historical names. Counter guards and unrelated words survive. New findings use numeric IDs and corrected semantics; historical report schemas remain compatible. [Evidence](research/QVM_EFFECT_COUNTER.md).
 
 
 
1989
  RE-1014–1023 batch validation passed:1,978 Python tests,319 Rust tests,131 deterministic affected producers and601 documentation files. All ten tasks have separate commits and focused checks. [Defuse evidence and next work](research/QVM_DEFUSE_BATCH.md).
1990
 
1991
  RE-1024: Twelve original-QVM cases prove283463 increments exactly client3036+4*index by1 with word wrapping; the supplied5 is a counter index, not a five-point score delta. Source205260 was already recovered as score update, and193620 emits team radio commands. Earlier defuse/assistance capture labels score/counter/sound were misleading historical names. Counter guards and unrelated words survive. New findings use numeric IDs and corrected semantics; historical report schemas remain compatible. [Evidence](research/QVM_EFFECT_COUNTER.md).
1992
+
1993
+ RE-1025: Rust implements caller-indexed wrapping counter increments across12 source cases. Index5 increases one word by1, not five score points; invalid indices preserve the supplied window. Historical enum/report tags remain compatible but now carry explicit score/radio/counter semantic corrections. True counter-enum ownership and larger state lifecycle remain open. [Evidence](research/RUST_EFFECT_COUNTER.md).
docs/PROVISIONAL_TODO.md CHANGED
@@ -2049,3 +2049,5 @@ RE-974–983 completed routing, command rewrite, inactivity, movement-parameter
2049
  - [ ] RE-1024 recover objective/native effect feedback and compose defusing with full client preparation/movement/timer execution ([scope](research/QVM_DEFUSE_BATCH.md#next-work-re-1024)).
2050
 
2051
  - [x] RE-1024 Correct native effect identities and recover objective counter ([evidence](research/QVM_EFFECT_COUNTER.md)).
 
 
 
2049
  - [ ] RE-1024 recover objective/native effect feedback and compose defusing with full client preparation/movement/timer execution ([scope](research/QVM_DEFUSE_BATCH.md#next-work-re-1024)).
2050
 
2051
  - [x] RE-1024 Correct native effect identities and recover objective counter ([evidence](research/QVM_EFFECT_COUNTER.md)).
2052
+
2053
+ - [x] RE-1025 Port indexed objective counters and label compatibility notes ([evidence](research/RUST_EFFECT_COUNTER.md)).
docs/RESEARCH_LEDGER.md CHANGED
@@ -2771,3 +2771,7 @@ Rust matches138 source snapshots across30 scripted sequences. Motion/button/team
2771
  ## 2026-10-29 — RE-1024 Correct native effect identities and recover objective counter
2772
 
2773
  Twelve original-QVM cases prove283463 increments exactly client3036+4*index by1 with word wrapping; the supplied5 is a counter index, not a five-point score delta. Source205260 was already recovered as score update, and193620 emits team radio commands. Earlier defuse/assistance capture labels score/counter/sound were misleading historical names. Counter guards and unrelated words survive. New findings use numeric IDs and corrected semantics; historical report schemas remain compatible. Focused `cargo xtask test-group qvm-effect-counter` passes with deterministic report regeneration and selected regressions. Full suite deferred to task ten. Original assets unchanged; Python uses the flake-declared Nix runtime.
 
 
 
 
 
2771
  ## 2026-10-29 — RE-1024 Correct native effect identities and recover objective counter
2772
 
2773
  Twelve original-QVM cases prove283463 increments exactly client3036+4*index by1 with word wrapping; the supplied5 is a counter index, not a five-point score delta. Source205260 was already recovered as score update, and193620 emits team radio commands. Earlier defuse/assistance capture labels score/counter/sound were misleading historical names. Counter guards and unrelated words survive. New findings use numeric IDs and corrected semantics; historical report schemas remain compatible. Focused `cargo xtask test-group qvm-effect-counter` passes with deterministic report regeneration and selected regressions. Full suite deferred to task ten. Original assets unchanged; Python uses the flake-declared Nix runtime.
2774
+
2775
+ ## 2026-10-29 — RE-1025 Port indexed objective counters and label compatibility notes
2776
+
2777
+ Rust implements caller-indexed wrapping counter increments across12 source cases. Index5 increases one word by1, not five score points; invalid indices preserve the supplied window. Historical enum/report tags remain compatible but now carry explicit score/radio/counter semantic corrections. True counter-enum ownership and larger state lifecycle remain open. Focused `cargo xtask test-group rust-effect-counter` passes with deterministic report regeneration and selected regressions. Full suite deferred to task ten. Original assets unchanged; Python uses the flake-declared Nix runtime.
docs/REVERSE_ENGINEERING_TODO.md CHANGED
@@ -2086,3 +2086,5 @@ RE-974–983 recover routing, command rewriting, inactivity and composed setup t
2086
  - [ ] RE-1024 recover objective/native effect feedback and compose defusing with full client preparation/movement/timer execution ([scope](research/QVM_DEFUSE_BATCH.md#next-work-re-1024)).
2087
 
2088
  - [x] RE-1024 Correct native effect identities and recover objective counter ([evidence](research/QVM_EFFECT_COUNTER.md)).
 
 
 
2086
  - [ ] RE-1024 recover objective/native effect feedback and compose defusing with full client preparation/movement/timer execution ([scope](research/QVM_DEFUSE_BATCH.md#next-work-re-1024)).
2087
 
2088
  - [x] RE-1024 Correct native effect identities and recover objective counter ([evidence](research/QVM_EFFECT_COUNTER.md)).
2089
+
2090
+ - [x] RE-1025 Port indexed objective counters and label compatibility notes ([evidence](research/RUST_EFFECT_COUNTER.md)).
docs/research/QVM_ASSISTANCE_BATCH.md CHANGED
@@ -1,5 +1,8 @@
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 |
 
1
  # Assistance search and replay: RE-1004–1013
2
 
3
+ Semantic correction from RE-1024: historical capture tags `teleport`, `award` and `sound` for functions205260,283463 and193620 identify score update, indexed counter increment and team radio respectively. Their numeric call arguments remain evidence; the old schemas are retained for compatibility. [Corrected source evidence](QVM_EFFECT_COUNTER.md).
4
+
5
+
6
  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.
7
 
8
  | Tasks | Contract | Paired scenarios |
docs/research/QVM_DEFUSE_BATCH.md CHANGED
@@ -1,5 +1,8 @@
1
  # Bomb-defuse transitions and replay: RE-1014–1023
2
 
 
 
 
3
  Ten tasks recover five source/Rust contracts across **278 paired scenarios**, including138 repeated-call snapshots. They extend the [assistance batch](QVM_ASSISTANCE_BATCH.md) through the mode8 bomb-defuse callback153419. Every task has a separate commit and focused validation. Native nested effect bodies, actual frame scheduling and full game/platform acceptance remain outside this evidence.
4
 
5
  | Tasks | Contract | Paired scenarios |
 
1
  # Bomb-defuse transitions and replay: RE-1014–1023
2
 
3
+ Semantic correction from RE-1024: historical capture tags `teleport`, `award` and `sound` for functions205260,283463 and193620 identify score update, indexed counter increment and team radio respectively. Their numeric call arguments remain evidence; the old schemas are retained for compatibility. [Corrected source evidence](QVM_EFFECT_COUNTER.md).
4
+
5
+
6
  Ten tasks recover five source/Rust contracts across **278 paired scenarios**, including138 repeated-call snapshots. They extend the [assistance batch](QVM_ASSISTANCE_BATCH.md) through the mode8 bomb-defuse callback153419. Every task has a separate commit and focused validation. Native nested effect bodies, actual frame scheduling and full game/platform acceptance remain outside this evidence.
7
 
8
  | Tasks | Contract | Paired scenarios |
docs/research/QVM_MOVE_CALLBACK_BATCH.md CHANGED
@@ -1,5 +1,8 @@
1
  # Movement callbacks: RE-994–1003
2
 
 
 
 
3
  Ten tasks recover five source/Rust contracts across **244 paired fixtures**. They extend the [movement-context batch](QVM_MOVE_CONTEXT_BATCH.md) by replacing supplied mode10 self feedback with recovered callback policies. Every task has its own focused validation and commit. This remains bounded reverse engineering; nonempty assistance search, mode8 objective mutation and actual movement54475 remain open.
4
 
5
  | Tasks | Contract | Paired fixtures |
 
1
  # Movement callbacks: RE-994–1003
2
 
3
+ Semantic correction from RE-1024: historical capture tags `teleport`, `award` and `sound` for functions205260,283463 and193620 identify score update, indexed counter increment and team radio respectively. Their numeric call arguments remain evidence; the old schemas are retained for compatibility. [Corrected source evidence](QVM_EFFECT_COUNTER.md).
4
+
5
+
6
  Ten tasks recover five source/Rust contracts across **244 paired fixtures**. They extend the [movement-context batch](QVM_MOVE_CONTEXT_BATCH.md) by replacing supplied mode10 self feedback with recovered callback policies. Every task has its own focused validation and commit. This remains bounded reverse engineering; nonempty assistance search, mode8 objective mutation and actual movement54475 remain open.
7
 
8
  | Tasks | Contract | Paired fixtures |
docs/research/README.md CHANGED
@@ -1617,3 +1617,5 @@ The extension collector adds five focused tests for native tail calls, command-r
1617
  - [Bomb-defuse transitions and replay: RE-1014–1023](QVM_DEFUSE_BATCH.md).
1618
 
1619
  - [RE-1024: Correct native effect identities and recover objective counter](QVM_EFFECT_COUNTER.md).
 
 
 
1617
  - [Bomb-defuse transitions and replay: RE-1014–1023](QVM_DEFUSE_BATCH.md).
1618
 
1619
  - [RE-1024: Correct native effect identities and recover objective counter](QVM_EFFECT_COUNTER.md).
1620
+
1621
+ - [RE-1025: Port indexed objective counters and label compatibility notes](RUST_EFFECT_COUNTER.md).
docs/research/RUST_EFFECT_COUNTER.md ADDED
@@ -0,0 +1,5 @@
 
 
 
 
 
 
1
+ # Port indexed objective counters and label compatibility notes
2
+
3
+ RE-1025. Focused validation: `cargo xtask test-group rust-effect-counter`. [Machine report](rust-effect-counter.json).
4
+
5
+ Rust implements caller-indexed wrapping counter increments across12 source cases. Index5 increases one word by1, not five score points; invalid indices preserve the supplied window. Historical enum/report tags remain compatible but now carry explicit score/radio/counter semantic corrections. True counter-enum ownership and larger state lifecycle remain open.
docs/research/rust-effect-counter.json ADDED
@@ -0,0 +1,583 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ {
2
+ "limits": "Finite source/Rust contract parity; native time/file/network replies remain supplied or captured.",
3
+ "probes": [
4
+ {
5
+ "rust": {
6
+ "counters": [
7
+ 1,
8
+ 101,
9
+ 102,
10
+ 103,
11
+ 104,
12
+ 105,
13
+ 106,
14
+ 107,
15
+ 108,
16
+ 109,
17
+ 110,
18
+ 111,
19
+ 112,
20
+ 113,
21
+ 114
22
+ ],
23
+ "guards": [
24
+ 2864434397,
25
+ 287454020
26
+ ]
27
+ },
28
+ "source": {
29
+ "counters": [
30
+ 1,
31
+ 101,
32
+ 102,
33
+ 103,
34
+ 104,
35
+ 105,
36
+ 106,
37
+ 107,
38
+ 108,
39
+ 109,
40
+ 110,
41
+ 111,
42
+ 112,
43
+ 113,
44
+ 114
45
+ ],
46
+ "guards": [
47
+ 2864434397,
48
+ 287454020
49
+ ]
50
+ }
51
+ },
52
+ {
53
+ "rust": {
54
+ "counters": [
55
+ 8,
56
+ 101,
57
+ 102,
58
+ 103,
59
+ 104,
60
+ 105,
61
+ 106,
62
+ 107,
63
+ 108,
64
+ 109,
65
+ 110,
66
+ 111,
67
+ 112,
68
+ 113,
69
+ 114
70
+ ],
71
+ "guards": [
72
+ 2864434397,
73
+ 287454020
74
+ ]
75
+ },
76
+ "source": {
77
+ "counters": [
78
+ 8,
79
+ 101,
80
+ 102,
81
+ 103,
82
+ 104,
83
+ 105,
84
+ 106,
85
+ 107,
86
+ 108,
87
+ 109,
88
+ 110,
89
+ 111,
90
+ 112,
91
+ 113,
92
+ 114
93
+ ],
94
+ "guards": [
95
+ 2864434397,
96
+ 287454020
97
+ ]
98
+ }
99
+ },
100
+ {
101
+ "rust": {
102
+ "counters": [
103
+ 0,
104
+ 101,
105
+ 102,
106
+ 103,
107
+ 104,
108
+ 105,
109
+ 106,
110
+ 107,
111
+ 108,
112
+ 109,
113
+ 110,
114
+ 111,
115
+ 112,
116
+ 113,
117
+ 114
118
+ ],
119
+ "guards": [
120
+ 2864434397,
121
+ 287454020
122
+ ]
123
+ },
124
+ "source": {
125
+ "counters": [
126
+ 0,
127
+ 101,
128
+ 102,
129
+ 103,
130
+ 104,
131
+ 105,
132
+ 106,
133
+ 107,
134
+ 108,
135
+ 109,
136
+ 110,
137
+ 111,
138
+ 112,
139
+ 113,
140
+ 114
141
+ ],
142
+ "guards": [
143
+ 2864434397,
144
+ 287454020
145
+ ]
146
+ }
147
+ },
148
+ {
149
+ "rust": {
150
+ "counters": [
151
+ 2147483649,
152
+ 101,
153
+ 102,
154
+ 103,
155
+ 104,
156
+ 105,
157
+ 106,
158
+ 107,
159
+ 108,
160
+ 109,
161
+ 110,
162
+ 111,
163
+ 112,
164
+ 113,
165
+ 114
166
+ ],
167
+ "guards": [
168
+ 2864434397,
169
+ 287454020
170
+ ]
171
+ },
172
+ "source": {
173
+ "counters": [
174
+ 2147483649,
175
+ 101,
176
+ 102,
177
+ 103,
178
+ 104,
179
+ 105,
180
+ 106,
181
+ 107,
182
+ 108,
183
+ 109,
184
+ 110,
185
+ 111,
186
+ 112,
187
+ 113,
188
+ 114
189
+ ],
190
+ "guards": [
191
+ 2864434397,
192
+ 287454020
193
+ ]
194
+ }
195
+ },
196
+ {
197
+ "rust": {
198
+ "counters": [
199
+ 100,
200
+ 101,
201
+ 102,
202
+ 103,
203
+ 104,
204
+ 1,
205
+ 106,
206
+ 107,
207
+ 108,
208
+ 109,
209
+ 110,
210
+ 111,
211
+ 112,
212
+ 113,
213
+ 114
214
+ ],
215
+ "guards": [
216
+ 2864434397,
217
+ 287454020
218
+ ]
219
+ },
220
+ "source": {
221
+ "counters": [
222
+ 100,
223
+ 101,
224
+ 102,
225
+ 103,
226
+ 104,
227
+ 1,
228
+ 106,
229
+ 107,
230
+ 108,
231
+ 109,
232
+ 110,
233
+ 111,
234
+ 112,
235
+ 113,
236
+ 114
237
+ ],
238
+ "guards": [
239
+ 2864434397,
240
+ 287454020
241
+ ]
242
+ }
243
+ },
244
+ {
245
+ "rust": {
246
+ "counters": [
247
+ 100,
248
+ 101,
249
+ 102,
250
+ 103,
251
+ 104,
252
+ 8,
253
+ 106,
254
+ 107,
255
+ 108,
256
+ 109,
257
+ 110,
258
+ 111,
259
+ 112,
260
+ 113,
261
+ 114
262
+ ],
263
+ "guards": [
264
+ 2864434397,
265
+ 287454020
266
+ ]
267
+ },
268
+ "source": {
269
+ "counters": [
270
+ 100,
271
+ 101,
272
+ 102,
273
+ 103,
274
+ 104,
275
+ 8,
276
+ 106,
277
+ 107,
278
+ 108,
279
+ 109,
280
+ 110,
281
+ 111,
282
+ 112,
283
+ 113,
284
+ 114
285
+ ],
286
+ "guards": [
287
+ 2864434397,
288
+ 287454020
289
+ ]
290
+ }
291
+ },
292
+ {
293
+ "rust": {
294
+ "counters": [
295
+ 100,
296
+ 101,
297
+ 102,
298
+ 103,
299
+ 104,
300
+ 0,
301
+ 106,
302
+ 107,
303
+ 108,
304
+ 109,
305
+ 110,
306
+ 111,
307
+ 112,
308
+ 113,
309
+ 114
310
+ ],
311
+ "guards": [
312
+ 2864434397,
313
+ 287454020
314
+ ]
315
+ },
316
+ "source": {
317
+ "counters": [
318
+ 100,
319
+ 101,
320
+ 102,
321
+ 103,
322
+ 104,
323
+ 0,
324
+ 106,
325
+ 107,
326
+ 108,
327
+ 109,
328
+ 110,
329
+ 111,
330
+ 112,
331
+ 113,
332
+ 114
333
+ ],
334
+ "guards": [
335
+ 2864434397,
336
+ 287454020
337
+ ]
338
+ }
339
+ },
340
+ {
341
+ "rust": {
342
+ "counters": [
343
+ 100,
344
+ 101,
345
+ 102,
346
+ 103,
347
+ 104,
348
+ 2147483649,
349
+ 106,
350
+ 107,
351
+ 108,
352
+ 109,
353
+ 110,
354
+ 111,
355
+ 112,
356
+ 113,
357
+ 114
358
+ ],
359
+ "guards": [
360
+ 2864434397,
361
+ 287454020
362
+ ]
363
+ },
364
+ "source": {
365
+ "counters": [
366
+ 100,
367
+ 101,
368
+ 102,
369
+ 103,
370
+ 104,
371
+ 2147483649,
372
+ 106,
373
+ 107,
374
+ 108,
375
+ 109,
376
+ 110,
377
+ 111,
378
+ 112,
379
+ 113,
380
+ 114
381
+ ],
382
+ "guards": [
383
+ 2864434397,
384
+ 287454020
385
+ ]
386
+ }
387
+ },
388
+ {
389
+ "rust": {
390
+ "counters": [
391
+ 100,
392
+ 101,
393
+ 102,
394
+ 103,
395
+ 104,
396
+ 105,
397
+ 106,
398
+ 107,
399
+ 108,
400
+ 109,
401
+ 110,
402
+ 111,
403
+ 112,
404
+ 113,
405
+ 1
406
+ ],
407
+ "guards": [
408
+ 2864434397,
409
+ 287454020
410
+ ]
411
+ },
412
+ "source": {
413
+ "counters": [
414
+ 100,
415
+ 101,
416
+ 102,
417
+ 103,
418
+ 104,
419
+ 105,
420
+ 106,
421
+ 107,
422
+ 108,
423
+ 109,
424
+ 110,
425
+ 111,
426
+ 112,
427
+ 113,
428
+ 1
429
+ ],
430
+ "guards": [
431
+ 2864434397,
432
+ 287454020
433
+ ]
434
+ }
435
+ },
436
+ {
437
+ "rust": {
438
+ "counters": [
439
+ 100,
440
+ 101,
441
+ 102,
442
+ 103,
443
+ 104,
444
+ 105,
445
+ 106,
446
+ 107,
447
+ 108,
448
+ 109,
449
+ 110,
450
+ 111,
451
+ 112,
452
+ 113,
453
+ 8
454
+ ],
455
+ "guards": [
456
+ 2864434397,
457
+ 287454020
458
+ ]
459
+ },
460
+ "source": {
461
+ "counters": [
462
+ 100,
463
+ 101,
464
+ 102,
465
+ 103,
466
+ 104,
467
+ 105,
468
+ 106,
469
+ 107,
470
+ 108,
471
+ 109,
472
+ 110,
473
+ 111,
474
+ 112,
475
+ 113,
476
+ 8
477
+ ],
478
+ "guards": [
479
+ 2864434397,
480
+ 287454020
481
+ ]
482
+ }
483
+ },
484
+ {
485
+ "rust": {
486
+ "counters": [
487
+ 100,
488
+ 101,
489
+ 102,
490
+ 103,
491
+ 104,
492
+ 105,
493
+ 106,
494
+ 107,
495
+ 108,
496
+ 109,
497
+ 110,
498
+ 111,
499
+ 112,
500
+ 113,
501
+ 0
502
+ ],
503
+ "guards": [
504
+ 2864434397,
505
+ 287454020
506
+ ]
507
+ },
508
+ "source": {
509
+ "counters": [
510
+ 100,
511
+ 101,
512
+ 102,
513
+ 103,
514
+ 104,
515
+ 105,
516
+ 106,
517
+ 107,
518
+ 108,
519
+ 109,
520
+ 110,
521
+ 111,
522
+ 112,
523
+ 113,
524
+ 0
525
+ ],
526
+ "guards": [
527
+ 2864434397,
528
+ 287454020
529
+ ]
530
+ }
531
+ },
532
+ {
533
+ "rust": {
534
+ "counters": [
535
+ 100,
536
+ 101,
537
+ 102,
538
+ 103,
539
+ 104,
540
+ 105,
541
+ 106,
542
+ 107,
543
+ 108,
544
+ 109,
545
+ 110,
546
+ 111,
547
+ 112,
548
+ 113,
549
+ 2147483649
550
+ ],
551
+ "guards": [
552
+ 2864434397,
553
+ 287454020
554
+ ]
555
+ },
556
+ "source": {
557
+ "counters": [
558
+ 100,
559
+ 101,
560
+ 102,
561
+ 103,
562
+ 104,
563
+ 105,
564
+ 106,
565
+ 107,
566
+ 108,
567
+ 109,
568
+ 110,
569
+ 111,
570
+ 112,
571
+ 113,
572
+ 2147483649
573
+ ],
574
+ "guards": [
575
+ 2864434397,
576
+ 287454020
577
+ ]
578
+ }
579
+ }
580
+ ],
581
+ "source_report": "docs/research/qvm-effect-counter.json",
582
+ "source_report_sha256": "1114bee870f527e21cbed2d0de0f863e8b9fb5b67242a8b03881827ea2c92c9c"
583
+ }
docs/research/rust-health-impulse.json CHANGED
@@ -2985,7 +2985,7 @@
2985
  "exit_code": 2
2986
  }
2987
  ],
2988
- "rust_unit_tests": 279,
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": 281,
2989
  "source_report": "docs/research/qvm-health-impulse.json",
2990
  "source_report_sha256": "625fd8064004ea6dbdf398d51d0af844d9c635ff04c0a0790886dddb6ab81e71"
2991
  }
scripts/analyze_rust_effect_counter.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-effect-feedback'],check=True,capture_output=True)
9
+ binary=Path(os.environ.get('CARGO_TARGET_DIR','target'))/'debug'/'urt-effect-feedback'
10
+ path=Path('docs/research/qvm-effect-counter.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 ['counters', 'guards']},rust=result(binary,'counter',encode(p['input']))))
13
+ write_json(Path('docs/research/rust-effect-counter.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
+ def encode(a):return [a['index'],a['value']]
16
+ if __name__=='__main__':main()
scripts/test_rust_effect_counter.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-effect-counter.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-effect-counter.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
@@ -4318,3 +4318,41 @@ report scripts/analyze_qvm_effect_counter.py docs/research/qvm-effect-counter.js
4318
  edge docs/research/qvm-effect-counter.json scripts/test_qvm_effect_counter.py
4319
  group qvm-effect-counter scripts/analyze_qvm_effect_counter.py
4320
  edge scripts/analyze_qvm_effect_counter.py scripts/analyze_qvm_resumer_audit.py
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
4318
  edge docs/research/qvm-effect-counter.json scripts/test_qvm_effect_counter.py
4319
  group qvm-effect-counter scripts/analyze_qvm_effect_counter.py
4320
  edge scripts/analyze_qvm_effect_counter.py scripts/analyze_qvm_resumer_audit.py
4321
+ report scripts/analyze_rust_effect_counter.py docs/research/rust-effect-counter.json
4322
+ edge docs/research/rust-effect-counter.json scripts/test_rust_effect_counter.py
4323
+ group rust-effect-counter scripts/analyze_rust_effect_counter.py
4324
+ edge scripts/analyze_rust_effect_counter.py scripts/analyze_qvm_resumer_audit.py
4325
+ edge Cargo.toml scripts/analyze_rust_effect_counter.py
4326
+ edge Cargo.lock scripts/analyze_rust_effect_counter.py
4327
+ edge crates/urt-gameplay/Cargo.toml scripts/analyze_rust_effect_counter.py
4328
+ edge crates/urt-gameplay/src/lib.rs scripts/analyze_rust_effect_counter.py
4329
+ edge crates/urt-gameplay/src/filter_loading.rs scripts/analyze_rust_effect_counter.py
4330
+ edge crates/urt-gameplay/src/filter_lifecycle.rs scripts/analyze_rust_effect_counter.py
4331
+ edge crates/urt-gameplay/src/native_policy.rs scripts/analyze_rust_effect_counter.py
4332
+ edge crates/urt-gameplay/src/bin/urt-filter-loading.rs scripts/analyze_rust_effect_counter.py
4333
+ edge crates/urt-gameplay/src/qvm_format.rs scripts/analyze_rust_effect_counter.py
4334
+ edge docs/research/qvm-effect-counter.json scripts/analyze_rust_effect_counter.py
4335
+ group rust-effect-counter scripts/analyze_rust_health_impulse.py
4336
+ group gameplay scripts/analyze_rust_effect_counter.py
4337
+ edge crates/urt-gameplay/src/filter_commands.rs scripts/analyze_rust_effect_counter.py
4338
+ edge crates/urt-gameplay/src/bin/urt-filter-commands.rs scripts/analyze_rust_effect_counter.py
4339
+ edge crates/urt-gameplay/src/client_timer.rs scripts/analyze_rust_effect_counter.py
4340
+ edge crates/urt-gameplay/src/bin/urt-client-timer.rs scripts/analyze_rust_effect_counter.py
4341
+ edge crates/urt-gameplay/src/client_processing.rs scripts/analyze_rust_effect_counter.py
4342
+ edge crates/urt-gameplay/src/bin/urt-client-processing.rs scripts/analyze_rust_effect_counter.py
4343
+ edge crates/urt-gameplay/src/client_move_context.rs scripts/analyze_rust_effect_counter.py
4344
+ edge crates/urt-gameplay/src/bin/urt-client-move-context.rs scripts/analyze_rust_effect_counter.py
4345
+ edge crates/urt-gameplay/src/move_callbacks.rs scripts/analyze_rust_effect_counter.py
4346
+ edge crates/urt-gameplay/src/bin/urt-move-callbacks.rs scripts/analyze_rust_effect_counter.py
4347
+ edge crates/urt-gameplay/src/assistance.rs scripts/analyze_rust_effect_counter.py
4348
+ edge crates/urt-gameplay/src/bin/urt-assistance.rs scripts/analyze_rust_effect_counter.py
4349
+ edge crates/urt-gameplay/src/move_callbacks.rs scripts/analyze_rust_effect_counter.py
4350
+ edge crates/urt-gameplay/src/defuse.rs scripts/analyze_rust_effect_counter.py
4351
+ edge crates/urt-gameplay/src/bin/urt-defuse.rs scripts/analyze_rust_effect_counter.py
4352
+ edge crates/urt-gameplay/src/move_callbacks.rs scripts/analyze_rust_effect_counter.py
4353
+ edge crates/urt-gameplay/src/effect_feedback.rs scripts/analyze_rust_effect_counter.py
4354
+ edge crates/urt-gameplay/src/bin/urt-effect-feedback.rs scripts/analyze_rust_effect_counter.py
4355
+ edge crates/urt-gameplay/src/score.rs scripts/analyze_rust_effect_counter.py
4356
+ edge crates/urt-gameplay/src/transition.rs scripts/analyze_rust_effect_counter.py
4357
+ edge crates/urt-gameplay/src/effect_feedback.rs scripts/analyze_rust_health_impulse.py
4358
+ edge crates/urt-gameplay/src/bin/urt-effect-feedback.rs scripts/analyze_rust_health_impulse.py
xtask/src/lib.rs CHANGED
@@ -1162,6 +1162,9 @@ mod integration_tests {
1162
  ("move_callbacks", "defuse_complete"),
1163
  ("defuse", "defuse_sequence"),
1164
  ("move_callbacks", "defuse_sequence"),
 
 
 
1165
  ("client_move_context", "client_move_scratch"),
1166
  ("client_processing", "client_routing"),
1167
  ("client_timer", "client_routing"),
@@ -1395,6 +1398,7 @@ mod integration_tests {
1395
  ("qvm-defuse-finish", "defuse_finish"),
1396
  ("qvm-defuse-complete", "defuse_complete"),
1397
  ("qvm-defuse-sequence", "defuse_sequence"),
 
1398
  ("qvm-client-move-scratch", "client_move_scratch"),
1399
  ("qvm-client-routing", "client_routing"),
1400
  ("qvm-client-command-rewrite", "client_command_rewrite"),
 
1162
  ("move_callbacks", "defuse_complete"),
1163
  ("defuse", "defuse_sequence"),
1164
  ("move_callbacks", "defuse_sequence"),
1165
+ ("effect_feedback", "effect_counter"),
1166
+ ("score", "effect_counter"),
1167
+ ("transition", "effect_counter"),
1168
  ("client_move_context", "client_move_scratch"),
1169
  ("client_processing", "client_routing"),
1170
  ("client_timer", "client_routing"),
 
1398
  ("qvm-defuse-finish", "defuse_finish"),
1399
  ("qvm-defuse-complete", "defuse_complete"),
1400
  ("qvm-defuse-sequence", "defuse_sequence"),
1401
+ ("qvm-effect-counter", "effect_counter"),
1402
  ("qvm-client-move-scratch", "client_move_scratch"),
1403
  ("qvm-client-routing", "client_routing"),
1404
  ("qvm-client-command-rewrite", "client_command_rewrite"),