Harshita Kalani

Week 6 of GSoC 2024: Midway Through the Journey

Today, I am halfway through my GSoC 2024 journey. The journey was so exciting and I'm aspiring for more. Talking about the tasks done, this week, I focused on handling the optional arguments for compile-time evaluation of functions, specifically the mask argument for sum intrinsic. With the new design, it works with the mask argument and dim = 1. Following this, I added support for mask in product, iparity, minval, and maxval, along with tests for them. While doing that, I found that the implementation logic for complex arguments in product was incorrect and spent some time resolving that.
Meanwhile, I cleaned up some unused and unnecessary code in the name2signature mapping.
A workaround for the abs function in the stdlib package was no longer needed, so I removed it, added tests for the same, updated the CI hash, and opened a PR.
This week, I mainly focused on adding tests for intrinsics and ensuring they work for scalar/array values at both compile-time and runtime. If any errors or divergences were found, I opened issues for them. I've created a master list of all the intrinsics for which tests need to be added and ensured that the implementations are robust. You can find the list here: #3067.
Additionally, I updated the integration tests for intrinsics, adding tests for both scalar and array values at compile-time and runtime. I added tests for sin, cos, tan, dsin, dcos, and dtan. Then, I added tests for lgt, llt, lle, lge, blt, bgt, ble, and bge.
While adding tests for ibclr, ibset, and btest, I found that LFortran does not throw an error for negative values of the pos argument. So, I fixed that. While adding tests for digits, leadz, and trailz, I found several issues, such as incorrect output types and no support for array input in digits. Additionally, digits is implemented as an elemental function, but it should be an inquiry function. I opened issues for all these and will work on them next week.
I also analyzed the selected_int_kind, selected_real_kind, and selected_char_kind functions and found that errors are not reported when non-scalar arguments are passed or when the wrong type of arguments is passed.
The third-party code failure while implementing the real intrinsic is yet to be dealt with. I'll also work on supporting optional arguments in array intrinsic functions.
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
  • Handle optional arguments for array intrinsics
  • Continue working on SNAP compilation
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
GSoC: Week 5