Skip to content

feat(r8): Propagate class-level synthesized flag to members#73

Merged
romtsn merged 15 commits intomasterfrom
rz/feat/r8-tests-synthetic
Mar 3, 2026
Merged

feat(r8): Propagate class-level synthesized flag to members#73
romtsn merged 15 commits intomasterfrom
rz/feat/r8-tests-synthetic

Conversation

@romtsn
Copy link
Copy Markdown
Member

@romtsn romtsn commented Dec 23, 2025

Part of #40

Propagates the class-level is_synthesized flag (from # {"id":"com.android.tools.r8.synthesized"} headers) to all members of that class. This allows callers (e.g. Sentry symbolicator) to filter out synthetic frames via method_synthesized() — this crate intentionally keeps them in the output.

Changes

  • mapper.rs / cache/raw.rs: OR class-level and method-level synthesized flags when resolving mappings
  • tests/r8-synthetic.rs: 7 tests covering lambda methods, lambda with inlining, and moved synthesized info — including both mapper and cache paths, stacktrace remapping, and method_synthesized() flag verification

@romtsn romtsn requested a review from loewenheim December 23, 2025 13:32
@loewenheim
Copy link
Copy Markdown
Contributor

We could filter them out in remap_stacktrace, yeah. For the remap_stacktrace_typed I would leave it as it is.

@romtsn
Copy link
Copy Markdown
Member Author

romtsn commented Jan 21, 2026

we keept marking frames as synthesized and don't drop them in this crate. We can close this PR. We could also hide the synthesized frames in the Sentry UI

@romtsn romtsn force-pushed the rz/fix/r8-tests-ambiguous-no-line branch from cf3f732 to 82d62e3 Compare January 27, 2026 10:53
Base automatically changed from rz/fix/r8-tests-ambiguous-no-line to rz/feat/r8-tests-ambiguous January 28, 2026 16:47
Base automatically changed from rz/feat/r8-tests-ambiguous to master January 28, 2026 17:03
Copy link
Copy Markdown

@cursor cursor bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Cursor Bugbot has reviewed your changes and found 1 potential issue.

Bugbot Autofix is OFF. To automatically fix reported issues with cloud agents, enable autofix in the Cursor dashboard.

romtsn and others added 3 commits February 26, 2026 16:30
When a class is marked as synthesized via R8's `com.android.tools.r8.synthesized`
header, propagate that flag to all its members so callers can filter
synthetic frames.  Also fix test mappings that used invalid single-quote
JSON for R8 headers.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
… test

- Remove r8-synthetic.NOTES.md (stale, describes pre-fix state)
- Fix MOVED_SYNTHETIZED_INFO_MAPPING R8 header to use valid JSON
- Add test_synthetic_lambda_method_synthesized_flag_cache to verify
  the cache path also sets method_synthesized correctly

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
@romtsn romtsn changed the title feat(r8-tests): Add R8 synthetic tests feat(r8): Propagate class-level synthesized flag to members Feb 26, 2026
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
@romtsn romtsn requested a review from a team February 27, 2026 13:07
Copy link
Copy Markdown
Member

@Dav1dde Dav1dde left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

High level this makes sense to me to inherit the flag from the class to its members, but there was some prior discussions about how and where to do it, where I am missing a bit of context:


we keept marking frames as synthesized and don't drop them in this crate. We can close this PR. We could also hide the synthesized frames in the Sentry UI

What made you change your mind, seemed like it was an option to not do this?


Sebastian also mentioned a different place remap_stacktrace, why did you choose this approach?

@romtsn
Copy link
Copy Markdown
Member Author

romtsn commented Mar 3, 2026

@Dav1dde sorry, should've definitely written something to give more context:

We still need to drop them, because users might have their custom stacktrace rules configured, which forcefully mark synthesized frames as in-app, and then those frames can show up in stacktraces completely unrelated to the app resulting in wrong code ownership assignments. So we've made the decision to drop them in sentry/symbolicator altogether, avoiding this situation and aligning with how Google's r8-retrace behaves.

I've repurposed this PR (should've probably closed this and opened a new one) to propagate synthesized classes flag to its members, since we don't operate on the class level, but on the members level in sentry/symbolicator.

@romtsn romtsn merged commit e0ca873 into master Mar 3, 2026
9 checks passed
@romtsn romtsn deleted the rz/feat/r8-tests-synthetic branch March 3, 2026 12:41
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants