Repository navigation
Conversation
Materialize embedded fields and their types before joining them with methods. Keep the helper non-inline and non-magic to avoid expanding field-type lookups across all fields. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
owen-mc
force-pushed
the
go/fix-dca-tuple-sum-noise-2
branch
from
November 3, 2026 12:58
e12788e to
e1083dd
Compare
Contributor
Author
|
DCA shows a reduction in tuple count for the intended predicate and no significant change in overall analysis time. |
Contributor
There was a problem hiding this comment.
🟢 Approval recommended
No active review issues are reported for the embedded-method resolution optimization.
No open issues 🎉
What changed in this PR
This PR optimizes Go embedded-method resolution by filtering embedded fields and their types before joining them with methods, reducing intermediate tuples without changing lookup semantics.
Changes:
- Adds a private
nomagichelper to materialize embedded fields and their types. - Updates
getMethodOfEmbeddedto use the smaller relation for method lookup.
| File | Description |
|---|---|
go/ql/lib/semmle/go/Types.qll |
Separates embedded-field filtering from method joins to reduce intermediate computation. |
Review effort: Balanced (auto)
hvitved
approved these changes
Nov 3, 2026
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.
StructType.getMethodOfEmbeddedcould join methods with types of all fields before filtering to embedded fields, producing large intermediate relations.Materialize embedded fields and their types in a private helper before joining them with methods. Mark the helper
nomagicto preserve this small intermediate relation.On the AWS SDK database, this reduces tuple sums by approximately 93%:
These distinct staged computations can receive the same DCA reporting key: shared-work attribution can change, while DCA strips RA hashes and omits singleton stage suffixes. This optimization does not fix that reporting issue, but substantially reduces the work involved. Across three full-suite runs, all corresponding entries were below DCA’s 10-million-tuple reporting threshold.