nmarshall commited on
Commit
008aa5c
·
1 Parent(s): 5248e2c

qvm: recover per-entity event expiry

Browse files
docs/FINDINGS.md CHANGED
@@ -2045,3 +2045,5 @@ RE-1034–1043 batch validation passed:2,018 Python tests,339 Rust tests,146 det
2045
  - The Rust allocated callback resolves its radio effect into ordered commands, marker updates and formatter ring state. [Rust located callback parity](research/RUST_DEFUSE_LOCATED_CALLBACK.md).
2046
 
2047
  - The Rust fixed-pool release path preserves the source unlink and resource request order and recovers the full record reset. [Entity release parity](research/RUST_ENTITY_RELEASE.md).
 
 
 
2045
  - The Rust allocated callback resolves its radio effect into ordered commands, marker updates and formatter ring state. [Rust located callback parity](research/RUST_DEFUSE_LOCATED_CALLBACK.md).
2046
 
2047
  - The Rust fixed-pool release path preserves the source unlink and resource request order and recovers the full record reset. [Entity release parity](research/RUST_ENTITY_RELEASE.md).
2048
+
2049
+ - Temporary entities free after their signed event age exceeds 300. At the threshold they remain allocated and skip ordinary entity dispatch. [QVM frame expiry](research/QVM_ENTITY_EVENT_EXPIRY.md).
docs/PROVISIONAL_TODO.md CHANGED
@@ -2107,3 +2107,5 @@ RE-974–983 completed routing, command rewrite, inactivity, movement-parameter
2107
  - [x] RE-1049 Compose allocated defuse and located radio in Rust ([evidence](research/RUST_DEFUSE_LOCATED_CALLBACK.md)).
2108
 
2109
  - [x] RE-1050 Port entity free and its ordered engine requests to the Rust fixed pool ([evidence](research/RUST_ENTITY_RELEASE.md)).
 
 
 
2107
  - [x] RE-1049 Compose allocated defuse and located radio in Rust ([evidence](research/RUST_DEFUSE_LOCATED_CALLBACK.md)).
2108
 
2109
  - [x] RE-1050 Port entity free and its ordered engine requests to the Rust fixed pool ([evidence](research/RUST_ENTITY_RELEASE.md)).
2110
+
2111
+ - [x] RE-1051 Trace the per-entity frame event expiry, free and unlink branches ([evidence](research/QVM_ENTITY_EVENT_EXPIRY.md)).
docs/RESEARCH_LEDGER.md CHANGED
@@ -2875,3 +2875,7 @@ The Rust callback resolves the returned event's radio plan using actor state and
2875
  ## 2026-11-25 — RE-1050 Port entity free and its ordered engine requests to the Rust fixed pool
2876
 
2877
  Rust matches all 49 recovered free cases, including complete resets, protected records and duplicate aliased resource requests. The fixed pool now exposes the free timestamp consumed by allocation reuse. See [entity release parity](research/RUST_ENTITY_RELEASE.md).
 
 
 
 
 
2875
  ## 2026-11-25 — RE-1050 Port entity free and its ordered engine requests to the Rust fixed pool
2876
 
2877
  Rust matches all 49 recovered free cases, including complete resets, protected records and duplicate aliased resource requests. The fixed pool now exposes the free timestamp consumed by allocation reuse. See [entity release parity](research/RUST_ENTITY_RELEASE.md).
