Verify a fix actually closed the targeted retain cycle
verifyFixCompare before and after memory snapshots to get a per-pattern verdict on whether a fix resolved a retain cycle, returning PASS/PARTIAL/FAIL and bytes freed.
Instructions
[mg.memory] Cycle-semantic diff. Classifies both before and after .memgraph snapshots and emits a per-pattern PASS/PARTIAL/FAIL verdict plus bytes freed and instances released. Use as a CI gate: if expectedPatternId is provided, expectedPatternVerdict tells you in one field whether the fix landed.
Pipeline: this is the natural followup to classifyCycle after you've shipped a fix. Capture a fresh .memgraph, point this at the before/after pair.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| before | Yes | Absolute path to the baseline `.memgraph` (pre-fix). | |
| after | Yes | Absolute path to the post-fix `.memgraph`. | |
| expectedPatternId | No | If provided, the verdict is gated on whether this specific patternId disappeared from `after`. Defaults to checking every classified pattern. | |
| expectedAliveClasses | No | v1.14+. Class names that legitimately stay alive across the before/after snapshots. Singletons, framework registrars, persistent caches. When a class in this list appears in regressionClasses[], it is moved to expectedAlive[] and does not flip the verdict to FAIL. Each entry can be a plain string (treated as case-insensitive substring, the v1.14 default behavior) OR an object `{ pattern: string, mode?: "exact" | "substring" | "regex" }` (v1.17+). Modes: - `exact`: case-insensitive full-string equality. Use for system class names that are stable. - `substring`: case-insensitive substring match (the v1.14 default). - `regex`: JavaScript regex (anchors / flags as written in the pattern). Use for nuanced class-name shapes. Merged with the curated default list (DebugSwift's ignoredViewControllerClassNames + ignoredViewClassNames + ignoredWindowClassNames, all `mode: "exact"`) unless `disableDefaultWhitelist: true`. | |
| disableDefaultWhitelist | No | v1.14+. When true, the curated DEFAULT_EXPECTED_ALIVE_CLASSES list is NOT applied. Only the user-supplied expectedAliveClasses (if any) is used. Useful for strict regression mode in tests where every alive class should be evaluated. | |
| verbosity | No | compact |