mustflow 2.116.1 → 2.116.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/package.json +1 -1
- package/templates/default/i18n.toml +72 -6
- package/templates/default/locales/en/.mustflow/skills/INDEX.md +37 -11
- package/templates/default/locales/en/.mustflow/skills/compiler-engineering-review/SKILL.md +477 -0
- package/templates/default/locales/en/.mustflow/skills/compiler-engineering-review/references/compiler-diagnostics-abi-linker-checklist.md +778 -0
- package/templates/default/locales/en/.mustflow/skills/compiler-engineering-review/references/compiler-generators-properties-checklist.md +501 -0
- package/templates/default/locales/en/.mustflow/skills/compiler-engineering-review/references/compiler-test-strategy-differential-checklist.md +498 -0
- package/templates/default/locales/en/.mustflow/skills/compiler-engineering-review/references/debug-symbol-symbolication-checklist.md +412 -0
- package/templates/default/locales/en/.mustflow/skills/compiler-engineering-review/references/ir-design-ssa-pass-pipeline-checklist.md +759 -0
- package/templates/default/locales/en/.mustflow/skills/compiler-engineering-review/references/miscompile-reduction-ir-checklist.md +434 -0
- package/templates/default/locales/en/.mustflow/skills/cross-platform-filesystem-safety/SKILL.md +55 -36
- package/templates/default/locales/en/.mustflow/skills/cross-platform-filesystem-safety/references/path-containment-handle-checklist.md +251 -0
- package/templates/default/locales/en/.mustflow/skills/file-upload-security-review/SKILL.md +133 -32
- package/templates/default/locales/en/.mustflow/skills/file-upload-security-review/references/file-upload-parser-ssrf-resource-checklist.md +306 -0
- package/templates/default/locales/en/.mustflow/skills/formal-verification-review/SKILL.md +310 -0
- package/templates/default/locales/en/.mustflow/skills/formal-verification-review/references/formal-concurrency-model-checking-smt-checklist.md +457 -0
- package/templates/default/locales/en/.mustflow/skills/formal-verification-review/references/formal-contracts-modeling-checklist.md +434 -0
- package/templates/default/locales/en/.mustflow/skills/formal-verification-review/references/formal-memory-bounds-ci-checklist.md +509 -0
- package/templates/default/locales/en/.mustflow/skills/fuzz-harness-review/SKILL.md +439 -0
- package/templates/default/locales/en/.mustflow/skills/fuzz-harness-review/references/fuzz-harness-campaign-checklist.md +379 -0
- package/templates/default/locales/en/.mustflow/skills/fuzz-harness-review/references/fuzz-oracle-triage-ci-checklist.md +307 -0
- package/templates/default/locales/en/.mustflow/skills/idempotency-integrity-review/SKILL.md +48 -28
- package/templates/default/locales/en/.mustflow/skills/idempotency-integrity-review/references/operation-ordering-stale-write-checklist.md +259 -0
- package/templates/default/locales/en/.mustflow/skills/input-boundary-validation-review/SKILL.md +329 -0
- package/templates/default/locales/en/.mustflow/skills/input-boundary-validation-review/references/input-boundary-security-checklist.md +319 -0
- package/templates/default/locales/en/.mustflow/skills/input-event-synchronization-review/SKILL.md +306 -0
- package/templates/default/locales/en/.mustflow/skills/input-event-synchronization-review/references/input-session-state-checklist.md +298 -0
- package/templates/default/locales/en/.mustflow/skills/input-event-synchronization-review/references/remote-input-transport-interaction-checklist.md +328 -0
- package/templates/default/locales/en/.mustflow/skills/interpreter-engineering-review/SKILL.md +353 -0
- package/templates/default/locales/en/.mustflow/skills/interpreter-engineering-review/references/interpreter-diagnostics-recovery-checklist.md +267 -0
- package/templates/default/locales/en/.mustflow/skills/interpreter-engineering-review/references/interpreter-execution-closure-performance-checklist.md +428 -0
- package/templates/default/locales/en/.mustflow/skills/interpreter-engineering-review/references/interpreter-gc-verification-checklist.md +457 -0
- package/templates/default/locales/en/.mustflow/skills/interpreter-engineering-review/references/interpreter-semantics-runtime-checklist.md +391 -0
- package/templates/default/locales/en/.mustflow/skills/modal-loop-reentrancy-review/SKILL.md +294 -0
- package/templates/default/locales/en/.mustflow/skills/modal-loop-reentrancy-review/references/modal-loop-reentrancy-checklist.md +290 -0
- package/templates/default/locales/en/.mustflow/skills/modal-loop-reentrancy-review/references/nested-modal-state-lifetime-checklist.md +297 -0
- package/templates/default/locales/en/.mustflow/skills/name-resolution-integrity-review/SKILL.md +252 -0
- package/templates/default/locales/en/.mustflow/skills/name-resolution-integrity-review/references/dns-network-resolution-checklist.md +394 -0
- package/templates/default/locales/en/.mustflow/skills/name-resolution-integrity-review/references/language-symbol-resolution-checklist.md +282 -0
- package/templates/default/locales/en/.mustflow/skills/name-resolution-integrity-review/references/module-package-loader-resolution-checklist.md +352 -0
- package/templates/default/locales/en/.mustflow/skills/parser-engineering-review/SKILL.md +103 -17
- package/templates/default/locales/en/.mustflow/skills/parser-engineering-review/references/cst-ast-lowering-checklist.md +260 -0
- package/templates/default/locales/en/.mustflow/skills/parser-engineering-review/references/lexer-tokenization-checklist.md +397 -0
- package/templates/default/locales/en/.mustflow/skills/parser-engineering-review/references/tree-serialization-compatibility-checklist.md +164 -0
- package/templates/default/locales/en/.mustflow/skills/parser-engineering-review/references/tree-traversal-rewrite-checklist.md +209 -0
- package/templates/default/locales/en/.mustflow/skills/race-condition-review/SKILL.md +68 -11
- package/templates/default/locales/en/.mustflow/skills/race-condition-review/references/race-reproduction-memory-model-checklist.md +268 -0
- package/templates/default/locales/en/.mustflow/skills/routes.toml +151 -0
- package/templates/default/locales/en/.mustflow/skills/session-handoff-integrity-review/SKILL.md +343 -0
- package/templates/default/locales/en/.mustflow/skills/session-handoff-integrity-review/references/session-auth-stream-resume-checklist.md +413 -0
- package/templates/default/locales/en/.mustflow/skills/session-handoff-integrity-review/references/session-handoff-protocol-checklist.md +485 -0
- package/templates/default/locales/en/.mustflow/skills/two-phase-transition-integrity-review/SKILL.md +267 -0
- package/templates/default/locales/en/.mustflow/skills/two-phase-transition-integrity-review/references/admission-decision-recovery-checklist.md +308 -0
- package/templates/default/locales/en/.mustflow/skills/two-phase-transition-integrity-review/references/two-phase-transition-checklist.md +229 -0
- package/templates/default/locales/en/.mustflow/skills/ui-dispatch-lifecycle-review/SKILL.md +300 -0
- package/templates/default/locales/en/.mustflow/skills/ui-dispatch-lifecycle-review/references/ui-affinity-event-loop-checklist.md +277 -0
- package/templates/default/locales/en/.mustflow/skills/ui-dispatch-lifecycle-review/references/ui-dispatch-lifecycle-checklist.md +292 -0
- package/templates/default/manifest.toml +115 -1
|
@@ -0,0 +1,457 @@
|
|
|
1
|
+
# Interpreter GC and Verification Checklist
|
|
2
|
+
|
|
3
|
+
Use this checklist when an interpreter owns guest-object reachability, moving or generational GC,
|
|
4
|
+
weak containers, finalization, native resources, heap verification, or semantic testing oracles.
|
|
5
|
+
|
|
6
|
+
## Contents
|
|
7
|
+
|
|
8
|
+
1. [Runtime root API](#runtime-root-api)
|
|
9
|
+
2. [Safepoints and temporary values](#safepoints-and-temporary-values)
|
|
10
|
+
3. [Object construction and publication](#object-construction-and-publication)
|
|
11
|
+
4. [Upvalue and suspended-frame tracing](#upvalue-and-suspended-frame-tracing)
|
|
12
|
+
5. [Write barriers](#write-barriers)
|
|
13
|
+
6. [Moving objects and handles](#moving-objects-and-handles)
|
|
14
|
+
7. [Generations and remembered sets](#generations-and-remembered-sets)
|
|
15
|
+
8. [Weak containers and ephemerons](#weak-containers-and-ephemerons)
|
|
16
|
+
9. [Finalization and resurrection](#finalization-and-resurrection)
|
|
17
|
+
10. [Reference-count reentrancy](#reference-count-reentrancy)
|
|
18
|
+
11. [External resources and shutdown](#external-resources-and-shutdown)
|
|
19
|
+
12. [Heap verifier and stress modes](#heap-verifier-and-stress-modes)
|
|
20
|
+
13. [Stage-specific harnesses](#stage-specific-harnesses)
|
|
21
|
+
14. [Generator lanes and semantic environment](#generator-lanes-and-semantic-environment)
|
|
22
|
+
15. [Canonical outcomes and independent oracles](#canonical-outcomes-and-independent-oracles)
|
|
23
|
+
16. [Definedness and metamorphic relations](#definedness-and-metamorphic-relations)
|
|
24
|
+
17. [Executable semantic properties](#executable-semantic-properties)
|
|
25
|
+
18. [Structure-aware reduction](#structure-aware-reduction)
|
|
26
|
+
19. [Semantic coverage and replay](#semantic-coverage-and-replay)
|
|
27
|
+
20. [Failure triage](#failure-triage)
|
|
28
|
+
21. [Failure matrix](#failure-matrix)
|
|
29
|
+
22. [Invariants](#invariants)
|
|
30
|
+
23. [Skill handoffs](#skill-handoffs)
|
|
31
|
+
|
|
32
|
+
## Runtime root API
|
|
33
|
+
|
|
34
|
+
Treat the root set as a named runtime contract. Enumerate roots from:
|
|
35
|
+
|
|
36
|
+
- active VM stacks and frames;
|
|
37
|
+
- suspended generators, coroutines, promises, and continuations;
|
|
38
|
+
- globals, modules, import or export cells, and builtin values;
|
|
39
|
+
- bytecode constants and executable-code metadata that owns guest values;
|
|
40
|
+
- current guest exceptions and pending completions;
|
|
41
|
+
- open and closed upvalues;
|
|
42
|
+
- native local and persistent handles;
|
|
43
|
+
- callbacks retained across guest calls;
|
|
44
|
+
- debugger, profiler, coverage, and snapshot state;
|
|
45
|
+
- caches, intern tables, symbol tables, and pending finalization queues.
|
|
46
|
+
|
|
47
|
+
Native or host code must use a root guard, handle scope, persistent handle, or another collector-aware
|
|
48
|
+
API. A host-language local variable containing a guest pointer is not root evidence by itself.
|
|
49
|
+
|
|
50
|
+
For each root family, name its owner, creation point, release point, tracing rule, concurrency
|
|
51
|
+
ownership, and stale-generation behavior.
|
|
52
|
+
|
|
53
|
+
## Safepoints and temporary values
|
|
54
|
+
|
|
55
|
+
Inventory every operation that can allocate, trigger collection, resize managed storage, enter a
|
|
56
|
+
native callback, or yield to another collector phase. Hidden allocation sites often include:
|
|
57
|
+
|
|
58
|
+
- string concatenation and interpolation;
|
|
59
|
+
- boxing or numeric promotion;
|
|
60
|
+
- error and stack-trace construction;
|
|
61
|
+
- property or symbol interning;
|
|
62
|
+
- hash-table growth and rehash;
|
|
63
|
+
- operand-stack or frame growth;
|
|
64
|
+
- iterator creation;
|
|
65
|
+
- native argument conversion;
|
|
66
|
+
- source-map or profiler materialization.
|
|
67
|
+
|
|
68
|
+
Before a safepoint, place every live temporary in collector-visible storage. After a moving
|
|
69
|
+
safepoint, reload through the updated handle or slot. Do not keep a raw pointer from before an
|
|
70
|
+
allocation and continue using it afterward.
|
|
71
|
+
|
|
72
|
+
## Object construction and publication
|
|
73
|
+
|
|
74
|
+
Use a staged construction protocol:
|
|
75
|
+
|
|
76
|
+
1. allocate storage in a collector-known but externally unreachable state;
|
|
77
|
+
2. initialize every reference field to a safe traced null or sentinel;
|
|
78
|
+
3. root the partial object and all constructor temporaries;
|
|
79
|
+
4. populate fields only through the declared store barrier;
|
|
80
|
+
5. attach collector metadata and tracing shape;
|
|
81
|
+
6. register finalization only after its invariants hold;
|
|
82
|
+
7. publish the object to guest-visible storage last.
|
|
83
|
+
|
|
84
|
+
Cleanup must be idempotent for every partial state. A collector must never interpret uninitialized
|
|
85
|
+
bits as references, and a finalizer must never release a resource that was not successfully acquired.
|
|
86
|
+
|
|
87
|
+
## Upvalue and suspended-frame tracing
|
|
88
|
+
|
|
89
|
+
An open upvalue traces its owning frame and live slot. A closed upvalue traces its heap cell. The
|
|
90
|
+
transition must be atomic with respect to frame reuse and collector observation.
|
|
91
|
+
|
|
92
|
+
Check:
|
|
93
|
+
|
|
94
|
+
- one mutable binding maps to one shared cell;
|
|
95
|
+
- all frame exits close owned upvalues exactly once;
|
|
96
|
+
- close order covers return, throw, cancellation, cleanup, and generator completion;
|
|
97
|
+
- suspended frames remain roots while resumable;
|
|
98
|
+
- canceled or completed frames release roots and native continuations;
|
|
99
|
+
- slot reuse cannot alias a still-open capture;
|
|
100
|
+
- debugger retention follows an explicit policy;
|
|
101
|
+
- serializer or migration paths reject unsupported open-frame state safely.
|
|
102
|
+
|
|
103
|
+
If coroutines heap-allocate whole frames, distinguish frame lifetime from ordinary call-stack
|
|
104
|
+
lifetime and include handler, completion, budget, and source state in tracing.
|
|
105
|
+
|
|
106
|
+
## Write barriers
|
|
107
|
+
|
|
108
|
+
Route every guest-reference mutation through one collector-aware store surface. Cover:
|
|
109
|
+
|
|
110
|
+
- object field writes;
|
|
111
|
+
- array and tuple element stores;
|
|
112
|
+
- bulk copy and move;
|
|
113
|
+
- hash insert, delete, rehash, and resize;
|
|
114
|
+
- closure capture and upvalue close;
|
|
115
|
+
- module or global binding updates;
|
|
116
|
+
- inline-cache and shape metadata that owns guest references;
|
|
117
|
+
- native extension writes;
|
|
118
|
+
- deserialization and cache loading;
|
|
119
|
+
- promotion and evacuation updates.
|
|
120
|
+
|
|
121
|
+
The barrier must preserve the collector's declared invariant, such as snapshot-at-the-beginning,
|
|
122
|
+
incremental update, tri-color, generational old-to-young, or another named model. Public mutable
|
|
123
|
+
fields that bypass the barrier are correctness defects, not encapsulation style issues.
|
|
124
|
+
|
|
125
|
+
## Moving objects and handles
|
|
126
|
+
|
|
127
|
+
Object identity must not depend on storage address when the collector can move objects. Across a
|
|
128
|
+
moving safepoint use:
|
|
129
|
+
|
|
130
|
+
- local handles for one dynamic call scope;
|
|
131
|
+
- persistent handles for retained native ownership;
|
|
132
|
+
- weak handles for non-owning observation;
|
|
133
|
+
- explicit pin scopes only when movement must be prevented;
|
|
134
|
+
- owner handle plus offset for interior locations;
|
|
135
|
+
- stable guest identity or handle identity for language-visible object identity.
|
|
136
|
+
|
|
137
|
+
Pinning needs a bounded scope, fragmentation policy, concurrency rule, and failure behavior. Do not
|
|
138
|
+
turn every FFI call into permanent pinning. Do not serialize raw addresses or storage tags.
|
|
139
|
+
|
|
140
|
+
## Generations and remembered sets
|
|
141
|
+
|
|
142
|
+
A minor collection is correct only if every old-to-young edge is discoverable. Review:
|
|
143
|
+
|
|
144
|
+
- card or remembered-set insertion on every store path;
|
|
145
|
+
- bulk operations and table resize;
|
|
146
|
+
- promotion with unscanned young children;
|
|
147
|
+
- native and deserialization writes;
|
|
148
|
+
- dirty-card clearing and rescanning;
|
|
149
|
+
- concurrent mutation ownership;
|
|
150
|
+
- remembered-set growth and stale entries;
|
|
151
|
+
- large-object or pinned-object generation policy.
|
|
152
|
+
|
|
153
|
+
Stress with a tiny nursery and frequent promotion. Compare results across collector schedules. A
|
|
154
|
+
minor collection that appears fast but loses a young object is a semantic failure.
|
|
155
|
+
|
|
156
|
+
## Weak containers and ephemerons
|
|
157
|
+
|
|
158
|
+
Define weak-key, weak-value, weak-both, and ephemeron behavior separately. For an ephemeron, a value
|
|
159
|
+
becomes strongly relevant only when its key is reachable through another strong path; a value that
|
|
160
|
+
points back to its key must not keep the pair alive by itself.
|
|
161
|
+
|
|
162
|
+
Marking may require repeated processing until reachability reaches a fixed point. Specify:
|
|
163
|
+
|
|
164
|
+
- table registration and processing phase;
|
|
165
|
+
- key and value tracing rule;
|
|
166
|
+
- fixed-point termination;
|
|
167
|
+
- mutation during marking;
|
|
168
|
+
- cleanup ordering;
|
|
169
|
+
- iterator behavior during collection;
|
|
170
|
+
- interaction with finalization and resurrection;
|
|
171
|
+
- cache invalidation and observable guest behavior.
|
|
172
|
+
|
|
173
|
+
Do not implement weak keys as merely skipping key marking while tracing every value strongly.
|
|
174
|
+
|
|
175
|
+
## Finalization and resurrection
|
|
176
|
+
|
|
177
|
+
Treat finalizers as adversarial callbacks with unpredictable timing. They may:
|
|
178
|
+
|
|
179
|
+
- reenter the VM;
|
|
180
|
+
- allocate and trigger another collection;
|
|
181
|
+
- throw or fail;
|
|
182
|
+
- publish the object again;
|
|
183
|
+
- observe partially shut down services;
|
|
184
|
+
- run in an order different from ordinary ownership order.
|
|
185
|
+
|
|
186
|
+
Define eligibility, queueing, at-most-once behavior, resurrection state, second-death behavior,
|
|
187
|
+
exception handling, collector reentrancy, thread ownership, and shutdown limits. Core external
|
|
188
|
+
resources still need deterministic close; finalization is only a bounded fallback.
|
|
189
|
+
|
|
190
|
+
## Reference-count reentrancy
|
|
191
|
+
|
|
192
|
+
Dropping the last strong reference may execute guest or native cleanup immediately. Before a
|
|
193
|
+
decrement that can reach zero:
|
|
194
|
+
|
|
195
|
+
- remove the object from containers or registries;
|
|
196
|
+
- repair length, links, indices, and invariants;
|
|
197
|
+
- clear externally visible slots;
|
|
198
|
+
- prevent duplicate release;
|
|
199
|
+
- preserve a strong reference for borrowed values that escape the current call;
|
|
200
|
+
- define cycle traversal and breaking where cycles are possible.
|
|
201
|
+
|
|
202
|
+
Assume release can reenter the current object, call arbitrary guest code, or inspect the container.
|
|
203
|
+
The data structure must already be coherent.
|
|
204
|
+
|
|
205
|
+
## External resources and shutdown
|
|
206
|
+
|
|
207
|
+
GC reachability does not guarantee timely release of files, sockets, native buffers, GPU objects,
|
|
208
|
+
thread-affine handles, or host subscriptions. Each resource needs:
|
|
209
|
+
|
|
210
|
+
- explicit open or acquire state;
|
|
211
|
+
- deterministic idempotent close;
|
|
212
|
+
- owner and thread or event-loop affinity;
|
|
213
|
+
- cancellation of retained callbacks;
|
|
214
|
+
- external-memory accounting;
|
|
215
|
+
- finalizer fallback policy;
|
|
216
|
+
- error behavior during partial construction;
|
|
217
|
+
- shutdown phase and deadline.
|
|
218
|
+
|
|
219
|
+
Stage runtime shutdown:
|
|
220
|
+
|
|
221
|
+
1. reject new guest and native work;
|
|
222
|
+
2. run bounded declared guest shutdown hooks where permitted;
|
|
223
|
+
3. cancel asynchronous and scheduled work;
|
|
224
|
+
4. detach callbacks and close external resources;
|
|
225
|
+
5. process only the permitted bounded finalization work;
|
|
226
|
+
6. release modules, caches, roots, and collector state;
|
|
227
|
+
7. report resources that could not be closed.
|
|
228
|
+
|
|
229
|
+
## Heap verifier and stress modes
|
|
230
|
+
|
|
231
|
+
Development and test configurations should be able to vary allocation and collection schedules:
|
|
232
|
+
|
|
233
|
+
- collect on every or pseudo-random allocation;
|
|
234
|
+
- use tiny nursery and heap thresholds;
|
|
235
|
+
- force movement and compaction;
|
|
236
|
+
- inject safepoints between evaluator substeps;
|
|
237
|
+
- poison freed slots and cleared frame entries;
|
|
238
|
+
- verify root maps and handle scopes;
|
|
239
|
+
- audit remembered-set and barrier coverage;
|
|
240
|
+
- validate object headers, trace shapes, and field kinds;
|
|
241
|
+
- randomize weak and finalizer processing within the allowed contract;
|
|
242
|
+
- compare live-object and external-resource baselines after repeated lifecycles.
|
|
243
|
+
|
|
244
|
+
Keep sanitizer, memory checker, fuzzing, and platform-specific diagnostics as separate configured or
|
|
245
|
+
manual evidence lanes. A normal test passing is not proof that a collector invariant was exercised.
|
|
246
|
+
|
|
247
|
+
## Stage-specific harnesses
|
|
248
|
+
|
|
249
|
+
Partition interpreter verification by stage so deep runtime paths are reachable directly:
|
|
250
|
+
|
|
251
|
+
- bytes to lexer;
|
|
252
|
+
- bytes or tokens to parser;
|
|
253
|
+
- syntax to resolver and semantic analysis;
|
|
254
|
+
- typed executable IR to bytecode;
|
|
255
|
+
- bytecode to verifier;
|
|
256
|
+
- verified bytecode to VM;
|
|
257
|
+
- runtime value to canonical serialization;
|
|
258
|
+
- guest program plus collector schedule to outcome;
|
|
259
|
+
- command sequence to REPL or module session.
|
|
260
|
+
|
|
261
|
+
Each persistent harness needs deterministic reset, bounded input, no process exit, no stale modules,
|
|
262
|
+
no pending finalizers, no retained RNG or clock state, and no cross-input background work.
|
|
263
|
+
`fuzz-harness-review` owns harness and campaign engineering; this checklist owns interpreter state
|
|
264
|
+
and oracle semantics.
|
|
265
|
+
|
|
266
|
+
## Generator lanes and semantic environment
|
|
267
|
+
|
|
268
|
+
Keep invalid and valid generation lanes distinct.
|
|
269
|
+
|
|
270
|
+
Invalid inputs target decoding, lexing, parsing, recovery, diagnostics, verifier rejection, and
|
|
271
|
+
resource limits. Valid programs target resolution, typed IR, operators, bytecode, execution,
|
|
272
|
+
closures, modules, natives, and GC.
|
|
273
|
+
|
|
274
|
+
A valid-program generator should track:
|
|
275
|
+
|
|
276
|
+
- lexical scopes and visible bindings;
|
|
277
|
+
- semantic types and permitted conversions;
|
|
278
|
+
- declaration and initialization state;
|
|
279
|
+
- function result type and effects;
|
|
280
|
+
- loop, handler, suspension, and completion context;
|
|
281
|
+
- operator and protocol availability;
|
|
282
|
+
- object graph and aliasing shape;
|
|
283
|
+
- collector and resource budget;
|
|
284
|
+
- specified versus unspecified semantic regions.
|
|
285
|
+
|
|
286
|
+
Prefer generating a semantic goal first, then constructing an expression or statement that satisfies
|
|
287
|
+
it. A grammar-only generator usually spends its budget rediscovering shallow rejection paths.
|
|
288
|
+
|
|
289
|
+
## Canonical outcomes and independent oracles
|
|
290
|
+
|
|
291
|
+
Normalize execution into a semantic envelope before comparison:
|
|
292
|
+
|
|
293
|
+
- terminal kind: normal, guest throw, cancellation, budget, engine defect, or other declared state;
|
|
294
|
+
- semantic result value and identity relations;
|
|
295
|
+
- ordered guest mutation and host-effect trace;
|
|
296
|
+
- stable guest error code, source relation, and logical stack;
|
|
297
|
+
- final globals, module state, and observable object graph;
|
|
298
|
+
- deterministic service consumption;
|
|
299
|
+
- budget charges and terminal point;
|
|
300
|
+
- external resource state;
|
|
301
|
+
- collector-independent liveness observations where promised.
|
|
302
|
+
|
|
303
|
+
Normalize paths, host addresses, randomized seeds, locale text, unordered observations, NaN payloads,
|
|
304
|
+
or signed-zero text only when the language contract says they are not observable.
|
|
305
|
+
|
|
306
|
+
Prefer independent oracles: a small specification evaluator, executable semantic table, property,
|
|
307
|
+
metamorphic relation, or independently implemented engine. Two engines sharing parser, type solver,
|
|
308
|
+
numeric helper, or lowering may share the same defect; agreement is evidence, not final authority.
|
|
309
|
+
|
|
310
|
+
## Definedness and metamorphic relations
|
|
311
|
+
|
|
312
|
+
Before treating divergence as a defect, prove the input has one permitted meaning for every compared
|
|
313
|
+
observation. Exclude or normalize intentionally unspecified evaluation, iteration, overflow,
|
|
314
|
+
floating-point, scheduling, time, or host behavior.
|
|
315
|
+
|
|
316
|
+
Possible meaning-preserving relations include:
|
|
317
|
+
|
|
318
|
+
- alpha-renaming with capture avoidance;
|
|
319
|
+
- adding an unused declaration with no observable initialization effect;
|
|
320
|
+
- inserting unreachable code under a proven condition;
|
|
321
|
+
- parse, canonical print, and reparse;
|
|
322
|
+
- surface syntax versus specified desugaring;
|
|
323
|
+
- optimized versus unoptimized executable form;
|
|
324
|
+
- cached versus freshly compiled code;
|
|
325
|
+
- changed GC frequency or movement schedule;
|
|
326
|
+
- serialize and deserialize canonical values;
|
|
327
|
+
- suspend and resume without intervening external effects.
|
|
328
|
+
|
|
329
|
+
Each relation needs explicit side-effect, numeric, NaN, reflection, capture, module, native, and
|
|
330
|
+
resource preconditions. A transformation is not semantic just because it looks harmless.
|
|
331
|
+
|
|
332
|
+
## Executable semantic properties
|
|
333
|
+
|
|
334
|
+
Useful interpreter properties include:
|
|
335
|
+
|
|
336
|
+
- equal map keys have equal hashes;
|
|
337
|
+
- serialization round trips preserve semantic value;
|
|
338
|
+
- resolved closed programs do not fail with a static name error at runtime;
|
|
339
|
+
- typed closed programs do not produce the forbidden class of dynamic type failure;
|
|
340
|
+
- compound assignment evaluates its place exactly once;
|
|
341
|
+
- operator decline follows the declared fallback order while throw stops it;
|
|
342
|
+
- AST and bytecode engines produce the same canonical outcome;
|
|
343
|
+
- collector schedule changes do not change guest results;
|
|
344
|
+
- open and closed upvalues preserve shared mutation;
|
|
345
|
+
- source mapping identifies the same semantic operation across engines;
|
|
346
|
+
- budget exhaustion occurs at the declared charge point;
|
|
347
|
+
- safe diagnostic rendering never executes guest code;
|
|
348
|
+
- repeated execution reset returns modules, roots, finalizers, and resources to baseline.
|
|
349
|
+
|
|
350
|
+
Give every property a stable identity and a counterexample representation suitable for reduction and
|
|
351
|
+
regression tests.
|
|
352
|
+
|
|
353
|
+
## Structure-aware reduction
|
|
354
|
+
|
|
355
|
+
Reduce the representation that preserves reachability to the failing stage. Text deletion is useful
|
|
356
|
+
for raw decoder or lexer failures; deep interpreter failures usually need syntax or typed-IR edits.
|
|
357
|
+
|
|
358
|
+
Possible structural operations include:
|
|
359
|
+
|
|
360
|
+
- remove statements, declarations, functions, modules, or object members;
|
|
361
|
+
- replace expressions with smaller type-correct values;
|
|
362
|
+
- shrink literals and collection shapes;
|
|
363
|
+
- inline a call or remove unused parameters;
|
|
364
|
+
- simplify scopes while repairing binding identities;
|
|
365
|
+
- shrink object graphs, alias sets, and collector schedules;
|
|
366
|
+
- reduce native effects while preserving the same capability path.
|
|
367
|
+
|
|
368
|
+
The interestingness predicate must preserve the original failure class and semantic fingerprint.
|
|
369
|
+
A wrong-result case reduced into any crash, parse rejection, timeout, or unrelated assertion is not
|
|
370
|
+
the same reproducer.
|
|
371
|
+
|
|
372
|
+
## Semantic coverage and replay
|
|
373
|
+
|
|
374
|
+
Machine-code coverage is not enough to distinguish semantic state combinations. Track bounded
|
|
375
|
+
domain feedback such as:
|
|
376
|
+
|
|
377
|
+
- opcode by operand-kind tuple;
|
|
378
|
+
- conversion graph edge;
|
|
379
|
+
- operator candidate and decline or throw path;
|
|
380
|
+
- completion and cleanup edge;
|
|
381
|
+
- binding and upvalue state transition;
|
|
382
|
+
- object-shape or metaobject generation transition;
|
|
383
|
+
- GC phase, barrier, weak, finalizer, and promotion transition;
|
|
384
|
+
- budget dimension and terminal point;
|
|
385
|
+
- source-map and diagnostic category;
|
|
386
|
+
- native capability and async completion path.
|
|
387
|
+
|
|
388
|
+
Store a reproduction capsule with input, stable property or divergence ID, generator seed, semantic
|
|
389
|
+
version, executable-engine mode, optimization and cache state, deterministic host inputs, hash seed,
|
|
390
|
+
locale and timezone policy, GC mode and schedule seed, budget values, target architecture assumptions,
|
|
391
|
+
and applicable diagnostic build lane.
|
|
392
|
+
|
|
393
|
+
## Failure triage
|
|
394
|
+
|
|
395
|
+
Classify failures before deduplication or reduction:
|
|
396
|
+
|
|
397
|
+
- guest-semantic wrong result;
|
|
398
|
+
- engine assertion or invariant;
|
|
399
|
+
- crash or invalid memory access;
|
|
400
|
+
- hang or progress failure;
|
|
401
|
+
- budget escape or wrong terminal point;
|
|
402
|
+
- leak or retained root;
|
|
403
|
+
- diagnostic corruption or unsafe renderer execution;
|
|
404
|
+
- source-map or logical-stack mismatch;
|
|
405
|
+
- nondeterministic replay;
|
|
406
|
+
- harness-state contamination.
|
|
407
|
+
|
|
408
|
+
Deduplicate with stable semantic fingerprints plus maintainer evidence. Preserve minimized failures
|
|
409
|
+
as ordinary regression tests when they encode a durable contract; keep corpus and regression assets
|
|
410
|
+
as separate lifecycle classes under `fuzz-harness-review`.
|
|
411
|
+
|
|
412
|
+
## Failure matrix
|
|
413
|
+
|
|
414
|
+
| Failure | Required behavior |
|
|
415
|
+
| --- | --- |
|
|
416
|
+
| Temporary guest object crosses an allocating helper. | Root it before the safepoint and reload through a handle. |
|
|
417
|
+
| Partial object triggers GC. | Safe fields and construction state keep tracing valid. |
|
|
418
|
+
| Bulk copy creates old-to-young edges. | Store path records every required remembered-set entry. |
|
|
419
|
+
| Weak value points back to weak key. | Ephemeron fixed-point semantics decide reachability. |
|
|
420
|
+
| Finalizer resurrects an object. | Declared resurrection and at-most-once policy applies. |
|
|
421
|
+
| Last reference release reenters its container. | Container invariants were repaired before release. |
|
|
422
|
+
| GC frequency changes guest output. | Preserve both outcomes and localize missing root, barrier, or finalizer rule. |
|
|
423
|
+
| AST and VM share one wrong numeric helper. | Independent property or reference model remains necessary. |
|
|
424
|
+
| Differential input uses unspecified iteration order. | Exclude or normalize only that permitted observation. |
|
|
425
|
+
| Reducer changes wrong result into crash. | Reject the candidate because the fingerprint changed. |
|
|
426
|
+
| Persistent harness retains a pending finalizer. | Reset fails and the input is not trusted for coverage. |
|
|
427
|
+
|
|
428
|
+
## Invariants
|
|
429
|
+
|
|
430
|
+
- Every guest reference live at a safepoint is collector-visible.
|
|
431
|
+
- Partial objects are traceable and cleanable in every construction state.
|
|
432
|
+
- Every guest-reference store follows the declared barrier.
|
|
433
|
+
- Guest identity survives object movement.
|
|
434
|
+
- Minor collection can discover every old-to-young edge.
|
|
435
|
+
- Weak-container reachability follows the declared fixed-point semantics.
|
|
436
|
+
- Finalizers are bounded fallbacks, not deterministic resource ownership.
|
|
437
|
+
- Reference release may reenter, so structures become coherent first.
|
|
438
|
+
- External resources have explicit close and staged shutdown independent of GC.
|
|
439
|
+
- Canonical outcomes compare semantics rather than renderer or storage details.
|
|
440
|
+
- Differential claims exclude unspecified behavior and prefer independent authority.
|
|
441
|
+
- Reduction preserves the original stable failure identity.
|
|
442
|
+
- Persistent harness reset covers modules, roots, handles, RNG, finalizers, and background work.
|
|
443
|
+
|
|
444
|
+
## Skill handoffs
|
|
445
|
+
|
|
446
|
+
- Use `interpreter-engineering-review` for VM root families, guest object identity, collector-visible
|
|
447
|
+
frames and upvalues, interpreter state reset, canonical outcomes, and semantic oracle design.
|
|
448
|
+
- Use `memory-lifetime-review` for general retainer graphs, deterministic cleanup, host handles,
|
|
449
|
+
repeated lifecycle, native memory diagnostics, and application resource leaks.
|
|
450
|
+
- Use `fuzz-harness-review` for target implementation, instrumentation, mutators, corpus lifecycle,
|
|
451
|
+
sanitizer lanes, campaign operation, and artifact promotion.
|
|
452
|
+
- Use `compiler-engineering-review` for typed IR or bytecode lowering, verifier stages,
|
|
453
|
+
optimization-definedness, and compiler wrong-code reduction.
|
|
454
|
+
- Use `parser-engineering-review` for invalid-input generation, parser recovery, syntax mutation, and
|
|
455
|
+
source-unit invariants.
|
|
456
|
+
- Use `security-flow-review` for native capabilities, sandbox escape, filesystem, network, process,
|
|
457
|
+
secrets, and tenant boundaries.
|