Virtual Machine Replay Core for Deterministic Execution

Resolve Bottlenecks,
Find Innovative Solutions
Generate Solutions

Solution Overview

Problem

In virtual machine environments, replaying a recorded program's execution is hindered by non-determinism, particularly due to interactions with the operating system, leading to inefficiencies and inflexibility that prevent effective debugging, as existing approaches require recording and replaying every detail, resulting in large storage needs and slow performance.

Innovation Solution

The solution involves selectively recording only deterministic operations and simulating non-deterministic ones during replay, using a replay core that modifies bytecodes and intercepts class loading and verification processes to ensure deterministic behavior, allowing the virtual machine to perform debugging functions like halting execution or displaying variables.

Engineering Contradictions & Design Principles

VSEngineering Contradiction Analysis

1Reliability

If all operations are recorded and replayed in detail, then execution behavior is replicated accurately, but storage requirements increase and replay performance deteriorates

Engineering Contradiction:
Improveexecution behavior replication accuracyVSAvoidstorage requirements
Core Design Contradiction:
ReliabilityVSQuantity of substance

Solution Approach 1:

The patent segments operations into two categories: deterministic operations that are recorded and replayed, and non-deterministic operations that are simulated. This segmentation allows the system to record only the necessary deterministic portion of execution, reducing storage requirements while maintaining reliable replication of expected behavior patterns.

Inventive Principle:
Principle #1Segmentation

Solution Approach 2:

Instead of copying and storing complete execution traces including all non-deterministic operations, the patent creates a simplified replay record that captures only deterministic operation patterns. The replay core then simulates non-deterministic operations based on these patterns, reducing storage needs while preserving execution fidelity.

Inventive Principle:
Principle #26Copying

2Reliability

If all operations are recorded and replayed in detail, then execution behavior is replicated accurately, but replay speed decreases

Engineering Contradiction:
Improveexecution behavior replication accuracyVSAvoidreplay speed
Core Design Contradiction:
ReliabilityVSProductivity

Solution Approach 1:

The patent divides the replay process into two paths: deterministic operations are replayed from recorded patterns for accuracy, while non-deterministic operations are simulated for speed. This segmentation enables fast replay without sacrificing the accuracy of deterministic behavior replication.

Inventive Principle:
Principle #1Segmentation

Solution Approach 2:

The patent creates a lightweight replay record containing only deterministic operation patterns rather than complete execution traces. This copied representation enables rapid replay by eliminating the need to process and replay every individual operation, significantly improving replay speed while maintaining accuracy for deterministic portions.

Inventive Principle:
Principle #26Copying

3Difficulty of detecting and measuring

If complete execution traces are recorded, then debugging capability is enhanced, but system complexity increases

Engineering Contradiction:
Improvedebugging capabilityVSAvoidsystem complexity
Core Design Contradiction:
Difficulty of detecting and measuringVSDevice complexity

Solution Approach 1:

The patent segments the debugging support functionality into a dedicated replay core that handles deterministic operation replay separately from the main virtual machine execution. This segmentation isolates the complexity of trace analysis and debugging aids into a separate module, making the overall system more manageable while enhancing debugging capability.

Inventive Principle:
Principle #1Segmentation

Solution Approach 2:

The replay core acts as an intermediary between the recorded execution patterns and the debugging interface. It translates deterministic operation patterns into meaningful debugging information without requiring the main virtual machine to directly handle complex trace analysis, thereby reducing overall system complexity while maintaining strong debugging capabilities.

Inventive Principle:
Principle #24Intermediary (Mediator)

4Adaptability or versatility

If non-deterministic operations are simulated rather than replayed, then replay flexibility is improved, but execution fidelity may be compromised

Engineering Contradiction:
Improvereplay flexibilityVSAvoidexecution fidelity
Core Design Contradiction:
Adaptability or versatilityVSReliability

Solution Approach 1:

The patent segments operations into deterministic and non-deterministic categories, applying different replay strategies to each. Deterministic operations are replayed with high fidelity to ensure execution accuracy, while non-deterministic operations are simulated to provide flexibility. This segmentation allows the system to maintain reliability for critical deterministic behavior while gaining flexibility in handling variable operations.

Inventive Principle:
Principle #1Segmentation

Data Source

PatentUS10083046B2Ensuring determinism during programmatic replay in a virtual machine
Publication Date: 2018.09.25 CA TECH INC
  • US10083046B2 patent drawing
  • US10083046B2 patent drawing
  • US10083046B2 patent drawing

AI summary

Aspects of an application program's execution which might be subject to non-determinism are performed in a deterministic manner while the application program's execution is being recorded in a virtual machine environment so that the application program's behavior, when played back in that virtual machine environment, will duplicate the behavior that the application program exhibited when originally executed and recorded. Techniques disclosed herein take advantage of the recognition that only minimal data needs to be recorded in relation to the execution of deterministic operations, which actually can be repeated “verbatim” during replay, and that more highly detailed data should be recorded only in relation to non-deterministic operations, so that those non-deterministic operations can be deterministically simulated (rather than attempting to re-execute those operations under circumstances where the outcome of the re-execution might differ) based on the detailed data during replay.