nmarshall commited on
Commit
d8e6444
·
1 Parent(s): ccfeae3

gameplay: port entity hash search

Browse files
crates/urt-gameplay/src/bin/urt-camera-world.rs ADDED
@@ -0,0 +1,60 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ use urt_gameplay::camera_world::*;
2
+ fn array(v: &[u32]) -> String {
3
+ format!(
4
+ "[{}]",
5
+ v.iter()
6
+ .map(|v| v.to_string())
7
+ .collect::<Vec<_>>()
8
+ .join(",")
9
+ )
10
+ }
11
+ fn cursor(v: u32) -> Option<usize> {
12
+ if v == u32::MAX {
13
+ None
14
+ } else {
15
+ Some(v as usize)
16
+ }
17
+ }
18
+ fn run() -> Result<String, String> {
19
+ let a = std::env::args().skip(1).collect::<Vec<_>>();
20
+ let kind = a.first().ok_or("missing command")?;
21
+ let w = a[1..]
22
+ .iter()
23
+ .map(|v| v.parse::<u32>().map_err(|_| "invalid word".to_string()))
24
+ .collect::<Result<Vec<_>, _>>()?;
25
+ match kind.as_str() {
26
+ "hash" => {
27
+ if w.len() < 4 {
28
+ return Err("missing hash input".into());
29
+ }
30
+ let n = w[3] as usize;
31
+ if n > 1024 || w.len() != 4 + 3 * n {
32
+ return Err("invalid hash count".into());
33
+ }
34
+ let e = w[4..]
35
+ .chunks_exact(3)
36
+ .map(|v| HashEntity {
37
+ in_use: v[0] as i32,
38
+ class_present: v[1] != 0,
39
+ class_hash: v[2],
40
+ })
41
+ .collect::<Vec<_>>();
42
+ let j =
43
+ find_class(&e, w[0] as usize, cursor(w[1]), w[2]).map_err(|e| format!("{e:?}"))?;
44
+ Ok(format!(
45
+ "{{\"result\":{}}}",
46
+ j.map(|j| j as i32).unwrap_or(-1)
47
+ ))
48
+ }
49
+ _ => Err("unknown command".into()),
50
+ }
51
+ }
52
+ fn main() {
53
+ match run() {
54
+ Ok(s) => println!("{s}"),
55
+ Err(e) => {
56
+ eprintln!("{e}");
57
+ std::process::exit(2);
58
+ }
59
+ }
60
+ }
crates/urt-gameplay/src/camera_world.rs ADDED
@@ -0,0 +1,79 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ //! Bounded entity search and camera setup contracts from the original VM.
2
+ #[derive(Clone, Copy, Debug, PartialEq, Eq)]
3
+ pub enum Error {
4
+ InvalidCount,
5
+ InvalidCursor,
6
+ InvalidString,
7
+ FloatDomain,
8
+ MathTranscript,
9
+ }
10
+ #[derive(Clone, Copy, Debug, PartialEq, Eq)]
11
+ pub struct HashEntity {
12
+ pub in_use: i32,
13
+ pub class_present: bool,
14
+ pub class_hash: u32,
15
+ }
16
+ fn bounds(len: usize, count: usize, after: Option<usize>) -> Result<usize, Error> {
17
+ if len > 1024 || count > len {
18
+ return Err(Error::InvalidCount);
19
+ }
20
+ if let Some(j) = after {
21
+ if j >= len {
22
+ return Err(Error::InvalidCursor);
23
+ }
24
+ Ok(j + 1)
25
+ } else {
26
+ Ok(0)
27
+ }
28
+ }
29
+ pub fn find_class(
30
+ entities: &[HashEntity],
31
+ count: usize,
32
+ after: Option<usize>,
33
+ hash: u32,
34
+ ) -> Result<Option<usize>, Error> {
35
+ let start = bounds(entities.len(), count, after)?;
36
+ Ok((start..count).find(|j| {
37
+ let e = entities[*j];
38
+ e.in_use != 0 && e.class_present && e.class_hash == hash
39
+ }))
40
+ }
41
+ #[cfg(test)]
42
+ mod hash_tests {
43
+ use super::*;
44
+ #[test]
45
+ fn collisions_and_nonzero_active_cursor() {
46
+ let e = [
47
+ HashEntity {
48
+ in_use: 0,
49
+ class_present: true,
50
+ class_hash: 7,
51
+ },
52
+ HashEntity {
53
+ in_use: -1,
54
+ class_present: true,
55
+ class_hash: 7,
56
+ },
57
+ HashEntity {
58
+ in_use: 2,
59
+ class_present: true,
60
+ class_hash: 7,
61
+ },
62
+ ];
63
+ assert_eq!(find_class(&e, 3, None, 7), Ok(Some(1)));
64
+ assert_eq!(find_class(&e, 3, Some(1), 7), Ok(Some(2)));
65
+ assert_eq!(find_class(&e, 0, Some(2), 7), Ok(None));
66
+ }
67
+ #[test]
68
+ fn safe_count_and_cursor_rejection() {
69
+ let e = [HashEntity {
70
+ in_use: 1,
71
+ class_present: false,
72
+ class_hash: 7,
73
+ }];
74
+ assert_eq!(find_class(&e, 1, None, 7), Ok(None));
75
+ assert_eq!(find_class(&e, 2, None, 7), Err(Error::InvalidCount));
76
+ assert_eq!(find_class(&e, 1, Some(1), 7), Err(Error::InvalidCursor));
77
+ assert_eq!(find_class(&[], 0, None, 7), Ok(None));
78
+ }
79
+ }
crates/urt-gameplay/src/lib.rs CHANGED
@@ -175,3 +175,5 @@ pub mod exit_rules;
175
  pub mod intermission;
176
 
177
  pub mod transition;
 
 
 
175
  pub mod intermission;
176
 
177
  pub mod transition;
178
+
179
+ pub mod camera_world;
docs/FINDINGS.md CHANGED
@@ -1562,3 +1562,6 @@ RE-813–822 replaces the scoreboard decimal assumption with actual37914 executi
1562
 
1563
 
1564
  **RE-854:** 80 original 276433 cases recover nonzero active/class-pointer filtering, first match after cursor, scan limits and raw hash equality. Class text is never compared, so collisions return the first eligible hash match. Read-only world behavior is verified; unsafe pointers and native/runtime behavior remain open. [Evidence](research/QVM_ENTITY_HASH.md).
 
 
 
 
1562
 
1563
 
1564
  **RE-854:** 80 original 276433 cases recover nonzero active/class-pointer filtering, first match after cursor, scan limits and raw hash equality. Class text is never compared, so collisions return the first eligible hash match. Read-only world behavior is verified; unsafe pointers and native/runtime behavior remain open. [Evidence](research/QVM_ENTITY_HASH.md).
1565
+
1566
+
1567
+ **RE-855:** Rust matches 80 original class-hash search cases, including inactive/null class filtering, collisions, nonzero signed active values and cursors beyond the scan count. Bounded safe entity slices reject invalid cursors/counts; class text is intentionally not compared because the source does not compare it. [Evidence](research/RUST_ENTITY_HASH.md).
docs/PROVISIONAL_TODO.md CHANGED
@@ -1584,3 +1584,6 @@ RE-853: Rust matches 144 original temporary-event cases, including exact snap wo
1584
 
1585
 
1586
  RE-854: 80 original 276433 cases recover nonzero active/class-pointer filtering, first match after cursor, scan limits and raw hash equality. Class text is never compared, so collisions return the first eligible hash match. Read-only world behavior is verified; unsafe pointers and native/runtime behavior remain open. Full runtime completion remains open. [Evidence](research/QVM_ENTITY_HASH.md).
 
 
 
 
1584
 
1585
 
