Runtime-Declared Asynchronous State Machines for Compact Intermediate Code

Resolve Bottlenecks,
Find Innovative Solutions
Generate Solutions

Solution Overview

Problem

Existing methods for representing asynchronous functionality in intermediate code result in larger code sizes, leading to increased bandwidth requirements and longer download times, as the runtime compiler lacks visibility into the asynchronous functions and cannot optimize performance effectively.

Innovation Solution

The runtime compiler declares the asynchronous state machine, rather than the source code language compiler, allowing for smaller intermediate code and enabling optimization specific to the environment.

Engineering Contradictions & Design Principles

VSEngineering Contradiction Analysis

1Reliability

If the source code language compiler declares the asynchronous state machine, then the asynchronous functionality is correctly implemented, but the intermediate code size increases leading to larger bandwidth requirements and longer download times

Engineering Contradiction:
Improveasynchronous functionality implementationVSAvoidintermediate code size
Core Design Contradiction:
ReliabilityVSWeight of stationary object

Solution Approach 1:

The patent extracts the asynchronous state machine declaration from the source code language compiler and relocates it to the runtime compiler. This separation allows the intermediate code to contain only minimal representations of asynchronous functions, while the detailed state machine logic is generated later by the runtime compiler, thereby reducing intermediate code size without compromising asynchronous functionality implementation

Inventive Principle:
Principle #2Taking out (Extraction)

Solution Approach 2:

The source code language compiler performs preliminary processing by identifying asynchronous functions and creating placeholder representations in the intermediate code, but defers the actual state machine generation to the runtime compiler. This preliminary action reduces intermediate code size while ensuring asynchronous functionality is preserved through the placeholder mechanisms

Inventive Principle:
Principle #10Preliminary action

2Productivity

If the source code language compiler declares the asynchronous state machine, then the asynchronous code is compiled, but the runtime compiler cannot optimize performance specific to the execution environment

Engineering Contradiction:
Improveasynchronous code compilationVSAvoidenvironment-specific optimization
Core Design Contradiction:
ProductivityVSAdaptability or versatility

Solution Approach 1:

The patent segments the compilation process into two distinct phases: the source code language compiler handles high-level asynchronous function identification and intermediate code generation, while the runtime compiler handles environment-specific state machine generation and optimization. This segmentation allows each compiler to focus on its strengths, maintaining productivity while enabling environment-specific adaptations

Inventive Principle:
Principle #1Segmentation

Solution Approach 2:

The patent introduces dynamic state machine generation at runtime, where the runtime compiler creates optimized state machines tailored to the specific execution environment. This dynamic approach allows the system to adapt asynchronous functionality to different runtime conditions, improving both productivity and environment-specific optimization capability

Inventive Principle:
Principle #15Dynamics

3Reliability

If the intermediate code contains complete asynchronous state machine representations, then the asynchronous behavior is preserved, but the code delivery efficiency decreases due to larger size

Engineering Contradiction:
Improveasynchronous behavior preservationVSAvoidcode download time
Core Design Contradiction:
ReliabilityVSLoss of time

Solution Approach 1:

The patent uses placeholder copies in the intermediate code that reference the actual asynchronous state machines to be generated at runtime. Instead of embedding complete state machine representations in the intermediate code, the system creates lightweight references that point to runtime-generated equivalents, thereby preserving asynchronous behavior while minimizing intermediate code size and download time

Inventive Principle:
Principle #26Copying

Data Source

PatentEP4196874B1Representing asynchronous state machine in intermediate code
Publication Date: 2025.10.29 MICROSOFT TECHNOLOGY LICENSING LLC
  • EP4196874B1 patent drawingFigure 1
  • EP4196874B1 patent drawingFigure 2
  • EP4196874B1 patent drawingFigure 3

AI summary

Representing asynchronous functionality in intermediate code, and then having the runtime compiler, rather than the source code language compiler, declare the corresponding asynchronous state machine. This allows the size of the intermediate code to be smaller thereby facilitating more efficient delivery of the code to end users. Furthermore, the runtime compiler can now use its optimization capability to optimize performance of the asynchronous functionality specific to the actual environment in which the asynchronous work will operate.