2878
+
2879
+ ## 2026-11-25 — RE-1051 Trace the per-entity frame event expiry, free and unlink branches
2880
+
2881
+ Thirty cases recover the signed wrapped difference, the strict 300-time cutoff, client-event clearing and the precedence of temporary free over standalone unlink. See [frame expiry findings](research/QVM_ENTITY_EVENT_EXPIRY.md).
docs/research/QVM_ENTITY_EVENT_EXPIRY.md ADDED
@@ -0,0 +1,7 @@
 
 
 
 
 
 
 
 
1
+ # Per-entity event expiry in the QVM frame loop
2
+
3
+ [The source report](qvm-entity-event-expiry.json) traces the per-entity slice beginning at 15418 in 30 cases. Unused records skip to the next entity. For a live record, the original subtracts event timestamp word 568 from the current tick with 32-bit wrapping and compares the result as signed. Expiry occurs when the result is greater than 300. At exactly 300, temporarily retained entities already skip the rest of per-entity dispatch, but their record remains live.
4
+
5
+ On expiry, a nonzero event word 180 is cleared first. If the entity has a client, that same branch also clears client word 128. A zero event word leaves the client word untouched. Next, nonzero word 572 calls free 277400 and goes directly to the next entity. This takes precedence when unlink word 576 is also nonzero. Protected records still take the free path and follow the existing protected-record semantics. For records with word 572 clear, nonzero word 576 is cleared before the standalone unlink request. The ordinary per-entity dispatch continues at 15509.
6
+
7
+ The probe runs the actual free child when reached and captures native unlink. The rest of the frame loop, native entity registration and client event delivery lie outside this slice.
docs/research/QVM_LOCATION_ALLOCATION_BATCH.md CHANGED
@@ -81,3 +81,5 @@ RE-1048 follows [located radio within the allocated callback](QVM_DEFUSE_LOCATED
81
  RE-1049 matches all 48 source fixtures in [the Rust located callback](RUST_DEFUSE_LOCATED_CALLBACK.md), preserving the link snapshot and resolving the start's radio before returning its command plan.
82
 
83
  RE-1050 ports [entity free](RUST_ENTITY_RELEASE.md) into the Rust pool and verifies every final record and ordered request. This exposes the known reset and timestamp behavior needed for longer callback lifecycles.
 
 
 
81
  RE-1049 matches all 48 source fixtures in [the Rust located callback](RUST_DEFUSE_LOCATED_CALLBACK.md), preserving the link snapshot and resolving the start's radio before returning its command plan.
82
 
83
  RE-1050 ports [entity free](RUST_ENTITY_RELEASE.md) into the Rust pool and verifies every final record and ordered request. This exposes the known reset and timestamp behavior needed for longer callback lifecycles.
84
+
85
+ RE-1051 traces [the frame-level event expiry gate](QVM_ENTITY_EVENT_EXPIRY.md). The source retains temporary records through age 300, frees them at age 301 and gives free precedence over the standalone unlink flag.
docs/research/README.md CHANGED
@@ -1673,3 +1673,5 @@ The extension collector adds five focused tests for native tail calls, command-r
1673
  - [Located radio in the Rust defuse callback](RUST_DEFUSE_LOCATED_CALLBACK.md)
1674
 
1675
  - [Entity release in the Rust fixed pool](RUST_ENTITY_RELEASE.md)
 
 
 
1673
  - [Located radio in the Rust defuse callback](RUST_DEFUSE_LOCATED_CALLBACK.md)
1674
 
1675
  - [Entity release in the Rust fixed pool](RUST_ENTITY_RELEASE.md)
1676
+
1677
+ - [Per-entity event expiry in the QVM frame loop](QVM_ENTITY_EVENT_EXPIRY.md)
docs/research/qvm-entity-event-expiry.json ADDED
@@ -0,0 +1,1007 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ {
2
+ "limits": "Per-entity in-use and event-age slice 15418 through skip/dispatch boundaries. Actual free277400; native unlink captured.",
3
+ "probes": [
4
+ {
5
+ "client_event": 88,
6
+ "execution": {
7
+ "stop": 15623,
8
+ "trace_length": 26,
9
+ "trace_sha256": "5853bece9f4514912477730b6ee3bcced80b5081e2b5496bb657fb2921636332"
10
+ },
11
+ "free_traces": [],
12
+ "input": {
13
+ "event": 77,
14
+ "event_time": 701,
15
+ "has_client": 1,
16
+ "kind": "temporary",
17
+ "live": 1,
18
+ "protected": 0,
19
+ "tick": 1000
20
+ },
21
+ "record": {
22
+ "180": 77,
23
+ "520": 2014404608,
24
+ "532": 1,
25
+ "536": 0,
26
+ "540": 0,
27
+ "548": 0,
28
+ "564": 0,
29
+ "568": 701,
30
+ "572": 1,
31
+ "576": 1
32
+ },
33
+ "requests": []
34
+ },
35
+ {
36
+ "client_event": 88,
37
+ "execution": {
38
+ "stop": 15509,
39
+ "trace_length": 24,
40
+ "trace_sha256": "1c95ea36e6e7a45eb9b388a691ab217fff8bce47c452bebbf60ccdf9540cda3b"
41
+ },
42
+ "free_traces": [],
43
+ "input": {
44
+ "event": 77,
45
+ "event_time": 701,
46
+ "has_client": 1,
47
+ "kind": "unlink",
48
+ "live": 1,
49
+ "protected": 0,
50
+ "tick": 1000
51
+ },
52
+ "record": {
53
+ "180": 77,
54
+ "520": 2014404608,
55
+ "532": 1,
56
+ "536": 0,
57
+ "540": 0,
58
+ "548": 0,
59
+ "564": 0,
60
+ "568": 701,
61
+ "572": 0,
62
+ "576": 1
63
+ },
64
+ "requests": []
65
+ },
66
+ {
67
+ "client_event": 88,
68
+ "execution": {
69
+ "stop": 15509,
70
+ "trace_length": 24,
71
+ "trace_sha256": "1c95ea36e6e7a45eb9b388a691ab217fff8bce47c452bebbf60ccdf9540cda3b"
72
+ },
73
+ "free_traces": [],
74
+ "input": {
75
+ "event": 77,
76
+ "event_time": 701,
77
+ "has_client": 1,
78
+ "kind": "persistent",
79
+ "live": 1,
80
+ "protected": 0,
81
+ "tick": 1000
82
+ },
83
+ "record": {
84
+ "180": 77,
85
+ "520": 2014404608,
86
+ "532": 1,
87
+ "536": 0,
88
+ "540": 0,
89
+ "548": 0,
90
+ "564": 0,
91
+ "568": 701,
92
+ "572": 0,
93
+ "576": 0
94
+ },
95
+ "requests": []
96
+ },
97
+ {
98
+ "client_event": 88,
99
+ "execution": {
100
+ "stop": 15623,
101
+ "trace_length": 26,
102
+ "trace_sha256": "5853bece9f4514912477730b6ee3bcced80b5081e2b5496bb657fb2921636332"
103
+ },
104
+ "free_traces": [],
105
+ "input": {
106
+ "event": 77,
107
+ "event_time": 700,
108
+ "has_client": 1,
109
+ "kind": "temporary",
110
+ "live": 1,
111
+ "protected": 0,
112
+ "tick": 1000
113
+ },
114
+ "record": {
115
+ "180": 77,
116
+ "520": 2014404608,
117
+ "532": 1,
118
+ "536": 0,
119
+ "540": 0,
120
+ "548": 0,
121
+ "564": 0,
122
+ "568": 700,
123
+ "572": 1,
124
+ "576": 1
125
+ },
126
+ "requests": []
127
+ },
128
+ {
129
+ "client_event": 88,
130
+ "execution": {
131
+ "stop": 15509,
132
+ "trace_length": 24,
133
+ "trace_sha256": "1c95ea36e6e7a45eb9b388a691ab217fff8bce47c452bebbf60ccdf9540cda3b"
134
+ },
135
+ "free_traces": [],
136
+ "input": {
137
+ "event": 77,
138
+ "event_time": 700,
139
+ "has_client": 1,
140
+ "kind": "unlink",
141
+ "live": 1,
142
+ "protected": 0,
143
+ "tick": 1000
144
+ },
145
+ "record": {
146
+ "180": 77,
147
+ "520": 2014404608,
148
+ "532": 1,
149
+ "536": 0,
150
+ "540": 0,
151
+ "548": 0,
152
+ "564": 0,
153
+ "568": 700,
154
+ "572": 0,
155
+ "576": 1
156
+ },
157
+ "requests": []
158
+ },
159
+ {
160
+ "client_event": 88,
161
+ "execution": {
162
+ "stop": 15509,
163
+ "trace_length": 24,
164
+ "trace_sha256": "1c95ea36e6e7a45eb9b388a691ab217fff8bce47c452bebbf60ccdf9540cda3b"
165
+ },
166
+ "free_traces": [],
167
+ "input": {
168
+ "event": 77,
169
+ "event_time": 700,
170
+ "has_client": 1,
171
+ "kind": "persistent",
172
+ "live": 1,
173
+ "protected": 0,
174
+ "tick": 1000
175
+ },
176
+ "record": {
177
+ "180": 77,
178
+ "520": 2014404608,
179
+ "532": 1,
180
+ "536": 0,
181
+ "540": 0,
182
+ "548": 0,
183
+ "564": 0,
184
+ "568": 700,
185
+ "572": 0,
186
+ "576": 0
187
+ },
188
+ "requests": []
189
+ },
190
+ {
191
+ "client_event": 0,
192
+ "execution": {
193
+ "stop": 15623,
194
+ "trace_length": 61,
195
+ "trace_sha256": "e52693786a7387976ee9a7302f5e4a470915e3e4cc6ed5961bf633d7393c8ab6"
196
+ },
197
+ "free_traces": [
198
+ "c496775aa516b95d57461db37ab4b2473c5cda7cc694d97a3086a6d26a7d2bc2"
199
+ ],
200
+ "input": {
201
+ "event": 77,
202
+ "event_time": 699,
203
+ "has_client": 1,
204
+ "kind": "temporary",
205
+ "live": 1,
206
+ "protected": 0,
207
+ "tick": 1000
208
+ },
209
+ "record": {
210
+ "180": 0,
211
+ "520": 0,
212
+ "532": 0,
213
+ "536": 97202,
214
+ "540": 155463540,
215
+ "548": 0,
216
+ "564": 1000,
217
+ "568": 0,
218
+ "572": 0,
219
+ "576": 0
220
+ },
221
+ "requests": [
222
+ -32
223
+ ]
224
+ },
225
+ {
226
+ "client_event": 0,
227
+ "execution": {
228
+ "stop": 15509,
229
+ "trace_length": 79,
230
+ "trace_sha256": "94a780a39c205bf4cf4ba015b00235564c09f6a38162c654459c60ea05ad919d"
231
+ },
232
+ "free_traces": [],
233
+ "input": {
234
+ "event": 77,
235
+ "event_time": 699,
236
+ "has_client": 1,
237
+ "kind": "unlink",
238
+ "live": 1,
239
+ "protected": 0,
240
+ "tick": 1000
241
+ },
242
+ "record": {
243
+ "180": 0,
244
+ "520": 2014404608,
245
+ "532": 1,
246
+ "536": 0,
247
+ "540": 0,
248
+ "548": 0,
249
+ "564": 0,
250
+ "568": 699,
251
+ "572": 0,
252
+ "576": 0
253
+ },
254
+ "requests": [
255
+ -32
256
+ ]
257
+ },
258
+ {
259
+ "client_event": 0,
260
+ "execution": {
261
+ "stop": 15509,
262
+ "trace_length": 67,
263
+ "trace_sha256": "e079ceb4d7ff6090f0d718d15d397b61116f1a5eab878b05b3971569bc526101"
264
+ },
265
+ "free_traces": [],
266
+ "input": {
267
+ "event": 77,
268
+ "event_time": 699,
269
+ "has_client": 1,
270
+ "kind": "persistent",
271
+ "live": 1,
272
+ "protected": 0,
273
+ "tick": 1000
274
+ },
275
+ "record": {
276
+ "180": 0,
277
+ "520": 2014404608,
278
+ "532": 1,
279
+ "536": 0,
280
+ "540": 0,
281
+ "548": 0,
282
+ "564": 0,
283
+ "568": 699,
284
+ "572": 0,
285
+ "576": 0
286
+ },
287
+ "requests": []
288
+ },
289
+ {
290
+ "client_event": 88,
291
+ "execution": {
292
+ "stop": 15623,
293
+ "trace_length": 26,
294
+ "trace_sha256": "5853bece9f4514912477730b6ee3bcced80b5081e2b5496bb657fb2921636332"
295
+ },
296
+ "free_traces": [],
297
+ "input": {
298
+ "event": 77,
299
+ "event_time": 1001,
300
+ "has_client": 1,
301
+ "kind": "temporary",
302
+ "live": 1,
303
+ "protected": 0,
304
+ "tick": 1000
305
+ },
306
+ "record": {
307
+ "180": 77,
308
+ "520": 2014404608,
309
+ "532": 1,
310
+ "536": 0,
311
+ "540": 0,
312
+ "548": 0,
313
+ "564": 0,
314
+ "568": 1001,
315
+ "572": 1,
316
+ "576": 1
317
+ },
318
+ "requests": []
319
+ },
320
+ {
321
+ "client_event": 88,
322
+ "execution": {
323
+ "stop": 15509,
324
+ "trace_length": 24,
325
+ "trace_sha256": "1c95ea36e6e7a45eb9b388a691ab217fff8bce47c452bebbf60ccdf9540cda3b"
326
+ },
327
+ "free_traces": [],
328
+ "input": {
329
+ "event": 77,
330
+ "event_time": 1001,
331
+ "has_client": 1,
332
+ "kind": "unlink",
333
+ "live": 1,
334
+ "protected": 0,
335
+ "tick": 1000
336
+ },
337
+ "record": {
338
+ "180": 77,
339
+ "520": 2014404608,
340
+ "532": 1,
341
+ "536": 0,
342
+ "540": 0,
343
+ "548": 0,
344
+ "564": 0,
345
+ "568": 1001,
346
+ "572": 0,
347
+ "576": 1
348
+ },
349
+ "requests": []
350
+ },
351
+ {
352
+ "client_event": 88,
353
+ "execution": {
354
+ "stop": 15509,
355
+ "trace_length": 24,
356
+ "trace_sha256": "1c95ea36e6e7a45eb9b388a691ab217fff8bce47c452bebbf60ccdf9540cda3b"
357
+ },
358
+ "free_traces": [],
359
+ "input": {
360
+ "event": 77,
361
+ "event_time": 1001,
362
+ "has_client": 1,
363
+ "kind": "persistent",
364
+ "live": 1,
365
+ "protected": 0,
366
+ "tick": 1000
367
+ },
368
+ "record": {
369
+ "180": 77,
370
+ "520": 2014404608,
371
+ "532": 1,
372
+ "536": 0,
373
+ "540": 0,
374
+ "548": 0,
375
+ "564": 0,
376
+ "568": 1001,
377
+ "572": 0,
378
+ "576": 0
379
+ },
380
+ "requests": []
381
+ },
382
+ {
383
+ "client_event": 0,
384
+ "execution": {
385
+ "stop": 15623,
386
+ "trace_length": 61,
387
+ "trace_sha256": "e52693786a7387976ee9a7302f5e4a470915e3e4cc6ed5961bf633d7393c8ab6"
388
+ },
389
+ "free_traces": [
390
+ "c496775aa516b95d57461db37ab4b2473c5cda7cc694d97a3086a6d26a7d2bc2"
391
+ ],
392
+ "input": {
393
+ "event": 77,
394
+ "event_time": 4294967000,
395
+ "has_client": 1,
396
+ "kind": "temporary",
397
+ "live": 1,
398
+ "protected": 0,
399
+ "tick": 5
400
+ },
401
+ "record": {
402
+ "180": 0,
403
+ "520": 0,
404
+ "532": 0,
405
+ "536": 97202,
406
+ "540": 155463540,
407
+ "548": 0,
408
+ "564": 5,
409
+ "568": 0,
410
+ "572": 0,
411
+ "576": 0
412
+ },
413
+ "requests": [
414
+ -32
415
+ ]
416
+ },
417
+ {
418
+ "client_event": 0,
419
+ "execution": {
420
+ "stop": 15509,
421
+ "trace_length": 79,
422
+ "trace_sha256": "94a780a39c205bf4cf4ba015b00235564c09f6a38162c654459c60ea05ad919d"
423
+ },
424
+ "free_traces": [],
425
+ "input": {
426
+ "event": 77,
427
+ "event_time": 4294967000,
428
+ "has_client": 1,
429
+ "kind": "unlink",
430
+ "live": 1,
431
+ "protected": 0,
432
+ "tick": 5
433
+ },
434
+ "record": {
435
+ "180": 0,
436
+ "520": 2014404608,
437
+ "532": 1,
438
+ "536": 0,
439
+ "540": 0,
440
+ "548": 0,
441
+ "564": 0,
442
+ "568": 4294967000,
443
+ "572": 0,
444
+ "576": 0
445
+ },
446
+ "requests": [
447
+ -32
448
+ ]
449
+ },
450
+ {
451
+ "client_event": 0,
452
+ "execution": {
453
+ "stop": 15509,
454
+ "trace_length": 67,
455
+ "trace_sha256": "e079ceb4d7ff6090f0d718d15d397b61116f1a5eab878b05b3971569bc526101"
456
+ },
457
+ "free_traces": [],
458
+ "input": {
459
+ "event": 77,
460
+ "event_time": 4294967000,
461
+ "has_client": 1,
462
+ "kind": "persistent",
463
+ "live": 1,
464
+ "protected": 0,
465
+ "tick": 5
466
+ },
467
+ "record": {
468
+ "180": 0,
469
+ "520": 2014404608,
470
+ "532": 1,
471
+ "536": 0,
472
+ "540": 0,
473
+ "548": 0,
474
+ "564": 0,
475
+ "568": 4294967000,
476
+ "572": 0,
477
+ "576": 0
478
+ },
479
+ "requests": []
480
+ },
481
+ {
482
+ "client_event": 88,
483
+ "execution": {
484
+ "stop": 15623,
485
+ "trace_length": 26,
486
+ "trace_sha256": "5853bece9f4514912477730b6ee3bcced80b5081e2b5496bb657fb2921636332"
487
+ },
488
+ "free_traces": [],
489
+ "input": {
490
+ "event": 77,
491
+ "event_time": 4294967001,
492
+ "has_client": 1,
493
+ "kind": "temporary",
494
+ "live": 1,
495
+ "protected": 0,
496
+ "tick": 5
497
+ },
498
+ "record": {
499
+ "180": 77,
500
+ "520": 2014404608,
501
+ "532": 1,
502
+ "536": 0,
503
+ "540": 0,
504
+ "548": 0,
505
+ "564": 0,
506
+ "568": 4294967001,
507
+ "572": 1,
508
+ "576": 1
509
+ },
510
+ "requests": []
511
+ },
512
+ {
513
+ "client_event": 88,
514
+ "execution": {
515
+ "stop": 15509,
516
+ "trace_length": 24,
517
+ "trace_sha256": "1c95ea36e6e7a45eb9b388a691ab217fff8bce47c452bebbf60ccdf9540cda3b"
518
+ },
519
+ "free_traces": [],
520
+ "input": {
521
+ "event": 77,
522
+ "event_time": 4294967001,
523
+ "has_client": 1,
524
+ "kind": "unlink",
525
+ "live": 1,
526
+ "protected": 0,
527
+ "tick": 5
528
+ },
529
+ "record": {
530
+ "180": 77,
531
+ "520": 2014404608,
532
+ "532": 1,
533
+ "536": 0,
534
+ "540": 0,
535
+ "548": 0,
536
+ "564": 0,
537
+ "568": 4294967001,
538
+ "572": 0,
539
+ "576": 1
540
+ },
541
+ "requests": []
542
+ },
543
+ {
544
+ "client_event": 88,
545
+ "execution": {
546
+ "stop": 15509,
547
+ "trace_length": 24,
548
+ "trace_sha256": "1c95ea36e6e7a45eb9b388a691ab217fff8bce47c452bebbf60ccdf9540cda3b"
549
+ },
550
+ "free_traces": [],
551
+ "input": {
552
+ "event": 77,
553
+ "event_time": 4294967001,
554
+ "has_client": 1,
555
+ "kind": "persistent",
556
+ "live": 1,
557
+ "protected": 0,
558
+ "tick": 5
559
+ },
560
+ "record": {
561
+ "180": 77,
562
+ "520": 2014404608,
563
+ "532": 1,
564
+ "536": 0,
565
+ "540": 0,
566
+ "548": 0,
567
+ "564": 0,
568
+ "568": 4294967001,
569
+ "572": 0,
570
+ "576": 0
571
+ },
572
+ "requests": []
573
+ },
574
+ {
575
+ "client_event": 88,
576
+ "execution": {
577
+ "stop": 15623,
578
+ "trace_length": 26,
579
+ "trace_sha256": "5853bece9f4514912477730b6ee3bcced80b5081e2b5496bb657fb2921636332"
580
+ },
581
+ "free_traces": [],
582
+ "input": {
583
+ "event": 77,
584
+ "event_time": 2147483653,
585
+ "has_client": 1,
586
+ "kind": "temporary",
587
+ "live": 1,
588
+ "protected": 0,
589
+ "tick": 5
590
+ },
591
+ "record": {
592
+ "180": 77,
593
+ "520": 2014404608,
594
+ "532": 1,
595
+ "536": 0,
596
+ "540": 0,
597
+ "548": 0,
598
+ "564": 0,
599
+ "568": 2147483653,
600
+ "572": 1,
601
+ "576": 1
602
+ },
603
+ "requests": []
604
+ },
605
+ {
606
+ "client_event": 88,
607
+ "execution": {
608
+ "stop": 15509,
609
+ "trace_length": 24,
610
+ "trace_sha256": "1c95ea36e6e7a45eb9b388a691ab217fff8bce47c452bebbf60ccdf9540cda3b"
611
+ },
612
+ "free_traces": [],
613
+ "input": {
614
+ "event": 77,
615
+ "event_time": 2147483653,
616
+ "has_client": 1,
617
+ "kind": "unlink",
618
+ "live": 1,
619
+ "protected": 0,
620
+ "tick": 5
621
+ },
622
+ "record": {
623
+ "180": 77,
624
+ "520": 2014404608,
625
+ "532": 1,
626
+ "536": 0,
627
+ "540": 0,
628
+ "548": 0,
629
+ "564": 0,
630
+ "568": 2147483653,
631
+ "572": 0,
632
+ "576": 1
633
+ },
634
+ "requests": []
635
+ },
636
+ {
637
+ "client_event": 88,
638
+ "execution": {
639
+ "stop": 15509,
640
+ "trace_length": 24,
641
+ "trace_sha256": "1c95ea36e6e7a45eb9b388a691ab217fff8bce47c452bebbf60ccdf9540cda3b"
642
+ },
643
+ "free_traces": [],
644
+ "input": {
645
+ "event": 77,
646
+ "event_time": 2147483653,
647
+ "has_client": 1,
648
+ "kind": "persistent",
649
+ "live": 1,
650
+ "protected": 0,
651
+ "tick": 5
652
+ },
653
+ "record": {
654
+ "180": 77,
655
+ "520": 2014404608,
656
+ "532": 1,
657
+ "536": 0,
658
+ "540": 0,
659
+ "548": 0,
660
+ "564": 0,
661
+ "568": 2147483653,
662
+ "572": 0,
663
+ "576": 0
664
+ },
665
+ "requests": []
666
+ },
667
+ {
668
+ "client_event": 88,
669
+ "execution": {
670
+ "stop": 15623,
671
+ "trace_length": 39,
672
+ "trace_sha256": "1e9149718ae731afeaa13c52cee6d994af924c17ec15d261a46770040b4f3242"
673
+ },
674
+ "free_traces": [
675
+ "f944d58348dcc065ec80df2b6bb5a5b318f42f4bff97516b9b5281744ad66eb9"
676
+ ],
677
+ "input": {
678
+ "event": 0,
679
+ "event_time": 699,
680
+ "has_client": 0,
681
+ "kind": "temporary",
682
+ "live": 1,
683
+ "protected": 1,
684
+ "tick": 1000
685
+ },
686
+ "record": {
687
+ "180": 0,
688
+ "520": 0,
689
+ "532": 1,
690
+ "536": 0,
691
+ "540": 0,
692
+ "548": 1,
693
+ "564": 0,
694
+ "568": 699,
695
+ "572": 1,
696
+ "576": 1
697
+ },
698
+ "requests": [
699
+ -32
700
+ ]
701
+ },
702
+ {
703
+ "client_event": 88,
704
+ "execution": {
705
+ "stop": 15623,
706
+ "trace_length": 39,
707
+ "trace_sha256": "1e9149718ae731afeaa13c52cee6d994af924c17ec15d261a46770040b4f3242"
708
+ },
709
+ "free_traces": [
710
+ "f944d58348dcc065ec80df2b6bb5a5b318f42f4bff97516b9b5281744ad66eb9"
711
+ ],
712
+ "input": {
713
+ "event": 0,
714
+ "event_time": 699,
715
+ "has_client": 1,
716
+ "kind": "temporary",
717
+ "live": 1,
718
+ "protected": 1,
719
+ "tick": 1000
720
+ },
721
+ "record": {
722
+ "180": 0,
723
+ "520": 2014404608,
724
+ "532": 1,
725
+ "536": 0,
726
+ "540": 0,
727
+ "548": 1,
728
+ "564": 0,
729
+ "568": 699,
730
+ "572": 1,
731
+ "576": 1
732
+ },
733
+ "requests": [
734
+ -32
735
+ ]
736
+ },
737
+ {
738
+ "client_event": 88,
739
+ "execution": {
740
+ "stop": 15623,
741
+ "trace_length": 52,
742
+ "trace_sha256": "70fb5b6071093488cf8eb476e370231a6bd2a1e936198d89ac05b8e54f7175c2"
743
+ },
744
+ "free_traces": [
745
+ "f944d58348dcc065ec80df2b6bb5a5b318f42f4bff97516b9b5281744ad66eb9"
746
+ ],
747
+ "input": {
748
+ "event": 77,
749
+ "event_time": 699,
750
+ "has_client": 0,
751
+ "kind": "temporary",
752
+ "live": 1,
753
+ "protected": 1,
754
+ "tick": 1000
755
+ },
756
+ "record": {
757
+ "180": 0,
758
+ "520": 0,
759
+ "532": 1,
760
+ "536": 0,
761
+ "540": 0,
762
+ "548": 1,
763
+ "564": 0,
764
+ "568": 699,
765
+ "572": 1,
766
+ "576": 1
767
+ },
768
+ "requests": [
769
+ -32
770
+ ]
771
+ },
772
+ {
773
+ "client_event": 0,
774
+ "execution": {
775
+ "stop": 15623,
776
+ "trace_length": 61,
777
+ "trace_sha256": "e52693786a7387976ee9a7302f5e4a470915e3e4cc6ed5961bf633d7393c8ab6"
778
+ },
779
+ "free_traces": [
780
+ "f944d58348dcc065ec80df2b6bb5a5b318f42f4bff97516b9b5281744ad66eb9"
781
+ ],
782
+ "input": {
783
+ "event": 77,
784
+ "event_time": 699,
785
+ "has_client": 1,
786
+ "kind": "temporary",
787
+ "live": 1,
788
+ "protected": 1,
789
+ "tick": 1000
790
+ },
791
+ "record": {
792
+ "180": 0,
793
+ "520": 2014404608,
794
+ "532": 1,
795
+ "536": 0,
796
+ "540": 0,
797
+ "548": 1,
798
+ "564": 0,
799
+ "568": 699,
800
+ "572": 1,
801
+ "576": 1
802
+ },
803
+ "requests": [
804
+ -32
805
+ ]
806
+ },
807
+ {
808
+ "client_event": 88,
809
+ "execution": {
810
+ "stop": 15509,
811
+ "trace_length": 57,
812
+ "trace_sha256": "4a658a274cb07f179f7d42e47e07b331445cc58eb3f2b0adf73e89ecfcb03fc7"
813
+ },
814
+ "free_traces": [],
815
+ "input": {
816
+ "event": 0,
817
+ "event_time": 699,
818
+ "has_client": 0,
819
+ "kind": "unlink",
820
+ "live": 1,
821
+ "protected": 0,
822
+ "tick": 1000
823
+ },
824
+ "record": {
825
+ "180": 0,
826
+ "520": 0,
827
+ "532": 1,
828
+ "536": 0,
829
+ "540": 0,
830
+ "548": 0,
831
+ "564": 0,
832
+ "568": 699,
833
+ "572": 0,
834
+ "576": 0
835
+ },
836
+ "requests": [
837
+ -32
838
+ ]
839
+ },
840
+ {
841
+ "client_event": 88,
842
+ "execution": {
843
+ "stop": 15509,
844
+ "trace_length": 57,
845
+ "trace_sha256": "4a658a274cb07f179f7d42e47e07b331445cc58eb3f2b0adf73e89ecfcb03fc7"
846
+ },
847
+ "free_traces": [],
848
+ "input": {
849
+ "event": 0,
850
+ "event_time": 699,
851
+ "has_client": 1,
852
+ "kind": "unlink",
853
+ "live": 1,
854
+ "protected": 0,
855
+ "tick": 1000
856
+ },
857
+ "record": {
858
+ "180": 0,
859
+ "520": 2014404608,
860
+ "532": 1,
861
+ "536": 0,
862
+ "540": 0,
863
+ "548": 0,
864
+ "564": 0,
865
+ "568": 699,
866
+ "572": 0,
867
+ "576": 0
868
+ },
869
+ "requests": [
870
+ -32
871
+ ]
872
+ },
873
+ {
874
+ "client_event": 88,
875
+ "execution": {
876
+ "stop": 15509,
877
+ "trace_length": 70,
878
+ "trace_sha256": "388753e8dc11cc3d7776a1e7c1bb982419b91c4015b9473bb4ac12f5a59edcc7"
879
+ },
880
+ "free_traces": [],
881
+ "input": {
882
+ "event": 77,
883
+ "event_time": 699,
884
+ "has_client": 0,
885
+ "kind": "unlink",
886
+ "live": 1,
887
+ "protected": 0,
888
+ "tick": 1000
889
+ },
890
+ "record": {
891
+ "180": 0,
892
+ "520": 0,
893
+ "532": 1,
894
+ "536": 0,
895
+ "540": 0,
896
+ "548": 0,
897
+ "564": 0,
898
+ "568": 699,
899
+ "572": 0,
900
+ "576": 0
901
+ },
902
+ "requests": [
903
+ -32
904
+ ]
905
+ },
906
+ {
907
+ "client_event": 0,
908
+ "execution": {
909
+ "stop": 15509,
910
+ "trace_length": 79,
911
+ "trace_sha256": "94a780a39c205bf4cf4ba015b00235564c09f6a38162c654459c60ea05ad919d"
912
+ },
913
+ "free_traces": [],
914
+ "input": {
915
+ "event": 77,
916
+ "event_time": 699,
917
+ "has_client": 1,
918
+ "kind": "unlink",
919
+ "live": 1,
920
+ "protected": 0,
921
+ "tick": 1000
922
+ },
923
+ "record": {
924
+ "180": 0,
925
+ "520": 2014404608,
926
+ "532": 1,
927
+ "536": 0,
928
+ "540": 0,
929
+ "548": 0,
930
+ "564": 0,
931
+ "568": 699,
932
+ "572": 0,
933
+ "576": 0
934
+ },
935
+ "requests": [
936
+ -32
937
+ ]
938
+ },
939
+ {
940
+ "client_event": 88,
941
+ "execution": {
942
+ "stop": 15623,
943
+ "trace_length": 9,
944
+ "trace_sha256": "6fa10166ff247dde4d85e50bc466d537442be6cce4d5cdefa7f9a145dfbc98ab"
945
+ },
946
+ "free_traces": [],
947
+ "input": {
948
+ "event": 77,
949
+ "event_time": 699,
950
+ "has_client": 1,
951
+ "kind": "temporary",
952
+ "live": 0,
953
+ "protected": 0,
954
+ "tick": 1000
955
+ },
956
+ "record": {
957
+ "180": 77,
958
+ "520": 2014404608,
959
+ "532": 0,
960
+ "536": 0,
961
+ "540": 0,
962
+ "548": 0,
963
+ "564": 0,
964
+ "568": 699,
965
+ "572": 1,
966
+ "576": 1
967
+ },
968
+ "requests": []
969
+ }
970
+ ],
971
+ "sha256": "a589351dfe517470a1b121dd2164714987d9e4577bf00c6486e1540035d7a79d",
972
+ "source": {
973
+ "archive": "zUrT43_qvm.pk3",
974
+ "archive_sha256": "b59bf0c5bedf11d50e0edd220da7eade96de40601e98ae14c54c819047df0796",
975
+ "member": {
976
+ "bytes": 983300,
977
+ "comment_hex": "",
978
+ "compressed_bytes": 246560,
979
+ "compression": 8,
980
+ "crc32": "98ea1768",
981
+ "create_system": 0,
982
+ "create_version": 63,
983
+ "date_time": [
984
+ 2018,
985
+ 6,
986
+ 18,
987
+ 22,
988
+ 11,
989
+ 50
990
+ ],
991
+ "directory": false,
992
+ "entry_index": 2,
993
+ "external_attr": 32,
994
+ "extra_hex": "0a0020000000000001001800d1e24e974007d40116dcbf962f1fd20116dcbf962f1fd201",
995
+ "extract_version": 20,
996
+ "flags": 0,
997
+ "header_offset": 221309,
998
+ "internal_attr": 0,
999
+ "occurrence": 0,
1000
+ "output": "assets/extracted/zUrT43_qvm.pk3/members/000002/vm/qagame.qvm",
1001
+ "path": "vm/qagame.qvm",
1002
+ "sha256": "a589351dfe517470a1b121dd2164714987d9e4577bf00c6486e1540035d7a79d",
1003
+ "type": "member",
1004
+ "volume": 0
1005
+ }
1006
+ }
1007
+ }
docs/research/qvm-resumer-audit.json CHANGED
@@ -1444,6 +1444,84 @@
1444
  "repeated_calls_opt_in": true,
1445
  "repeated_calls_setting": "literal_true"
1446
  },
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1447
  {
1448
  "backward_conditional_branches": [],
1449
  "calls": [
@@ -10705,8 +10783,8 @@
10705
  }
10706
  },