1586
  RE-854: 80 original 276433 cases recover nonzero active/class-pointer filtering, first match after cursor, scan limits and raw hash equality. Class text is never compared, so collisions return the first eligible hash match. Read-only world behavior is verified; unsafe pointers and native/runtime behavior remain open. Full runtime completion remains open. [Evidence](research/QVM_ENTITY_HASH.md).
1587
+
1588
+
1589
+ RE-855: Rust matches 80 original class-hash search cases, including inactive/null class filtering, collisions, nonzero signed active values and cursors beyond the scan count. Bounded safe entity slices reject invalid cursors/counts; class text is intentionally not compared because the source does not compare it. Full runtime completion remains open. [Evidence](research/RUST_ENTITY_HASH.md).
docs/RESEARCH_LEDGER.md CHANGED
@@ -1952,3 +1952,8 @@ Batch RE-844–853 boundary: the single `cargo xtask test-full --since 15d7fcac`
1952
  ## 2026-10-27 — RE-854 Original entity class-hash search and cursor semantics
1953
 
1954
  80 original 276433 cases recover nonzero active/class-pointer filtering, first match after cursor, scan limits and raw hash equality. Class text is never compared, so collisions return the first eligible hash match. Read-only world behavior is verified; unsafe pointers and native/runtime behavior remain open. Focused `cargo xtask test-group entity-hash` passes (5 Python tests); selected reports regenerate twice deterministically, with storage, documentation links and whitespace guards. Full suite deferred to task ten. Original assets unchanged; source fixtures do not establish complete native/runtime parity.
 
 
 
 
 
 
1952
  ## 2026-10-27 — RE-854 Original entity class-hash search and cursor semantics
1953
 
1954
  80 original 276433 cases recover nonzero active/class-pointer filtering, first match after cursor, scan limits and raw hash equality. Class text is never compared, so collisions return the first eligible hash match. Read-only world behavior is verified; unsafe pointers and native/runtime behavior remain open. Focused `cargo xtask test-group entity-hash` passes (5 Python tests); selected reports regenerate twice deterministically, with storage, documentation links and whitespace guards. Full suite deferred to task ten. Original assets unchanged; source fixtures do not establish complete native/runtime parity.
1955
+
1956
+
1957
+ ## 2026-10-27 — RE-855 Rust entity class-hash search
1958
+
1959
+ Rust matches 80 original class-hash search cases, including inactive/null class filtering, collisions, nonzero signed active values and cursors beyond the scan count. Bounded safe entity slices reject invalid cursors/counts; class text is intentionally not compared because the source does not compare it. Focused `cargo xtask test-group rust-entity-hash` passes (9 Python tests); selected reports regenerate twice deterministically, with storage, documentation links and whitespace guards. Full suite deferred to task ten. Original assets unchanged; source fixtures do not establish complete native/runtime parity.
docs/REVERSE_ENGINEERING_TODO.md CHANGED
@@ -1621,3 +1621,6 @@ Purpose: turn the supplied installation into an evidence-backed specification of
1621
 
1622
 
1623
  - [x] RE-854 Original entity class-hash search and cursor semantics ([evidence](research/QVM_ENTITY_HASH.md)).
 
 
 
 
1621
 
1622
 
1623
  - [x] RE-854 Original entity class-hash search and cursor semantics ([evidence](research/QVM_ENTITY_HASH.md)).
1624
+
1625
+
1626
+ - [x] RE-855 Rust entity class-hash search ([evidence](research/RUST_ENTITY_HASH.md)).
docs/research/README.md CHANGED
@@ -1158,3 +1158,6 @@ The extension collector adds five focused tests for native tail calls, command-r
1158
 
1159
 
1160
  [RE-854: Original entity class-hash search and cursor semantics](QVM_ENTITY_HASH.md).
 
 
 
 
1158
 
1159
 
1160
  [RE-854: Original entity class-hash search and cursor semantics](QVM_ENTITY_HASH.md).
1161
+
1162
+
1163
+ [RE-855: Rust entity class-hash search](RUST_ENTITY_HASH.md).
docs/research/RUST_ENTITY_HASH.md ADDED
@@ -0,0 +1,7 @@
 
 
 
 
 
 
 
 
1
+ # Rust entity class-hash search
2
+
3
+ RE-855. Reproduce with `python3 scripts/analyze_rust_entity_hash.py`; focused validation: `cargo xtask test-group rust-entity-hash`. [Machine report](rust-entity-hash.json).
4
+
5
+ Rust matches 80 original class-hash search cases, including inactive/null class filtering, collisions, nonzero signed active values and cursors beyond the scan count. Bounded safe entity slices reject invalid cursors/counts; class text is intentionally not compared because the source does not compare it.
6
+
7
+ Original executable/native runtime and complete Linux/macOS Rust/Bevy/Solari acceptance remain unverified.
docs/research/rust-entity-hash.json ADDED
@@ -0,0 +1,647 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ {
2
+ "limits": "Rust matches 80 original class-hash search cases, including inactive/null class filtering, collisions, nonzero signed active values and cursors beyond the scan count. Bounded safe entity slices reject invalid cursors/counts; class text is intentionally not compared because the source does not compare it.",
3
+ "probes": [
4
+ {
5
+ "rust": {
6
+ "result": -1
7
+ },
8
+ "source": {
9
+ "result": -1
10
+ }
11
+ },
12
+ {
13
+ "rust": {
14
+ "result": -1
15
+ },
16
+ "source": {
17
+ "result": -1
18
+ }
19
+ },
20
+ {
21
+ "rust": {
22
+ "result": -1
23
+ },
24
+ "source": {
25
+ "result": -1
26
+ }
27
+ },
28
+ {
29
+ "rust": {
30
+ "result": -1
31
+ },
32
+ "source": {
33
+ "result": -1
34
+ }
35
+ },
36
+ {
37
+ "rust": {
38
+ "result": -1
39
+ },
40
+ "source": {
41
+ "result": -1
42
+ }
43
+ },
44
+ {
45
+ "rust": {
46
+ "result": -1
47
+ },
48
+ "source": {
49
+ "result": -1
50
+ }
51
+ },
52
+ {
53
+ "rust": {
54
+ "result": -1
55
+ },
56
+ "source": {
57
+ "result": -1
58
+ }
59
+ },
60
+ {
61
+ "rust": {
62
+ "result": -1
63
+ },
64
+ "source": {
65
+ "result": -1
66
+ }
67
+ },
68
+ {
69
+ "rust": {
70
+ "result": -1
71
+ },
72
+ "source": {
73
+ "result": -1
74
+ }
75
+ },
76
+ {
77
+ "rust": {
78
+ "result": -1
79
+ },
80
+ "source": {
81
+ "result": -1
82
+ }
83
+ },
84
+ {
85
+ "rust": {
86
+ "result": -1
87
+ },
88
+ "source": {
89
+ "result": -1
90
+ }
91
+ },
92
+ {
93
+ "rust": {
94
+ "result": -1
95
+ },
96
+ "source": {
97
+ "result": -1
98
+ }
99
+ },
100
+ {
101
+ "rust": {
102
+ "result": -1
103
+ },
104
+ "source": {
105
+ "result": -1
106
+ }
107
+ },
108
+ {
109
+ "rust": {
110
+ "result": -1
111
+ },
112
+ "source": {
113
+ "result": -1
114
+ }
115
+ },
116
+ {
117
+ "rust": {
118
+ "result": -1
119
+ },
120
+ "source": {
121
+ "result": -1
122
+ }
123
+ },
124
+ {
125
+ "rust": {
126
+ "result": -1
127
+ },
128
+ "source": {
129
+ "result": -1
130
+ }
131
+ },
132
+ {
133
+ "rust": {
134
+ "result": -1
135
+ },
136
+ "source": {
137
+ "result": -1
138
+ }
139
+ },
140
+ {
141
+ "rust": {
142
+ "result": -1
143
+ },
144
+ "source": {
145
+ "result": -1
146
+ }
147
+ },
148
+ {
149
+ "rust": {
150
+ "result": -1
151
+ },
152
+ "source": {
153
+ "result": -1
154
+ }
155
+ },
156
+ {
157
+ "rust": {
158
+ "result": -1
159
+ },
160
+ "source": {
161
+ "result": -1
162
+ }
163
+ },
164
+ {
165
+ "rust": {
166
+ "result": -1
167
+ },
168
+ "source": {
169
+ "result": -1
170
+ }
171
+ },
172
+ {
173
+ "rust": {
174
+ "result": -1
175
+ },
176
+ "source": {
177
+ "result": -1
178
+ }
179
+ },
180
+ {
181
+ "rust": {
182
+ "result": -1
183
+ },
184
+ "source": {
185
+ "result": -1
186
+ }
187
+ },
188
+ {
189
+ "rust": {
190
+ "result": -1
191
+ },
192
+ "source": {
193
+ "result": -1
194
+ }
195
+ },
196
+ {
197
+ "rust": {
198
+ "result": -1
199
+ },
200
+ "source": {
201
+ "result": -1
202
+ }
203
+ },
204
+ {
205
+ "rust": {
206
+ "result": -1
207
+ },
208
+ "source": {
209
+ "result": -1
210
+ }
211
+ },
212
+ {
213
+ "rust": {
214
+ "result": -1
215
+ },
216
+ "source": {
217
+ "result": -1
218
+ }
219
+ },
220
+ {
221
+ "rust": {
222
+ "result": -1
223
+ },
224
+ "source": {
225
+ "result": -1
226
+ }
227
+ },
228
+ {
229
+ "rust": {
230
+ "result": -1
231
+ },
232
+ "source": {
233
+ "result": -1
234
+ }
235
+ },
236
+ {
237
+ "rust": {
238
+ "result": -1
239
+ },
240
+ "source": {
241
+ "result": -1
242
+ }
243
+ },
244
+ {
245
+ "rust": {
246
+ "result": -1
247
+ },
248
+ "source": {
249
+ "result": -1
250
+ }
251
+ },
252
+ {
253
+ "rust": {
254
+ "result": -1
255
+ },
256
+ "source": {
257
+ "result": -1
258
+ }
259
+ },
260
+ {
261
+ "rust": {
262
+ "result": -1
263
+ },
264
+ "source": {
265
+ "result": -1
266
+ }
267
+ },
268
+ {
269
+ "rust": {
270
+ "result": -1
271
+ },
272
+ "source": {
273
+ "result": -1
274
+ }
275
+ },
276
+ {
277
+ "rust": {
278
+ "result": -1
279
+ },
280
+ "source": {
281
+ "result": -1
282
+ }
283
+ },
284
+ {
285
+ "rust": {
286
+ "result": -1
287
+ },
288
+ "source": {
289
+ "result": -1
290
+ }
291
+ },
292
+ {
293
+ "rust": {
294
+ "result": -1
295
+ },
296
+ "source": {
297
+ "result": -1
298
+ }
299
+ },
300
+ {
301
+ "rust": {
302
+ "result": -1
303
+ },
304
+ "source": {
305
+ "result": -1
306
+ }
307
+ },
308
+ {
309
+ "rust": {
310
+ "result": -1
311
+ },
312
+ "source": {
313
+ "result": -1
314
+ }
315
+ },
316
+ {
317
+ "rust": {
318
+ "result": -1
319
+ },
320
+ "source": {
321
+ "result": -1
322
+ }
323
+ },
324
+ {
325
+ "rust": {
326
+ "result": -1
327
+ },
328
+ "source": {
329
+ "result": -1
330
+ }
331
+ },
332
+ {
333
+ "rust": {
334
+ "result": 3
335
+ },
336
+ "source": {
337
+ "result": 3
338
+ }
339
+ },
340
+ {
341
+ "rust": {
342
+ "result": -1
343
+ },
344
+ "source": {
345
+ "result": -1
346
+ }
347
+ },
348
+ {
349
+ "rust": {
350
+ "result": 2
351
+ },
352
+ "source": {
353
+ "result": 2
354
+ }
355
+ },
356
+ {
357
+ "rust": {
358
+ "result": -1
359
+ },
360
+ "source": {
361
+ "result": -1
362
+ }
363
+ },
364
+ {
365
+ "rust": {
366
+ "result": 3
367
+ },
368
+ "source": {
369
+ "result": 3
370
+ }
371
+ },
372
+ {
373
+ "rust": {
374
+ "result": -1
375
+ },
376
+ "source": {
377
+ "result": -1
378
+ }
379
+ },
380
+ {
381
+ "rust": {
382
+ "result": 2
383
+ },
384
+ "source": {
385
+ "result": 2
386
+ }
387
+ },
388
+ {
389
+ "rust": {
390
+ "result": -1
391
+ },
392
+ "source": {
393
+ "result": -1
394
+ }
395
+ },
396
+ {
397
+ "rust": {
398
+ "result": 3
399
+ },
400
+ "source": {
401
+ "result": 3
402
+ }
403
+ },
404
+ {
405
+ "rust": {
406
+ "result": -1
407
+ },
408
+ "source": {
409
+ "result": -1
410
+ }
411
+ },
412
+ {
413
+ "rust": {
414
+ "result": -1
415
+ },
416
+ "source": {
417
+ "result": -1
418
+ }
419
+ },
420
+ {
421
+ "rust": {
422
+ "result": -1
423
+ },
424
+ "source": {
425
+ "result": -1
426
+ }
427
+ },
428
+ {
429
+ "rust": {
430
+ "result": -1
431
+ },
432
+ "source": {
433
+ "result": -1
434
+ }
435
+ },
436
+ {
437
+ "rust": {
438
+ "result": -1
439
+ },
440
+ "source": {
441
+ "result": -1
442
+ }
443
+ },
444
+ {
445
+ "rust": {
446
+ "result": -1
447
+ },
448
+ "source": {
449
+ "result": -1
450
+ }
451
+ },
452
+ {
453
+ "rust": {
454
+ "result": -1
455
+ },
456
+ "source": {
457
+ "result": -1
458
+ }
459
+ },
460
+ {
461
+ "rust": {
462
+ "result": -1
463
+ },
464
+ "source": {
465
+ "result": -1
466
+ }
467
+ },
468
+ {
469
+ "rust": {
470
+ "result": -1
471
+ },
472
+ "source": {
473
+ "result": -1
474
+ }
475
+ },
476
+ {
477
+ "rust": {
478
+ "result": -1
479
+ },
480
+ "source": {
481
+ "result": -1
482
+ }
483
+ },
484
+ {
485
+ "rust": {
486
+ "result": 7
487
+ },
488
+ "source": {
489
+ "result": 7
490
+ }
491
+ },
492
+ {
493
+ "rust": {
494
+ "result": 3
495
+ },
496
+ "source": {
497
+ "result": 3
498
+ }
499
+ },
500
+ {
501
+ "rust": {
502
+ "result": 5
503
+ },
504
+ "source": {
505
+ "result": 5
506
+ }
507
+ },
508
+ {
509
+ "rust": {
510
+ "result": 2
511
+ },
512
+ "source": {
513
+ "result": 2
514
+ }
515
+ },
516
+ {
517
+ "rust": {
518
+ "result": 7
519
+ },
520
+ "source": {
521
+ "result": 7
522
+ }
523
+ },
524
+ {
525
+ "rust": {
526
+ "result": 3
527
+ },
528
+ "source": {
529
+ "result": 3
530
+ }
531
+ },
532
+ {
533
+ "rust": {
534
+ "result": 5
535
+ },
536
+ "source": {
537
+ "result": 5
538
+ }
539
+ },
540
+ {
541
+ "rust": {
542
+ "result": 2
543
+ },
544
+ "source": {
545
+ "result": 2
546
+ }
547
+ },
548
+ {
549
+ "rust": {
550
+ "result": 7
551
+ },
552
+ "source": {
553
+ "result": 7
554
+ }
555
+ },
556
+ {
557
+ "rust": {
558
+ "result": 3
559
+ },
560
+ "source": {
561
+ "result": 3
562
+ }
563
+ },
564
+ {
565
+ "rust": {
566
+ "result": 5
567
+ },
568
+ "source": {
569
+ "result": 5
570
+ }
571
+ },
572
+ {
573
+ "rust": {
574
+ "result": -1
575
+ },
576
+ "source": {
577
+ "result": -1
578
+ }
579
+ },
580
+ {
581
+ "rust": {
582
+ "result": 7
583
+ },
584
+ "source": {
585
+ "result": 7
586
+ }
587
+ },
588
+ {
589
+ "rust": {
590
+ "result": 4
591
+ },
592
+ "source": {
593
+ "result": 4
594
+ }
595
+ },
596
+ {
597
+ "rust": {
598
+ "result": 5
599
+ },
600
+ "source": {
601
+ "result": 5
602
+ }
603
+ },
604
+ {
605
+ "rust": {
606
+ "result": -1
607
+ },
608
+ "source": {
609
+ "result": -1
610
+ }
611
+ },
612
+ {
613
+ "rust": {
614
+ "result": -1
615
+ },
616
+ "source": {
617
+ "result": -1
618
+ }
619
+ },
620
+ {
621
+ "rust": {
622
+ "result": -1
623
+ },
624
+ "source": {
625
+ "result": -1
626
+ }
627
+ },
628
+ {
629
+ "rust": {
630
+ "result": -1
631
+ },
632
+ "source": {
633
+ "result": -1
634
+ }
635
+ },
636
+ {
637
+ "rust": {
638
+ "result": -1
639
+ },
640
+ "source": {
641
+ "result": -1
642
+ }
643
+ }
644
+ ],
645
+ "source_report": "docs/research/qvm-entity-hash.json",
646
+ "source_report_sha256": "216f2f5b2030ce0dd68e34799abca9a7aadc01e8716f8fdbd60d1248b6a7de1f"
647
+ }
docs/research/rust-health-impulse.json CHANGED
@@ -2985,7 +2985,7 @@
2985
  "exit_code": 2
