Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

(Closes #2125) Fix bugs in SymbolTable deep copy and InlineTrans when array bounds reference formal arg #2633

Merged
merged 62 commits into from
Jul 23, 2024

Conversation

arporter
Copy link
Member

@arporter arporter commented Jun 28, 2024

Fixes bugs in SymbolTable deep copy for for symbol initial values and shape specification. Also fixes a bug in InlineTrans when the lower bound of an array formal argument is specified by a reference to another formal argument.
Finally, adds the force option to InlineTrans to permit it to ignore CodeBlocks within the target routine.

@arporter arporter self-assigned this Jun 28, 2024
Copy link

codecov bot commented Jun 28, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 99.85%. Comparing base (029f69f) to head (565c2c3).

Additional details and impacted files
@@            Coverage Diff             @@
##           master    #2633      +/-   ##
==========================================
- Coverage   99.86%   99.85%   -0.02%     
==========================================
  Files         352      352              
  Lines       48512    47308    -1204     
==========================================
- Hits        48447    47239    -1208     
- Misses         65       69       +4     

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

@arporter arporter changed the title (Closes #2125) Fix bugs in SymbolTable deep copy for symbol initial values and shape specification (Closes #2125) Fix bugs in SymbolTable deep copy and InlineTrans when array bounds reference formal arg Jun 28, 2024
@arporter
Copy link
Member Author

arporter commented Jul 1, 2024

This is ready for a first look now. One for @sergisiso, @hiker or @LonelyCat124. I've triggered the integration tests.

@arporter
Copy link
Member Author

arporter commented Jul 1, 2024

(I am wondering whether having the "force" option to InlineTrans mean "ignore CodeBlocks" is a good idea: perhaps it should be more specific such as "permit-codeblocks"?)

Copy link
Collaborator

@sergisiso sergisiso left a comment

Choose a reason for hiding this comment

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

@arporter I agree this needs to be done, as now we carelessly leave symbols pointing behind. But there are more symbols that the ones updated by this PR and the behaviour would be inconsistent if we update some but not others. Let me know if you want this PR sooner to fix a specific bug, but otherwise I suggest also updating all symbols inside symbols/datatypes.

src/psyclone/psyir/symbols/datatypes.py Outdated Show resolved Hide resolved
src/psyclone/psyir/symbols/datatypes.py Show resolved Hide resolved
src/psyclone/psyir/symbols/datatypes.py Outdated Show resolved Hide resolved
src/psyclone/psyir/symbols/datatypes.py Show resolved Hide resolved
src/psyclone/psyir/symbols/datasymbol.py Outdated Show resolved Hide resolved
src/psyclone/psyir/symbols/datasymbol.py Show resolved Hide resolved
src/psyclone/psyir/symbols/symbol_table.py Outdated Show resolved Hide resolved
Copy link
Collaborator

@sergisiso sergisiso left a comment

Choose a reason for hiding this comment

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

Fantastic work @arporter. There is final documentation suggestions but then this can go.

src/psyclone/psyir/nodes/reference.py Outdated Show resolved Hide resolved
src/psyclone/psyir/nodes/scoping_node.py Show resolved Hide resolved
doc/developer_guide/psyir_symbols.rst Outdated Show resolved Hide resolved
doc/developer_guide/psyir_symbols.rst Outdated Show resolved Hide resolved
@sergisiso
Copy link
Collaborator

sergisiso commented Jul 18, 2024

Also check if the sphinx-link-check issue is relevant and launch an integration test since I see none of the last ones were complete.

@arporter
Copy link
Member Author

Link check failure seems to have sorted itself out. I've triggered the integration tests again. Ready for another look, CI-permitting.

@arporter
Copy link
Member Author

LFRic 'everything-everywhere-all-at-once' integration test failed due to hitting max. recursion depth.
Problem occurs in backend when processing (inlined?) kernel mm_diagonal_kernel_code_r_double for reconstruct_w3_field_alg_mod_psy.

@arporter
Copy link
Member Author

The problem was that in Reference.replace_symbols_using() I had added a call to replace_symbols_using on the Symbol itself. This then hit an infinite recursion if the Symbol had an initial value defined by a PSyIR expression. Since it is the responsibility of the SymbolTable to update its symbols, I've simply removed the offending call and updated a failing test.

@arporter
Copy link
Member Author

Integration tests were green and coverage is all OK. Really ready for review...

Copy link
Collaborator

@sergisiso sergisiso left a comment

Choose a reason for hiding this comment

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

@arporter All comments have been addressed, the documentation has been updated explaining the new internal details and it builds correctly. The integration passes (and the system was noisy but looking at the best bars on multiple runs it seems the performance is unaffected). This is ready to merge.

@sergisiso sergisiso merged commit 9d0538b into master Jul 23, 2024
11 of 12 checks passed
@sergisiso sergisiso deleted the 2125_tuple_inline_fixes branch July 23, 2024 12:40
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.

2 participants