Skip to content

Honor skip_libs in get_max_calls_to() for CallsTo scoring - #1242

Merged
williballenthin merged 2 commits into
mandiant:masterfrom
vee1e:todo-skip-libs-maxcalls
Mar 24, 2026
Merged

williballenthin merged 2 commits into
mandiant:masterfrom
vee1e:todo-skip-libs-maxcalls

Conversation

@vee1e

@vee1e vee1e commented Mar 19, 2026 •

Copy link
Copy Markdown
Collaborator

Fixes:

# TODO skip_libs and is_library_function
# continue

This PR implements the existing skip_libs behavior by excluding viv_utils.flirt.is_library_function() matches from get_max_calls_to() when skip_libs=True.

CallsTo scoring depends on this value in floss/features/features.py. Before this change, library functions were still included in the max-xref normalization baseline even though the API exposed a skip_libs option. That could compress CallsTo scores for real candidate functions in binaries with heavily referenced library/runtime code.

This makes the CallsTo heuristic consistent with its function signature and improves normalization quality. In practice, decoder candidates are less likely to be unfairly down-ranked by high-fan-in library functions.

AI Disclaimer: GPT 5.4 (in Codex) was used to write local test scripts and for researching on the issue.

@gemini-code-assist

Copy link
Copy Markdown
Contributor

Summary of Changes

Hello, I'm Gemini Code Assist1! I'm currently reviewing this pull request and will post my feedback shortly. In the meantime, here's a summary to help you and other reviewers quickly get up to speed!

This pull request addresses an inconsistency in how CallsTo scores are calculated by ensuring that the skip_libs parameter is honored within the get_max_calls_to() function. Previously, library functions were inadvertently included in the normalization baseline, which could lead to an unfair down-ranking of legitimate decoder candidates in binaries with extensive library code. The change makes the scoring heuristic more consistent and enhances the quality of function normalization.

Highlights

  • CallsTo Scoring Accuracy: Implemented the skip_libs parameter in get_max_calls_to() to correctly exclude library functions from the maximum cross-references calculation, improving the accuracy of CallsTo scores.

🧠 New Feature in Public Preview: You can now enable Memory to help Gemini Code Assist learn from your team's feedback. This makes future code reviews more consistent and personalized to your project's style. Click here to enable Memory in your admin console.

Using Gemini Code Assist

The full guide for Gemini Code Assist can be found on our documentation page, here are some quick tips.

Invoking Gemini

You can request assistance from Gemini at any point by creating a comment using either /gemini <command> or @gemini-code-assist <command>. Below is a summary of the supported commands on the current page.

Feature Command Description
Code Review /gemini review Performs a code review for the current pull request in its current state.
Pull Request Summary /gemini summary Provides a summary of the current pull request in its current state.
Comment @gemini-code-assist Responds in comments when explicitly tagged, both in pull request comments and review comments.
Help /gemini help Displays a list of available commands.

Customization

To customize Gemini Code Assist for GitHub experience, repository maintainers can create a configuration file and/or provide a custom code review style guide (such as PEP-8 for Python) by creating and adding files to a .gemini/ folder in the base of the repository. Detailed instructions can be found here.

Limitations & Feedback

Gemini Code Assist may make mistakes. Please leave feedback on any instances where its feedback is incorrect or counter productive. You can react with 👍 and 👎 on @gemini-code-assist comments. If you're interested in giving your feedback about your experience with Gemini Code Assist for GitHub and other Google products, sign up here.

Footnotes

  1. Review the Privacy Notices, Generative AI Prohibited Use Policy, Terms of Service, and learn how to configure Gemini Code Assist in GitHub here. Gemini can make mistakes, so double check it and use code with caution. ↩

@gemini-code-assist gemini-code-assist Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Code Review

This pull request correctly implements the skip_libs parameter in get_max_calls_to by filtering out library functions, which was previously a TODO. This change will improve the quality of the CallsTo scoring heuristic. I've added one comment regarding a potential runtime error that this change makes more likely to occur.

Comment thread floss/identify.py Resolved
@williballenthin

Copy link
Copy Markdown
Collaborator

thanks!

@williballenthin
williballenthin merged commit 7b6f241 into mandiant:master Mar 24, 2026
20 checks passed
@vee1e
vee1e deleted the todo-skip-libs-maxcalls branch March 25, 2026 03:33
vee1e pushed a commit to vee1e/flare-floss that referenced this pull request May 29, 2026
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.

2 participants