xref: /third_party/mesa3d/.gitlab-ci/docs/skqp.rst (revision bf215546)
1bf215546Sopenharmony_ciskqp
2bf215546Sopenharmony_ci====
3bf215546Sopenharmony_ci
4bf215546Sopenharmony_ci`skqp <https://skia.org/docs/dev/testing/skqp/>`_ stands for SKIA Quality
5bf215546Sopenharmony_ciProgram conformance tests.  Basically, it has sets of rendering tests and unit
6bf215546Sopenharmony_citests to ensure that `SKIA <https://skia.org/>`_ is meeting its design specifications on a specific
7bf215546Sopenharmony_cidevice.
8bf215546Sopenharmony_ci
9bf215546Sopenharmony_ciThe rendering tests have support for GL, GLES and Vulkan backends and test some
10bf215546Sopenharmony_cirendering scenarios.
11bf215546Sopenharmony_ciAnd the unit tests check the GPU behavior without rendering images.
12bf215546Sopenharmony_ci
13bf215546Sopenharmony_ciTests
14bf215546Sopenharmony_ci-----
15bf215546Sopenharmony_ci
16bf215546Sopenharmony_ciRender tests design
17bf215546Sopenharmony_ci^^^^^^^^^^^^^^^^^^^
18bf215546Sopenharmony_ci
19bf215546Sopenharmony_ciIt is worth noting that `rendertests.txt` can bring some detail about each test
20bf215546Sopenharmony_ciexpectation, so each test can have a max pixel error count, to tell skqp that it
21bf215546Sopenharmony_ciis OK to have at most that number of errors for that test. See also:
22bf215546Sopenharmony_cihttps://github.com/google/skia/blob/c29454d1c9ebed4758a54a69798869fa2e7a36e0/tools/skqp/README_ALGORITHM.md
23bf215546Sopenharmony_ci
24bf215546Sopenharmony_ci.. _test-location:
25bf215546Sopenharmony_ci
26bf215546Sopenharmony_ciLocation
27bf215546Sopenharmony_ci^^^^^^^^
28bf215546Sopenharmony_ci
29bf215546Sopenharmony_ciEach `rendertests.txt` and `unittest.txt` file must be located inside a specific
30bf215546Sopenharmony_cisubdirectory inside skqp assets directory.
31bf215546Sopenharmony_ci
32bf215546Sopenharmony_ci+--------------+--------------------------------------------+
33bf215546Sopenharmony_ci| Test type    | Location                                   |
34bf215546Sopenharmony_ci+==============+============================================+
35bf215546Sopenharmony_ci| Render tests |  `${SKQP_ASSETS_DIR}/skqp/rendertests.txt` |
36bf215546Sopenharmony_ci+--------------+--------------------------------------------+
37bf215546Sopenharmony_ci| Unit tests   |  `${SKQP_ASSETS_DIR}/skqp/unittests.txt`   |
38bf215546Sopenharmony_ci+--------------+--------------------------------------------+
39bf215546Sopenharmony_ci
40bf215546Sopenharmony_ciThe `skqp-runner.sh` script will make the necessary modifications to separate
41bf215546Sopenharmony_ci`rendertests.txt` for each backend-driver combination. As long as the test files are located in the expected place:
42bf215546Sopenharmony_ci
43bf215546Sopenharmony_ci+--------------+----------------------------------------------------------------------------------------------+
44bf215546Sopenharmony_ci| Test type    | Location                                                                                     |
45bf215546Sopenharmony_ci+==============+==============================================================================================+
46bf215546Sopenharmony_ci| Render tests | `${MESA_REPOSITORY_DIR}/src/${GPU_DRIVER}/ci/${GPU_VERSION}-${SKQP_BACKEND}_rendertests.txt` |
47bf215546Sopenharmony_ci+--------------+----------------------------------------------------------------------------------------------+
48bf215546Sopenharmony_ci| Unit tests   | `${MESA_REPOSITORY_DIR}/src/${GPU_DRIVER}/ci/${GPU_VERSION}_unittests.txt`                   |
49bf215546Sopenharmony_ci+--------------+----------------------------------------------------------------------------------------------+
50bf215546Sopenharmony_ci
51bf215546Sopenharmony_ciWhere `SKQP_BACKEND` can be:
52bf215546Sopenharmony_ci
53bf215546Sopenharmony_ci- gl: for GL backend
54bf215546Sopenharmony_ci- gles: for GLES backend
55bf215546Sopenharmony_ci- vk: for Vulkan backend
56bf215546Sopenharmony_ci
57bf215546Sopenharmony_ciExample file
58bf215546Sopenharmony_ci""""""""""""
59bf215546Sopenharmony_ci
60bf215546Sopenharmony_ci.. code-block:: console
61bf215546Sopenharmony_ci
62bf215546Sopenharmony_ci  src/freedreno/ci/freedreno-a630-skqp-gl_rendertests.txt
63bf215546Sopenharmony_ci
64bf215546Sopenharmony_ci- GPU_DRIVER: `freedreno`
65bf215546Sopenharmony_ci- GPU_VERSION: `freedreno-a630`
66bf215546Sopenharmony_ci- SKQP_BACKEND: `gl`
67bf215546Sopenharmony_ci
68bf215546Sopenharmony_ci.. _rendertests-design:
69bf215546Sopenharmony_ci
70bf215546Sopenharmony_ciskqp reports
71bf215546Sopenharmony_ci------------
72bf215546Sopenharmony_ci
73bf215546Sopenharmony_ciskqp generates reports after finishing its execution, they are located at the job
74bf215546Sopenharmony_ciartifacts results directory and are divided in subdirectories by rendering tests
75bf215546Sopenharmony_cibackends and unit
76bf215546Sopenharmony_citests. The job log has links to every generated report in order to facilitate
77bf215546Sopenharmony_cithe skqp debugging.
78bf215546Sopenharmony_ci
79bf215546Sopenharmony_ciMaintaining skqp on Mesa CI
80bf215546Sopenharmony_ci---------------------------
81bf215546Sopenharmony_ci
82bf215546Sopenharmony_ciskqp is built alongside with another binary, namely `list_gpu_unit_tests`, it is
83bf215546Sopenharmony_cilocated in the same folder where `skqp` binary is.
84bf215546Sopenharmony_ci
85bf215546Sopenharmony_ciThis binary will generate the expected `unittests.txt` for the target GPU, so
86bf215546Sopenharmony_ciideally it should be executed on every skqp update and when a new device
87bf215546Sopenharmony_cireceives skqp CI jobs.
88bf215546Sopenharmony_ci
89bf215546Sopenharmony_ci1. Generate target unit tests for the current GPU with :code:`./list_gpu_unit_tests > unittests.txt`
90bf215546Sopenharmony_ci
91bf215546Sopenharmony_ci2. Run skqp job
92bf215546Sopenharmony_ci
93bf215546Sopenharmony_ci3. If there is a failing or crashing unit test, remove it from the corresponding `unittests.txt`
94bf215546Sopenharmony_ci
95bf215546Sopenharmony_ci4. If there is a crashing render test, remove it from the corresponding `rendertests.txt`
96bf215546Sopenharmony_ci
97bf215546Sopenharmony_ci5. If there is a failing render test, visually inspect the result from the HTML report
98bf215546Sopenharmony_ci    - If the render result is OK, update the max error count for that test
99bf215546Sopenharmony_ci    - Otherwise, or put `-1` in the same threshold, as seen in :ref:`rendertests-design`
100bf215546Sopenharmony_ci
101bf215546Sopenharmony_ci6. Remember to put the new tests files to the locations cited in :ref:`test-location`
102