2986
  }
2987
  ],
2988
- "rust_unit_tests": 109,
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": 111,
2989
  "source_report": "docs/research/qvm-health-impulse.json",
2990
  "source_report_sha256": "625fd8064004ea6dbdf398d51d0af844d9c635ff04c0a0790886dddb6ab81e71"
2991
  }
scripts/analyze_rust_entity_hash.py ADDED
@@ -0,0 +1,14 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ #!/usr/bin/env python3
2
+ import hashlib,json
3
+ from pathlib import Path
4
+ from rust_camera_world_support import binary,result,invoke
5
+ from analyze_qvm import write_json
6
+ from analyze_qvm_entity_hash import ENTITIES
7
+ def encode(s):
8
+ a=s['input'];return [a['count'],a['after'],a['hash'],len(ENTITIES),*[e[k] for e in ENTITIES for k in ['active','name','hash']]]
9
+ def project(s):return {'result':s['result']}
10
+ def main():
11
+ b=binary();p=Path('docs/research/qvm-entity-hash.json');data=p.read_bytes();rows=[]
12
+ for s in json.loads(data)['probes']:rows.append({'source':project(s),'rust':result(b,'hash',encode(s))})
13
+ write_json(Path('docs/research/rust-entity-hash.json'),{'source_report':str(p),'source_report_sha256':hashlib.sha256(data).hexdigest(),'probes':rows,'limits':'Rust matches 80 original class-hash search cases, including inactive/null class filtering, collisions, nonzero signed active values and cursors beyond the scan count. Bounded safe entity slices reject invalid cursors/counts; class text is intentionally not compared because the source does not compare it.'})
14
+ if __name__=='__main__':main()
scripts/rust_camera_world_support.py ADDED
@@ -0,0 +1,7 @@
 
 
 
 
 
 
 
 
1
+ """Scoped entity/camera Rust adapter, without full workspace test execution."""
2
+ import os,subprocess
3
+ from pathlib import Path
4
+ from rust_lifecycle_support import result,invoke
5
+ def binary():
6
+ subprocess.run(['cargo','build','--offline','--package','urt-gameplay','--bin','urt-camera-world'],capture_output=True,text=True,check=True)
7
+ return Path(os.environ.get('CARGO_TARGET_DIR','target'))/'debug'/'urt-camera-world'
scripts/test_rust_entity_hash.py ADDED
@@ -0,0 +1,9 @@
 
 
 
 
 
 
 
 
 
 
1
+ import hashlib,json,unittest
2
+ from pathlib import Path
3
+ class PortTests(unittest.TestCase):
4
+ def test_all_original_cases(self):
5
+ r=json.loads(Path('docs/research/rust-entity-hash.json').read_text());src=json.loads(Path(r['source_report']).read_text());self.assertEqual(len(r['probes']),len(src['probes']));self.assertGreater(len(r['probes']),20)
6
+ for p in r['probes']:self.assertEqual(p['rust'],p['source'])
7
+ def test_source_identity(self):
8
+ r=json.loads(Path('docs/research/rust-entity-hash.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
@@ -2338,3 +2338,18 @@ edge docs/research/qvm-entity-hash.json scripts/test_qvm_entity_hash.py
2338
  group entity-hash scripts/analyze_qvm_entity_hash.py
2339
  edge scripts/analyze_qvm_entity_hash.py scripts/analyze_qvm_resumer_audit.py
2340
  edge scripts/qvm_camera_world_support.py scripts/analyze_qvm_resumer_audit.py
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
2338
  group entity-hash scripts/analyze_qvm_entity_hash.py
2339
  edge scripts/analyze_qvm_entity_hash.py scripts/analyze_qvm_resumer_audit.py
2340
  edge scripts/qvm_camera_world_support.py scripts/analyze_qvm_resumer_audit.py
2341
+ edge Cargo.toml scripts/analyze_rust_entity_hash.py
2342
+ edge Cargo.lock scripts/analyze_rust_entity_hash.py
2343
+ edge crates/urt-gameplay/Cargo.toml scripts/analyze_rust_entity_hash.py
2344
+ edge crates/urt-gameplay/src/lib.rs scripts/analyze_rust_entity_hash.py
2345
+ edge crates/urt-gameplay/src/camera_world.rs scripts/analyze_rust_entity_hash.py
2346
+ edge crates/urt-gameplay/src/bin/urt-camera-world.rs scripts/analyze_rust_entity_hash.py
2347
+ edge docs/research/qvm-entity-hash.json scripts/analyze_rust_entity_hash.py
2348
+ edge crates/urt-gameplay/src/camera_world.rs scripts/analyze_rust_health_impulse.py
2349
+ group rust-entity-hash scripts/analyze_rust_health_impulse.py
2350
+ group gameplay scripts/analyze_rust_entity_hash.py
2351
+ report scripts/analyze_rust_entity_hash.py docs/research/rust-entity-hash.json
2352
+ edge docs/research/rust-entity-hash.json scripts/test_rust_entity_hash.py
2353
+ group rust-entity-hash scripts/analyze_rust_entity_hash.py
2354
+ edge scripts/analyze_rust_entity_hash.py scripts/analyze_qvm_resumer_audit.py
2355
+ edge scripts/rust_camera_world_support.py scripts/analyze_qvm_resumer_audit.py