mustflow 2.116.0 → 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.
Files changed (59) hide show
  1. package/dist/core/source-anchors.js +11 -0
  2. package/package.json +1 -1
  3. package/templates/default/i18n.toml +72 -6
  4. package/templates/default/locales/en/.mustflow/skills/INDEX.md +37 -11
  5. package/templates/default/locales/en/.mustflow/skills/compiler-engineering-review/SKILL.md +477 -0
  6. package/templates/default/locales/en/.mustflow/skills/compiler-engineering-review/references/compiler-diagnostics-abi-linker-checklist.md +778 -0
  7. package/templates/default/locales/en/.mustflow/skills/compiler-engineering-review/references/compiler-generators-properties-checklist.md +501 -0
  8. package/templates/default/locales/en/.mustflow/skills/compiler-engineering-review/references/compiler-test-strategy-differential-checklist.md +498 -0
  9. package/templates/default/locales/en/.mustflow/skills/compiler-engineering-review/references/debug-symbol-symbolication-checklist.md +412 -0
  10. package/templates/default/locales/en/.mustflow/skills/compiler-engineering-review/references/ir-design-ssa-pass-pipeline-checklist.md +759 -0
  11. package/templates/default/locales/en/.mustflow/skills/compiler-engineering-review/references/miscompile-reduction-ir-checklist.md +434 -0
  12. package/templates/default/locales/en/.mustflow/skills/cross-platform-filesystem-safety/SKILL.md +55 -36
  13. package/templates/default/locales/en/.mustflow/skills/cross-platform-filesystem-safety/references/path-containment-handle-checklist.md +251 -0
  14. package/templates/default/locales/en/.mustflow/skills/file-upload-security-review/SKILL.md +133 -32
  15. package/templates/default/locales/en/.mustflow/skills/file-upload-security-review/references/file-upload-parser-ssrf-resource-checklist.md +306 -0
  16. package/templates/default/locales/en/.mustflow/skills/formal-verification-review/SKILL.md +310 -0
  17. package/templates/default/locales/en/.mustflow/skills/formal-verification-review/references/formal-concurrency-model-checking-smt-checklist.md +457 -0
  18. package/templates/default/locales/en/.mustflow/skills/formal-verification-review/references/formal-contracts-modeling-checklist.md +434 -0
  19. package/templates/default/locales/en/.mustflow/skills/formal-verification-review/references/formal-memory-bounds-ci-checklist.md +509 -0
  20. package/templates/default/locales/en/.mustflow/skills/fuzz-harness-review/SKILL.md +439 -0
  21. package/templates/default/locales/en/.mustflow/skills/fuzz-harness-review/references/fuzz-harness-campaign-checklist.md +379 -0
  22. package/templates/default/locales/en/.mustflow/skills/fuzz-harness-review/references/fuzz-oracle-triage-ci-checklist.md +307 -0
  23. package/templates/default/locales/en/.mustflow/skills/idempotency-integrity-review/SKILL.md +48 -28
  24. package/templates/default/locales/en/.mustflow/skills/idempotency-integrity-review/references/operation-ordering-stale-write-checklist.md +259 -0
  25. package/templates/default/locales/en/.mustflow/skills/input-boundary-validation-review/SKILL.md +329 -0
  26. package/templates/default/locales/en/.mustflow/skills/input-boundary-validation-review/references/input-boundary-security-checklist.md +319 -0
  27. package/templates/default/locales/en/.mustflow/skills/input-event-synchronization-review/SKILL.md +306 -0
  28. package/templates/default/locales/en/.mustflow/skills/input-event-synchronization-review/references/input-session-state-checklist.md +298 -0
  29. package/templates/default/locales/en/.mustflow/skills/input-event-synchronization-review/references/remote-input-transport-interaction-checklist.md +328 -0
  30. package/templates/default/locales/en/.mustflow/skills/interpreter-engineering-review/SKILL.md +353 -0
  31. package/templates/default/locales/en/.mustflow/skills/interpreter-engineering-review/references/interpreter-diagnostics-recovery-checklist.md +267 -0
  32. package/templates/default/locales/en/.mustflow/skills/interpreter-engineering-review/references/interpreter-execution-closure-performance-checklist.md +428 -0
  33. package/templates/default/locales/en/.mustflow/skills/interpreter-engineering-review/references/interpreter-gc-verification-checklist.md +457 -0
  34. package/templates/default/locales/en/.mustflow/skills/interpreter-engineering-review/references/interpreter-semantics-runtime-checklist.md +391 -0
  35. package/templates/default/locales/en/.mustflow/skills/modal-loop-reentrancy-review/SKILL.md +294 -0
  36. package/templates/default/locales/en/.mustflow/skills/modal-loop-reentrancy-review/references/modal-loop-reentrancy-checklist.md +290 -0
  37. package/templates/default/locales/en/.mustflow/skills/modal-loop-reentrancy-review/references/nested-modal-state-lifetime-checklist.md +297 -0
  38. package/templates/default/locales/en/.mustflow/skills/name-resolution-integrity-review/SKILL.md +252 -0
  39. package/templates/default/locales/en/.mustflow/skills/name-resolution-integrity-review/references/dns-network-resolution-checklist.md +394 -0
  40. package/templates/default/locales/en/.mustflow/skills/name-resolution-integrity-review/references/language-symbol-resolution-checklist.md +282 -0
  41. package/templates/default/locales/en/.mustflow/skills/name-resolution-integrity-review/references/module-package-loader-resolution-checklist.md +352 -0
  42. package/templates/default/locales/en/.mustflow/skills/parser-engineering-review/SKILL.md +103 -17
  43. package/templates/default/locales/en/.mustflow/skills/parser-engineering-review/references/cst-ast-lowering-checklist.md +260 -0
  44. package/templates/default/locales/en/.mustflow/skills/parser-engineering-review/references/lexer-tokenization-checklist.md +397 -0
  45. package/templates/default/locales/en/.mustflow/skills/parser-engineering-review/references/tree-serialization-compatibility-checklist.md +164 -0
  46. package/templates/default/locales/en/.mustflow/skills/parser-engineering-review/references/tree-traversal-rewrite-checklist.md +209 -0
  47. package/templates/default/locales/en/.mustflow/skills/race-condition-review/SKILL.md +68 -11
  48. package/templates/default/locales/en/.mustflow/skills/race-condition-review/references/race-reproduction-memory-model-checklist.md +268 -0
  49. package/templates/default/locales/en/.mustflow/skills/routes.toml +151 -0
  50. package/templates/default/locales/en/.mustflow/skills/session-handoff-integrity-review/SKILL.md +343 -0
  51. package/templates/default/locales/en/.mustflow/skills/session-handoff-integrity-review/references/session-auth-stream-resume-checklist.md +413 -0
  52. package/templates/default/locales/en/.mustflow/skills/session-handoff-integrity-review/references/session-handoff-protocol-checklist.md +485 -0
  53. package/templates/default/locales/en/.mustflow/skills/two-phase-transition-integrity-review/SKILL.md +267 -0
  54. package/templates/default/locales/en/.mustflow/skills/two-phase-transition-integrity-review/references/admission-decision-recovery-checklist.md +308 -0
  55. package/templates/default/locales/en/.mustflow/skills/two-phase-transition-integrity-review/references/two-phase-transition-checklist.md +229 -0
  56. package/templates/default/locales/en/.mustflow/skills/ui-dispatch-lifecycle-review/SKILL.md +300 -0
  57. package/templates/default/locales/en/.mustflow/skills/ui-dispatch-lifecycle-review/references/ui-affinity-event-loop-checklist.md +277 -0
  58. package/templates/default/locales/en/.mustflow/skills/ui-dispatch-lifecycle-review/references/ui-dispatch-lifecycle-checklist.md +292 -0
  59. package/templates/default/manifest.toml +115 -1
@@ -0,0 +1,778 @@
1
+ # Diagnostics, ABI, Codegen, and Linker Checklist
2
+
3
+ Use this checklist for compiler diagnostics and recovery, source mapping, fix-its, ABI and layout,
4
+ machine lowering, assembly and object metadata, unwind, linker resolution, cross-target execution,
5
+ and binary compatibility.
6
+
7
+ ## Contents
8
+
9
+ 1. [Structured diagnostics](#structured-diagnostics)
10
+ 2. [Source coordinates](#source-coordinates)
11
+ 3. [Macro, include, and generated provenance](#macro-include-and-generated-provenance)
12
+ 4. [Recovery and fix-its](#recovery-and-fix-its)
13
+ 5. [Diagnostic determinism and rendering](#diagnostic-determinism-and-rendering)
14
+ 6. [Stage separation](#stage-separation)
15
+ 7. [ABI producer-consumer matrix](#abi-producer-consumer-matrix)
16
+ 8. [Layout and calling-convention probes](#layout-and-calling-convention-probes)
17
+ 9. [Exceptions and unwind](#exceptions-and-unwind)
18
+ 10. [Object metadata](#object-metadata)
19
+ 11. [Machine-code pipeline](#machine-code-pipeline)
20
+ 12. [Assembler and disassembler](#assembler-and-disassembler)
21
+ 13. [Differential execution](#differential-execution)
22
+ 14. [Object-format and symbol-namespace matrix](#object-format-and-symbol-namespace-matrix)
23
+ 15. [Link resolution graph](#link-resolution-graph)
24
+ 16. [Archive extraction and section reachability](#archive-extraction-and-section-reachability)
25
+ 17. [Relocation contract](#relocation-contract)
26
+ 18. [Static and dynamic resolution](#static-and-dynamic-resolution)
27
+ 19. [Visibility, export, and import boundaries](#visibility-export-and-import-boundaries)
28
+ 20. [Language linkage and complete ABI identity](#language-linkage-and-complete-abi-identity)
29
+ 21. [Stable C and plugin boundaries](#stable-c-and-plugin-boundaries)
30
+ 22. [Dynamic loading and plugin lifecycle](#dynamic-loading-and-plugin-lifecycle)
31
+ 23. [Relaxation and boundary generation](#relaxation-and-boundary-generation)
32
+ 24. [Portable link reproduction](#portable-link-reproduction)
33
+ 25. [Cross-target evidence](#cross-target-evidence)
34
+ 26. [Failure matrix](#failure-matrix)
35
+ 27. [Invariants](#invariants)
36
+ 28. [Skill handoffs](#skill-handoffs)
37
+
38
+ ## Structured diagnostics
39
+
40
+ Treat the diagnostic data model as the primary contract. Record:
41
+
42
+ - stable diagnostic identity or category;
43
+ - severity and whether policy can remap it;
44
+ - primary source location and range;
45
+ - related locations and ranges;
46
+ - parent error, child note, and causal graph;
47
+ - message arguments before localization;
48
+ - expected tokens, types, candidates, or recovery action;
49
+ - fix-it edits with applicability or confidence;
50
+ - originating compiler stage;
51
+ - recovery node or placeholder identity;
52
+ - rendered text, color, and layout as a secondary surface.
53
+
54
+ Use both inline expectations and complete rendering fixtures when the repository supports them.
55
+ Inline assertions tie a diagnostic to its source position and identity; full fixtures cover snippets,
56
+ underlines, notes, help text, ordering, truncation, and line wrapping.
57
+
58
+ Do not let broad text matching accept the right words at the wrong location. Do not let a complete
59
+ snapshot make harmless wording or ordering changes hide a structural span or note-ownership defect.
60
+
61
+ ## Source coordinates
62
+
63
+ Name every coordinate unit:
64
+
65
+ - byte offset in the original source buffer;
66
+ - decoded scalar or code-point index;
67
+ - UTF-16 or host string offset;
68
+ - grapheme cluster boundary;
69
+ - line index and line-ending policy;
70
+ - terminal display column;
71
+ - token-start and token-end semantics;
72
+ - half-open character range or token range.
73
+
74
+ Test a matrix containing:
75
+
76
+ - ASCII;
77
+ - tabs at several tab stops;
78
+ - multi-byte encoded characters;
79
+ - combining marks;
80
+ - wide and emoji characters;
81
+ - mixed scripts and bidirectional text where supported;
82
+ - LF, CRLF, and other accepted line boundaries;
83
+ - byte-order mark;
84
+ - final newline present and absent;
85
+ - invalid or replacement-decoded input where the frontend accepts it;
86
+ - multi-character operators, escapes, raw strings, comments, and escaped newlines at range ends.
87
+
88
+ Internal source anchors and rendered columns may use different units. Convert explicitly and test
89
+ the mapping. A byte-based primary location does not permit a byte count to be drawn directly as a
90
+ terminal underline.
91
+
92
+ ## Macro, include, and generated provenance
93
+
94
+ For macro-like expansion systems, preserve and test:
95
+
96
+ - spelling location;
97
+ - expansion or invocation location;
98
+ - argument-substitution origin;
99
+ - token-paste or generated-token origin;
100
+ - nested expansion stack;
101
+ - whether the user can fix the invocation or must fix the definition;
102
+ - primary versus note-location policy.
103
+
104
+ For includes, modules, precompiled state, generated files, virtual files, and remapping:
105
+
106
+ - distinguish physical path, logical source name, and user-visible remapped path;
107
+ - preserve include or import stack order;
108
+ - point notes for declarations back to their source artifact;
109
+ - prevent absolute workspace, cache, or temporary paths from leaking after remapping;
110
+ - test symlink and case behavior only under the repository's supported platform contract;
111
+ - ensure remapping is applied once and consistently to every related location.
112
+
113
+ ## Recovery and fix-its
114
+
115
+ Measure recovery by preserved structure and bounded damage:
116
+
117
+ - delete, duplicate, or replace one token in a small valid program;
118
+ - require the parser or semantic stage to make progress;
119
+ - preserve later valid declarations or regions when the language contract permits it;
120
+ - cap related diagnostics and recovery work;
121
+ - preserve error or recovery nodes with source provenance;
122
+ - block recovery placeholders from unsafe optimization, lowering, code generation, or execution;
123
+ - distinguish one root repair from independent later errors.
124
+
125
+ Treat fix-its as edit transactions:
126
+
127
+ 1. validate all edit ranges against the same source snapshot;
128
+ 2. reject or resolve overlapping and conflicting edits explicitly;
129
+ 3. apply edits in an offset-safe order;
130
+ 4. rerun the relevant frontend and semantic stages;
131
+ 5. require the intended diagnostic to disappear or change as specified;
132
+ 6. check that no forbidden new diagnostic or semantic change appears;
133
+ 7. apply the same fix-it again and require no additional change when idempotence is promised.
134
+
135
+ For warning fix-its that claim semantics preservation, compare observable behavior or the relevant
136
+ IR contract. For error recovery, compare the compiler's assumed repaired structure with the actual
137
+ structure after applying the edit.
138
+
139
+ ## Diagnostic determinism and rendering
140
+
141
+ Repeat under:
142
+
143
+ - serial and supported parallel frontend modes;
144
+ - different worker counts and schedules;
145
+ - terminal widths from narrow to wide;
146
+ - color on and off;
147
+ - Unicode and ASCII fallback rendering;
148
+ - short and long paths;
149
+ - multiple supported language or edition modes;
150
+ - duplicate-suppression enabled and disabled when exposed;
151
+ - stable and randomized internal IDs where applicable.
152
+
153
+ Compare diagnostic identities, primary spans, related-span ownership, and note graph before line
154
+ order. Independent diagnostics may reorder; a note moving to another parent is not harmless.
155
+
156
+ Normalization may remove known platform paths, nondeterministic temporary names, or color escapes.
157
+ It must not erase line, column, range, diagnostic identity, argument, note relation, or mode-specific
158
+ behavior that the test intends to protect.
159
+
160
+ ## Stage separation
161
+
162
+ Persist and test separately:
163
+
164
+ | Stage | Primary artifact | Stronger oracle |
165
+ | --- | --- | --- |
166
+ | Frontend | Semantic IR or module | Source semantics and structured diagnostics. |
167
+ | Optimizer | Transformed IR | Defined execution or translation validation. |
168
+ | Machine lowering | Machine IR | Machine verifier and target semantics. |
169
+ | Assembler | Object | Encoding, relocation, symbol, and section contracts. |
170
+ | Linker | Linked image and map | Resolution graph, relocations, layout, and loader contract. |
171
+ | Runtime | Process observation | ABI-aware independent reference or specified behavior. |
172
+
173
+ Do not wrap compile, assemble, link, load, and run into one Boolean result when diagnosing a
174
+ compiler defect. Preserve the artifact before and after the first failing stage.
175
+
176
+ For whole-program optimization, also separate summary generation, import or index selection,
177
+ per-module backend compilation, native object generation, and final native link.
178
+
179
+ ## ABI producer-consumer matrix
180
+
181
+ Cross independent implementations and versions:
182
+
183
+ | Caller producer | Callee producer | Direction |
184
+ | --- | --- | --- |
185
+ | Compiler or version A | Compiler or version B | A calls B. |
186
+ | Compiler or version B | Compiler or version A | B calls A. |
187
+ | Current | Previous supported | Current calls previous and reverse. |
188
+ | Compiler generated | Hand-authored boundary probe | Both directions where valid. |
189
+
190
+ Cover ABI surfaces such as:
191
+
192
+ - scalar, aggregate, vector, and variadic arguments;
193
+ - return-in-register and hidden aggregate-return conventions;
194
+ - stack alignment and caller-reserved areas;
195
+ - callee-saved registers and flags;
196
+ - homogeneous or special aggregate classes;
197
+ - over-aligned and packed data;
198
+ - bit fields and flexible tails;
199
+ - empty base or zero-sized members where the ABI defines them;
200
+ - virtual dispatch and member pointers where applicable;
201
+ - name mangling and symbol versioning;
202
+ - exceptions, unwind, destructors, and cleanup;
203
+ - thread-local storage and visibility.
204
+
205
+ One compiler building both sides can make the same ABI mistake symmetrically and appear correct.
206
+
207
+ ## Layout and calling-convention probes
208
+
209
+ Use independent evidence layers:
210
+
211
+ - source-level size, alignment, and offset observations;
212
+ - compiler layout or ABI classification output;
213
+ - debug type metadata;
214
+ - object symbols and relocations;
215
+ - hand-authored caller or callee probes;
216
+ - runtime register, stack, and memory capture;
217
+ - binary-compatibility comparison against a supported baseline.
218
+
219
+ A boundary probe may record, without perturbing the contract more than necessary:
220
+
221
+ - incoming argument registers and stack slots;
222
+ - stack pointer alignment;
223
+ - hidden result and context pointers;
224
+ - vector and floating-point register placement;
225
+ - preserved-register values before and after the call;
226
+ - aggregate bytes and padding where observation is defined;
227
+ - return registers and cleanup behavior.
228
+
229
+ Do not use debug metadata as proof of runtime layout or runtime values as proof that debug metadata
230
+ is correct. Compare them as separate products.
231
+
232
+ ## Exceptions and unwind
233
+
234
+ Test cross-boundary throw and catch in both producer directions. Cover:
235
+
236
+ - normal call and tail-call adjacency;
237
+ - destructor and cleanup ordering;
238
+ - register pressure and callee-saved restoration;
239
+ - stack probing and dynamic allocation;
240
+ - inline assembly adjacency;
241
+ - inlining boundaries;
242
+ - foreign-function frames;
243
+ - signal, structured, table-driven, or platform-specific unwind modes in declared scope;
244
+ - backtrace and personality or language-runtime interaction.
245
+
246
+ Inspect unwind records structurally in the object and linked image, then test runtime unwinding on a
247
+ supported target. A function returning the right value does not exercise exception ABI.
248
+
249
+ ## Object metadata
250
+
251
+ Inspect fields consumed by assemblers, linkers, loaders, debuggers, and runtimes:
252
+
253
+ - instruction encodings and data bytes;
254
+ - relocation type, offset, addend, symbol, and section;
255
+ - symbol value, size, type, binding, visibility, and version;
256
+ - section type, flags, alignment, order constraints, and grouping;
257
+ - deduplication or COMDAT-like groups;
258
+ - thread-local storage model;
259
+ - exception and unwind records;
260
+ - debug line and type information;
261
+ - target attributes and feature notes;
262
+ - build identity or reproducibility metadata where in scope.
263
+
264
+ Whole-object byte comparison is often too sensitive to timestamps, string tables, or harmless
265
+ ordering. Disassembly text is too weak for relocations, visibility, unwind, debug, and grouping.
266
+ Parse and compare the structural fields that own the contract.
267
+
268
+ ## Object-format and symbol-namespace matrix
269
+
270
+ Name the concrete object and loader contract before interpreting a symbol listing. Similar-looking
271
+ rows do not have portable meaning across formats.
272
+
273
+ When the task names Linux ELF with GNU `ld`, use that as the explicit baseline rather than a vague
274
+ "Unix linker" model:
275
+
276
+ - `.symtab` is the regular link-time and tooling symbol table and may contain local symbols and
277
+ entries that are not part of the runtime interface;
278
+ - `.dynsym` is the loader-facing dynamic namespace selected for dynamic linking and runtime lookup;
279
+ - symbol binding, type, visibility, section index, value, size, and optional version are separate
280
+ fields and must not be collapsed into one "symbol exists" Boolean;
281
+ - undefined, absolute, common or tentative, and section-defined entries have different selection and
282
+ allocation meaning;
283
+ - local, global or strong, and weak binding affect resolution independently of visibility;
284
+ - procedure linkage and global-offset indirection affect call and data binding without making the
285
+ regular symbol table identical to the dynamic interface.
286
+
287
+ Do not project those ELF section names or GNU resolution rules onto PE/COFF or Mach-O. Use the
288
+ platform columns below to name the corresponding evidence surfaces and explicitly record when the
289
+ selected linker implements a different policy.
290
+
291
+ | Contract | ELF-family baseline | PE/COFF-family distinction | Mach-O-family distinction |
292
+ | --- | --- | --- | --- |
293
+ | Full link-time symbols | Regular object symbol table records local and global definitions, undefined references, binding, type, visibility, section, value, and size. | COFF object symbols and auxiliary records drive static linking, but are not the runtime export surface. | Object symbols and dynamic-symbol metadata participate in linking, while final exported-name structures are a separate loader surface. |
294
+ | Loader-visible interface | Dynamic symbol namespace plus dynamic dependency and relocation metadata. | Export directory, import directory, and import-library contract are distinct surfaces. | Exported-name data, indirect symbols, stubs, pointer sections, and load-command dependencies form the loader contract. |
295
+ | Deduplication | Weak, group, and link-once-like semantics are format and linker policy. | COMDAT selection carries explicit selection policy and associative relationships. | Weak and coalesced definitions use platform-specific selection and dead-strip rules. |
296
+ | Dynamic indirection | Procedure and data indirection structures may defer or localize binding. | Import address indirection and optional delayed loading follow the image contract. | Stubs and lazy or non-lazy symbol pointers mediate imports. |
297
+ | Namespace model | Visibility, version, preemption, and dependency scope affect selection. | Imported and exported names, decorated names, and module boundaries are explicit. | Two-level or flat namespace policy changes which image owns a definition. |
298
+
299
+ For every claim, record which namespace was inspected: input object, archive index, linked regular
300
+ symbol table, loader-visible export table, import table, dynamic dependency list, or runtime lookup.
301
+ Absence from one namespace is not evidence of absence from the others.
302
+
303
+ ## Machine-code pipeline
304
+
305
+ Persist machine-stage input and output around:
306
+
307
+ - instruction legalization;
308
+ - register-bank or class selection;
309
+ - instruction selection;
310
+ - target combines and peepholes;
311
+ - scheduling;
312
+ - register allocation and spilling;
313
+ - frame layout;
314
+ - prologue and epilogue insertion;
315
+ - branch relaxation and thunk insertion;
316
+ - final instruction encoding.
317
+
318
+ Run the machine verifier or repository equivalent after each stage. Check operand classes, virtual
319
+ and physical register constraints, dominance and liveness, frame indices, call-preserved masks,
320
+ implicit operands, bundle or delay-slot rules, target feature requirements, and terminators.
321
+
322
+ The first invalid machine artifact is more useful than a later assembler crash or wrong executable.
323
+
324
+ ## Assembler and disassembler
325
+
326
+ Use semantic round trips:
327
+
328
+ 1. assemble source into object;
329
+ 2. parse encodings, relocations, symbols, and sections;
330
+ 3. disassemble to a canonical or accepted assembly form;
331
+ 4. reassemble;
332
+ 5. compare semantic encodings and metadata;
333
+ 6. execute supported instructions through a reference model, emulator, or real target where useful.
334
+
335
+ Allow documented mnemonic aliases, implicit operands, canonical operand order, and formatting
336
+ changes. Reject changes in instruction semantics, target features, relocation meaning, or flags.
337
+
338
+ Keep malformed encoding and text rejection lanes separate from valid semantic round trips.
339
+
340
+ ## Differential execution
341
+
342
+ Compare the same defined IR or source across:
343
+
344
+ - optimization levels;
345
+ - compiler revisions;
346
+ - backend selection paths;
347
+ - instruction-selection modes;
348
+ - target features;
349
+ - code models and relocation models;
350
+ - assemblers or linkers;
351
+ - reference interpreter or specification model.
352
+
353
+ Freeze or normalize legitimate dimensions: floating-point mode, denormal handling, exception masks,
354
+ address-space layout when irrelevant, environment, locale, runtime libraries, and target feature
355
+ availability.
356
+
357
+ Do not use majority vote. Select a specification, interpreter, translation validator, hand-written
358
+ reference, or other independent authority. If none exists, classify the result as a discrepancy.
359
+
360
+ ## Link resolution graph
361
+
362
+ Represent a minimal graph of:
363
+
364
+ - strong and weak definitions;
365
+ - tentative or common definitions where supported;
366
+ - hidden, protected, and default visibility;
367
+ - versioned symbols;
368
+ - archive members and extraction rules;
369
+ - groups and cyclic archives;
370
+ - deduplicated or COMDAT-like sections;
371
+ - whole-archive or force-load behavior;
372
+ - link scripts and symbol aliases;
373
+ - whole-program optimization inputs and native objects;
374
+ - undefined-reference demand at each ordered input position;
375
+ - archive index entries and the members that satisfy that demand;
376
+ - section roots and reference edges used by section collection;
377
+ - relocations from consuming locations to selected definitions;
378
+ - loader-visible exports, imports, direct dependencies, and binding time.
379
+
380
+ Capture the actual final link inputs after compiler-driver expansion. Source declarations, build
381
+ configuration, and an intended library list do not prove what the linker consumed. Compare object
382
+ identity, order, archive membership, target mode, symbol decoration, whole-program optimization
383
+ artifacts, startup objects, and implicit libraries.
384
+
385
+ Permute object and archive order only where the format and command contract allow order variation.
386
+ Inspect selected definition, discarded alternatives, map or selection-trace evidence, relocation
387
+ target, retained section, final regular symbol table, loader-visible symbol table, and dependency
388
+ closure. Final program output can hide wrong resolution when two definitions happen to return the
389
+ same value.
390
+
391
+ ## Archive extraction and section reachability
392
+
393
+ An archive is a searchable set of members, not one giant object. Model extraction as a stateful
394
+ process:
395
+
396
+ 1. begin with the unresolved references and roots already established by earlier inputs;
397
+ 2. inspect the archive under its declared scan and rescan rules;
398
+ 3. extract only members selected by current demand unless the contract forces broader retention;
399
+ 4. add each extracted member's definitions, undefined references, groups, and sections;
400
+ 5. continue until the platform and option contract says the input is exhausted;
401
+ 6. run section reachability and deduplication as separate decisions.
402
+
403
+ Test order-sensitive and cyclic cases with the smallest graph that exposes the rule. Grouping,
404
+ rescan, whole-archive, force-load, automatic-registration anchors, and undefined-symbol roots are
405
+ distinct retention mechanisms; do not treat one as a portable spelling for another.
406
+
407
+ For the ordinary GNU `ld` static-archive baseline, an archive is considered where it appears in the
408
+ ordered input stream and members are pulled to satisfy demand known at that point. A definition or
409
+ new undefined reference introduced only by a later input does not by itself prove that an earlier
410
+ archive will be searched again. Treat explicit group or rescan semantics as a different contract and
411
+ preserve the selection trace that proves the revisit.
412
+
413
+ For constructors, registries, plugins, and self-registering tests, prove both member extraction and
414
+ section survival. A member can be extracted and later have an unreferenced registration section
415
+ discarded, or never be extracted despite containing a constructor. Record the root that keeps the
416
+ registration path alive and test its absence as a negative case.
417
+
418
+ For every collected or discarded section, preserve:
419
+
420
+ - owning object and archive member;
421
+ - group or associative relationship;
422
+ - root reason or incoming reference edge;
423
+ - deduplication winner and discarded peers;
424
+ - collection decision and the policy phase that made it;
425
+ - any address-significant, unwind, initialization, or metadata coupling.
426
+
427
+ ## Relocation contract
428
+
429
+ A relocation is a deferred calculation owned jointly by the producer, object format, linker, and
430
+ loader. Record:
431
+
432
+ - relocation kind and architecture;
433
+ - consuming section and offset;
434
+ - referenced symbol or section;
435
+ - explicit or implicit addend representation;
436
+ - place, symbol, base, and other terms used by the formula;
437
+ - width, signedness, alignment, range, and overflow behavior;
438
+ - static-link versus dynamic-load responsibility;
439
+ - indirection, thunk, or relaxation eligibility;
440
+ - final encoded value and selected definition.
441
+
442
+ Do not infer the relocation contract from disassembly text or a resolved address alone. Two object
443
+ files can produce identical bytes while carrying different future-link behavior, and a linked image
444
+ can run in one layout while retaining the wrong dynamic relocation or interposition semantics.
445
+
446
+ Pair every relocation regression with a producer-side structural assertion and a consumer-side
447
+ selection assertion. Generate boundary cases around displacement, code model, alignment, TLS model,
448
+ preemptibility, and section-placement transitions under the named target ABI.
449
+
450
+ ## Static and dynamic resolution
451
+
452
+ Keep three decisions separate:
453
+
454
+ | Boundary | Question |
455
+ | --- | --- |
456
+ | Static object and archive selection | Which input definition and section satisfy each reference in the linked image? |
457
+ | Dynamic dependency construction | Which shared images and import records remain direct runtime dependencies? |
458
+ | Loader binding | Which runtime definition satisfies each loader-visible reference, and when is that choice made? |
459
+
460
+ Record local, hidden, protected, preemptible, interposable, weak, versioned, and undefined behavior
461
+ under the exact platform contract. Eager versus deferred binding, executable-defined overrides,
462
+ symbol interposition, two-level namespace ownership, import-address indirection, and direct binding
463
+ are not interchangeable mechanisms.
464
+
465
+ Dependency pruning policies can make input position and current unresolved demand observable. Prove
466
+ the final direct dependency list and the relocation or import that justifies each retained dependency.
467
+ Do not accept an indirect dependency merely because it happens to be present in the current process.
468
+ For shared-library closure, test the consumer against the declared direct dependencies instead of
469
+ letting ambient loader state complete the graph.
470
+
471
+ ## Visibility, export, and import boundaries
472
+
473
+ Define the public binary surface with an allowlist, not with whatever names the linker happens to
474
+ expose. Use the platform's native export mechanism and verify the final image after link.
475
+
476
+ For a library header or generated interface, distinguish at least:
477
+
478
+ - producer of a shared library;
479
+ - consumer of that shared library;
480
+ - static-library build and consumer;
481
+ - internal implementation and test-only visibility;
482
+ - language linkage and calling convention;
483
+ - data import or export when unavoidable.
484
+
485
+ Prefer hidden or internal visibility for implementation symbols. Treat exported global data as a
486
+ high-risk ABI because storage ownership, initialization, thread-local rules, copy or import
487
+ relocations, and module unload all become observable. Prefer accessor functions or opaque handles.
488
+
489
+ Diff the final exported names, versions, ordinals where part of the contract, types, sizes where
490
+ available, and direct dependencies against a supported baseline. Check both unexpected additions and
491
+ missing required exports. Source annotations alone are not proof: template instantiation, inline
492
+ emission, linker scripts, export lists, definition files, whole-program optimization, and dead
493
+ stripping can change the final surface.
494
+
495
+ ## Language linkage and complete ABI identity
496
+
497
+ Language linkage controls only part of the boundary. A C-linkage name can still disagree on calling
498
+ convention, parameter or return representation, alignment, packing, ownership, exception behavior,
499
+ thread-local model, or target ABI. Some name-mangling schemes omit facts such as return type, so two
500
+ incompatible declarations can resolve to the same symbol.
501
+
502
+ Treat a matching decorated or mangled name as a lookup result, not an ABI proof. Record the complete
503
+ boundary identity:
504
+
505
+ - target architecture, object format, and ABI family;
506
+ - compiler ABI mode and ABI-affecting options;
507
+ - source-language version and relevant runtime-library ABI;
508
+ - calling convention and function type including return classification;
509
+ - record layout, packing, alignment, bit-field, enum, and vector rules;
510
+ - exception, unwind, RTTI, and dynamic-cast identity;
511
+ - template, inline, virtual table, type-info, and key-definition ownership;
512
+ - allocator, deallocator, destructor, and module-unload ownership.
513
+
514
+ Default arguments and inline implementation live in consumers once compiled. Changing them without
515
+ changing a symbol can change behavior across old and new clients. COMDAT or weak deduplication can
516
+ also hide an ODR mismatch by selecting one copy nondeterministically or by link order. Test mixed
517
+ old/new consumers, reverse producer roles, and load order where the supported ABI permits it.
518
+
519
+ Avoid exposing standard-library containers, compiler-private exception types, or private class
520
+ layout across a long-lived binary boundary unless the toolchain, runtime, build options, and support
521
+ window are intentionally locked. Ensure allocation and release occur in the owning module when heaps
522
+ or runtimes may differ.
523
+
524
+ ## Stable C and plugin boundaries
525
+
526
+ For a durable cross-toolchain boundary, prefer an explicitly versioned C-shaped facade with opaque
527
+ handles and fixed-width or otherwise contract-defined scalar representations. That reduces the
528
+ surface; it does not remove the ABI work.
529
+
530
+ For a versioned function-table interface, specify:
531
+
532
+ - structure size and ABI version before optional fields;
533
+ - required and optional capability bits;
534
+ - nullability and lifetime of every function pointer and context;
535
+ - calling convention and thread-safety contract;
536
+ - ownership of input buffers, returned buffers, handles, and callbacks;
537
+ - allocator and release functions paired by the same module;
538
+ - error transport that does not throw exceptions across the boundary;
539
+ - forward and backward compatibility rules for unknown fields and capabilities;
540
+ - initialization, shutdown, reentrancy, and module-unload behavior.
541
+
542
+ Negotiate the highest mutually supported contract and test smaller historical table sizes. Reject a
543
+ provider before calling through it when required fields, version, size, target ABI, or capabilities
544
+ do not match. Keep the export allowlist small: usually the boundary-discovery entry point and the
545
+ explicitly supported C facade, not every implementation symbol.
546
+
547
+ ## Dynamic loading and plugin lifecycle
548
+
549
+ Treat plugin activation as a transaction with explicit discovery, validation, binding, publication,
550
+ quiescence, and retirement stages.
551
+
552
+ ### Dependency retention and binding time
553
+
554
+ Record:
555
+
556
+ - direct shared dependencies retained in the final image and why each is needed;
557
+ - dependency pruning decision at the input position where the shared image appeared;
558
+ - symbols, constructors, registration side effects, or runtime lookups not visible as ordinary
559
+ unresolved references;
560
+ - eager versus deferred function binding;
561
+ - data relocations and other references that remain eager under a lazy function policy;
562
+ - delayed-load or optional-load failure hook and fallback contract;
563
+ - capability and entry-point validation completed before publication.
564
+
565
+ A lazy policy moves some failures to first use; it does not prove the module can satisfy every
566
+ required reference. Validate required capabilities and entry points before accepting work. Treat
567
+ optional functionality as a negotiated capability, not as an unhandled missing symbol at call time.
568
+
569
+ Do not rely on a transitive shared dependency to complete the consumer's undeclared closure. Compare
570
+ the final direct-dependency list with an allowlist and test in an environment without ambient copies.
571
+
572
+ ### Interposition and exported data
573
+
574
+ For every default-visible or otherwise preemptible symbol, record whether calls from the defining
575
+ image may bind to another definition. Local binding, protected semantics, symbolic binding, semantic-
576
+ interposition assumptions, and instrumentation interposition are different contracts.
577
+
578
+ Changing interposition policy can alter:
579
+
580
+ - internal call targets;
581
+ - optimizer inlining and constant propagation;
582
+ - preload-based instrumentation, sanitizers, profilers, and tests;
583
+ - allocator, logging, hook, and singleton identity;
584
+ - override behavior expected by existing consumers.
585
+
586
+ Treat exported writable data as a storage ABI. Record copy or import relocation behavior, address
587
+ identity, initialization owner, TLS model, mutation visibility, and unload lifetime. Prefer functions
588
+ and opaque contexts because an exported address is harder to version or interpose safely.
589
+
590
+ When static archives are bundled into a shared image, verify that their implementation symbols do
591
+ not leak into the final dynamic interface. Default visibility inside an archive is not private after
592
+ the member becomes part of a shared image.
593
+
594
+ ### Loader scopes and namespaces
595
+
596
+ Record the platform-specific lookup domain:
597
+
598
+ - process-global, local, dependency, self-first, or isolated namespace;
599
+ - promotion rules that can make a local image globally visible;
600
+ - parent, host, or bundle-loader relationship;
601
+ - two-level image ownership versus flat name lookup;
602
+ - deep-binding or self-first policy and its effect on interposition;
603
+ - duplicate runtime, allocator, RTTI, exception, and singleton instances;
604
+ - namespace limit, shared process state, and security boundary.
605
+
606
+ A separate loader namespace can isolate symbol resolution without isolating memory corruption,
607
+ signals, file descriptors, credentials, or process privileges. Use process isolation when trust or
608
+ crash containment is required.
609
+
610
+ Do not use self-first binding as a universal collision fix. It can split runtime identity and defeat
611
+ instrumentation that depends on interposition.
612
+
613
+ ### Runtime symbol lookup
614
+
615
+ Centralize runtime lookup behind a typed resolver that records:
616
+
617
+ - module or namespace identity;
618
+ - symbol spelling, optional version, and case policy;
619
+ - name versus ordinal lookup;
620
+ - lookup API error protocol, including valid null-valued definitions where supported;
621
+ - expected function type and calling convention;
622
+ - required versus optional classification;
623
+ - capability bit and ABI-table field associated with the result;
624
+ - stable diagnostic without exposing raw addresses or private paths.
625
+
626
+ Do not treat a pointer value alone as the complete success signal when the platform exposes a
627
+ separate error channel. Avoid sparse ordinal lookup as an optional API protocol unless the export
628
+ contract explicitly owns those ordinals.
629
+
630
+ ### Activation and retirement
631
+
632
+ Activate in this order:
633
+
634
+ 1. resolve an allowed absolute or manifest-bound artifact identity;
635
+ 2. verify platform, architecture, ABI major, binary identity, and trust policy;
636
+ 3. load into the intended namespace and binding mode;
637
+ 4. resolve every required discovery entry point and negotiate the function table;
638
+ 5. validate size, version, capabilities, ownership, threading, and error contracts;
639
+ 6. publish the provider atomically to new callers;
640
+ 7. on retirement, block new calls and unregister callbacks;
641
+ 8. cancel work, join threads, drain calls, return handles, and wait for the ownership epoch to close;
642
+ 9. unload only when no code, data, TLS destructor, callback, vtable, or function pointer can remain.
643
+
644
+ Loader close success does not prove physical unmapping, and physical unmapping does not prove safety.
645
+ For complex native plugins, a never-unload policy or process replacement can be safer than in-process
646
+ hot reload. State that lifecycle choice explicitly.
647
+
648
+ Do not use an ambient search path as version negotiation. Bind discovery to an allowed location and
649
+ manifest containing architecture, ABI, identity, and capability expectations, then verify the loaded
650
+ image rather than trusting its filename.
651
+
652
+ ## Relaxation and boundary generation
653
+
654
+ Derive exact thresholds from target and object rules, then generate cases at:
655
+
656
+ - minimum minus one, minimum, and minimum plus one;
657
+ - maximum minus one, maximum, and maximum plus one;
658
+ - alignment boundary before and after one byte or unit of padding;
659
+ - branch displacement just within and just outside direct reach;
660
+ - small or medium code-model boundary;
661
+ - local versus global, preemptible, or interposable symbol boundary;
662
+ - relaxation eligible versus one-condition-ineligible;
663
+ - section collection root present versus absent;
664
+ - identical-code folding candidates differing by one relocation or semantic property.
665
+
666
+ Verify the expected direct form, relaxed form, thunk, veneer, long branch, relocation, retained
667
+ section, or non-folded identity. Store the formula and target parameters, not only a giant fixture.
668
+
669
+ ## Portable link reproduction
670
+
671
+ A closed link reproducer should include:
672
+
673
+ - linker identity and target mode;
674
+ - response or argument file after driver expansion;
675
+ - all native objects, archives, scripts, startup objects, and required libraries;
676
+ - environment and working-directory assumptions;
677
+ - whole-program optimization outputs or a separate boundary proving they are not the failing stage;
678
+ - expected map, selected symbol, relocation, diagnostic, image hash, or runtime predicate;
679
+ - privacy and license review for embedded inputs.
680
+
681
+ Reduce in layers:
682
+
683
+ 1. libraries and archive groups;
684
+ 2. archive members and objects;
685
+ 3. sections;
686
+ 4. symbols;
687
+ 5. relocations and data;
688
+ 6. link options and scripts;
689
+ 7. target features and layout facts.
690
+
691
+ Preserve the original link defect rather than accepting any link failure.
692
+
693
+ ## Cross-target evidence
694
+
695
+ Separate evidence levels:
696
+
697
+ - host-side parsing and structural validation of target IR, machine IR, assembly, and object;
698
+ - successful cross-link with correct target metadata;
699
+ - emulator or simulator execution;
700
+ - remote runner execution;
701
+ - real hardware execution;
702
+ - cross-version or cross-compiler producer-consumer execution.
703
+
704
+ Report which level ran. A correct object header on the host does not prove target execution, and an
705
+ emulator result may not cover hardware errata, system ABI integration, or feature detection.
706
+
707
+ Preserve target runtime libraries, loader, kernel or operating environment, CPU features, and
708
+ execution arguments in the reproduction capsule.
709
+
710
+ ## Failure matrix
711
+
712
+ | Fault or variation | Required evidence |
713
+ | --- | --- |
714
+ | Diagnostic text changes but structure is stable. | Structural contract passes; rendering fixture is reviewed separately. |
715
+ | Same text appears at wrong source span. | Inline identity and location assertion fails. |
716
+ | Macro expansion moves the caret. | Spelling and expansion policy selects the correct primary and note sites. |
717
+ | One token is removed. | Recovery progresses, later structure survives as specified, and cascades remain bounded. |
718
+ | Fix-its overlap. | Transaction rejects or resolves conflict explicitly. |
719
+ | Parallel diagnostics reorder. | Parent-note graph and diagnostic multiset remain stable. |
720
+ | Same compiler builds ABI caller and callee. | Cross-producer fixture prevents common-mode masking. |
721
+ | Runtime layout is right but debug layout is wrong. | Independent layout layers detect the metadata defect. |
722
+ | Machine IR becomes invalid after one stage. | Immediate verifier localizes the producing stage. |
723
+ | Disassembly spelling changes. | Semantic encoding and relocation comparison ignores harmless aliases. |
724
+ | Symbol order changes. | Resolution graph distinguishes permitted order dependence from defect. |
725
+ | A symbol exists in an object but not at runtime. | Namespace evidence distinguishes regular symbols, loader-visible exports, imports, and stripped metadata. |
726
+ | An archive contains the required definition but the link fails. | Ordered unresolved-demand and member-extraction trace proves whether the member was eligible. |
727
+ | A registrar or constructor silently disappears. | Archive extraction and section-root evidence independently prove member and section survival. |
728
+ | A definition is selected but a call reaches another implementation. | Static relocation choice, dynamic dependency, visibility, interposition, and loader binding are checked separately. |
729
+ | A C-linkage function resolves but corrupts its caller. | Full calling convention, return classification, layout, ownership, and toolchain ABI identity are compared. |
730
+ | A shared library gains accidental public symbols. | Final export allowlist diff rejects the expanded loader-visible surface. |
731
+ | A plugin table is shorter than the current provider expects. | Size, version, capability, required-field, and nullability gates reject it before indirect calls. |
732
+ | Application starts but fails on the first rare plugin call. | Eager capability and required-entry validation exposes deferred binding failure before publication. |
733
+ | Bundled dependency hijacks another plugin. | Final export allowlist, loader scope, interposition, dependency identity, and namespace evidence reveal the leak. |
734
+ | A writable global has two observed values. | Data export, copy or import relocation, address identity, TLS model, and storage owner are compared. |
735
+ | Runtime symbol lookup returns a null-like value. | Platform error-channel protocol distinguishes valid value from lookup failure. |
736
+ | Plugin unload succeeds and later callback crashes. | Retirement evidence covers call quiescence, callback removal, threads, TLS, handles, and pointer lifetime. |
737
+ | Development loads the right plugin but production loads another. | Allowed path, manifest identity, search policy, architecture, ABI, and post-load image identity are verified. |
738
+ | Branch crosses reach by one unit. | Generated boundary case selects required long form or thunk. |
739
+ | Link driver fails outside the original machine. | Closed input archive exposes missing ambient dependency. |
740
+ | Cross target cannot execute locally. | Host structural evidence is reported separately from missing runtime proof. |
741
+
742
+ ## Invariants
743
+
744
+ - Every diagnostic assertion identifies structure and source, not text alone.
745
+ - Every rendered column derives from an explicit coordinate conversion.
746
+ - Every recovery path progresses or terminates within a declared bound.
747
+ - Every fix-it transaction applies to one source snapshot and has a post-apply oracle.
748
+ - Every ABI claim crosses an independent producer-consumer boundary or names the common-mode gap.
749
+ - Every object claim checks the metadata fields that own the behavior.
750
+ - Every symbol claim names the object, archive, linked, export, import, or runtime namespace observed.
751
+ - Every archive claim distinguishes member extraction from section retention.
752
+ - Every relocation claim records its formula inputs, range, selected target, and static or dynamic owner.
753
+ - Every public binary surface has a final-image export and direct-dependency allowlist.
754
+ - Every language-linkage claim is subordinate to a complete calling, layout, ownership, runtime, and
755
+ toolchain ABI contract.
756
+ - Every versioned plugin table validates size, version, capabilities, and required fields before use.
757
+ - Every plugin activation resolves and validates required capabilities before publishing the provider.
758
+ - Every loader-scope claim names interposition, namespace, dependency, and runtime-identity effects.
759
+ - Every exported-data claim identifies storage, relocation, TLS, address, and lifecycle ownership.
760
+ - Every unload claim proves quiescence of calls, callbacks, threads, TLS, handles, and code pointers.
761
+ - Every backend first-failure claim preserves machine artifacts around the boundary.
762
+ - Every differential execution result has an independent semantic authority.
763
+ - Every linker reduction preserves the original resolution or relocation predicate.
764
+ - Every cross-target claim states the actual execution evidence level.
765
+
766
+ ## Skill handoffs
767
+
768
+ - Use `compiler-engineering-review` for the full diagnostic, ABI, codegen, object, and linker
769
+ contract.
770
+ - Use `parser-engineering-review` for tokenization, grammar, CST and AST recovery, and parser source
771
+ units.
772
+ - Use `fuzz-harness-review` for harness, instrumentation, corpus, campaign, sanitizer, and generic
773
+ reducer infrastructure.
774
+ - Use the matching C, C++, Rust, assembly, or other language skill for source and ABI semantics.
775
+ - Use `cross-platform-filesystem-safety` for path, case, symlink, and file identity issues that are
776
+ not specific to compiler source mapping.
777
+ - Use `error-message-integrity-review` for public error mapping beyond compiler diagnostics.
778
+ - Use `test-maintenance` for regression fixtures and snapshot lifecycle.