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

Please add this doc in the Article section of the official rco website #172

Merged
merged 4 commits into from
Jul 14, 2021

Conversation

saxenism
Copy link
Contributor

No description provided.

Copy link
Owner

@jcrodriguez1989 jcrodriguez1989 left a comment

Choose a reason for hiding this comment

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

Left some comments :)


As **Dwight D. Eisenhower** once said,

> In preparing for battle I have always found that plans are useless, but planning is indispensable.
Copy link
Owner

Choose a reason for hiding this comment

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

I would put this in italic.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

The quote or the author 😅


> In preparing for battle I have always found that plans are useless, but planning is indispensable.

I had listed several optimization techniques that could have been implemented in `rco` in my [*GSoC* proposal](https://drive.google.com/file/d/1HvF0oE9gW4BYt2Lo-1zRl1dcbsG1wEPg/view) as well the [*potential optimizers* vignette](https://rpubs.com/hinduBale/strategies_ideas_rco) but when we got down to discussing the design of these optimizers, it became quite clear to me and my mentors that we were walking on thin ice. With the extreme constraints that are imposed due to R's flexible nature, only a few of our optimization strategies seemed bullet-proof.
Copy link
Owner

Choose a reason for hiding this comment

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

Is it ok that GSoC is italic here?


Owing to the fantastic upkeep of the `rco` repository, it had almost no bugs in the optimizers, and that is no mean feat. However [an issue reporting a bug](https://github.com/jcrodriguez1989/rco/issues/107) was reported. The bug was that an optimizer, namely `opt-dead-expr()` did not function when the user used `;`. Ideally, the optimizer shouldn't have been affected by the usage of `;`, but here it was, a bug, laying dormant for over 6 months.

I decided to tackle this bug head on. I [created a separate branch](https://github.com/hinduBale/rco/tree/issue%23107) for this bug and reproduced the bug. After lots of trials and tribulations and lots of reverse-engineering, I zeroed in one the problem. It was a problem that existed in very low-level R code. When a R script without the use of `;` is parsed, the they get tokenized as something called `expr` but when `;` was used, the parser tokenized them as an `exprlist`. The exsisting optimizer didnot handle the case of `exprlist`, so I appended code that handled `exprlist` and then the optimizer started functioning normally irrespective of the usage of `;`. This is an issue which could arise in other optimizers too, but given that, it has been solved in one optimizer, solving them in other optimizers would not prove challenging. Also, in the process of making the `opt_dead_expr()` optimizer work, I further bolstered the robustness of the optimizer by **doubling the number of test cases** that the optimizer must pass, including tests with `;`.
Copy link
Owner

Choose a reason for hiding this comment

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

typo: "the they".

Copy link
Owner

Choose a reason for hiding this comment

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

typo: "didnot".


### Call for Actions:

To reduce dependencies on 3rd party applications and to promote homogeneity, we decided to go for an in-house solution for the CI/CD needs of our package, ie `Github Actions`. Earlier the popular choice for carrying out CI/CD operations were 3rd party applications such as *Travis CI* or *codecov.io*, but lately more and more developers and organizations had been migrating to Github Actions and we decided to follow suit. *Github Marketplace* wasn't much help, as there were not much support for the **R Language** as compared to more popular languages such as *Rust*, *Ruby*, *Typescript*, etc. So, I went through several documentations and scarce examples and [created a branch](https://github.com/hinduBale/rco/tree/ghActions) that [renders a website](https://hindubale.github.io/rco/) and completes the testing that Travis used to do. We left out the *code coverage* as *Github* [doesnot yet support badges that shows the percentage](https://github.com/r-lib/actions/issues/156#event-3643325125) of coverage.
Copy link
Owner

Choose a reason for hiding this comment

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

I would avoid the "more popular ...".

Copy link
Owner

Choose a reason for hiding this comment

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

typo: "doesnot".

@@ -0,0 +1,183 @@
---
Copy link
Owner

Choose a reason for hiding this comment

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

Add you as an author.
Maybe add a link to your website or mail.

Copy link
Owner

@jcrodriguez1989 jcrodriguez1989 left a comment

Choose a reason for hiding this comment

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

Great work Rahul!

@jcrodriguez1989 jcrodriguez1989 merged commit 9b0fdcc into jcrodriguez1989:develop Jul 14, 2021
@jcrodriguez1989 jcrodriguez1989 deleted the gsoc2020FinalReport branch July 14, 2021 11:49
jcrodriguez1989 added a commit that referenced this pull request Jul 14, 2021
* Create optimization_ideas.Rmd (#156)

Creates optimization_ideas vignette

* DCE: examples and Idea section from GCI-2019

DCE: examples and Idea section from GCI-2019

* A PR combining the PRs of all Google Code-in students related to loop-invariate optimizer (#163)

thanks!

* GCI PR for constant folding optimizer (#164)

Co-authored-by: Stephanie <20eristoffs@asij.ac.jp>
Co-authored-by: Umang Majumder <54509868+ZeroDawn0D@users.noreply.github.com>
Co-authored-by: udaydatar7 <54199456+udaydatar7@users.noreply.github.com>
Co-authored-by: Eric Liu <electrobyt1337@gmail.com>
Co-authored-by: Pratish <pratishrai724@gmail.com>
Co-authored-by: Rahul Saxena <saxenism@gmail.com>

* GCI PRs for opt-common-subexpr (#165)

thanks!

Co-authored-by: Adrian Serapio <adtserapio@gmail.com>
Co-authored-by: azamlynny <azamlynny@hotmail.com>
Co-authored-by: Umang Majumder <54509868+ZeroDawn0D@users.noreply.github.com>
Co-authored-by: Jack-horwell <36800721+Jack-horwell@users.noreply.github.com>
Co-authored-by: Pratish <pratishrai724@gmail.com>
Co-authored-by: udaydatar7 <54199456+udaydatar7@users.noreply.github.com>
Co-authored-by: Juan Cruz Rodriguez <jcrodriguez@unc.edu.ar>
Co-authored-by: Rahul Saxena <saxenism@gmail.com>

* All GCI PRs for constant propagation optimizer (#166)

thanks!

Co-authored-by: Pratish <pratishrai724@gmail.com>
Co-authored-by: udaydatar7 <54199456+udaydatar7@users.noreply.github.com>
Co-authored-by: Umang Majumder <54509868+ZeroDawn0D@users.noreply.github.com>
Co-authored-by: Juan Cruz Rodriguez <jcrodriguez@unc.edu.ar>
Co-authored-by: Rahul Saxena <saxenism@gmail.com>

* All GCI PRs for dead expression optimizer. (#167)

thanks!

Co-authored-by: Adrian Serapio <adtserapio@gmail.com>
Co-authored-by: Umang Majumder <54509868+ZeroDawn0D@users.noreply.github.com>
Co-authored-by: Pratish <pratishrai724@gmail.com>
Co-authored-by: Eric Liu <electrobyt1337@gmail.com>
Co-authored-by: Rahul Saxena <saxenism@gmail.com>

* All GCI PRs for Dead Store Optimizer (#168)

thanks!

Co-authored-by: Umang Majumder <54509868+ZeroDawn0D@users.noreply.github.com>
Co-authored-by: Eric Liu <electrobyt1337@gmail.com>
Co-authored-by: Pratish <pratishrai724@gmail.com>
Co-authored-by: Adrian Serapio <adtserapio@gmail.com>
Co-authored-by: Rishi R <56316487+Rishi0812@users.noreply.github.com>
Co-authored-by: Rahul Saxena <saxenism@gmail.com>
Co-authored-by: Juan Cruz Rodriguez <jcrodriguez@unc.edu.ar>

* Conditional Thread Optimizer PR (#162)

* Explained Dead Code Elimination

* Update opt-dead-code.R

* Update opt-dead-code.R

* Create opt-dead-code-example.R

* Update opt-dead-code.R

* Added examples

Examples of unoptimized and optimized code to explain dead code elimination

* Added #' to example

* Non-technical description of dead code elimination

* Update to definition in ##Idea

GCI user ID Rishi0812

* Added example of Dead Code Elimination

* Added Idea Section to Dead Code Elimination Vignette

* Updating NEWS.md

* Changing \donttest for \dontrun, it seems 4.0.0 will check donttest examples.

* Rebuilding site.

* Removing renv.

* Removing a separate example file for DCE

This was introduced when I merged a PR from a student's fork of the `rco`.

* Finalizing the Idea section of the DCE

* Selected final examples for DCE

* Final example selected

* Resolved spacing issue

* Resolved Spacing Issue - 2

* Resolved Spacing Issue - 3

* Improved the Idea section

* Fixed the performance typo

* Revert "Fixed the performance typo"

This reverts commit c791bef.

* Update opt-dead-code.Rmd

typo fix

* Added a few functions

* Added a few functions

* Added logic for duplicate expr

* Meh

* Added merge logic

* The entire process of merging implemented. Phhew!!

* Ran into the else parse bug

* First iteration complete

* Final commit for cond_thread

* Meh

* Resolved duplicate vignette

* Solved another issue in vignette build

* I'm sleepy now, this is last

* Missed a comma :(

* I dunno what's happening anymore

* Fixed the >= function logic

* Last ditch

* Ok I'm officially crying now T_T

* Now no test would fail

* Seriously, this is the last time

* Bhak

* erfg

* Update parse.R

* Update opt-constant-folding.R

* Update opt-dead-code.R

* Dude c'mmon

* Update optimize-files.R

* Update opt-dead-code.R

* plixx

* Added more tests to increase coverage

* Another test for extra coverage

* Implemented suggested changes

* Some missing edits

* Improved Tests

* Fixed boolean condition

* Improved indentations

* documented

* Workaround for R CMD check failed

* Version bump & code styling

* Examples edit

* Fixed the indentation bug

* Code Styiling

* Provided another example in vignette

* Improving vignette

* Styling test cases

* Fixed unwanted changes due to `;`

* Ran all checks, works fine

Co-authored-by: Pratish <pratishrai724@gmail.com>
Co-authored-by: Ian Chang <ianchangai1339@gmail.com>
Co-authored-by: Jack-horwell <36800721+Jack-horwell@users.noreply.github.com>
Co-authored-by: Rishi R <56316487+Rishi0812@users.noreply.github.com>
Co-authored-by: Adrian Serapio <adtserapio@gmail.com>
Co-authored-by: Juan Cruz Rodriguez <jcrodriguez@unc.edu.ar>
Co-authored-by: Rahul Saxena <saxenism@gmail.com>

* Adding the Memory Allocation Optimizer (#169)

* Initial Commit

* Second commit - firm logic in place

* First iteration of a working prototype

* Just another test text

* Tests and Vignettes for mem-alloc opt

* Final edits in diff files for the new optimizer

* Removed unnecessary files

* Reverted changes in man/opt_dead

* Reverted changes in man/opt_dead

* Reverted changes in man/const_prop

* Reverted changes in man/common_subexpr

Co-authored-by: Rahul Saxena <saxenism@gmail.com>
Co-authored-by: Juan C Rodriguez <jcrodriguez@unc.edu.ar>

* Possible fix for Issue#107 (#170)

* Possible fix for issue#107

* Reverting unrelated changes

* Reverting unrelated changes

* Reverting unrelated changes

Co-authored-by: Rahul Saxena <saxenism@gmail.com>

* Added the reporting functions (#171)

* Added the reporting functions

* Added comments

Co-authored-by: Rahul Saxena <saxenism@gmail.com>

* Please add this doc in the Article section of the official rco website (#172)

* Please add this in the Article section of the official rco website

* Fixed some blockquote issues

* Trying new changes

* Delete Document.dcf

Co-authored-by: Rahul Saxena <saxenism@gmail.com>
Co-authored-by: Juan C Rodriguez <jcrodriguez@unc.edu.ar>

* Checking merge

Co-authored-by: Rahul Saxena <rahulsaxena.pro@gmail.com>
Co-authored-by: Stephanie <20eristoffs@asij.ac.jp>
Co-authored-by: Umang Majumder <54509868+ZeroDawn0D@users.noreply.github.com>
Co-authored-by: udaydatar7 <54199456+udaydatar7@users.noreply.github.com>
Co-authored-by: Eric Liu <electrobyt1337@gmail.com>
Co-authored-by: Pratish <pratishrai724@gmail.com>
Co-authored-by: Rahul Saxena <saxenism@gmail.com>
Co-authored-by: Adrian Serapio <adtserapio@gmail.com>
Co-authored-by: azamlynny <azamlynny@hotmail.com>
Co-authored-by: Jack-horwell <36800721+Jack-horwell@users.noreply.github.com>
Co-authored-by: Rishi R <56316487+Rishi0812@users.noreply.github.com>
Co-authored-by: Ian Chang <ianchangai1339@gmail.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants