GPU Shader Code Coverage via Embedded Probes and Hit Files

Resolve Bottlenecks,
Find Innovative Solutions
Generate 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

VSEngineering 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

Engineering Contradiction:
Improveaccuracy of code coverage dataVSAvoidlabor intensity
Core Design Contradiction:
ReliabilityVSProductivity

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.

Inventive Principle:
Principle #25Self-service

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.

Inventive Principle:
Principle #28Mechanics substitution (Replace mechanical system)

2Productivity

If automated tools are developed for GPU shader code coverage, then productivity and accuracy improve, but device complexity increases

Engineering Contradiction:
Improveautomation of coverage generationVSAvoidsystem complexity
Core Design Contradiction:
ProductivityVSDevice complexity

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.

Inventive Principle:
Principle #5Merging (Combining)

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.

Inventive Principle:
Principle #6Universality (Multi-functionality)

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

Engineering Contradiction:
Improvecompleteness of code coverage dataVSAvoidcycle time for coverage generation
Core Design Contradiction:
Measurement precisionVSLoss of time

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.

Inventive Principle:
Principle #10Preliminary action

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.

Inventive Principle:
Principle #26Copying

Data Source

PatentEP4451132A1Systems and methods for determining code coverage for GPU shader code
Publication Date: 2024.10.23 HONEYWELL INTERNATIONAL INC
  • EP4451132A1 patent drawingFigure 1
  • EP4451132A1 patent drawingFigure 2
  • EP4451132A1 patent drawingFigure 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.