Skip to content

Conversation

@sergisiso
Copy link
Collaborator

No description provided.

@codecov
Copy link

codecov bot commented Jun 27, 2025

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 99.90%. Comparing base (2f6bd75) to head (8a6ac60).
⚠️ Report is 7 commits behind head on master.

Additional details and impacted files
@@           Coverage Diff           @@
##           master    #3041   +/-   ##
=======================================
  Coverage   99.90%   99.90%           
=======================================
  Files         376      376           
  Lines       53157    53213   +56     
=======================================
+ Hits        53105    53161   +56     
  Misses         52       52           

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@sergisiso sergisiso self-assigned this Jul 16, 2025
@sergisiso
Copy link
Collaborator Author

@arporter This is ready for another review. Some comments are outdated due to preceding PRs.

Copy link
Member

@arporter arporter left a comment

Choose a reason for hiding this comment

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

Looks good Sergi, thanks very much. I got a bit worried about the fact that we might be breaking PSyAD but, when I tried, it seemed fine. I agree that the frontend is the right place to do the reasoning about the type of unresolved symbols and I like that change. As discussed, I think we can safely extend it to say that a symbol that is accessed with and without parentheses must be an array.

@sergisiso
Copy link
Collaborator Author

@arporter This is ready for another review. I addressed all comments but note that the integration test showed a small difference in the nemo async workflow. I will explore this more to see if it is replicable and what file it comes from in the meantime.

Copy link
Member

@arporter arporter left a comment

Choose a reason for hiding this comment

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

Looking good now Sergi, thanks very much. Well done on the fixes to preserve the Sympy behaviour.
Just a bit more tidying to do (and wrangling over whether we raise an InternalError :-) ).
I wondered whether the documentation mentioned the fact that we (used to) assume a part reference was an array access but I couldn't find anything.

shape = node.symbol.shape
else:
# If we don't know the dimension we make it look like a
# function call without argumetns, this will make it not
Copy link
Member

Choose a reason for hiding this comment

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

"arguments"


return (f"{name}{self.array_parenthesis[0]}"
f"{','.join(result)}{self.array_parenthesis[1]}")
if name in self.type_map:
Copy link
Member

Choose a reason for hiding this comment

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

Good solution! Thanks.

symbol_type=DataSymbol,
datatype=UnresolvedType())
if name in direct_refnames_in_exprs:
# If this any other expression has the same reference name without
Copy link
Member

Choose a reason for hiding this comment

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

s/this//

if name in direct_refnames_in_exprs:
# If this any other expression has the same reference name without
# parenthesis, e.g.: a + a(3), we know a is an array and not a
# function call, as the later have mandatory parenthesis.
Copy link
Member

Choose a reason for hiding this comment

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

"latter"

array_assignment = schedule.children[1]
assert isinstance(array_assignment, Assignment)
var_accesses = array_assignment.reference_accesses()
# We don't know if 'f' is a function or an array (CALLED or READ), so
Copy link
Member

Choose a reason for hiding this comment

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

Good comment, thanks.

module = parse_tree.children[0]

# By default this will all be parsed as Calls with unknown
# is_lememental/is_pre attributes
Copy link
Member

Choose a reason for hiding this comment

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

"is_elemental/is_pure"


assert loop.start_expr.datatype == INTEGER_TYPE
assert loop.stop_expr.datatype == INTEGER_TYPE
assert loop.step_expr.datatype == INTEGER_TYPE
Copy link
Member

Choose a reason for hiding this comment

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

This one is still outstanding. Possibly your new 'refine_symbols_with_usagemethod in the frontend could be extended for this. Similarly for precision symbols (e.g 1.0_wp meanswp` is an integer).

f"'{self.debug_string()}' include a function call or "
f"unsupported feature. Querying the return type of "
f"such things is yet to be implemented.")
# The validate only allows [Range | DataNode] children, so there is
Copy link
Member

Choose a reason for hiding this comment

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

Oh yes, I can see that it was this way before. However, I think it's useful to defend against these cases as it saves time later - if we come to modify e.g. _validate_child in future and forget to modify this routine at the same time it could cause some pain.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants