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

[GCI] Added Lightning Bolt for WASM accelerated modules #1365

Merged
merged 6 commits into from Dec 19, 2019
Merged

[GCI] Added Lightning Bolt for WASM accelerated modules #1365

merged 6 commits into from Dec 19, 2019

Conversation

harshkhandeparkar
Copy link
Member

@harshkhandeparkar harshkhandeparkar commented Dec 17, 2019

Fixes #1320 (<=== Replace 0000 with the Issue Number)

I think the issue asks to show an icon for modules that support WASM. But WASM can also fail. So I added an extra bit - Check if it succeeded or not and notify the UI. This makes it so that the icon is shown only if the WASM succeeds.
I also added a nice tooltip to the icon.

What works:

  • The tooltip is shown!
  • The icon is shown only when useWasm flag is set to true, the module uses it and wasm succeded

wasm-tooltip

What doesn't work:

  • Meta modules cannot transfer information about whether WASM succeded or not because of the way they are built - Also since meta modules are a combo of many other modules, they can individually succeed or fail in WASM so the final output is indeterminate.
  • Some modules just don't use WASM. eg: Crop, WebGLDistort, etc.
  • WASM just fails for some modules eg: Contrast. IDK why.

Make sure these boxes are checked before your pull request (PR) is ready to be reviewed and merged. Thanks!

  • tests pass -- look for a green checkbox ✔️ a few minutes after opening your PR -- or run tests locally with npm test
  • code is in a uniquely-named feature branch and has no merge conflicts
  • PR is descriptively titled
  • ask @publiclab/is-reviewers for help, in a comment below
  • Insert-step functionality is working correct as expected.

We're happy to help you get this ready -- don't be afraid to ask for help, and don't be discouraged if your tests fail at first!

If tests do fail, click on the red X to learn why by reading the logs.

Please be sure you've reviewed our contribution guidelines at https://publiclab.org/contributing-to-public-lab-software
Please make sure to get at least two reviews before asking for merging the PR as that would make the PR more reliable on our part
Thanks!

@harshkhandeparkar
Copy link
Member Author

Out of the 41 file changes, most are just repeated Module.js code changes. Same change everywhere.
Overall I changed:

  1. defaultHtmlStepUi.js
  2. demo.css
  3. PixelManipulation.js
  4. src/Run.js
  5. Module.js x 37

@codecov
Copy link

codecov bot commented Dec 17, 2019

Codecov Report

Merging #1365 into main will decrease coverage by 0.11%.
The diff coverage is 89.15%.

Impacted file tree graph

@@            Coverage Diff             @@
##             main    #1365      +/-   ##
==========================================
- Coverage   66.23%   66.12%   -0.12%     
==========================================
  Files         125      125              
  Lines        2559     2571      +12     
  Branches      400      404       +4     
==========================================
+ Hits         1695     1700       +5     
- Misses        864      871       +7
Impacted Files Coverage Δ
examples/lib/defaultHtmlStepUi.js 10.73% <0%> (-0.25%) ⬇️
src/modules/Exposure/Module.js 100% <100%> (ø) ⬆️
src/modules/FlipImage/Module.js 89.47% <100%> (ø) ⬆️
src/modules/Histogram/Module.js 100% <100%> (ø) ⬆️
src/modules/GridOverlay/Module.js 100% <100%> (ø) ⬆️
src/modules/Dynamic/Module.js 75.67% <100%> (ø) ⬆️
src/modules/EdgeDetect/Module.js 96.15% <100%> (ø) ⬆️
src/modules/Blur/Module.js 100% <100%> (ø) ⬆️
src/modules/DrawRectangle/Module.js 100% <100%> (ø) ⬆️
src/modules/Channel/Module.js 87.5% <100%> (ø) ⬆️
... and 28 more

@harshkhandeparkar
Copy link
Member Author

@jywarren @Divy123 could you please review this?

@jywarren
Copy link
Member

Hi! If wasm fails maybe we should show a red lightning icon?

This is really nice. Is there anything we should think of that's changing documentation for module requirements that we should include in the readmes? Thanks!

@jywarren
Copy link
Member

Also, I believe it needs a rebase! Thanks Harsh!

@harshkhandeparkar
Copy link
Member Author

harshkhandeparkar commented Dec 19, 2019 via email

@harshkhandeparkar
Copy link
Member Author

@jywarren please try to merge this today. I want to claim the HoF task (about caching). I had done some work on it around 9 months back. I want to continue the work. Remember the PR for using package.json version for cache?

@jywarren jywarren merged commit 6476b8d into publiclab:main Dec 19, 2019
@jywarren
Copy link
Member

Awesome!!!!

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.

Add lightening bolt icon at the top of step panel to show if the step is wasm accelerated.
3 participants