Add all_function_sizes and function_size EGraph methods#338
Merged
saulshanabrook merged 7 commits intomainfrom Sep 2, 2025
Merged
Add all_function_sizes and function_size EGraph methods#338saulshanabrook merged 7 commits intomainfrom
all_function_sizes and function_size EGraph methods#338saulshanabrook merged 7 commits intomainfrom
Conversation
Member
Author
|
@actions-user changelog |
Contributor
There was a problem hiding this comment.
Pull Request Overview
Adds functionality to inspect function sizes in the Python EGraph API by exposing the function-size egglog command. This includes methods to get the size of a specific function or all functions, and handles conversion between egglog function names and Python callable objects.
Key Changes
- Added
function_size()andall_function_sizes()methods to EGraph class for inspecting function table sizes - Implemented
create_callable()function to convert egglog function references back to Python callable objects - Added comprehensive test coverage for various callable types (functions, methods, constants, etc.)
Reviewed Changes
Copilot reviewed 5 out of 5 changed files in this pull request and generated 4 comments.
Show a summary per file
| File | Description |
|---|---|
| python/egglog/egraph.py | Adds function size inspection methods and ExprCallable type alias |
| python/egglog/runtime.py | Implements create_callable utility and improves RuntimeClass/RuntimeFunction representations |
| python/egglog/egraph_state.py | Fixes constructor/function registration logic for builtin classes |
| python/tests/test_high_level.py | Adds comprehensive test coverage for function size inspection |
| docs/reference/egglog-translation.md | Documents the new function size inspection functionality |
Tip: Customize your code reviews with copilot-instructions.md. Create the file or learn how to get started.
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
CodSpeed Instrumentation Performance ReportMerging #338 will not alter performanceComparing Summary
Footnotes |
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.
Exposes
function-sizeegglog command in Python. Handles also turning egglog function back into Python functions if no function name is specified and all functions should be checked.