10707
  "summary": {
10708
- "call_expressions": 217,
10709
- "files": 166,
10710
  "legacy_expressions": 158,
10711
  "nonliteral_ranges": 33,
10712
  "unresolved_mode_expressions": 3
 
1444
  "repeated_calls_opt_in": true,
1445
  "repeated_calls_setting": "literal_true"
1446
  },
1447
+ {
1448
+ "backward_conditional_branches": [],
1449
+ "calls": [
1450
+ {
1451
+ "dynamic_store_requires_review": false,
1452
+ "implicit_local_offset": null,
1453
+ "instruction": 15477,
1454
+ "stores_result": false,
1455
+ "target": 277400
1456
+ },
1457
+ {
1458
+ "dynamic_store_requires_review": false,
1459
+ "implicit_local_offset": null,
1460
+ "instruction": 15498,
1461
+ "stores_result": false,
1462
+ "target": -32
1463
+ },
1464
+ {
1465
+ "dynamic_store_requires_review": false,
1466
+ "implicit_local_offset": null,
1467
+ "instruction": 15536,
1468
+ "stores_result": false,
1469
+ "target": 224382
1470
+ },
1471
+ {
1472
+ "dynamic_store_requires_review": false,
1473
+ "implicit_local_offset": null,
1474
+ "instruction": 15551,
1475
+ "stores_result": false,
1476
+ "target": 224921
1477
+ },
1478
+ {
1479
+ "dynamic_store_requires_review": false,
1480
+ "implicit_local_offset": null,
1481
+ "instruction": 15571,
1482
+ "stores_result": false,
1483
+ "target": 219367
1484
+ },
1485
+ {
1486
+ "dynamic_store_requires_review": false,
1487
+ "implicit_local_offset": null,
1488
+ "instruction": 15586,
1489
+ "stores_result": false,
1490
+ "target": 229957
1491
+ },
1492
+ {
1493
+ "dynamic_store_requires_review": false,
1494
+ "implicit_local_offset": null,
1495
+ "instruction": 15601,
1496
+ "stores_result": false,
1497
+ "target": 226251
1498
+ },
1499
+ {
1500
+ "dynamic_store_requires_review": false,
1501
+ "implicit_local_offset": null,
1502
+ "instruction": 15613,
1503
+ "stores_result": false,
1504
+ "target": 155772
1505
+ },
1506
+ {
1507
+ "dynamic_store_requires_review": false,
1508
+ "implicit_local_offset": null,
1509
+ "instruction": 15621,
1510
+ "stores_result": false,
1511
+ "target": 13179
1512
+ }
1513
+ ],
1514
+ "explicit_result_offsets": null,
1515
+ "helper": "qvm_trace_support.resume",
1516
+ "line": 53,
1517
+ "literal_range": [
1518
+ 15418,
1519
+ 15623
1520
+ ],
1521
+ "path": "scripts/analyze_qvm_entity_event_expiry.py",
1522
+ "repeated_calls_opt_in": true,
1523
+ "repeated_calls_setting": "literal_true"
1524
+ },
1525
  {
1526
  "backward_conditional_branches": [],
1527
  "calls": [
 
10783
  }
10784
  },
10785
  "summary": {
10786
+ "call_expressions": 218,
10787
+ "files": 167,
10788
  "legacy_expressions": 158,
10789
  "nonliteral_ranges": 33,
10790
  "unresolved_mode_expressions": 3
scripts/analyze_qvm_entity_event_expiry.py ADDED
@@ -0,0 +1,71 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ """Trace the per-entity frame event expiry slice and its actual free child."""
2
+ from itertools import product
3
+ from pathlib import Path
4
+
5
+ from analyze_qvm import write_json
6
+ from analyze_qvm_entity_free import ENTITY, FIELDS, release
7
+ from qvm_research_support import source
8
+ from qvm_trace_support import resume
9
+
10
+
11
+ FRAME = ENTITY - 0x4000
12
+ CLIENT = ENTITY + 0x5000
13
+ FIELDS_IN_REPORT = (180, 520, 532, 536, 540, 548, 564, 568, 572, 576)
14
+
15
+
16
+ def fixtures():
17
+ # Age is signed after 32-bit subtraction, including a wrapped clock.
18
+ clocks = [(1000, 701), (1000, 700), (1000, 699), (1000, 1001),
19
+ (5, 0xfffffed8), (5, 0xfffffed9), (5, 0x80000005)]
20
+ for (tick, event_time), kind in product(clocks, ('temporary', 'unlink', 'persistent')):
21
+ yield dict(tick=tick, event_time=event_time, live=1, kind=kind,
22
+ protected=0, event=77, has_client=1)
23
+ for kind, event, has_client in product(('temporary', 'unlink'), (0, 77), (0, 1)):
24
+ yield dict(tick=1000, event_time=699, live=1, kind=kind,
25
+ protected=int(kind == 'temporary'), event=event, has_client=has_client)
26
+ yield dict(tick=1000, event_time=699, live=0, kind='temporary', protected=0,
27
+ event=77, has_client=1)
28
+
29
+
30
+ def probe(ins, a):
31
+ m = {ENTITY + offset: 0 for offset in range(0, 880, 4)}
32
+ m.update({FRAME + 24: ENTITY, 34992532: a['tick'], CLIENT + 128: 88,
33
+ ENTITY + 180: a['event'], ENTITY + 520: CLIENT if a['has_client'] else 0,
34
+ ENTITY + 532: a['live'], ENTITY + 548: a['protected'],
35
+ ENTITY + 568: a['event_time'], ENTITY + 572: int(a['kind'] == 'temporary'),
36
+ ENTITY + 576: int(a['kind'] != 'persistent')})
37
+ assert all(m[ENTITY + offset] == 0 for offset in FIELDS)
38
+ requests = []
39
+ free_traces = []
40
+
41
+ def free(i, memory, args):
42
+ assert args == {8: ENTITY}
43
+ memory, child = release(i, memory, ENTITY)
44
+ requests.extend(r['target'] for r in child['requests'])
45
+ free_traces.append(child['execution']['trace_sha256'])
46
+ return memory, 0, {'actual_source_child': 277400}
47
+
48
+ def unlink(i, memory, args):
49
+ assert args == {8: ENTITY}
50
+ requests.append(-32)
51
+ return memory, 0, {'native_unlink_captured': True}
52
+
53
+ m, trace = resume(ins, 15418, 15623, m, FRAME, boundaries=(15509, 15623),
54
+ handlers={277400: free, -32: unlink}, repeated_calls=True,
55
+ sync_child_words=True, coherent_memory=True)
56
+ return dict(input=a, record={str(o): m[ENTITY + o] & 0xffffffff for o in FIELDS_IN_REPORT},
57
+ client_event=m[CLIENT + 128], requests=requests, free_traces=free_traces,
58
+ execution={k: trace[k] for k in ('stop', 'trace_length', 'trace_sha256')})
59
+
60
+
61
+ def main():
62
+ meta, _, _, ins = source()
63
+ write_json(Path('docs/research/qvm-entity-event-expiry.json'), {
64
+ 'source': meta['source'], 'sha256': meta['sha256'],
65
+ 'probes': [probe(ins, a) for a in fixtures()],
66
+ 'limits': 'Per-entity in-use and event-age slice 15418 through skip/dispatch boundaries. Actual free277400; native unlink captured.',
67
+ })
68
+
69
+
70
+ if __name__ == '__main__':
71
+ main()
scripts/test_qvm_entity_event_expiry.py ADDED
@@ -0,0 +1,42 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ import json
2
+ import unittest
3
+ from pathlib import Path
4
+
5
+ from qvm_move_callbacks_oracle import signed
6
+
7
+
8
+ class EntityEventExpiryTests(unittest.TestCase):
9
+ def test_frame_gate_and_order(self):
10
+ report = json.loads(Path('docs/research/qvm-entity-event-expiry.json').read_text())
11
+ self.assertEqual(len(report['probes']), 30)
12
+ for row in report['probes']:
13
+ a = row['input']
14
+ with self.subTest(input=a):
15
+ temporary = a['kind'] == 'temporary'
16
+ unlink = a['kind'] != 'persistent'
17
+ expired = a['live'] and signed((a['tick'] - a['event_time']) & 0xffffffff) > 300
18
+ record = dict(zip(('180', '520', '532', '536', '540', '548', '564', '568', '572', '576'),
19
+ (a['event'], 0x78116000 if a['has_client'] else 0,
20
+ a['live'], 0, 0, a['protected'], 0, a['event_time'],
21
+ int(temporary), int(unlink))))
22
+ client = 0 if expired and a['event'] and a['has_client'] else 88
23
+ requests = []
24
+ if expired:
25
+ record['180'] = 0
26
+ if temporary:
27
+ requests.append(-32)
28
+ if not a['protected']:
29
+ record = dict.fromkeys(record, 0)
30
+ record.update({'536': 97202, '540': 155463540, '564': a['tick']})
31
+ elif unlink:
32
+ requests.append(-32)
33
+ record['576'] = 0
34
+ self.assertEqual(row['record'], record)
35
+ self.assertEqual(row['client_event'], client)
36
+ self.assertEqual(row['requests'], requests)
37
+ self.assertEqual(len(row['free_traces']), int(bool(expired and temporary)))
38
+ self.assertEqual(row['execution']['stop'], 15623 if not a['live'] or temporary else 15509)
39
+
40
+
41
+ if __name__ == '__main__':
42
+ unittest.main()
xtask/checks.tsv CHANGED
@@ -4809,3 +4809,7 @@ group gameplay scripts/analyze_rust_entity_release.py
4809
  edge docs/research/qvm-entity-free.json scripts/analyze_rust_entity_release.py
4810
  edge crates/urt-gameplay/src/location_feedback.rs scripts/analyze_rust_entity_release.py
4811
  edge crates/urt-gameplay/src/bin/urt-location-feedback.rs scripts/analyze_rust_entity_release.py
 
 
 
 
 
4809
  edge docs/research/qvm-entity-free.json scripts/analyze_rust_entity_release.py
4810
  edge crates/urt-gameplay/src/location_feedback.rs scripts/analyze_rust_entity_release.py
4811
  edge crates/urt-gameplay/src/bin/urt-location-feedback.rs scripts/analyze_rust_entity_release.py
4812
+ report scripts/analyze_qvm_entity_event_expiry.py docs/research/qvm-entity-event-expiry.json
4813
+ edge docs/research/qvm-entity-event-expiry.json scripts/test_qvm_entity_event_expiry.py
4814
+ group qvm-entity-event-expiry scripts/analyze_qvm_entity_event_expiry.py
4815
+ edge scripts/analyze_qvm_entity_event_expiry.py scripts/analyze_qvm_resumer_audit.py