Harshita Kalani

Week 5 of GSoC 2024: Tackling Intrinsics and Integrating New Features

Hello, welcome back to my weekly blog on GSoC 2024 progress. This week, I started by resolving issues related to real intrinsic as mentioned in the last blog. I fixed the use of nested intrinsics like sum. After handling that, two of the checks failed: one was an issue in the third-party code and the other related to WebAssembly (WASM). I worked on resolving the WASM issue and was able to resolve it. Thanks to Ubaid and Ondrej for the guidance. I've created a Minimal Reproducible Example (MRE) for the third-party code failure and will address it next week.
I investigated the same_as_type intrinsic, which is currently giving incorrect output. The issue seems to be with type handling when changed with allocation. I'll discuss this with my mentors and try to resolve it.
I reviewed the implementation of array intrinsics cshift and eoshift. They now work fine for one-dimensional arrays. My goal is to make these array intrinsics handle optional arguments as well. For this, I continued working on the PR related to handling optional arguments in minloc and maxloc. The design mentioned in the last blog caused runtime test failures, so I've devised another method to handle this and will complete it next week. If finished early, I'll handle optional arguments for more array intrinsics.
The third-party code failure in len_trim and trim functions was due to an issue with handling generics. I realized that a design change is needed to resolve this, which is currently a low priority. Thanks to Pranav for the help. I'll look for another workaround.
This week, I also updated the integration tests for intrinsics, adding tests for both scalar and array at compile-time and runtime. I added tests for verify, index, scan, adjustl, and adjustr. While adding tests for erf, erfc, derf, and derfc, I realized that we don't support arrays for intrinsics implemented with intrinsic mapping, so I fixed that. I'll add tests for the remaining intrinsics next week.
I then restarted working on SNAP compilation, commenting out the non-functional parts and pushing the changes. I investigated an issue related to handling tuples and will look into it in-depth next week.
For the upcoming week, I plan to work on the following tasks:

  • Fix third-party code failure in the real intrinsic
  • Update integration tests for more intrinsics and fix related issues
  • Implement the remaining intrinsics
  • Handle optional arguments for array intrinsics
  • Continue working on SNAP compilation
  • Debug check_equal_type function to fix same_as_type intrinsic
  • Generalize intrinsic registration in the ASR to C, C++, and Julia backend
Progress tracker: #4017.
Overall, I found this week's work engaging and am grateful to Ondřej Čertík and the rest of the mentors at LFortran for their constant reviews and suggestions. I look forward to next week and am eager to complete the planned tasks.

Here's a link to related blogs:
GSoC: Week 1
GSoC: Week 2
GSoC: Week 3
GSoC: Week 4