Virtual Machine Replay Core Bytecode Instrumentation

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 simulating every operation, resulting in large storage needs and slow replay speeds.

Innovation Solution

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

Engineering Contradictions & Design Principles

VSEngineering Contradiction Analysis

1Reliability

If every operation is recorded and simulated during replay, then deterministic behavior is achieved, but storage requirements increase and replay speed decreases

Engineering Contradiction:
Improvedeterministic behaviorVSAvoidstorage requirements
Core Design Contradiction:
ReliabilityVSQuantity of substance

Solution Approach 1:

The patent segments operations into deterministic and non-deterministic categories. Only deterministic operations are recorded during the record phase, while non-deterministic operations are excluded from recording. During replay, the virtual machine re-executes deterministic operations and simulates non-deterministic ones, achieving deterministic behavior without storing all operations.

Inventive Principle:
Principle #1Segmentation

Solution Approach 2:

The patent extracts and identifies deterministic operations from the mixed stream of operations. By using bytecode instrumentation and analysis, the system separates deterministic operations that can be recorded and replayed from non-deterministic operations that require simulation, reducing the quantity of recorded data while maintaining determinism.

Inventive Principle:
Principle #2Taking out (Extraction)

2Reliability

If every operation is recorded and simulated during replay, then deterministic behavior is achieved, but replay speed decreases

Engineering Contradiction:
Improvedeterministic behaviorVSAvoidreplay speed
Core Design Contradiction:
ReliabilityVSProductivity

Solution Approach 1:

The patent segments operations into deterministic and non-deterministic categories. Only deterministic operations are recorded during the record phase, while non-deterministic operations are excluded from recording. During replay, the virtual machine re-executes deterministic operations and simulates non-deterministic ones, achieving deterministic behavior without storing all operations.

Inventive Principle:
Principle #1Segmentation

Solution Approach 2:

The patent applies partial action by recording only the necessary deterministic operations rather than all operations. This selective recording reduces the replay workload and improves replay speed while still ensuring deterministic behavior for the critical deterministic portions of the program execution.

Inventive Principle:
Principle #16Partial or excessive action

3Reliability

If the virtual machine re-executes operations during replay, then deterministic behavior is achieved, but flexibility for debugging is reduced

Engineering Contradiction:
Improvedeterministic behaviorVSAvoiddebugging flexibility
Core Design Contradiction:
ReliabilityVSAdaptability or versatility

Solution Approach 1:

The patent makes the replay process dynamic by allowing the virtual machine to switch between re-execution and simulation modes based on operation type. Deterministic operations are re-executed for accuracy, while non-deterministic operations are simulated to allow debugging interventions. This dynamic approach maintains determinism where needed while providing flexibility for debugging.

Inventive Principle:
Principle #15Dynamics

Solution Approach 2:

The patent introduces an intermediary layer (the replay core with bytecode instrumentation) that mediates between the recorded operations and the virtual machine execution. This intermediary identifies deterministic operations, manages their re-execution, and handles non-deterministic operations through simulation, allowing debugging flexibility without compromising deterministic behavior.

Inventive Principle:
Principle #24Intermediary (Mediator)

4Adaptability or versatility

If non-deterministic operations are simulated rather than re-executed, then replay flexibility is improved, but ensuring determinism becomes more difficult

Engineering Contradiction:
Improvedebugging flexibilityVSAvoiddeterminism
Core Design Contradiction:
Adaptability or versatilityVSReliability

Solution Approach 1:

The patent extracts and identifies deterministic operations from the mixed stream of operations. By using bytecode instrumentation and analysis, the system separates deterministic operations that can be recorded and replayed from non-deterministic operations that require simulation, reducing the quantity of recorded data while maintaining determinism.

Inventive Principle:
Principle #2Taking out (Extraction)

Solution Approach 2:

The patent introduces an intermediary layer (the replay core with bytecode instrumentation) that mediates between the recorded operations and the virtual machine execution. This intermediary identifies deterministic operations, manages their re-execution, and handles non-deterministic operations through simulation, allowing debugging flexibility without compromising deterministic behavior.

Inventive Principle:
Principle #24Intermediary (Mediator)

Data Source

PatentUS10585796B2Ensuring determinism during programmatic replay in a virtual machine
Publication Date: 2020.03.10 CA TECH INC
  • US10585796B2 patent drawing
  • US10585796B2 patent drawing
  • US10585796B2 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.