Repository navigation
Conversation
Index diagnostic images by address and debug ID to avoid per-frame scans. Bound derived frame data before materializing recursive call paths.
philprime
force-pushed
the
philprime/feat/flamegraph-culprit-identification
branch
from
October 16, 2026 13:20
cabb3a0 to
2f95ff1
Compare
This branch has not been deployed
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Culprit identification belongs in Relay so we can share it across SDKs instead of implementing and maintaining the same selection algorithm in each SDK. SDKs can send sampled call trees, while Relay derives a representative exception stack for normal symbolication and grouping. This PR establishes that shared implementation, with MetricKit hangs as its first consumer.
Stacked on #6473. The base branch is
philprime/feat/flamegraph-attachments, so this diff contains only culprit selection and event enrichment.Selection and integration
The selector follows Android's
AnrCulpritIdentifierscoring:sample_count × (depth + application_frames). It folds identical root-to-frame prefixes using inclusive sample counts, keeps independent tree populations separate, prefers attributed trees, and resolves ties in input order. Application weighting uses suppliedin_appvalues rather than platform-specific package rules.Only
mx_hang_diagnosticevents are enriched in this PR. Processing Relays fill missing exception stacks before normalization, allowing derived frames to follow the existing trimming, filtering, and PII-scrubbing pipeline. Existing stacks remain authoritative. The complete attachment stays unchanged, while only debug images needed by the selected path are copied into the event, with relative references remapped to avoid collisions with existing event images.Other SDKs can reuse the selector when they adopt the attachment format. This PR does not enable Android ANR enrichment or change any SDK.
Validation
The implementation was AI-assisted.
make checkandmake testpassed, including the all-feature Rust workspace tests, Python tests, and full integration suite. Focused coverage exercises prefix scoring, duplicate frames, recursion, large counts, debug-image selection/remapping, and processing versus forwarding behavior.