fix[next]: Include compile-time arguments in fingerprint#2537
Open
SF-N wants to merge 2 commits intoGridTools:mainfrom
Open
fix[next]: Include compile-time arguments in fingerprint#2537SF-N wants to merge 2 commits intoGridTools:mainfrom
SF-N wants to merge 2 commits intoGridTools:mainfrom
Conversation
There was a problem hiding this comment.
Pull request overview
Refactors compilable-program fingerprinting to include full compile-time arguments (to avoid hash collisions) and adds a unit test ensuring different scalar precisions produce different fingerprints.
Changes:
- Update
fingerprint_compilable_programto hash(program IR fingerprint, compile-time args)instead of selected fields. - Add unit test validating fingerprint uniqueness for different scalar precisions.
Reviewed changes
Copilot reviewed 2 out of 2 changed files in this pull request and generated 3 comments.
| File | Description |
|---|---|
| tests/next_tests/unit_tests/iterator_tests/test_ir.py | Adds a regression test ensuring different precision compile-time args change the fingerprint. |
| src/gt4py/next/otf/stages.py | Refactors fingerprint input to include the entire CompileTimeArgs object. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
Comment on lines
41
to
46
| program_hash = utils.content_hash( | ||
| ( | ||
| program.fingerprint(), | ||
| sorted(offset_provider.items(), key=lambda el: el[0]), | ||
| column_axis, | ||
| program_def.data.fingerprint(), | ||
| program_def.args, | ||
| ) | ||
| ) |
Comment on lines
+12
to
+13
| from gt4py.next.otf import arguments, definitions, stages | ||
| from gt4py.next.type_system import type_specifications as ts |
| assert node1.fingerprint() != node3.fingerprint() | ||
|
|
||
|
|
||
| def test_different_precisions(): |
tehrengruber
added a commit
to tehrengruber/gt4py
that referenced
this pull request
Mar 18, 2026
tehrengruber
added a commit
to tehrengruber/gt4py
that referenced
this pull request
Mar 18, 2026
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.
This pull request refactors the way unique hashes are generated for compilable programs and adds a new unit test to ensure hash uniqueness for different precision arguments.
The
fingerprint_compilable_programfunction insrc/gt4py/next/otf/stages.pynow generates the hash using the entireargsobject instead of individually hashing specific components likeoffset_providerandcolumn_axis.A new unit test,
test_different_precisions, was added to verify that changing the precision of a scalar argument results in a different fingerprint hash.