Embedding Profile Tests in Compiled Binaries for Deterministic Feedback

Resolve Bottlenecks,
Find Innovative Solutions
Generate Solutions

Solution Overview

Problem

Profile driven feedback (PDF) in software compilation requires user intervention to specify and run test cases, leading to non-deterministic results and debugging issues due to potential modifications in test cases, affecting the consistency and accuracy of optimization.

Innovation Solution

Embedding test cases into a binary file during compilation, allowing automatic execution and recompilation based on performance data, ensuring consistent execution context and accurate profiling without user intervention.

Engineering Contradictions & Design Principles

VSEngineering Contradiction Analysis

1Extent of automation

If user specifies and runs test cases manually to generate profile information, then the profiling process can be completed, but the process becomes non-deterministic and requires user intervention

Engineering Contradiction:
Improveautomation of PDF processVSAvoiddeterminism of profiling results
Core Design Contradiction:
Extent of automationVSReliability

Solution Approach 1:

Test cases are embedded into the binary file during compilation, preparing them in advance for automatic execution. This preliminary embedding eliminates the need for manual user intervention later, making the profiling process both automated and deterministic across different compilation runs.

Inventive Principle:
Principle #10Preliminary action

Solution Approach 2:

The compiled binary file contains embedded test cases that automatically execute during profiling without requiring external user input. The system serves itself by having the binary file contain its own test cases, eliminating dependency on user actions and ensuring consistent, deterministic results.

Inventive Principle:
Principle #25Self-service

2Adaptability or versatility

If test cases are modified intentionally or accidentally, then different profiles are generated, but this causes debugging and maintenance issues

Engineering Contradiction:
Improveflexibility in test case modificationVSAvoidconsistency of profiling results
Core Design Contradiction:
Adaptability or versatilityVSReliability

Solution Approach 1:

Test cases are merged into the binary file itself during compilation, creating a unified structure where the test cases and the program code are inseparable. This merging ensures that any modification to test cases requires explicit user action, preventing accidental changes and maintaining consistency across profiling runs.

Inventive Principle:
Principle #5Merging (Combining)

Solution Approach 2:

Test cases are nested within the binary file structure, embedded as part of the compiled code. This nesting protects the test cases from external modification and ensures they remain consistent with the program version they were designed to test, eliminating accidental changes while maintaining adaptability through controlled updates.

Inventive Principle:
Principle #7Nested doll (Nesting)

3Ease of operation

If manual user intervention is required for PDF process, then test execution can be controlled, but the process becomes complex and time-consuming

Engineering Contradiction:
Improvesimplicity of PDF processVSAvoidtime for user intervention
Core Design Contradiction:
Ease of operationVSLoss of time

Solution Approach 1:

The system performs the entire profiling process automatically without user intervention. The embedded test cases execute on their own when the binary is run, and profile information is generated automatically. This self-service approach dramatically simplifies operation and eliminates the time users would spend manually specifying and running tests.

Inventive Principle:
Principle #25Self-service

Solution Approach 2:

All test case specifications are performed preliminarily during compilation, before runtime. This preliminary configuration eliminates the need for user actions during profiling, making the process simple and fast. Users only need to compile with the appropriate flags, and the rest happens automatically.

Inventive Principle:
Principle #10Preliminary action

Data Source

PatentUS10248554B2Embedding profile tests into profile driven feedback generated binaries
Publication Date: 2019.04.02 INTERNATIONAL BUSINESS MACHINE CORPORATION
  • US10248554B2 patent drawing
  • US10248554B2 patent drawing
  • US10248554B2 patent drawing

AI summary

Aspects of the present invention include a method, system and computer program product that embeds collected profiling test case information into a binary file of a computer program and subsequently recompiles the program. The method includes a processor specifying one or more test cases to be embedded into a compiled binary file, wherein the one or more test cases relate to at least a portion of a computer program representing a compilation unit; executing the one or more embedded test cases under the computer program; gathering performance data associated with the computer program as the one or more embedded test cases are executed; recompiling the compilation unit based on the performance data; and linking the computer program based on the performance data.