-
-
Notifications
You must be signed in to change notification settings - Fork 851
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
Some unit tests fail with SSE disabled (i.e. scalar path only) #2414
Comments
It looks like CI runs the tests on the agents "as is", so with AVX (except MacOS?) and SSE enabled. When the PR is labeled for ARM then an extra runner for ARM is started. Thus bugs in the scalar code-paths may not be covered by CI, as the path via AVX/SSE is taken usually. My suggestion is to add a new entry in the ImageSharp/.github/workflows/build-and-test.yml Lines 16 to 19 in 302a23f
|
@brianpopow in #2413 (comment) you wrote about coverage. Please check if there's coverage for
I guess that's not covered, as it's a scalar-path and method ClampedAddSubtractHalf (which calls this method) has a pure SSE2-implemation.
|
We should be running any decoder/encoder tests using |
Here is the coverage report For LosslessUtils.
There is a test There are some paths not covered, for example |
That's a bit strange. When the private method Besides that I wonder why so many tests (10+) fail when SSE is disabled. |
The issue is in
This will run
I had no chance yet to look into those failing tests, but we need to fix them all. |
Is the cost of running of a whole CI-leg with SSE disabled too high? |
To cover all the intrinsic paths on 4 OS (linux is counted 2x now we have ARM) for 2X target frameworks the build matrix explodes to something like 28 images now.
I don't think there's a way to keep our coverage report intact while splitting out the features into separate matrix entries. I would suggest we ensure that all decoder/encoder methods use |
This should be avoided, for sure. I'm not that familiar with GH-Actions (I'm using Azure Pipelines mostly) but I think that should be possible w/o exploding the matrix.
|
I can confirm this. I see 133 failing tests going scalar-only on my machine. For example, this is the output when decoding I recommend fixing these one-by-one, adding the missing test cases for each individual bug in the process. While |
After merging #2416 many errors will be solved. Probably the image you have posted will render correct. |
No, this image is YCbCr, looks like we have more lurking bugs. |
I went a bit back in history and could identify the problematic PR which introduced this error. What I know so far is that the tests are failing after #2076 got merged |
Now on the main branch there are 39 failing tests left for dotnet6.0 and it seems The difference seem to come from png test which have text chunks and call
Other failing tests are tiff images which use jpeg compression, example: Other failing tests seems to have something todo with resizing, for example |
I've found a nasty bug, not related to the color converter pipeline. |
@br3aker thanks for looking into this issue! |
With #2427 merged, 15 test remain failing on the current main branch now. Two failing tests are webp encoding tests. I think there is an issue that the AVX version of P.S. I whish there would be an option not to close linked issues when PR are merged. I could not find any. |
The only way to avoid closing is not to use the closing keywords when linking to issues. |
I cant figure out what's going wrong with those png encoder tests. As mentioned above those failing tests seem to be related to decoding text chunks. Here is an example stack trace from
The weird thing is, when I execute a single failing test, the test runs fine and is green. |
Wild guess: maybe tiered compilation (rejitter?) doesn't respect ISA environmental variables on net6? Didn't check on net7. I've set this env variable Last failing test is related to image diff threshold, not sure whether it's related to the codegen. Now I'm completely lost, we can't simply set this variable and go on - there's a probability it can be broken by some R2R situation? Sorry to bother you @tannergooding but I'm not sure we can solve this on our own :) |
Could I get a few more details on exactly what's being set and what OS/architecture you're running on? |
Win11/x86, no emulation
We are trying to test all ImageSharp tests for scalar path so I've set We got some flaky tests which end up throwing
With this settings flaky tests do not fail, i.e. no more |
This sounds like a bad interaction between |
Yep, setting |
Please open an issue. I'm pretty sure I know what the issue is, but would be good to get it tracked explicitly as impacting the broader community |
Got it, will do tomorrow, thank you for the help! |
I think we can go ahead and close this now that the upstream issue is fixed in .NET 7+ |
Prerequisites
DEBUG
andRELEASE
modeImageSharp version
local build with latest main-branch
Other ImageSharp packages and versions
none
Environment (Operating system, version and so on)
win-x64, DOTNET_EnableSSE=0
.NET Framework version
all
Description
While hunting the bug (fixed via #2413) I tried several things, amongst others disabling SSE for unit tests run with Visual Studio by using this
ImageSharp/.runsettings
Line 2 in 0a1f05b
Tests started to fail -- even when going back in the history of main-branch (so no recent commit caused these failures).
To me it looks like there are latent bugs in the scalar code-pathes. Can anyone confirm?
(description copied and adapted from #2413 (comment))
Steps to Reproduce
To reproduce together with that runsettings one can try this playlist.zip (for filtered tests).
Images
No response
The text was updated successfully, but these errors were encountered: