KhronosGroup / KhronosGroup/OpenCL-CTS

Potential optimization in `test_image_streams`: hoist generation of test data out of leaf functions

Open
#1,601 0 comments 0 reactions 0 assignees View on GitHub
Dominant language
C++
Stars
232
Forks
235
Avg merge
8d 7h
Merged PRs (30d)
18

Description

While investigating potential optimizations for the image streams test, it occurred to us that one potential source of slowdowns is having to repeatedly generate and upload test data for each test. Since random is random, it should be possible to share test data with multiple test instances. However, doing so is easier said than done. The main problem is that generation is not completely random: it depends on the dimensions and format of the image being tested. In particular, specific values are often piloted into the test data, and for some formats care is taken to avoid generating values that are out of range. Hoisting test data generation up may thus result in a reduction in test coverage, or may (as my colleagues discovered) even break the tests. Nonetheless, it should still be possible to do this.

(I've since discovered that the biggest time sink by far in `test_image_streams` is sampling the pixels in the read tests to validate the device's reading the image. Still, this may present an opportunity for further optimization afterwards.)

Contributor guide

No contributing guide indexed for this repository

Research direction

Start by locating the test_image_streams implementation and its leaf functions, then run the relevant tests to establish where test data generation and pixel sampling spend time. Trace how image dimensions, formats, piloted values, and range constraints affect generated data. Done means safely sharing or hoisting test data without reducing coverage or breaking validation, with the image-stream tests still passing.

Written by the indexing model from the issue text.

Assessment

Tech stack
cpp
Domain
performance, testing-qa
Issue type
Refactor
Difficulty
5/5
Estimated time
Over a week
Activity status
Stale
Clarity
Needs clarification
Newbie friendliness
25/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.