Conversation
There was a problem hiding this comment.
Copilot review overview
🟡 Changes recommended
Fixed timer names can still collide with valid parameters such as _gt4py_start.
Get a fresh assessment by requesting another Copilot review.
Review effort: Balanced
Findings: 1
Open (1)
What changed in this PR
Updates nanobind timer locals to reduce clashes with program parameters and adds regression coverage.
Changes:
- Prefixes generated timer names with
_gt4py_. - Adds domain-bound parameter tests for
startandstop.
| File | Description |
|---|---|
nanobind.py |
Renames generated timer locals. |
test_domain.py |
Adds parameter-name regression tests. |
💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.
| } | ||
| else { | ||
| auto start = std::chrono::high_resolution_clock::now(); | ||
| auto _gt4py_start = std::chrono::high_resolution_clock::now(); |
Contributor
Author
|
@tehrengruber What's your feeling about the convention? I am ok with the prefix and implicitly forbidding users calling their parameter |
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.

The nanobind wrapper generated for gtfn programs declared timer locals
startandstopin theexec_infobranch. A program parameter namedstartwas shadowed by the timer inside the wrapped call, so the bindings failed to compile (cannot convert 'start' (type 'std::chrono::time_point<...>') to type 'int32_t').Fix: rename the timers to
_gt4py_start/_gt4py_stop, matching the existing_gt4py_returnlocal.Test:
test_domain.pygains programs with domain-bound parameters namedstart/stopandstopalone. The first fails ongtfn.run_gtfnwithout the fix; both pass on all backends with it.