Skip to content

GSoC 2024 ‐ Jaysukh Makvana

Jaysukh Makvana edited this page Aug 24, 2024 · 6 revisions

About me

I am Jaysukh Makvana from Surat, Gujarat, India. I am a final year Bachelor of Technology student in the department of Computer Science and Technology at Indian Institute of Technology, Jodhpur.

Project overview

Referring the implementation of Complex64 and Complex128 arrays, I proposed adding support for Boolean array in stdlib-js which will be backed by Uint8Array. BooleanArray should have prototypes that any typed array have like get, set, sort, reverse, at etc. After implementing the BooleanArray constructors and prototypes we need to refactor the packages of @stdlib/array/* to add the support of boolean datatype across the entire array namespace. In the same way, We need to refactor the packages of @stdlib/strided/* to add the support of boolean datatype across the entire strided namespace. In parallel, We need to add some assertion package which we need to deal with different BooleanArray operation. Similar to strided and array namespace we need to refactor the packages of @stdlib/ndarray/* to add the support of boolean datatype across ndarray namespace. In the end, We need to add new packages like mskfilter, mskreject and mskput to ndarray namespace to get ndarray API parity with typed arrays.

Project recap

  • At the starting of Coding Period, I had @stdlib/array/bool containing constructors and some prototypes like set, length etc. So, I started my work with adding the various prototypes for the BooleanArray. I added the map, sort, find, findLast, findIndex, findLastIndex, reverse, toReversed, toSorted, every, some, indexOf, lastIndexOf, includes, slice, subarray, reduce, reduceRight, join, toString, keys, values, with, at, fill, filter, toLocaleString, copyWithin, entries and forEach prototypes for BooleanArray. I added benchmarks, tests and docs files for the same.
  • I added the some assertion utilities which I needed to refactor the array and strided namespace which includes @stdlib/assert/is-booleanarray, @stdlib/assert/is-same-booleanarray and it's base implementation. I added the one of the important package which reinterprets the BooleanArray as Uint8Array as @stdlib/strided/base/reinterpret-boolean.
  • After those work, I refactored the packages of array namespace to add the support of boolean datatype to array namespace.
  • Similarly, I refactored the packages of strided namespace to add the support of boolean datatype to strided namespace.
  • Similarly, I refactored the packages of ndarray namespace to add the support of boolean datatype to ndarray namespace.
  • Finally, I added the @stdlib/ndarray/base/mskfilter and @stdlib/ndarray/base/mskreject which used for the masking of ndarray.

Completed work

Current state

As a result of the work completed, the project now includes a BooleanArray with all the necessary prototypes that a typed array should have. The boolean datatype support has been integrated across all relevant packages within the array, strided, and ndarray namespaces. Additionally, the required assertion utilities for boolean data types and arrays have been implemented. Moreover, the ndarray now features mskfilter and mskreject APIs, which provide advanced functionality for fancy ndarray indexing.

What remains

For the remaining tasks, I need to implement the mskput API for ndarray and develop higher-level APIs for both mskfilter and mskreject. Additionally, I need to add the C-implementation for all three APIs. These enhancements will significantly contribute to the overall robustness and versatility of the project.

Challenges and lessons learned

I encountered several challenges during my work on this project, and I'd like to highlight a few key ones. One of them was maintaining the strict code standards of the stdlib after gaining a comprehensive understanding of the code flow. With multiple contributors working on related areas, adhering to these standards is essential for ensuring a consistent user experience across all packages. Over time, as I worked on various packages and carefully incorporated feedback on my PRs, I was able to overcome this hurdle.

Another challenge I encountered during this project was implementing new features for ndarray, a task that was unfamiliar to me based on my prior experience. To overcome this, I focused on understanding the ndarray implementation workflow. Replicating the exact process of reference implementations, adjusting tolerance levels, and meticulously checking intermediate values when the results were not as expected proved to be essential learning opportunities.

Throughout the project, I gained valuable insights. One key lesson was the importance of tackling new tasks by thoroughly understanding the implementation process and learning from reference implementations, which is essential for growth. Additionally, learning from continuous feedback and avoiding mistakes in subsequent work proved to be a crucial lesson for me.

Conclusion

This summer has been an incredible learning experience. Through this program, I have gained valuable insights into various aspects of feature development within a codebase. I've learned how to write and implement tests to ensure code correctness, add benchmarks to assess performance efficiency, and, most importantly, write clean and readable code. I am deeply grateful to Athan Reines and Philipp Burckhardt for providing me with this opportunity. I would also like to extend my heartfelt thanks to my mentors, Athan Reines and Pranav Goswami, for reviewing my work, providing valuable feedback and being readliy available for the discussions.