PSyclone icon indicating copy to clipboard operation
PSyclone copied to clipboard

(Closes #2515) fix bugs in symbol-table merge

Open arporter opened this issue 1 year ago • 6 comments

As it says. Primarily this is about making sure we don't rename symbols that are being imported into scope from elsewhere. Broken out of #924 as that is getting big.

arporter avatar Mar 05 '24 21:03 arporter

Codecov Report

All modified and coverable lines are covered by tests :white_check_mark:

Project coverage is 99.86%. Comparing base (ed742fd) to head (4c86703).

Additional details and impacted files
@@           Coverage Diff           @@
##           master    #2517   +/-   ##
=======================================
  Coverage   99.86%   99.86%           
=======================================
  Files         357      357           
  Lines       48234    48300   +66     
=======================================
+ Hits        48168    48234   +66     
  Misses         66       66           

:umbrella: View full report in Codecov by Sentry.
:loudspeaker: Have feedback on the report? Share it here.

codecov-commenter avatar Mar 18 '24 21:03 codecov-commenter

Ready for a first look. Probably one for @sergisiso as it adds some SymbolTable functionality, as well as fixing some bugs. I've triggered the integration tests. Note that the sphinx-link-check in the CI has mysteriously cancelled itself. Also, CodeCov is having one of its moments and is not reporting on coverage.

arporter avatar Mar 18 '24 21:03 arporter

Taking this back as the LFRic and NEMO integration tests failed :-(

arporter avatar Mar 19 '24 08:03 arporter

Allowing for intrinsics has fixed the LFRic integration tests. However, the NEMO MO passthrough still fails:

Executing:psyclone --limit output -api nemo -oalg /dev/null -opsy diatmb.f90 cfgs/MO_GO8_gnu/BLD/ppsrc/nemo/diatmb.f90
...
psyclone.psyir.symbols.symbol.SymbolError: PSyclone SymbolTable error: A symbol named 'iom_put' is present but unresolved in both tables and they do not share a wildcard import that could be bringing it into scope.

This is in a routine that has no imports. 'iom_put' is brought into scope by a wildcard import from iom at module level.

arporter avatar Mar 19 '24 12:03 arporter

The problem is in the Routine handler in the Fortran backend: we flatten all tables by populating a brand-new one. However, the brand-new one is not (initially) connected into the node hierarchy and therefore the search for a common wildcard import returns nothing.

arporter avatar Mar 19 '24 13:03 arporter

Finally got all of the integration tests to pass. Really ready for review now!

arporter avatar Mar 19 '24 16:03 arporter

CodeCov really isn't happy so I've checked the coverage for symbol_table.py locally and all is fine. I've tried firing off the CI again so maybe CodeCov will sort itself out. Anyway, ready for another look now.

arporter avatar Apr 22 '24 15:04 arporter

Should be ready for another look now, integration tests permitting.

arporter avatar Apr 26 '24 09:04 arporter