-
Notifications
You must be signed in to change notification settings - Fork 231
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
Improve output determinism and add internal ktxdiff tool for comparing test outputs #745
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I reviewed this because I wanted to see what you had done with the FP options. A few changes are needed to get the same settings that the ASTC dev says makes their invariance tests pass on all the compilers they support.
Thank you for the review. |
Those other MSVC jobs are not running the tests. They are principally for checking builds are successful with various options. |
windows (windows-2019, v142, x64, ...) does run the CTS |
That's VS2019. The one that's failing is VS2022 cl.exe. |
Okey, the results are in. The issue was too strict output tolerance. |
Do you have any idea why tests were passing with VS2019 cl.exe ( < v19.30) and failing with VS2022 cl.exe (v19.30), both on x64, before you adjusted the tolerance? Would you please modify tests/toktx-tests.cmake to use ktxdiff instead of diff. I'd like include it with this PR. |
I am pretty sure they changed their std library implementation between VS2019 and VS2022 causing basis-lz to produce different artifacts. I tried to keep the tolerance values reasonable low, but some artifacts can cause really high differences if you look at the difference between each color value. If you are unfortunate enough a 'negative' artifact (an artifact that causes a color value to be lower) can be replaced with a 'positive' one causing the difference to double.
Not as part of this PR. This PR was already a big enough headache as it tightened every platforms conformance. Tests in |
So it wasn't anything to do with floating point. I'm glad to know that because we are speficying the same type of FP behavior to both compilers.
I'll look into it but it won't be until some time after Siggraph. What are the circumstances needed to trigger the assert? I don't see it currently. Does it happen when you change a test to use ktxdiff instead of diff? |
No its not. Its just a consequence that we are now doing a meaningful test on every platform.
(I misspoke, the assert is only fires on MinGW, the other platforms have different issues) And just to clarify, these failing tests are only affecting the legacy tools. Every new tool and new test passes on every platform that we are testing. |
I haven't been running the tests on Debug configurations in CI because they take so damn long. I don't understand the MacOS failures. They aren't showing up in CI nor when I run them on my MacBook. What is different for you? The ktx2check-test-all failure sounds very much like the failure I saw in ktx2check-test-pipe-read which is due to a bug in pipes in Git for Windows 2.41.0's bash/MinGW. See git-for-windows/git#4464. That test is no longer run on WIN32. However ktx2check-test-all does not use pipes so it must be a different problem. I am happy to fix StringbufStream as we'll continue to support that. I don't want to put too much time into the legacy tools though. I have to finish work on issue #727 before I can look into these issues. |
@MarkCallow, we run our tests on a Mac Mini M2 running macOS 13.4.1 (build 22F82). |
I just ran the tests on an M2 running 13.4.1 (c) without this PR. All tests are passing except the small list I sent you before, that fail due to precision issues, etc. The same tests were passing on 13.4.1 before that. Are these failures new with this PR? Presumably they occur only on Apple Silicon as the tests are passing in CI on x64. |
All of these failures are really old, they are failing on commits even before the first ktxtools PR was merged. (I think the windows ones were not failing at the start of the project, but one windows update around 2023.mar. introduced some failures, similarly as it did for the CI) |
Additional important information: With Apple Silicon on MacOS most of the tests are not failing on Debug build, they only fail on Release build. |
Which failures, the Debug build failures on MinGW and Windows or the Release failures on macOS? I can understand not noticing the former as CI does not run the tests on Debug builds. I can't understand not noticing the latter as they are run in CI on x64 and I am always running them in Release mode on my M2 MacBook before I commit anything.
I am completely confused as to why you are seeing these failures and I am not. Are you running in Xcode or from the command line? If from Xcode have you built the |
Both of them are old.
Command line with calling cmake and ctest
Yes it is possible. But, we got sidetracked in this conversation. This PR should not cause or affect these failures. I will gather every failure and send you an email with the list and details. |
I am awaiting @aqnuep's review. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM.
…g test outputs (KhronosGroup#745) * Implement internal ktxdiff tool for comparing test output files. * Fix color conversion overflow.
…g test outputs (KhronosGroup#745) * Implement internal ktxdiff tool for comparing test output files. * Fix color conversion overflow.
…g test outputs (KhronosGroup#745) * Implement internal ktxdiff tool for comparing test output files. * Fix color conversion overflow.
…g test outputs (KhronosGroup#745) * Implement internal ktxdiff tool for comparing test output files. * Fix color conversion overflow.
/fp:precise
,-ffp-contract=off
and-ffp-model=precise
compiler options to improve output determinismktxdiff: This is a new test only tool with limited capability which aims to address our testing needs.
This is not a user facing tool as that would requires comprehensive and complete feature sets, documentation and test coverage which are outside of its scope. The tool separately compares the metadata and the uncompressed (zlib/zstd) "untranscoded" (uastc, basis-lz) decoded (astc) image data by either memcmp or by the given tolerance value.
Usage:
ktxdiff <expected-filepath> <received-filepath> <tolerance-float>
. ktxdiff exits with 0 on match, 1 on mismatch, 2 on error and writes information about mismatch to stdout and information about any error to stderr.