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

[Bug]: unexpected 4 and 16 bit image results using electron 21.4.1 and newer #37152

Closed
3 tasks done
robertmassman opened this issue Feb 6, 2023 · 24 comments
Closed
3 tasks done
Labels

Comments

@robertmassman
Copy link

Preflight Checklist

Electron Version

21.4.1 and newer

What operating system are you using?

macOS

Operating System Version

macOS 13.1

What arch are you using?

x64

Last Known Working Electron version

17.4.11

Expected Behavior

At the moment I’m using macOS with an Intel processor. I’m running the program with npm and electron and I’m currently using "electron": "^17.4.11" which has been telling me for some time that I need to update it because of the vulnerabilities that are stacking up. Every time I try to update electron I received errors when running the program. As of "electron": "^21.4.1" the program is able to work but I’m noticing some GPU oddities in the results. Please see below.

Is there something that needs to be configured for it to act like it was in previous versions?

Right now I have the program set up with the ability to switch between bit-depths “4, 8 and 16”.

  • When using “electron 17.4.11” I receive results as expected. Seen on the left side.
  • When I use “electron 21.4.1” I see things that are unexpected. .Seen on the right side.
  • 4 bit results look the same as 8 bit buffers.
  • 16 bit results have clipping in extreme areas and the image appears darker.
    4 bit
    8 bit
    16 bit

When I investigated further I can see that the starting image texture looks like it has the appropriate bit depth. But when I use the gaussian shader it looks like the gaussian filter is using 8 bit data, Not really sure. I’m including 2 videos that I hope show the differences between using electron 17.4.11 and 21.4.1.

Actual Behavior

Please see above

Testcase Gist URL

No response

Additional Information

No response

@robertmassman robertmassman changed the title [Bug]: [Bug]: unexpected 4 and 16 bit image results using electron 21.4.1 Feb 6, 2023
@robertmassman robertmassman changed the title [Bug]: unexpected 4 and 16 bit image results using electron 21.4.1 [Bug]: unexpected 4 and 16 bit image results using electron 21.4.1 and newer Feb 6, 2023
@VerteDinde VerteDinde added the blocked/need-repro Needs a test case to reproduce the bug label Feb 7, 2023
@github-actions
Copy link
Contributor

github-actions bot commented Feb 7, 2023

Hello @robertmassman. Thanks for reporting this and helping to make Electron better!

Would it be possible for you to make a standalone testcase with only the code necessary to reproduce the issue? For example, Electron Fiddle is a great tool for making small test cases and makes it easy to publish your test case to a gist that Electron maintainers can use.

Stand-alone test cases make fixing issues go more smoothly: it ensure everyone's looking at the same issue, it removes all unnecessary variables from the equation, and it can also provide the basis for automated regression tests.

Now adding the blocked/need-repro label for this reason. After you make a test case, please link to it in a followup comment. This issue will be closed in 10 days if the above is not addressed.

@VerteDinde
Copy link
Member

Hey @robertmassman, adding to the bot's response above - it's a bit hard for us to tell exactly what might be failing without seeing a code repro or any error logs. If you could share a repo with us, or some kind of error logs so we can see what GPU errors are corresponding with the images you linked above, happy to try and take a look!

@robertmassman
Copy link
Author

robertmassman commented Feb 7, 2023 via email

@github-actions github-actions bot removed the blocked/need-repro Needs a test case to reproduce the bug label Feb 8, 2023
@VerteDinde
Copy link
Member

@robertmassman Either would be great! If you're able to share the code written as is, that would be very helpful - basically, what helps us most is some code that allows us to quickly reproduce the issue. That will let us use it as a test case to track down exactly what's different per version and where in Electron is failing. 🙂 Thanks for the fast reply!

@robertmassman
Copy link
Author

@VerteDinde
I just added you as a collaborator to the demo page I created. Please check out the readme for a little info about it. Sorry for the lack of code commenting. If the demo doesn't help I can share the full program with but honestly It's a lot of code so you'll probably have an easier time with the demo I created. 

@robertmassman
Copy link
Author

@VerteDinde
I made a few changes to the demo. Also I looked into how to use my code editor to commit changes to GitHub and needed to pull the original to gain access to making commits from the code editor. please look for the new invitation to the Demo

@robertmassman
Copy link
Author

@codebytere
Hi, I see you are looking into the issue I'm seeing in electron. I added you as a contributor to the demo code I posted on GitHub. Please feel free to download it and adapt it to better suit your needs.

@VerteDinde
Copy link
Member

@robertmassman Thanks so much! Just confirming that I have access to the project, taking a look 🙇‍♀️ Would you mind if I added a few more maintainers to the project, so they can also take a look? Thanks again for making this and sharing it with us!

@robertmassman
Copy link
Author

@VerteDinde No problem at all. Feel free to add whoever can help look into the issue with you.

@VerteDinde
Copy link
Member

Hi @robertmassman, I'm so sorry - it looks like I don't have access to the bit depth repo anymore. Would you mind re-adding me? If you're not seeing the issue anymore, no worries!

@robertmassman
Copy link
Author

robertmassman commented Feb 27, 2023 via email

@codebytere
Copy link
Member

@robertmassman is there any way you could just provide a gist or public repo? It'd be much easier and better in case we need to return to this later.

@robertmassman
Copy link
Author

robertmassman commented Feb 28, 2023 via email

@robertmassman
Copy link
Author

robertmassman commented Feb 28, 2023 via email

@robertmassman
Copy link
Author

@VerteDinde
@codebytere

Any updates on the bit depth investigation?

@codebytere
Copy link
Member

codebytere commented Apr 3, 2023

hey @robertmassman - are there steps missing in your repo? It doesn't start as is - app is always undefined.

ElectronBitDepthDemo on git:main ❯ npm start                     3:34PM

> electron-bit-depth_demo_2@0.0.0 start
> electron .

/Users/codebytere/Developer/repros/ElectronBitDepthDemo/main.cjs:64
if (!app.requestSingleInstanceLock()) {
         ^

TypeError: Cannot read properties of undefined (reading 'requestSingleInstanceLock')
    at Object.<anonymous> (/Users/codebytere/Developer/repros/ElectronBitDepthDemo/main.cjs:64:10)
    at Module._compile (node:internal/modules/cjs/loader:1116:14)
    at Object.Module._extensions..js (node:internal/modules/cjs/loader:1169:10)
    at Module.load (node:internal/modules/cjs/loader:988:32)
    at Module._load (node:internal/modules/cjs/loader:829:12)
    at Function.c._load (node:electron/js2c/asar_bundle:5:13343)
    at Function.executeUserEntryPoint [as runMain] (node:internal/modules/run_main:81:12)
    at node:internal/main/run_main_module:17:47

@robertmassman
Copy link
Author

@codebytere
My repo does not include Node modules. Maybe you need to install them It relies on "PicoGL".

After I use terminal to locate the folder on my computer I type. "npm run start"

Screenshot 2023-04-03 at 9 54 02 AM

@robertmassman
Copy link
Author

@codebytere PS. Once you are able to run the demo and you decide to see what happens with the most current version of electron by updating "package.json" you will need to re-compile the demo "npm run compile" before running the demo again. Or you could type this into terminal "npm run compile && npm run start" to compile and start the demo.

@robertmassman
Copy link
Author

@codebytere Hope you are good. Any updates on the bit depth issue?

@robertmassman
Copy link
Author

Hi @codebytere. Any updates on the above issue?

@robertmassman
Copy link
Author

robertmassman commented Jun 16, 2023

@VerteDinde
@codebytere

Below is a link to a gist I just created. Please use electron 17.4.11 to see the expected behavior and any other version above to see the unexpected results. I hope this helps.

https://gist.github.com/robertmassman/80f3379d0d7333ff546681cedf17eac4

To hopefully help your investigation. Please see the comments I left in “gist” at line 10538. It’s in all caps so that I can find it more easily not because I’m shouting. Please don’t take offense.

Note that if you enable the above, write to screen code and then comment out the code below that line. Even though the demo is using the 4-bit buffer, the results will be as if you are not working with 8-bit data and display as if it's 8-bit. Similar to what is observed when updating from electron 17.4.11 to electron 21.4.1 or greater and leaving the code as it was before.

@codebytere
Copy link
Member

codebytere commented Jun 18, 2023

@robertmassman and you've confirmed this does not happen in Chrome with the same code?

@codebytere codebytere added the blocked/need-info ❌ Cannot proceed without more information label Jun 18, 2023
@robertmassman
Copy link
Author

@codebytere
Good question.

If I open index.html in the version of google chrome listed below. I do not see the expected results. The image looks smooth.

Google Chrome
Version 114.0.5735.133 (Official Build) (x86_64)
Screenshot 2023-06-18 at 9 23 24 AM

If I open index.html in the version of Firefox listed below. I see the expected results. The image looks blocky.

Firefox Browser
114.0.1 (64-bit)
Screenshot 2023-06-18 at 9 23 40 AM

If I open index.html in the version of Safari listed below. I do not see the expected results. The image looks smooth.

Safari
Version 16.5 (18615.2.9.11.4)

@codebytere
Copy link
Member

codebytere commented Jun 18, 2023

Unfortunately then there's not a lot we can do - that means this is an image processing issue in Chromium/Webkit. I recommend filing a bug at https://crbug.com and explaining what should be the case vs what you're seeing. When they fix it, we will inherit that!

@codebytere codebytere closed this as not planned Won't fix, can't repro, duplicate, stale Jun 18, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

3 participants