GPU Shader Code Coverage via Embedded Probes and Hit Files
Find Innovative SolutionsGenerate Solutions
Solution Overview
Problem
Current methods for generating structural code coverage data for GPU shader code are labor-intensive, prone to human error, and costly, and lack automated tools, making it difficult to achieve high levels of code coverage required for aerospace applications like DO-178C compliance.
Innovation Solution
A method and system that instrument GPU shader code by adding flags and creating graphic objects on a display device for each line of code, generating structural code coverage reports based on hit files and mappings, enabling automatic and accurate structural code coverage data collection.
Engineering Contradictions & Design Principles
Engineering Contradiction Analysis
1Reliability
If manual methods are used to generate structural code coverage data for GPU shader code, then flexibility and adaptability are maintained, but labor intensity increases, human error increases, and cost increases
Solution Approach 1:
The system enables self-service by having the GPU shader code itself execute the coverage collection through embedded probe code. The shader code automatically tracks its own execution paths, generates coverage data, and outputs hit files without requiring external manual analysis tools or human intervention in the coverage collection process.
Solution Approach 2:
The patent replaces manual mechanical processes with automated computational processes. Instead of manually analyzing code coverage, the system uses automated probe code embedded in the shader that automatically collects execution data, generates coverage reports, and outputs results through hit files, substituting human labor with computational automation.
2Productivity
If automated tools are developed for GPU shader code coverage, then productivity and accuracy improve, but device complexity increases
Solution Approach 1:
The patent merges the coverage collection functionality directly into the GPU shader code itself. By embedding probe code within the shader and using the GPU's native rendering pipeline to display coverage information, the system combines multiple functions (code execution, coverage tracking, and data collection) into a single integrated process, avoiding the need for separate complex external tools.
Solution Approach 2:
The system achieves multi-functionality by using the GPU shader code to perform both its primary rendering function and the secondary coverage collection function. The same shader executes coverage probes, generates coverage data, and outputs hit files, making the shader code universal for both rendering and testing purposes.
3Measurement precision
If comprehensive coverage data is collected for all code lines, then measurement precision improves, but the amount of data processing and time required increases
Solution Approach 1:
The system performs preliminary action by pre-compiling and pre-processing the shader code to embed coverage probes and generate the necessary mapping structures before actual testing. This preparation work is done in advance during the build process, so that during execution, the coverage collection can proceed more efficiently without requiring complex real-time analysis.
Solution Approach 2:
The patent uses copying by creating a simplified representation of the shader code structure through the probe code and hit file format. Instead of processing the complete complex shader code during coverage collection, the system copies essential coverage information into a streamlined hit file format that can be quickly processed to generate the final coverage report, reducing processing time while maintaining completeness.
Data Source
Figure 1
Figure 2
Figure 3
AI summary
Systems and methods for determining code coverage for GPU shader code are provided herein. In one example, a method includes adding a flag for each line of shader code to be executed by a GPU. The method further includes creating at least one graphic object to be displayed on a display device for each line of shader code to be executed by the GPU. The method further includes receiving one or more hit files that include a status of one or more attributes of displayed graphic objects on the display device after execution of a requirements-based test. The method further includes generating a structural code coverage report for the shader code based on the one or more hit files and a mapping between the shader code and the displayed graphic objects.