Repository navigation
type_match: score only a function's own variables, not its inlined callees' - #113
Merged
Merged
Conversation
…s inlined callees' _parse_function_die descended into every DW_TAG_inlined_subroutine child of a subprogram and scored the callee's parameters and locals as the caller's. At -O2 most are the parameters of glibc's _FORTIFY_SOURCE wrappers (`__fmt`, `__stream`), which have no storage in the compiled function, so no decompiler could ever match them. Inlined callees nested inside a lexical block were already skipped, so the two depths disagreed. Inlined subroutines are now skipped at every depth. A function whose only ground truth came from inlined callees no longer has type_match ground truth. The ground truth is part of the type_match cache key, so cache_version is unchanged. Fixes #97. Co-Authored-By: Claude Opus 5.5 <[email protected]> Claude-Session: https://claude.ai/code/session_01Cw8GgP4ynoKxZeBJ7RWZiN
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.
Reviewer
Huamnb reviewed by Zion. Its a pretty small change. Looks good.
PR
type_match scores an inlined callee's parameters and locals as variables of the function they were inlined into. At
-O2most of them belong to glibc's_FORTIFY_SOURCEwrappers, and the compiled function has no storage for them, so it can never score perfect:With this branch,
banner's ground truth is just[('n', ['int'])]. (Thevoidspelling is #94.)The fix:
_parse_function_dieskipsDW_TAG_inlined_subroutinechildren. An inlined callee nested inside a lexical block was already skipped, so only direct children of the subprogram were being scored.cache_versionis unchanged.Re-scored from the published checkpoints. Each cell is perfect functions before → after:
O0 moves by +26 or less per backend. Neither perfect count nor mean changes the order of the seven backends at any opt level.
Some functions do lose: when a decompiler had matched an inlined callee's variable, that true positive is no longer scored. At O2 this is 0–148 functions per backend, against 2,086–5,954 that improve.
Refreshing the published overlay drops those functions' type_match values. The
finalize_results.pycoverage guard will therefore report them, and the rebuild needs--allow-drops.Tests:
tests/test_metrics.pycompiles anoinlinecaller with an inlinedstatic inlinehelper at-O2. It checks that the DWARF really has the inlined subroutine, and that the caller's ground truth holds its ownxand none of the helper'svalue/doubled. It fails on main.Fixes #97.
🤖 Generated with Claude Code
https://claude.ai/code/session_01Cw8GgP4ynoKxZeBJ7RWZiN