You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
i have noticed, that this seems to happen only on linux (at least i have not seen this on windows yet). Also only in Release mode. Never seen this in Debug mode so far.
Weird thing is really that it only happens occasionally, not always. So i was expecting some kind of race condition, because the tests are run in parallel, but changing the xunit config to:
Even running only the test CloneAs_ToBgr24 produces the error. I still suspect some race condition, because of parallel execution, but its not because other tests are running at the same time.
I have noticed, that when it fails, its every time the value in the B channel which is wrong.
I suspect the ParallelFor in CloneAs is causing this, but i could not pinpoint exactly where the error is. Setting the ParallelOptions.MaxDegreeOfParallelism to 1 reliable makes the test run successfully.
What i do not get is why this is not happening to CloneAs_ToRgb24. It uses the same CloneAs method.
i do not think anymore there is an issue in ParallelFor. I think it has to do with memory alignment of the bgr24 struct. If i change it to explicit and field offsets 0, 1, 2 accordingly to b, g , r, this issue does not happen anymore.
I am not sure why LayoutKind.Sequential produces a different result than this explicit one.
Activity
skipping CloneAs_ToBgr24 before it drives us mad (see #576)
brianpopow commentedon May 19, 2018
i have noticed, that this seems to happen only on linux (at least i have not seen this on windows yet). Also only in Release mode. Never seen this in Debug mode so far.
Weird thing is really that it only happens occasionally, not always. So i was expecting some kind of race condition, because the tests are run in parallel, but changing the xunit config to:
and its still happens some times
brianpopow commentedon May 20, 2018
Even running only the test CloneAs_ToBgr24 produces the error. I still suspect some race condition, because of parallel execution, but its not because other tests are running at the same time.
I have noticed, that when it fails, its every time the value in the B channel which is wrong.
I suspect the ParallelFor in CloneAs is causing this, but i could not pinpoint exactly where the error is. Setting the ParallelOptions.MaxDegreeOfParallelism to 1 reliable makes the test run successfully.
What i do not get is why this is not happening to CloneAs_ToRgb24. It uses the same CloneAs method.
using LayoutKind.Explicit for bgr24, to fix CloneAs_ToBgr24 failing s…
brianpopow commentedon May 23, 2018
i do not think anymore there is an issue in ParallelFor. I think it has to do with memory alignment of the bgr24 struct. If i change it to explicit and field offsets 0, 1, 2 accordingly to b, g , r, this issue does not happen anymore.
I am not sure why LayoutKind.Sequential produces a different result than this explicit one.
antonfirsov commentedon May 23, 2018
@brianpopow should be a CLR code generation bug again. Thanks for figuring this out!
JimBobSquarePants commentedon May 23, 2018
@brianpopow Good work! We should double check our other blittable types.
Rgba32Rgb24,Bgr24, andArgb32.using also LayoutKind.Explicit for rgb24, because it may also be affe…
brianpopow commentedon May 23, 2018
i have opened a PR for this: #591
I have changed rgb24 also, because it may also be affected by this.
Im not sure if Rgba32 and Argb32 can be affected by this.
JimBobSquarePants commentedon May 23, 2018
Ok, let's leave it at that, no point changing working code.
I've just updated your PR from master, will merge once it's built.
Merge pull request #591 from brianpopow/feature/fix-576
antonfirsov commentedon May 26, 2018
It pretty much looks like this is fixed with #591.