mustflow 2.116.1 → 2.116.3
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,501 @@
|
|
|
1
|
+
# Compiler Generators and Properties Checklist
|
|
2
|
+
|
|
3
|
+
Use this checklist when compiler testing needs valid or invalid generators, stage-aware mutation,
|
|
4
|
+
property or metamorphic laws, structure-aware shrinking, semantic coverage, or relation-graph triage.
|
|
5
|
+
|
|
6
|
+
## Contents
|
|
7
|
+
|
|
8
|
+
1. [Generator contract](#generator-contract)
|
|
9
|
+
2. [Valid and invalid lanes](#valid-and-invalid-lanes)
|
|
10
|
+
3. [Stage-specific harness matrix](#stage-specific-harness-matrix)
|
|
11
|
+
4. [Lexer generation](#lexer-generation)
|
|
12
|
+
5. [Parser generation and edit sequences](#parser-generation-and-edit-sequences)
|
|
13
|
+
6. [Type and semantic generation](#type-and-semantic-generation)
|
|
14
|
+
7. [Constraint-solver properties](#constraint-solver-properties)
|
|
15
|
+
8. [Source-level optimizer generation](#source-level-optimizer-generation)
|
|
16
|
+
9. [IR generation and mutation](#ir-generation-and-mutation)
|
|
17
|
+
10. [Pass-transition graphs](#pass-transition-graphs)
|
|
18
|
+
11. [Stage-local property ledger](#stage-local-property-ledger)
|
|
19
|
+
12. [Round-trip laws](#round-trip-laws)
|
|
20
|
+
13. [Alpha-renaming and binding laws](#alpha-renaming-and-binding-laws)
|
|
21
|
+
14. [Trivia and surface-form relations](#trivia-and-surface-form-relations)
|
|
22
|
+
15. [Dead-code relations](#dead-code-relations)
|
|
23
|
+
16. [Independent reorder relations](#independent-reorder-relations)
|
|
24
|
+
17. [Extraction and inlining relations](#extraction-and-inlining-relations)
|
|
25
|
+
18. [Algebraic and refinement relations](#algebraic-and-refinement-relations)
|
|
26
|
+
19. [Idempotence and convergence](#idempotence-and-convergence)
|
|
27
|
+
20. [Relation graphs](#relation-graphs)
|
|
28
|
+
21. [Structure-aware shrinking](#structure-aware-shrinking)
|
|
29
|
+
22. [Semantic coverage](#semantic-coverage)
|
|
30
|
+
23. [Replay and triage capsule](#replay-and-triage-capsule)
|
|
31
|
+
24. [Failure matrix](#failure-matrix)
|
|
32
|
+
25. [Invariants](#invariants)
|
|
33
|
+
26. [Skill handoffs](#skill-handoffs)
|
|
34
|
+
|
|
35
|
+
## Generator contract
|
|
36
|
+
|
|
37
|
+
Treat a generator as a compiler-facing model, not a random syntax printer. Record:
|
|
38
|
+
|
|
39
|
+
- target stage and accepted representation;
|
|
40
|
+
- semantic or structural facts guaranteed by construction;
|
|
41
|
+
- facts intentionally violated and their stable identity;
|
|
42
|
+
- entropy source and deterministic replay;
|
|
43
|
+
- maximum bytes, nodes, depth, scopes, blocks, edges, types, constraints, and runtime work;
|
|
44
|
+
- feature and production distribution;
|
|
45
|
+
- target and data-layout assumptions;
|
|
46
|
+
- runtime input generation;
|
|
47
|
+
- expected property or oracle;
|
|
48
|
+
- shrink representation and repair policy;
|
|
49
|
+
- generator schema and semantic version.
|
|
50
|
+
|
|
51
|
+
Track generator branch and feature histograms. A generator that produces thousands of examples but
|
|
52
|
+
rarely reaches generics, exceptional control flow, alias boundaries, vector operations, or the target
|
|
53
|
+
rewrite has a reachability defect.
|
|
54
|
+
|
|
55
|
+
## Valid and invalid lanes
|
|
56
|
+
|
|
57
|
+
Keep valid and invalid generation separate.
|
|
58
|
+
|
|
59
|
+
The valid lane should preserve every prerequisite needed by the target stage: decoding, grammar,
|
|
60
|
+
scope, types, effects, CFG, SSA, memory, target, ABI, or definedness rules. It explores deep semantic
|
|
61
|
+
and transformation behavior.
|
|
62
|
+
|
|
63
|
+
The invalid lane should violate one named rule from a valid starting point. It explores rejection,
|
|
64
|
+
diagnostics, recovery, verifier behavior, progress, and resource bounds.
|
|
65
|
+
|
|
66
|
+
Do not rely on a mostly-invalid generator that occasionally stumbles into accepted input. Do not
|
|
67
|
+
repair every mutation into validity and thereby abandon malformed-boundary coverage. Attach the
|
|
68
|
+
violated invariant and intended stage to every invalid artifact.
|
|
69
|
+
|
|
70
|
+
## Stage-specific harness matrix
|
|
71
|
+
|
|
72
|
+
Prefer narrow entrypoints:
|
|
73
|
+
|
|
74
|
+
| Input | Target | Typical oracle |
|
|
75
|
+
| --- | --- | --- |
|
|
76
|
+
| Raw bytes | Decoder or lexer | Progress, span bounds, stable token or error result |
|
|
77
|
+
| Tokens or source | Parser | Tree validity, recovery, full-versus-incremental relation |
|
|
78
|
+
| Syntax plus environment | Resolver or type checker | Binding, type, effect, and diagnostic facts |
|
|
79
|
+
| Typed or semantic IR | Lowering | Preservation and destination verifier |
|
|
80
|
+
| Valid compiler IR | Optimizer or analysis | Refinement, verifier, recomputation, activation |
|
|
81
|
+
| Minimally invalid IR | Verifier | Stable bounded rejection of one invariant |
|
|
82
|
+
| Valid machine IR | Backend stage | Machine verifier and target relation |
|
|
83
|
+
| Assembly or encoding | Assembler or disassembler | Semantic round trip and metadata |
|
|
84
|
+
| Objects and link graph | Linker | Resolution, relocation, and image structure |
|
|
85
|
+
| Program plus runtime vector | Executable | Canonical defined outcome |
|
|
86
|
+
|
|
87
|
+
One driver-level target remains useful for integration, but it should not be the only path to deep
|
|
88
|
+
stages. Persistent harness reset, feedback, corpus, sanitizer, and campaign mechanics belong to
|
|
89
|
+
`fuzz-harness-review`.
|
|
90
|
+
|
|
91
|
+
## Lexer generation
|
|
92
|
+
|
|
93
|
+
Generate raw bytes as well as accepted source text. Include:
|
|
94
|
+
|
|
95
|
+
- malformed and valid encoding sequences;
|
|
96
|
+
- byte-order marks at permitted and forbidden positions;
|
|
97
|
+
- NUL and control bytes;
|
|
98
|
+
- LF, CRLF, mixed line endings, and absent final newline;
|
|
99
|
+
- combining characters and declared normalization forms;
|
|
100
|
+
- long identifiers and code-point sequences;
|
|
101
|
+
- token-prefix conflicts and maximal-match boundaries;
|
|
102
|
+
- numeric base, separator, point, exponent, suffix, and overflow boundaries;
|
|
103
|
+
- escape, raw delimiter, interpolation, continuation, and unterminated string states.
|
|
104
|
+
|
|
105
|
+
Useful properties include monotonic non-overlapping spans, bounded ranges, progress on an error byte,
|
|
106
|
+
deterministic tokenization, literal-value preservation, and canonical token-print then relex. Reward
|
|
107
|
+
lexical state and transition diversity when ordinary edge coverage cannot distinguish it.
|
|
108
|
+
|
|
109
|
+
## Parser generation and edit sequences
|
|
110
|
+
|
|
111
|
+
Use grammar-aware generation with explicit budgets for nonterminal depth, recursion, repetition, and
|
|
112
|
+
node count. Adjust production weights from feature reachability without removing a raw-byte lane.
|
|
113
|
+
|
|
114
|
+
For structure-preserving mutation:
|
|
115
|
+
|
|
116
|
+
- splice expression into expression, type into type, declaration into declaration, and pattern into
|
|
117
|
+
pattern;
|
|
118
|
+
- preserve delimiter and nesting contracts when the target requires valid syntax;
|
|
119
|
+
- repair names and semantic environment only in lanes intended to reach later stages;
|
|
120
|
+
- keep near-miss mutations that insert, delete, duplicate, or replace one syntax element.
|
|
121
|
+
|
|
122
|
+
For incremental parsing, generate edit sequences rather than one final file. After each insertion,
|
|
123
|
+
deletion, or range replacement, compare the incremental result with a fresh parse of the exact same
|
|
124
|
+
snapshot after normalizing permitted identity differences. Check stale nodes, old-buffer ranges,
|
|
125
|
+
unbounded diagnostic growth, lost progress, and convergence after surrounding context stabilizes.
|
|
126
|
+
|
|
127
|
+
## Type and semantic generation
|
|
128
|
+
|
|
129
|
+
Carry a semantic environment containing:
|
|
130
|
+
|
|
131
|
+
- scopes, declarations, binding identities, and initialization state;
|
|
132
|
+
- semantic types, generic parameters, and constraints;
|
|
133
|
+
- mutability, ownership, lifetime, nullability, and variance where applicable;
|
|
134
|
+
- effects, exceptions, capabilities, and control context;
|
|
135
|
+
- function parameters, result types, and overload candidates;
|
|
136
|
+
- pattern exhaustiveness and refinement facts;
|
|
137
|
+
- module, visibility, and import state.
|
|
138
|
+
|
|
139
|
+
Generate the required result type first, then construct expressions and statements that inhabit it.
|
|
140
|
+
Choose call targets only from candidates whose argument, effect, lifetime, and visibility rules are
|
|
141
|
+
satisfied.
|
|
142
|
+
|
|
143
|
+
For near-miss generation, start from a valid program and break one relation: argument type, generic
|
|
144
|
+
arity, variance, nullability, borrow, effect, visibility, exhaustiveness, or initialization. Require
|
|
145
|
+
the intended rejection category and primary location, bounded cascades, no crash, and preservation of
|
|
146
|
+
unrelated semantic facts.
|
|
147
|
+
|
|
148
|
+
## Constraint-solver properties
|
|
149
|
+
|
|
150
|
+
Exercise recursive and mutually recursive constraints, overload sets, associated projections,
|
|
151
|
+
higher-ranked forms, subtyping cycles, ownership relations, and effect variables under explicit
|
|
152
|
+
budgets for steps, depth, candidates, and expanded goals.
|
|
153
|
+
|
|
154
|
+
Check metamorphic stability under:
|
|
155
|
+
|
|
156
|
+
- independent declaration order;
|
|
157
|
+
- candidate insertion order;
|
|
158
|
+
- hash seed and traversal order;
|
|
159
|
+
- alpha-renaming;
|
|
160
|
+
- equivalent explicit versus implicit constraints;
|
|
161
|
+
- old and new solver implementations where both are valid authorities.
|
|
162
|
+
|
|
163
|
+
Compare acceptance, selected candidate, inferred type, proof or obligation facts, and stable
|
|
164
|
+
diagnostic category. A timeout or budget exhaustion is its own outcome, not an arbitrary rejection.
|
|
165
|
+
|
|
166
|
+
## Source-level optimizer generation
|
|
167
|
+
|
|
168
|
+
Generate programs whose disputed observation is defined. Track ranges for:
|
|
169
|
+
|
|
170
|
+
- integer and shift operations;
|
|
171
|
+
- division and remainder;
|
|
172
|
+
- array and pointer indices;
|
|
173
|
+
- alignment, lifetime, provenance, and alias relations;
|
|
174
|
+
- initialization and valid object representation;
|
|
175
|
+
- floating-point mode and exceptional values;
|
|
176
|
+
- concurrency and data-race exclusion;
|
|
177
|
+
- target features and implementation-defined source rules.
|
|
178
|
+
|
|
179
|
+
Bias generation toward optimizer triggers: induction variables, reductions, repeated expressions,
|
|
180
|
+
branches, alias boundaries, vectorizable accesses, calls, aggregates, and control-flow shapes. A
|
|
181
|
+
generator can be perfectly defined yet useless if it never creates transformable structure.
|
|
182
|
+
|
|
183
|
+
Use dynamic undefined-behavior checks as one covered-path filter, not as a proof that the complete
|
|
184
|
+
program has one meaning.
|
|
185
|
+
|
|
186
|
+
## IR generation and mutation
|
|
187
|
+
|
|
188
|
+
Generate valid IR from stage invariants rather than relying only on frontend output. Track:
|
|
189
|
+
|
|
190
|
+
- operation, type, bit width, vector shape, and attributes;
|
|
191
|
+
- block, edge, terminator, and region structure;
|
|
192
|
+
- phi or block-argument predecessor agreement;
|
|
193
|
+
- dominance, use-def, liveness, and ownership;
|
|
194
|
+
- memory effects, alias classes, alignment, provenance, and atomics;
|
|
195
|
+
- poison, undefined, deferred choice, and fixing operations;
|
|
196
|
+
- calls, intrinsics, target features, data layout, and ABI facts.
|
|
197
|
+
|
|
198
|
+
After every valid mutation, run the structural verifier and compare any analysis claimed current.
|
|
199
|
+
Maintain a separate minimally invalid lane that violates one verifier rule and expects stable
|
|
200
|
+
rejection.
|
|
201
|
+
|
|
202
|
+
Frontend-generated IR covers realistic lowering. Direct IR generation covers valid states the
|
|
203
|
+
frontend rarely emits. Keep both.
|
|
204
|
+
|
|
205
|
+
## Pass-transition graphs
|
|
206
|
+
|
|
207
|
+
Do not generate arbitrary pass sequences that violate undocumented or declared prerequisites.
|
|
208
|
+
Represent pass sequencing as a state graph with:
|
|
209
|
+
|
|
210
|
+
- current IR dialect or form;
|
|
211
|
+
- required and preserved analyses;
|
|
212
|
+
- canonicalization state;
|
|
213
|
+
- target-lowering stage;
|
|
214
|
+
- whole-program or profile prerequisites;
|
|
215
|
+
- legal next transforms;
|
|
216
|
+
- verifier required after each edge.
|
|
217
|
+
|
|
218
|
+
Generate realistic variations: repeat canonicalization, omit an optional pass, reorder independent
|
|
219
|
+
passes, change inlining placement, vary whole-program mode, or alter profile input. If a pass is
|
|
220
|
+
declared idempotent, assert that a second application makes no semantic or normalized structural
|
|
221
|
+
change. Reduce the pass path together with the input so necessary predecessors remain.
|
|
222
|
+
|
|
223
|
+
## Stage-local property ledger
|
|
224
|
+
|
|
225
|
+
Give each property a stable identity, input domain, side conditions, observation, and shrink policy.
|
|
226
|
+
|
|
227
|
+
| Stage | Example property |
|
|
228
|
+
| --- | --- |
|
|
229
|
+
| Lexer | Spans progress and canonical token text relexes to equal token meaning. |
|
|
230
|
+
| Parser | Normalized parse-print-parse preserves structure. |
|
|
231
|
+
| Incremental parser | Edit result equals a fresh parse of the same snapshot. |
|
|
232
|
+
| Resolver | Every reference maps to one permitted binding identity. |
|
|
233
|
+
| Type checker | Typed nodes carry valid types and inserted conversions. |
|
|
234
|
+
| Lowering | Source or typed semantics are preserved in destination IR. |
|
|
235
|
+
| CFG or SSA transform | Verifier, dominance, use-def, and edge relations remain valid. |
|
|
236
|
+
| Analysis | Incremental update equals independent full recomputation. |
|
|
237
|
+
| Optimizer | Target refines source under the declared definedness model. |
|
|
238
|
+
| Backend | Machine verifier and target semantic relation hold. |
|
|
239
|
+
| Assembler | Accepted canonical round trip preserves encoding and relocation meaning. |
|
|
240
|
+
| Linker | Resolution graph selects the declared definitions and relocations. |
|
|
241
|
+
| Build | Permitted environment perturbations preserve normalized artifacts. |
|
|
242
|
+
|
|
243
|
+
An end-to-end result property remains useful, but it cannot replace stage-local laws when failure
|
|
244
|
+
localization matters.
|
|
245
|
+
|
|
246
|
+
## Round-trip laws
|
|
247
|
+
|
|
248
|
+
Apply round trips to every serialization boundary that claims semantic stability:
|
|
249
|
+
|
|
250
|
+
- token stream to canonical source and back;
|
|
251
|
+
- syntax to printer and parser;
|
|
252
|
+
- semantic, compiler, or machine IR serialize and deserialize;
|
|
253
|
+
- textual and binary IR forms;
|
|
254
|
+
- assembly, encoding, disassembly, and reassembly;
|
|
255
|
+
- object reader and writer where supported;
|
|
256
|
+
- profile, cache, or summary artifact encode and decode.
|
|
257
|
+
|
|
258
|
+
Compare normalized structure or semantics. Exclude temporary IDs, permitted block order, trivia,
|
|
259
|
+
non-contract metadata, and canonical spelling differences. Preserve source locations, debug facts,
|
|
260
|
+
relocations, or stable names when the relevant artifact contract includes them.
|
|
261
|
+
|
|
262
|
+
## Alpha-renaming and binding laws
|
|
263
|
+
|
|
264
|
+
Rename bound identifiers while preserving capture avoidance and declared name observability. Cover:
|
|
265
|
+
|
|
266
|
+
- local and module bindings;
|
|
267
|
+
- generic and type parameters;
|
|
268
|
+
- labels and pattern bindings;
|
|
269
|
+
- nested scopes and captures;
|
|
270
|
+
- macro hygiene identities;
|
|
271
|
+
- internal symbols and mangling relations;
|
|
272
|
+
- Unicode and long-name boundaries where the language permits them.
|
|
273
|
+
|
|
274
|
+
Compare binding graph, type or semantic facts, closure captures, executable outcome, and internal
|
|
275
|
+
mangling relation. Exclude exported, reflected, serialized, diagnostic, or otherwise name-observable
|
|
276
|
+
bindings from a relation that expects identical public output.
|
|
277
|
+
|
|
278
|
+
## Trivia and surface-form relations
|
|
279
|
+
|
|
280
|
+
Insert or remove permitted whitespace, comments, newlines, and redundant grouping while preserving
|
|
281
|
+
the language's token and grammar rules. Compare token meaning, syntax, semantic IR, diagnostics where
|
|
282
|
+
positions are intentionally related, and execution outcome.
|
|
283
|
+
|
|
284
|
+
Name exceptions:
|
|
285
|
+
|
|
286
|
+
- indentation or line-sensitive syntax;
|
|
287
|
+
- automatic statement termination;
|
|
288
|
+
- documentation comments;
|
|
289
|
+
- macro token trees;
|
|
290
|
+
- preprocessing directives;
|
|
291
|
+
- source-location or coverage contracts;
|
|
292
|
+
- identifier normalization rules.
|
|
293
|
+
|
|
294
|
+
Do not assume visually equivalent Unicode forms are semantically equal unless the language says so.
|
|
295
|
+
|
|
296
|
+
## Dead-code relations
|
|
297
|
+
|
|
298
|
+
Insert or modify code proven unobservable under the selected runtime input and language contract.
|
|
299
|
+
Candidate forms include unreachable blocks, unused functions, unread locals, or discarded pure
|
|
300
|
+
computations.
|
|
301
|
+
|
|
302
|
+
Side conditions must exclude or model:
|
|
303
|
+
|
|
304
|
+
- compile-time evaluation;
|
|
305
|
+
- macro expansion and annotation processing;
|
|
306
|
+
- imports and module initialization;
|
|
307
|
+
- destructors and cleanup;
|
|
308
|
+
- reflection and symbol enumeration;
|
|
309
|
+
- volatile, atomic, or I/O effects;
|
|
310
|
+
- diagnostics that are specified for dead code;
|
|
311
|
+
- code size, debug, or coverage observations when compared.
|
|
312
|
+
|
|
313
|
+
Dead-code relations can expose invalid speculative analysis, state leakage, register-pressure
|
|
314
|
+
effects, and optimizer interaction, but only when the supposedly dead region is truly unobservable.
|
|
315
|
+
|
|
316
|
+
## Independent reorder relations
|
|
317
|
+
|
|
318
|
+
Swap declarations, statements, instructions, blocks, or pass applications only when a dependence
|
|
319
|
+
certificate proves independence. Include:
|
|
320
|
+
|
|
321
|
+
- data and control dependence;
|
|
322
|
+
- alias and memory effects;
|
|
323
|
+
- exceptions and cleanup;
|
|
324
|
+
- volatile, atomic, and synchronization order;
|
|
325
|
+
- symbol-table and overload visibility;
|
|
326
|
+
- module initialization and link order;
|
|
327
|
+
- analysis prerequisites.
|
|
328
|
+
|
|
329
|
+
Compare semantic outcome and the relevant binding, analysis, or artifact facts. A difference can
|
|
330
|
+
expose unstable symbol insertion, traversal-order dependence, stale caches, or invalid alias facts.
|
|
331
|
+
|
|
332
|
+
## Extraction and inlining relations
|
|
333
|
+
|
|
334
|
+
Extract a pure or explicitly modeled region into a function, or inline a call back into its caller.
|
|
335
|
+
Record a certificate containing:
|
|
336
|
+
|
|
337
|
+
- free variables promoted to parameters;
|
|
338
|
+
- result and side-effect mapping;
|
|
339
|
+
- evaluation order;
|
|
340
|
+
- alias and lifetime relations;
|
|
341
|
+
- capture behavior;
|
|
342
|
+
- exception and cleanup edges;
|
|
343
|
+
- calling-convention and target facts;
|
|
344
|
+
- source and debug observation policy.
|
|
345
|
+
|
|
346
|
+
Exclude or model mutable aliases, nonlocal return, stack inspection, reflection, tail-call promises,
|
|
347
|
+
or target ABI observations. Compare runtime outcome plus the compiler boundary the relation intends
|
|
348
|
+
to stress.
|
|
349
|
+
|
|
350
|
+
## Algebraic and refinement relations
|
|
351
|
+
|
|
352
|
+
Algebraic transforms require semantic side conditions. Neutral operations, comparison inversion,
|
|
353
|
+
branch swapping, reassociation, strength reduction, and loop transformations can fail under:
|
|
354
|
+
|
|
355
|
+
- signed or unsigned overflow rules;
|
|
356
|
+
- floating-point NaN, infinity, signed zero, rounding, and exceptions;
|
|
357
|
+
- poison and undefined values;
|
|
358
|
+
- traps and side effects;
|
|
359
|
+
- changed evaluation count;
|
|
360
|
+
- memory aliasing and concurrency;
|
|
361
|
+
- target-specific arithmetic.
|
|
362
|
+
|
|
363
|
+
For IR with undefined or nondeterministic behavior, the correct relation may be refinement rather
|
|
364
|
+
than equality: the transformed program must not introduce an observation the source forbids. Record
|
|
365
|
+
the exact observation model and unsupported operations of any validator.
|
|
366
|
+
|
|
367
|
+
## Idempotence and convergence
|
|
368
|
+
|
|
369
|
+
Use idempotence only for passes that declare it. For canonicalizers, formatters, normalizers, and
|
|
370
|
+
analyses, compare the second application with the first after normalization.
|
|
371
|
+
|
|
372
|
+
If output changes again, classify:
|
|
373
|
+
|
|
374
|
+
- intentional discovery of a new opportunity;
|
|
375
|
+
- monotonic convergence with a declared bound;
|
|
376
|
+
- unstable temporary naming or order;
|
|
377
|
+
- oscillation;
|
|
378
|
+
- stale analysis or semantic corruption.
|
|
379
|
+
|
|
380
|
+
Also perturb hash seed, traversal order, worker count, and schedule for analyses expected to be
|
|
381
|
+
deterministic. Same facts in a different internal order may be permitted; different semantic facts
|
|
382
|
+
are not.
|
|
383
|
+
|
|
384
|
+
## Relation graphs
|
|
385
|
+
|
|
386
|
+
Represent related programs or artifacts as a graph. Each edge stores:
|
|
387
|
+
|
|
388
|
+
- transform identity and version;
|
|
389
|
+
- application location;
|
|
390
|
+
- side-condition certificate;
|
|
391
|
+
- expected equality, refinement, implication, rejection, or diagnostic relation;
|
|
392
|
+
- observations compared;
|
|
393
|
+
- source and target artifact hashes;
|
|
394
|
+
- stable property or divergence identity.
|
|
395
|
+
|
|
396
|
+
A graph can combine alpha-renaming, dead-code insertion, extraction, pass variation, cache round
|
|
397
|
+
trip, and target mode to expose interactions that one pair misses. When a failure appears, find the
|
|
398
|
+
smallest relation path whose final observations diverge.
|
|
399
|
+
|
|
400
|
+
Do not compose edges whose side conditions are invalidated by an earlier transform. Recheck or
|
|
401
|
+
transport certificates along the path.
|
|
402
|
+
|
|
403
|
+
## Structure-aware shrinking
|
|
404
|
+
|
|
405
|
+
Shrink at the stage of the defect while preserving the generator's semantic environment.
|
|
406
|
+
|
|
407
|
+
Possible units:
|
|
408
|
+
|
|
409
|
+
- source file, declaration, function, statement, expression, type, and token;
|
|
410
|
+
- scope, binding, generic constraint, effect, and runtime input;
|
|
411
|
+
- IR region, block, edge, instruction, operand, attribute, and metadata;
|
|
412
|
+
- machine block, register, frame object, and target feature;
|
|
413
|
+
- pass graph node and option dependency group;
|
|
414
|
+
- relation graph edge and side-condition certificate.
|
|
415
|
+
|
|
416
|
+
Repair only facts that the valid lane requires: binding identity, required type, dominance, use-def,
|
|
417
|
+
terminators, phi edges, or target constraints. Preserve the exact assertion, property, first
|
|
418
|
+
divergence, canonical outcome, and definedness class. Do not shrink original and transformed sides
|
|
419
|
+
independently when that destroys the relation.
|
|
420
|
+
|
|
421
|
+
## Semantic coverage
|
|
422
|
+
|
|
423
|
+
Track bounded domain features in addition to machine coverage:
|
|
424
|
+
|
|
425
|
+
- grammar production and parser state;
|
|
426
|
+
- semantic type, constraint, overload, and effect relation;
|
|
427
|
+
- CFG and SSA shape;
|
|
428
|
+
- opcode, width, vector lane, and poison path;
|
|
429
|
+
- transformation trigger and decline reason;
|
|
430
|
+
- alias, range, dominance, and cost result;
|
|
431
|
+
- pass-transition edge;
|
|
432
|
+
- backend legalization, selection, register, and frame state;
|
|
433
|
+
- diagnostic category and recovery action;
|
|
434
|
+
- object, relocation, symbol, and linker rule;
|
|
435
|
+
- property and metamorphic edge identity.
|
|
436
|
+
|
|
437
|
+
Use semantic feedback to diagnose generator starvation and corpus loss. Keep cardinality bounded and
|
|
438
|
+
versioned. Coverage remains a search signal, not a correctness oracle.
|
|
439
|
+
|
|
440
|
+
## Replay and triage capsule
|
|
441
|
+
|
|
442
|
+
Record enough to reproduce independently:
|
|
443
|
+
|
|
444
|
+
- raw and structured input;
|
|
445
|
+
- generator and shrinker versions;
|
|
446
|
+
- entropy seed and runtime input vector;
|
|
447
|
+
- semantic environment and definedness certificate;
|
|
448
|
+
- compiler and subordinate tool revisions;
|
|
449
|
+
- options, target, features, sysroot, libraries, and link closure;
|
|
450
|
+
- pass-transition and executed pass traces;
|
|
451
|
+
- relation graph and side conditions;
|
|
452
|
+
- expected and actual canonical outcomes;
|
|
453
|
+
- property, invariant, assertion, or divergence identity;
|
|
454
|
+
- environment, schedule, hash seed, locale, path, and cache state;
|
|
455
|
+
- first divergent artifact and reduction history.
|
|
456
|
+
|
|
457
|
+
Separate trigger, detection point, and suspected root cause. A verifier or sanitizer reports where it
|
|
458
|
+
noticed a defect, not necessarily where the first contract was violated.
|
|
459
|
+
|
|
460
|
+
## Failure matrix
|
|
461
|
+
|
|
462
|
+
| Failure or generator smell | Required response |
|
|
463
|
+
| --- | --- |
|
|
464
|
+
| Most generated programs fail name resolution. | Add or repair the semantic environment for the valid lane. |
|
|
465
|
+
| Invalid generator breaks several rules. | Start from valid input and tag one intended violation. |
|
|
466
|
+
| Optimizer generator never activates a rewrite. | Bias transformable structures and record activation coverage. |
|
|
467
|
+
| Dynamic check passes generated source. | Keep definedness certificate; the executed filter is not proof. |
|
|
468
|
+
| Random pass sequence crashes on missing prerequisite. | Generate from the valid pass-transition graph. |
|
|
469
|
+
| Alpha-renaming changes reflected names. | Exclude that observable binding or change the expected relation. |
|
|
470
|
+
| Dead-code insertion changes destructor behavior. | The relation side condition was false; reject the case. |
|
|
471
|
+
| Algebraic identity fails on signed zero. | Model floating semantics or restrict the input domain. |
|
|
472
|
+
| Shrinker turns wrong code into type rejection. | Reject the shrink because the failure identity changed. |
|
|
473
|
+
| Relation graph edge loses its certificate. | Stop composition or recompute the side condition. |
|
|
474
|
+
| Semantic coverage grows without an oracle failure path. | Treat it as exploration evidence only. |
|
|
475
|
+
|
|
476
|
+
## Invariants
|
|
477
|
+
|
|
478
|
+
- Every generator names the stage and facts it guarantees or violates.
|
|
479
|
+
- Valid and invalid lanes remain separate and reproducible.
|
|
480
|
+
- Generated programs carry the semantic environment needed to reach the target stage.
|
|
481
|
+
- Direct IR generation preserves verifier prerequisites for the valid lane.
|
|
482
|
+
- Pass sequences follow a declared transition graph.
|
|
483
|
+
- Every property has a stable identity, domain, side conditions, observation, and shrink policy.
|
|
484
|
+
- Metamorphic transforms carry certificates rather than relying on intuition.
|
|
485
|
+
- Structure-aware shrinking preserves the original defect and relation identity.
|
|
486
|
+
- Semantic coverage diagnoses reachability but never replaces an oracle.
|
|
487
|
+
- Replay capsules include generator, semantic, compiler, target, environment, and relation state.
|
|
488
|
+
|
|
489
|
+
## Skill handoffs
|
|
490
|
+
|
|
491
|
+
- Use `compiler-engineering-review` for compiler-stage generators, semantic properties, definedness,
|
|
492
|
+
refinement, transformation relations, and earliest-stage failure identity.
|
|
493
|
+
- Use `fuzz-harness-review` for persistent target reset, instrumentation, feedback configuration,
|
|
494
|
+
corpus operations, custom mutators, sanitizer lanes, and campaign lifecycle.
|
|
495
|
+
- Use `parser-engineering-review` for lexer and parser state-machine, source-unit, recovery, and
|
|
496
|
+
incremental parsing implementation details.
|
|
497
|
+
- Use `interpreter-engineering-review` when a guest interpreter or VM supplies an independent
|
|
498
|
+
semantic model or shares generated language programs.
|
|
499
|
+
- Use `test-maintenance` for promoting a minimized case into an ordinary deterministic regression.
|
|
500
|
+
- Use the matching language skill for source-language undefined, unspecified, implementation-
|
|
501
|
+
defined, memory-model, floating-point, and ABI semantics.
|