State based correction mechanism for code transformation using generative artificial intelligence
The dynamic agent planning and GenAI-powered approach in code transformation systems addresses the inefficiencies of linear execution by allowing backward navigation and path exploration, ensuring effective and resource-efficient transformation processes.
Patent Information
- Application Number
- US19/216466
- Authority / Receiving Office
- US · United States
- Patent Type
- Applications(United States)
- Current Assignee / Owner
- Filing Date
- 2025-05-22
- Publication Date
- 2026-11-26
AI Technical Summary
Existing code transformation systems often get stuck in local minima during complex tasks, leading to inefficient use of computational resources and incomplete transformations due to their linear, forward-only execution approach, which fails to account for potential alternative paths to resolve errors.
Implementing a dynamic agent planning and execution mechanism that allows for backward navigation and uses generative artificial intelligence (GenAI) models to generate multiple paths and strategically backtrack when encountering local minima, leveraging a state tracker and multi-agentic workflow to explore alternative solutions.
Enables efficient and complete code and platform transformations by dynamically navigating through potential paths, reducing computational waste and ensuring successful completion of transformation tasks.
Smart Images

Figure US20260377158A1-D00000_ABST
Abstract
Description
BACKGROUND
[0001] Code transformation is the process of transforming code (e.g., source code) from a first format or version to a second format or version. In many cases the transformed code is semantically equivalent to the original code. While code transformations may be performed manually, it is more common to use software to transform code.BRIEF DESCRIPTION OF DRAWINGS
[0002] Various examples in accordance with the present disclosure will be described with reference to the drawings, in which:
[0003] FIG. 1 illustrates examples of support for a code transformation service.
[0004] FIG. 2 illustrates examples of aspects of code transformation service.
[0005] FIG. 3 illustrates examples of a plan tree.
[0006] FIG. 4 illustrates examples of transformation state machine functions.
[0007] FIG. 5 illustrates examples of transformation state machine using agents and / or tools.
[0008] FIG. 6 illustrates examples of a state tracker.
[0009] FIG. 7 is a flow diagram illustrating operations of a method for transforming code according to some examples.
[0010] FIG. 8 illustrates examples of forward and backward error handling.
[0011] FIG. 9 illustrates an example provider network environment according to some examples.
[0012] FIG. 10 is a block diagram of an example provider network that provides a storage service and a hardware virtualization service to users according to some examples.
[0013] FIG. 11 is a block diagram illustrating an example computing device that can be used in some examples.DETAILED DESCRIPTION
[0014] The present disclosure relates to methods, apparatus, systems, and non-transitory computer-readable storage media for code transformation using generative artificial intelligence.
[0015] Existing transformation systems allow one to discover, plan, and execute migration and modernization jobs for legacy applications running on-premises or in the cloud. In some existing transformation services, an agent gets a user specified objective and performs planning to get a job plan that is a sequence of steps to achieve the objective. In some examples, an agent is a task-specific service that executes a specific transformation type. The agent will then execute the job plan step-by-step. If all of the steps are executed, then the job plan is successful.
[0016] If one of the steps cannot be executed, then the job plan fails, and the job will either be run again or the job plan will be modified and the modified job plan will be run again from the start. In this process, there are some clear limitations. For example, the current code transformation agents typically execute tasks in a linear, forward-only sequence. Once an agent commits to a path, it can only move forward or restart completely. Getting stuck in local minima is common, especially for complex tasks, and this results in complete restarts. This not only wastes computational resources (especially those that are shared in a provider network environment) but may not even allow for the transformation to be completed.
[0017] Examples detailed herein use dynamic agent planning and execution mechanism that enables dynamic backward navigation during execution when progress stalls. For example, the backward navigation allows for the process to escape local optimization minima. In some examples, one or more agents generate an initial sequence of job steps for transformation, execute steps while maintaining execution state, detect potential local minima, and strategically return to previous execution points to explore alternative solution paths when there are potential local minima.
[0018] When performing code and / or platform transformation there may be many different potential paths to fix errors occurred during the transformation process. This means that it can be tough to find the correct path (which has a collection of sub-paths) that fixes errors and some sub-paths may even introduce new errors. With so many paths, performing techniques such as random path initialization to escape local minima are computationally inefficient and do not account for the errors that could be caused by the random paths. The examples detailed herein use the historical exploration of sub-paths to help empirically determine which paths to eliminate when there is a stall and use a reward to determine which path(s) to explore when there is not a stall.
[0019] FIG. 1 illustrates examples of support for a code and / or platform transformation. In some examples, code and / or platform transformation is supported by one or more of a transformation service 114(A) of a conversational agent service 110, a standalone transformation service 114(B), and / or transformation software 114(C) of a non-provider network device 150. These transformation approaches generate a plan that is to be executed step-by-step to transform code, a platform (such as an operating system image), and / or correct errors from a previous transformation using one or more of agents, tools, and / or human input. When the plan gets stuck (e.g., a step cannot be resolved), then the code and / or platform transformation approaches allow for a restart of the plan but using a different path of potential solutions to resolving the steps of the plan.
[0020] Some of the agents used for the transformation use generative artificial intelligence (GenAI) models. In some examples, a generative artificial intelligence (GenAI) model is used to create multiple steps (and therefore plan variants) for the task. In some examples, a GenAI model is a language model that is a type of artificial intelligence (AI) model trained on textual or visual data to generate coherent and contextually relevant text. A “large” language model refers to a language model that has been trained on an extensive dataset and has a high number of parameters, enabling them to capture complex language patterns and perform a wider range of tasks. Large language models are designed to handle a wide range of natural language processing tasks, such as text completion, translation, summarization, and even conversation. The specific parameter count required for a model to be considered a “large” language model can vary depending on context and technological advancements. However, traditionally, large language models have millions to billions of parameters. GenAI models may be foundation models (which may be provided by foundation model service(s) 120), custom models, etc. In some examples, the models are not provided by the provider network (e.g., models 152).
[0021] Code and / or a platform to be transformed may be stored using a storage service 140 (e.g., code and / or platform 142) and / or stored externally to a provider network using code storage 154. Similarly, transformed code and / or platform may be stored using storage 154 and / or storage service(s) 140.
[0022] The conversational agent service 110 is GenAI-powered assistant. The conversational agent service 110 allows users to have conversations, solve problems, generate content, gain insights, and take action by connecting to information repositories, code, data, and enterprise systems.
[0023] Other services 130 such as identity and access management, model training, model hosting, managed compute services, etc. may be supported.
[0024] The provider network 100 (also referred to herein as a provider network, service provider network, etc.) provides users with the ability to use one or more of a variety of types of computing-related resources such as compute resources (e.g., executing virtual machine (VM) instances and / or containers, executing batch jobs, executing code without provisioning servers), data / storage resources (e.g., object storage, block-level storage, data archival storage, databases and database tables, etc.), network-related resources (e.g., configuring virtual networks including groups of compute resources, content delivery networks (CDNs), Domain Name System (DNS)), application resources (e.g., databases, application build / deployment services), access policies or roles, identity policies or roles, machine images, routers and other data processing resources, etc. These and other computing resources can be provided as services, such as a hardware virtualization service that can execute compute instances, a storage service that can store data objects, etc. The users (or “customers”) of provider networks 100 can use one or more user accounts that are associated with a customer account, though these terms can be used somewhat interchangeably depending upon the context of use. Provider networks are sometimes “multi-tenant” as they can provide services to multiple different customers using the same physical computing infrastructure; for example, virtual machine instances may be concurrently hosted for different customers using a same underlying physical host computing device.
[0025] Users can interact with a provider network 100 across one or more intermediate networks 106 (e.g., the internet) via one or more interface(s) using device(s) 150, such as through use of application programming interface (API) calls, via a console implemented as a website or application, etc. An API refers to an interface and / or communication protocol between a client and a server, such that if the client makes a request in a predefined format, the client should receive a response in a specific format or initiate a defined action. In the provider network context, APIs provide a gateway for customers to access infrastructure by allowing customers to obtain data from or cause actions within the provider network, enabling the development of applications that interact with resources and services hosted in the provider network. APIs can also enable different services of the provider network to exchange data with one another. The interface(s) can be part of, or serve as a front-end to, a control plane of the provider network 100 that includes “backend” services supporting and enabling the services that can be more directly offered to customers.
[0026] Thus, a provider network typically refers to a large pool of accessible virtualized computing resources (such as compute, storage, and networking resources, applications, and services). A provider network can provide convenient, on-demand network access to a shared pool of configurable computing resources that can be programmatically provisioned and released in response to customer commands. These resources can be dynamically provisioned and reconfigured to adjust to variable load. Provider network computing can thus be considered as both the applications delivered as services over a publicly accessible network (e.g., the Internet, a cellular communication network) and the hardware and software in cloud provider data centers that provide those services.
[0027] A provider network can be formed as a number of regions, where a region is a geographical area in which the provider clusters data centers. Each region includes multiple (e.g., two or more) availability zones (AZs) connected to one another via a private high-speed network, for example a fiber communication connection. An AZ (also known as a “zone”) provides an isolated failure domain including one or more data center facilities with separate power, separate networking, and separate cooling from those in another AZ. A data center refers to a physical building or enclosure that houses and provides power and cooling to servers of the provider network. Preferably, AZs within a region are positioned far enough away from one another so that a natural disaster (or other failure-inducing event) should not affect or take more than one AZ offline at the same time.
[0028] Users can connect to an AZ of the provider network via a publicly accessible network (e.g., the Internet, a cellular communication network), e.g., by way of a transit center (TC). TCs are the primary backbone locations linking users to the provider network and can be collocated at other network provider facilities (e.g., Internet service providers (ISPs), telecommunications providers) and securely connected (e.g., via a VPN or direct connection) to the AZs. Each region can operate two or more TCs for redundancy. Regions are connected to a global network which includes private networking infrastructure (e.g., fiber connections controlled by the provider) connecting each region to at least one other region. The provider network can deliver content from points of presence (or “POPs”) outside of, but networked with, these regions by way of edge locations and regional edge cache servers. This compartmentalization and geographic distribution of computing hardware enables the provider network to provide low-latency resource access to users on a global scale with a high degree of fault tolerance and stability.
[0029] To provide these and other computing resource services, provider networks 100 often rely upon virtualization techniques. For example, virtualization technologies can provide users the ability to control or use compute resources (e.g., a “compute instance,” such as a VM using a guest operating system (O / S) that operates using a hypervisor that might or might not further operate on top of an underlying host O / S, a container that might or might not operate in a VM, a compute instance that can execute on “bare metal” hardware without an underlying hypervisor), where one or multiple compute resources can be implemented using a single electronic device. Thus, a user can directly use a compute resource (e.g., provided by a hardware virtualization service) hosted by the provider network to perform a variety of computing tasks. Additionally, or alternatively, a user can indirectly use a compute resource by submitting code to be executed by the provider network (e.g., via an on-demand code execution service), which in turn uses one or more compute resources to execute the code-typically without the user having any control of or knowledge of the underlying compute instance(s) involved.
[0030] As described herein, one type of service that a provider network may provide may be referred to as a “managed compute service” that executes code or provides computing resources for its users in a managed configuration. Examples of managed compute services include, for example, an on-demand code execution service, a hardware virtualization service, a container service, or the like.
[0031] An on-demand code execution service (referred to in various examples as a function compute service, functions service, provider network functions service, functions as a service, or serverless computing service) can enable users of the provider network 100 to execute their code on provider network resources without having to select or manage the underlying hardware resources used to execute the code. For example, a user can use an on-demand code execution service by uploading their code and use one or more APIs to request that the service identify, provision, and manage any resources required to run the code. Thus, in various examples, a “serverless” function can include code provided by a user or other entity—such as the provider network itself—that can be executed on demand. Serverless functions can be maintained within the provider network by an on-demand code execution service and can be associated with a particular user or account or can be generally accessible to multiple users / accounts. A serverless function can be associated with a Uniform Resource Locator (URL), Uniform Resource Identifier (URI), or other reference, which can be used to invoke the serverless function. A serverless function can be executed by a compute resource, such as a virtual machine, container, etc., when triggered or invoked. In some examples, a serverless function can be invoked through an application programming interface (API) call or a specially formatted HyperText Transport Protocol (HTTP) request message. Accordingly, users can define serverless functions that can be executed on demand, without requiring the user to maintain dedicated infrastructure to execute the serverless function. Instead, the serverless functions can be executed on demand using resources maintained by the provider network 100. In some examples, these resources can be maintained in a “ready” state (e.g., having a pre-initialized runtime environment configured to execute the serverless functions), allowing the serverless functions to be executed in near real-time.
[0032] A hardware virtualization service (referred to in various implementations as an elastic compute service, a virtual machines service, a computing provider network service, a compute engine, or a provider network compute service) can enable users of the provider network 100 to provision and manage compute resources such as virtual machine instances. Virtual machine technology can use one physical server to run the equivalent of many servers (each of which is called a virtual machine), for example using a hypervisor, which can run at least partly on an offload card of the server (e.g., a card connected via PCI or PCIe to the physical CPUs) and other components of the virtualization host can be used for some virtualization management components. Such an offload card of the host can include one or more CPUs that are not available to user instances, but rather are dedicated to instance management tasks such as virtual machine management (e.g., a hypervisor), input / output virtualization to network-attached storage volumes, local migration management tasks, instance health monitoring, and the like). Virtual machines are commonly referred to as compute instances or simply “instances.” As used herein, provisioning a virtual compute instance generally includes reserving resources (e.g., computational and memory resources) of an underlying physical compute instance for the client (e.g., from a pool of available physical compute instances and other resources), installing or launching required software (e.g., an operating system), and making the virtual compute instance available to the client for performing tasks specified by the client.
[0033] Another type of managed compute service can be a container service, such as a container orchestration and management service (referred to in various implementations as a container service, provider network container service, container engine, or container provider network service) that allows users of the provider network to instantiate and manage containers. In some examples the container service can be a Kubernetes-based container orchestration and management service (referred to in various implementations as a container service for Kubernetes, Azure Kubernetes service, IBM provider network Kubernetes service, Kubernetes engine, or container engine for Kubernetes). A container, as referred to herein, packages up code and all its dependencies so an application (also referred to as a task, pod, or cluster in various container services) can run quickly and reliably from one computing environment to another. A container image is a standalone, executable package of software that includes everything needed to run an application process: code, runtime, system tools, system libraries and settings. Container images become containers at runtime. Containers are thus an abstraction of the application layer (meaning that each container simulates a different software application process). Though each container runs isolated processes, multiple containers can share a common operating system, for example by being launched within the same virtual machine. In contrast, virtual machines are an abstraction of the hardware layer (meaning that each virtual machine simulates a physical machine that can run software). While multiple virtual machines can run on one physical machine, each virtual machine typically has its own copy of an operating system, as well as the applications and their related files, libraries, and dependencies. Some containers can be run on instances that are running a container agent, and some containers can be run on bare-metal servers, or on an offload card of a server.
[0034] A virtual private cloud (VPC) (also referred to as a virtual network (VNet), virtual private network, or virtual cloud network, in various implementations) is a custom-defined, virtual network within another network, such as a cloud provider network. A VPC can be defined by at least its address space, internal structure (e.g., the computing resources that comprise the VPC, security groups), and transit paths, and is logically isolated from other virtual networks in the cloud. A VPC can span all of the availability zones in a particular region.
[0035] A VPC can provide the foundational network layer for a cloud service, for example a compute cloud or an edge cloud, or for a customer application or workload that runs on the cloud. A VPC can be dedicated to a particular customer account (or set of related customer accounts, such as different customer accounts belonging to the same business organization). Customers can launch resources, such as compute instances, into their VPC(s). When creating a VPC, a customer can specify a range of IP addresses for the VPC in the form of a Classless Inter-Domain Routing (CIDR) block. After creating a VPC, a customer can add one or more subnets in each availability zone or edge location associated with its region.
[0036] FIG. 2 illustrates examples of aspects of transformation service. A plan generator 202 decomposes a job into a plan sequential steps to be performed to complete the job as a plan tree 204. Each step is defined with input(s), output(s), and success criteria. FIG. 3 illustrates examples of a plan tree. The plan tree 204 has a plurality of steps (step 0302, step 1312, step 2322, and step 3332) with each step having at least one potential action(s) to take (e.g., step 0 potential action(s) 1304, step 0 potential action(s) 2306, and step 0 potential action(s) 3308) with each potential action(s) being a potential solution for a step. In some examples, not all potential action(s) are to be explored initially but merely identified. A grouping of potential action(s) from one step to another forms a path. For example, step 0—potential actions 304 followed by step 1—potential actions 2 forms a part of a path.
[0037] The plan tree 204 is executed, step-by-step, using plan execution logic 206. In some examples, the plan execution logic 206 includes one or more transformation state machines (TSMs) 207 and / or agents 208. TSMs 207 help with debugging and migration (e.g., at the whole code repository level). In a TSM framework, every debugging step is represented as a code-state (or state) which contains all the code in a repository, with a set of associated errors (compilation, run time, or logical errors) as attributes. In particular, in some examples, the set of (compilation, run time, and logical) errors associated with a state is called a task.
[0038] In some examples, one or more tools 209 may be used to perform a step. Examples of tools may include one or more of automated code review tools, code generation tools, language translation tools (e.g., to translate a natural language of the source code, etc.), prompt generation tools, etc.
[0039] In some examples, the execution of a step includes receiving and considering human input.
[0040] The initial state S0 is the state before TSM(s) 207 perform(s) any action. That is the code is the initial code and there are no errors or failed tests. A final state SØ occurs when there is an empty set of errors or when a set amount of time has passed. An action that is associated with a state is a modification of the source code in the repository.
[0041] A goal of the plan is to move from Soto SØ with an empty set of errors. In some examples, the TSM(s) 207 iteratively progresses over the states (forward) and uses an online reward mechanism to select the candidate next states. For example, the next state selection may be written as follows:xt+1=Ft(xt,ut),yt=O(xt)where xt is the state and represents the code files in the project, yt is the observation from the code xt such as an output of a compiler, run results of unit tests, metrics output from a static database, etc. using a deterministic operation O. The input ut is usually crafted from the observations such as a particular error to be solved. The time-varying operator Ft yields the next state xt+t. The TSM(s) 207 terminates either when the output yt reaches a desired value such as no build errors, all tests have passed, or t>T for some fixed time threshold.In some examples, the TSM(s) 207 has one or more functions. FIG. 4 illustrates examples of TSM functions. As shown, one function is the refinement of candidate next states. Note that in some examples, when a TSM is running, there may be error generated during a step and those errors are carried forward to be solved in the next step along with unsolved errors. A local-global exploration is used to take care of global tasks and not just local tasks that are being solved. A retrospection function allows a forward-backward thinking data structure to reset the TSM in case of dead ends. For example, if the TSM has stayed long on some errors, the history is traced back and the TSM is reset to the parent of a dead-lock error. A more detailed description of examples of retrospection are detailed later. These functions align with Monte Carlo tree search.In some examples, the TSM(s) 207 maintain(s) a state environment which is the primary shared resource across the system. The environment may constitutes of modules such as a space explorer to find the next possible states to visit (e.g., step analyzer 210), a state clock to maintain a multi-dimensional timeline of various events in the system such as GenAI calls as well as time-point of critical events of every tasks (e.g., the state clock provides timestamps for when a checkpoint is generated), a reward module that maintains another data structure of efforts spent on every task in the system (e.g., reasoning 212) (in some examples, rewards are computed online for each transition upon a query based on the collected statistics of the task history in the TSM), a state tracker 214 that collects snapshot of each transition St→St+1 as well as relevant data such as a timestamp, reward data-structures, and others. The state tracker 214 comprises of “forward” which accumulates the data-structures visited by different states / explore space and “retrospection” which records newly created tasks in the system.
[0044] In some examples, the TSM(s) 207 utilizes a plurality of agents. FIG. 5 illustrates examples of TSM using agents. An orchestrator layer 501 uses an orchestrator to query a task-complexity from the state tracker 214 and, based on the obtained information, to create a hierarchy of meta-agents (of meta-agents layer 503). The meta-agents themselves call individual agents and / or tools (shown as a part of agents and / or tools layer 505) (e.g., from an agent hub that is a collection of created agents) to perform a specific task and then release them to be used by another meta-agent. Doing so, the agents and / or tools layer 505 stays constant in size, while meta-agents layer 503 flexes. In some examples, tools are attached to agents by default. In some examples, tools are independent from agents.
[0045] In some examples, one or more of the agents of the agents and / or tools layer 505 are subjected to one or more policies and / or rules. These policies and / or rules restrict what an agent can do and / or dictate how a result from the agent are to be delivered.
[0046] In some examples, an agent is to follow a “greedy” policy and / or rule and report a result as it is predicted. In some examples, an agent is to follow an “optimal” policy and / or rule and wait to provide a result until more results are ready. In some examples, all results need to be ready before providing a result. In some examples, the use of policies and / or rules can significantly reduce model usage.
[0047] In some examples, there are several different kinds of agents 208. In some examples, a zero-shot reasoner agent (Za) is a GenAI-powered agent (LLM-powered) is a zero-shot reasoner which solves a task of code-debugging by directly producing code-fixes from the provided information such as code / project files, knowledge, etc.
[0048] In some examples, a plan-generation agent (PGa) is a GenAI-powered agent that generates diverse and detailed plans for solving a code-debugging problem.
[0049] In some examples, a plan-execution agent (PEa) is a GenAI-powered agent that takes a plan to solve a code-debugging task and develops code fixes for the plan.
[0050] In some examples, a self-reflection agent (SRa) is a GenAI-powered agent that summarizes agent actions and records the summary to be provided upon queried by any other agent. This agent can be called to generate a summary of any agentic-attempt (unplanned, or plan-based). In some examples, a summary is called a checkpoint. In some examples, the SRa maintains state tracker 214 of a plurality of check points. FIG. 6 illustrates examples of a state tracker. As shown, according to some embodiments, a checkpoint includes state, a listing of unexplored paths, timestamp information, reward information, graph information, and metrics. In this example, a checkpoint 0610 is generated when step 0 has been completed. This checkpoint 610 includes the state 612 at the time of completion of the step, an indication of which paths were unexplored 614 for this step (these paths may need to be explored later if there are issues with subsequent steps that cannot be resolved because of the path that was used to solve the step 0), timestamp information 617, reward information 618 (e.g., rt+Δrt), and metric(s) 616 (e.g., accuracy, loss, AUC, ROC, F1 score (precision and / or recall), error, one or more graphs 619 (e.g., error dependency, step artifact, substep artifact, etc.), etc.
[0051] This checkpoint 610 is maintained as subsequent checkpoints are generated such as checkpoint N 620 with state 622, unexplored path(s) 624, timestamp information 627, reward information 628, one or more graphs 629 (e.g., error dependency, step artifact, substep artifact, etc.), and metrics 626. A checkpoint for a given step may be used to restore a state for execution using an unexplored path. In some examples, the state of a checkpoint includes one or more of an error dependency graph (errors may have dependencies and relationships that need to be taken into account to properly backtrack), a step produced artifacts dependency graph, and / or a substep produced artifacts dependency graph (this may allow for not going back to a previous step, but going back to a previous substep).
[0052] In some examples, failed attempt(s) information 630 is maintained. This may include an indication of what path(s) lead to a failure. In some examples, this information is updated when an agent gets stuck. If checkpoints are deleted upon a “rollback” (e.g., all of the checkpoints between the failed point and at what point the GenAI determines the rollback should be to, then the failed attempts information 630 may be used to ensure that the same failure(s) are not repeated.
[0053] In some examples, the orchestrator agent (Oa) is a knowledge-powered agent that creates a dynamic workflow of the task assignment to different agents (e.g., PEa, PGa, SRa, and / or Za), collects their outputs, and then makes a decision about code-state transition based on a reward model. Note that the Oa agent dictates the state transitions, i.e., Xt→Xt+1 in some examples.
[0054] In some examples, the TSM(s) 207 uses a dynamic (time-varying) multi-agentic workflow as a realization of Ft which uses an online reward mechanism rt(xt, xt+1) to rank potential next states (steps) as follows: Ft:O(xt,ut)→A,A⊆AhAi(xt,ut)→xt+1k,k=0,… ,Ki-1,∀Ai∈Axt+1=arg maxxrt(xt,xt+1i)rt+1←rt+Δrt where Ah is the agent hub comprising pre-initiated agents Ai. Each agent Ai takes an input state xt and outputs a set of Ki candidate(s) for the next state xt+1. In some examples, the agent A is GenAI-powered or knowledge-powered. An orchestrator agent O analyzes the current state of the code, historical observation-based input, and uses a time-varying online scoring mechanism to select a subset of agents A from agent hub Ah to work on the current state. In some examples, an online reward model rt is a history based reward function used to assign scores to the obtained candidate next states xt+1i accumulated across agents and a best candidate is chosen. The reward is updated (using Δrt) after next-state selection based on agent exploration of the state space. In some examples, the reward is a reward function.In some examples, a retrospection recursive reasoner agent (RRRa) (e.g., reasoning 212) is a knowledge-powered agent that acts as a policing agent over the Oa agent and tracks its workflow. In some examples, the RRRa identifies when an agent is stuck. An agent may be stuck when there are repeated similar actions with no progress, there are diminishing returns in results, and / or there are circular patterns in execution. In some examples, this determination performed by detecting a local minimum.In some examples, knowledge-powered means the agent's main action is influenced by human engineering. In some examples, GenAI-powered means the agent's main action is performed by a GenAI model. In some examples, the RRRa utilizes a GenAI model along with knowledge to determine when an agent is stuck.
[0057] If the decisions made by the Oa agent Xt→Xt+1 . . . →Xm are such that they are not making any progress, the RRRa agent takes the authority from the Oa agent. Next, the RRRa retrospects into the inadequately made previous decisions by Oa. The RRRa works backward R(xt)→xt−m, m>0 and takes the “next-state” to a previously visited state xt−m. Afterwards, the RRRa collects a chain of bad decisions, goes back in time and resets the memory of Oa, and finally instructs the Oa to create different solutions avoiding a “deny code-states” list. The RRRa restores the system to a previous state while preserving learned information. This enables the exploration of alternative paths from that point and should prevent repetitions of known unsuccessful approaches.
[0058] In some examples, blind exploration is used instead of the reward model. For example,
[0059] FIG. 7 is a flow diagram illustrating operations of a method for transforming code according to some examples. Some or all of the operations (or other processes described herein, or variations, and / or combinations thereof) are performed under the control of one or more computing devices configured with executable instructions, and are implemented as code (e.g., executable instructions, one or more computer programs, or one or more applications) executing collectively on one or more processors. The code is stored on a computer-readable storage medium, for example, in the form of a computer program comprising instructions executable by one or more processors. The computer-readable storage medium is non-transitory. In some examples, one or more (or all) of the operations are performed by the transformation service 114 of the other figures.
[0060] A request to transform code and / or platform is received at 700. In some examples, the request includes one or more of a natural language description of the transformation, an identifier of a location of the code to transform, an identifier of a location to store transformed code, a selection of the transformation to be performed, etc. Examples of transformations may include one or more of mainframe code transformation, transforming code from a first language (e.g., COBOL) to a second language (e.g., JAVA), transforming code from a first version to a second version (e.g., from JAVA version 8 to JAVA version 17), transforming from a first virtual machine environment to a second virtual machine environment (e.g., from a first provider network to a second provider network), platform transformation (e.g., from an OS image for use on premise to an OS image for use in a provider network), etc.
[0061] In some examples, an initial transformation is performed in a target build environment at 701. For example, if the request is to transform code from JAVA version 8 to JAVA version 17, a build environment for JAVA 17 is created and an initial transformation occurs. Issues may include changes to configuration files, bugs caused by package changes, code may be obsolete, etc. The initial transformation is performed by one or more GenAI model or AI agents in some examples. The initial transformation is rule-based in some examples. In some examples, the initial transformation is both rule-based and GenAI based.
[0062] If there are no errors in that transformation, then nothing else needs to be done. For example, if there are no issues with transforming code from JAVA8 to JAVA 17 (e.g., the code can be run without errors) then there is no need to do anything further.
[0063] However, if there are issues, then those errors are addressed using a generated plan comprising a sequence of steps to address errors in the transformation is generated at 702. In some examples, the plan is generated using a PGa. In some examples, each step has one or more potential action(s), but not all potential action(s) and paths will be explored. In some examples, a step requires user input. In some examples, the plan is editable. For example, a user may select a different foundation model than was in the plan or provide their own model for a given task. In some examples, the plan is generated and executed using a Monte Carlo tree search. In some examples, a step solves one or more errors.
[0064] In some examples, the sequence of steps is determined, but the action(s) to be performed is dependent on the result of the previous action. In other words, the action(s) of each step is determined based on the execution of one or more preceding steps.
[0065] The plan is executed at 703. The execution is performed step-by-step but may also require backtracking to a previous point in the execution if a step stalls or generates errors that cannot be corrected. In some examples, the plan is executed using a plurality of GenAI agents.
[0066] A determination of one or more agents and / or tools to execute a step (or next step) of the plan is made at 704. For example, a Za and / or PEa of an agent pool is / are selected. Note that the step execution may also require human intervention and / or usage of one or more tools. In some examples, an orchestrator agent O analyzes the current state and input and uses a time-varying online scoring mechanism to select a subset of agents A from agent hub Ah to work on the current state. In some examples, the scoring mechanism is an online reward model.
[0067] The step of the plan is executed at 705. This execution uses the determined one or more agents, and may include tools, human intervention, etc. This execution may include several acts.
[0068] The determined one or more agents and / or tools are invoked to predict a result for the step at 706. For example, one or more Za and / or PEa are invoked. In some examples, the determined one or more agents are invoked more than once. In some examples, a tool and / or human intervention is also used in the prediction of a result. Note that a predicted result could generate an error, but that error is to be handled in a subsequent step. In some examples, an error dependency graph is maintained for errors and their dependencies. In some examples, a step produced artifacts dependency graph and / or substep produced artifacts dependency graph is maintained.
[0069] A determination of if the agent(s) and / or tool(s) completed the step is made at 708. As noted above, in some examples, a step includes defined input, output, and success criteria (e.g., one or more errors have been solved) and the success criteria is used to determine completeness. In some examples, an RRRa makes the decision on if the agent completed the step (e.g., using the success criteria, or other determination such as the detection of a local minimum).
[0070] If the agent(s) and / or tool(s) has / have not completed the step, an alternative action(s) and / or path for the step is determined, if possible, and the plan is terminated if not possible at 710. For example, the RRRa retrospects into one or more previous steps using one or more of the error dependency graph, step produced artifacts dependency graph, history (e.g., failed attempt(s) information 630), unexplored paths 614, and / or substep produced artifacts dependency graph. In some examples, the history acts as a deny-list (a list that maps failures) that maintained by the RRRa indicating when an agent cannot complete a step such that the combination of paths that lead to the failure is not repeated. Note that an error may be caused by other errors. For example, an error introduced or not solved by a parent step may cause an error for a subsequent step. Errors in the error dependency graph may also cross branches such that an error could impact several different branches (and potentially in different ways).
[0071] In some examples, when an alternative path is required, the failed attempts information 630 is updated. Note that this information is global (e.g., not a part of individual checkpoints) and accessible for all checkpoints.
[0072] In some examples, the artifacts that have been generated are output when the plan is terminated.
[0073] A state for the determined alternate path and / or action(s) is restored at 712. For example, state may be restored from a checkpoint.
[0074] When the agent has completed a checkpoint for the step is generated and stored at 714. In some examples, a SRa generates the checkpoint. Examples of contents of a checkpoint are detailed above and the updating includes updating the state information (e.g., the code (artifacts) at this point in time), metric(s) 626, the timestamp 627 for the checkpoint, the reward 628 at this point in time, one or more of the graphs 629 depending on the outcome of the step (such as updating the error dependency graph by removing errors, updating the artifact dependency graph(s) for any new, modified, or deleted artifacts, etc.), and the unexplored path(s) 624 is updated (e.g., the path that was just tried for the step is taken out of the unexplored paths(s) 624).
[0075] A determination of if all of the steps are done is made at 716. In some examples, the Oa makes this determination. In some examples, the RRRa makes this determination. If all of the steps are complete, the transformed code and / or platform is output at 718. In some examples, a part of the determination includes determining if a result of the agent(s) and / or tool(s) is viable. For example, is the result a valid result. In some examples, a validator per file type is used. In some examples, the viability is determined by comparing outputs of a plurality of agent(s) and / or tool(s) invocations.
[0076] If all of the steps are not complete, the Oa determines a next step to transition to at 717. In some examples, this determination uses a reward such as from a reward function or reward model.
[0077] FIG. 8 illustrates examples of forward and backward error handling. In some examples, this illustration is of aspects of error dependency graph. At the bottom of the figure is a first node (step) in a graph. This is the starting point after the initial transformation has been attempted. At this time, there are 12 errors. These errors may be interdependent, etc. A first error correction attempt (step 8E940E3) solves one of the 12 errors, but no other errors are solved. The next step of the plan is 7DBA31C. This is shown as a branch. At this branch, several different errors are able to be consecutively solved. In other words, several steps are performed that take the number of errors at the beginning of the branch from 11 to 3 errors.
[0078] Once this branch hits 3 errors, it cannot progress further. As shown, another branch is tried at step 7E58C03, but after several step iterations, the number of errors stalls at 3. Note that there is a reversion to a previous branch when a stall occurs. Another branch is tried at step 52A08CE which also does not progress the solution.
[0079] It is not until a branch at step 1C4FD05 is tried that the number of errors reduces from 3 to 2, at which point there is another stall.
[0080] This process of performing a step and reverting when it does not work continues until there are 0 errors or when the system reaches a termination condition (e.g., out of budget to continue). Note that when a step fails, that information is stored in failed attempt(s) information 630 to be used to exclude steps from consideration as a potential path. Additionally, as noted above, as steps are performed reward information associated with that step's execution is updated and stored as a part of a checkpoint. This reward information and exclusion of failed steps are used as a part of the prediction of which step to try next.
[0081] FIG. 9 illustrates an example provider network (or “service provider system”) environment according to some examples. In some examples, the illustrates provider network 100. A provider network 900 can provide resource virtualization to customers via one or more virtualization services 910 that allow customers to purchase, rent, or otherwise obtain instances 912 of virtualized resources, including but not limited to computation and storage resources, implemented on devices within the provider network or networks in one or more data centers. Local Internet Protocol (IP) addresses 916 can be associated with the resource instances 912; the local IP addresses are the internal network addresses of the resource instances 912 on the provider network 900. In some examples, the provider network 900 can also provide public IP addresses 914 and / or public IP address ranges (e.g., Internet Protocol version 4 (IPv4) or Internet Protocol version 6 (IPv6) addresses) that customers can obtain from the provider 900.
[0082] Conventionally, the provider network 900, via the virtualization services 910, can allow a customer of the service provider (e.g., a customer that operates one or more customer networks 950A-950C (or “client networks”) including one or more customer device(s) 952) to dynamically associate at least some public IP addresses 914 assigned or allocated to the customer with particular resource instances 912 assigned to the customer. The provider network 900 can also allow the customer to remap a public IP address 914, previously mapped to one virtualized computing resource instance 912 allocated to the customer, to another virtualized computing resource instance 912 that is also allocated to the customer. Using the virtualized computing resource instances 912 and public IP addresses 914 provided by the service provider, a customer of the service provider such as the operator of the customer network(s) 950A-950C can, for example, implement customer-specific applications and present the customer's applications on an intermediate network 940, such as the Internet. Other network entities 920 on the intermediate network 940 can then generate traffic to a destination public IP address 914 published by the customer network(s) 950A-950C; the traffic is routed to the service provider data center, and at the data center is routed, via a network substrate, to the local IP address 916 of the virtualized computing resource instance 912 currently mapped to the destination public IP address 914. Similarly, response traffic from the virtualized computing resource instance 912 can be routed via the network substrate back onto the intermediate network 940 to the source entity 920.
[0083] Local IP addresses, as used herein, refer to the internal or “private” network addresses, for example, of resource instances in a provider network. Local IP addresses can be within address blocks reserved by Internet Engineering Task Force (IETF) Request for Comments (RFC) 1918 and / or of an address format specified by IETF RFC 4193 and can be mutable within the provider network. Network traffic originating outside the provider network is not directly routed to local IP addresses; instead, the traffic uses public IP addresses that are mapped to the local IP addresses of the resource instances. The provider network can include networking devices or appliances that provide network address translation (NAT) or similar functionality to perform the mapping from public IP addresses to local IP addresses and vice versa.
[0084] Public IP addresses are Internet mutable network addresses that are assigned to resource instances, either by the service provider or by the customer. Traffic routed to a public IP address is translated, for example via 1:1 NAT, and forwarded to the respective local IP address of a resource instance.
[0085] Some public IP addresses can be assigned by the provider network infrastructure to particular resource instances; these public IP addresses can be referred to as standard public IP addresses, or simply standard IP addresses. In some examples, the mapping of a standard IP address to a local IP address of a resource instance is the default launch configuration for all resource instance types.
[0086] At least some public IP addresses can be allocated to or obtained by customers of the provider network 900; a customer can then assign their allocated public IP addresses to particular resource instances allocated to the customer. These public IP addresses can be referred to as customer public IP addresses, or simply customer IP addresses. Instead of being assigned by the provider network 900 to resource instances as in the case of standard IP addresses, customer IP addresses can be assigned to resource instances by the customers, for example via an API provided by the service provider. Unlike standard IP addresses, customer IP addresses are allocated to customer accounts and can be remapped to other resource instances by the respective customers as necessary or desired. A customer IP address is associated with a customer's account, not a particular resource instance, and the customer controls that IP address until the customer chooses to release it. Unlike conventional static IP addresses, customer IP addresses allow the customer to mask resource instance or availability zone failures by remapping the customer's public IP addresses to any resource instance associated with the customer's account. The customer IP addresses, for example, enable a customer to engineer around problems with the customer's resource instances or software by remapping customer IP addresses to replacement resource instances.
[0087] FIG. 10 is a block diagram of an example provider network environment that provides a storage service and a hardware virtualization service to users, according to some examples. In some examples, the illustrates provider network 100. A hardware virtualization service 1020 provides multiple compute resources 1024 (e.g., compute instances 1025, such as VMs) to users. The compute resources 1024 can, for example, be provided as a service to users (or “customers”) of a provider network 1000 (e.g., to a customer that implements a customer network 1050). Each computation resource 1024 can be provided with one or more local IP addresses. The provider network 1000 can be configured to route packets from the local IP addresses of the compute resources 1024 to public Internet destinations, and from public Internet sources to the local IP addresses of the compute resources 1024.
[0088] The provider network 1000 can provide the customer network 1050, for example coupled to an intermediate network 1040 via a local network 1056, the ability to implement virtual computing systems 1092 via the hardware virtualization service 1020 coupled to the intermediate network 1040 and to the provider network 1000. In some examples, the hardware virtualization service 1020 can provide one or more APIs 1002, for example a web services interface, via which the customer network 1050 can access functionality provided by the hardware virtualization service 1020, for example via a console 1094 (e.g., a web-based application, standalone application, mobile application, etc.) of a customer device 1090. In some examples, at the provider network 1000, each virtual computing system 1092 at the customer network 1050 can correspond to a computation resource 1024 that is leased, rented, or otherwise provided to the customer network 1050.
[0089] From an instance of the virtual computing system(s) 1092 and / or another customer device 1090 (e.g., via console 1094), the customer can access the functionality of a storage service 1010, for example via the one or more APIs 1002, to access data from and store data to storage resources 1018A-1018N of a virtual data store 1016 (e.g., a folder or “bucket,” a virtualized volume, a database, etc.) provided by the provider network 1000. In some examples, a virtualized data store gateway (not shown) can be provided at the customer network 1050 that can locally cache at least some data, for example frequently accessed or critical data, and that can communicate with the storage service 1010 via one or more communications channels to upload new or modified data from a local cache so that the primary store of data (the virtualized data store 1016) is maintained. In some examples, a user, via the virtual computing system 1092 and / or another customer device 1090, can mount and access virtual data store 1016 volumes via the storage service 1010 acting as a storage virtualization service, and these volumes can appear to the user as local (virtualized) storage 1098.
[0090] While not shown in FIG. 10, the virtualization service(s) can also be accessed from resource instances within the provider network 1000 via the API(s) 1002. For example, a customer, appliance service provider, or other entity can access a virtualization service from within a respective virtual network on the provider network 1000 via the API(s) 1002 to request allocation of one or more resource instances within the virtual network or within another virtual network.Illustrative Systems
[0091] In some examples, a system that implements a portion or all of the techniques described herein can include a physical general-purpose computer system, such as the electronic computing device 1100 (also referred to as a computing system or electronic device) illustrated in FIG. 11, that includes, or is configured to access, one or more computer-accessible media. In the illustrated example, the computing device 1100 includes one or more processors 1110 coupled to a system memory 1120 via an input / output (I / O) interface 1130. The computing device 1100 may further include one or more physical network interfaces 1140A-1140B coupled to the I / O interface 1130, which may be implemented by one or more network interface cards (NICs) 1142 and / or by offload card(s) 1170 described herein. While FIG. 11 shows the computing device 1100 as a single computing device, in various examples the computing device 1100 can include one computing device or any number of computing devices configured to work together as a single computing device 1100.
[0092] In various examples, the computing device 1100 can be a uniprocessor system including one processor 1110, or a multiprocessor system including several processors 1110A-1110N (e.g., two, four, eight, or another suitable number). The processor(s) 1110 can be any suitable processor(s) capable of executing instructions. For example, in various examples, the processor(s) 1110 can be general-purpose or embedded processors implementing any of a variety of instruction set architectures (ISAs), such as the x86, ARM, PowerPC, SPARC, or MIPS ISAs, or any other suitable ISA. In multiprocessor systems, each of the processors 1110 can commonly, but not necessarily, implement the same ISA.
[0093] The system memory 1120 can store instructions and data 1126 accessible by the processor(s) 1110. In various examples, the system memory 1120 can be implemented using any suitable memory technology, such as random-access memory (RAM), static RAM (SRAM), synchronous dynamic RAM (SDRAM), nonvolatile / Flash-type memory, or any other type of memory. In the illustrated example, program instructions and data implementing one or more desired functions, such as those methods, techniques, and data described above, are shown stored within the system memory 1120 as a transformation service code 1125 (e.g., executable to implement, in whole or in part, the code transformation service 114) and data 1126.
[0094] In some examples, the I / O interface 1130 can be configured to coordinate I / O traffic between the processor 1110, the system memory 1120, and any peripheral devices in the device, including the network interface(s) 1140 and / or other peripheral interfaces, such as an offload card 1170. In some examples, the I / O interface 1130 can perform any necessary protocol, timing, or other data transformations to convert data signals from one component (e.g., the system memory 1120) into a format suitable for use by another component (e.g., a processor 1110). In some examples, the I / O interface 1130 can include support for devices attached through various types of peripheral buses, such as a variant of the Peripheral Component Interconnect (PCI) bus standard or the Universal Serial Bus (USB) standard, for example. In some examples, the function of the I / O interface 1130 can be split into two or more separate components, such as a north bridge and a south bridge, for example. Also, in some examples, some or all of the functionality of the I / O interface 1130, such as an interface to the system memory 1120, can be incorporated directly into the processor(s) 1110.
[0095] The network interface(s) 1140A-1140B (or generally as 1140) can be configured to allow data to be exchanged between the computing device 1100 and other computing devices 1160 attached to a network or networks 1150, such as other computer systems or devices as illustrated in FIG. 1, for example. These other computing devices 1160 may operate within (or utilize) a same network 1150 (or set of networks) such as a cloud provider's network, or the computing device 1100 and the other computing device(s) 1160 may be geographically separate, owned or managed separately, etc., and the network 1150 may be the public internet or another network.
[0096] In various examples, network interface(s) 1140 can support communication via any suitable wired or wireless general data networks, such as types of Ethernet network. Additionally, the network interface(s) 1140 may support communication via telecommunications / telephony networks, such as analog voice networks or digital fiber communications networks, via storage area networks (SANs), such as Fibre Channel SANs, and / or via any other suitable type of network and / or protocol. In some examples, one or more network interfaces 1140A may be implemented on or by a network interface card (NIC) 1142. Alternatively, or additionally, one or more network interfaces 1140B may be implemented on or by one or more offload cards 1170.
[0097] In some examples, the computing device 1100 includes one or multiple offload cards 1170 (including one or more processors 1175, and possibly including one or more network interfaces 1140B) that are connected using an I / O interface 1130 (e.g., a bus implementing a version of the Peripheral Component Interconnect-Express (PCI-E) standard, or another interconnect such as a QuickPath interconnect (QPI) or UltraPath interconnect (UPI)).
[0098] In a cloud provider network context, offload card(s) 1170 may be deployed as dedicated hardware components that operate independently from the system main board that runs compute environments (e.g., for users or customers of the cloud provider), including code and data processing operations. Offload cards 1170 may thus implement outward-facing control interfaces used by the cloud provider to provision and manage compute, memory, and / or storage. Offload cards 1170 may also provide I / O interfaces, such as those needed to provide software-defined networking, network-backed block-level storage, instance storage, etc. Accordingly, the components that interact with the cloud provider service—whether logically inbound or outbound—may be run on these self-contained offload card computing devices that are physically separate from the system main board on which users' cloud workloads run. This separation provides various benefits, including increased overall system performance, improved security, ease of updating and management, etc.
[0099] As one example, a computing device 1100 may be deployed to act as a host electronic device (e.g., operating as part of a hardware virtualization service) that hosts compute instances (e.g., virtual machines), and the one or more offload cards 1170 may execute a virtualization manager (acting as a “controller”) that manages those compute instances that execute on the host electronic device. In some examples, the offload card(s) 1170A or 1170B may thus perform compute instance management operations, such as pausing and / or un-pausing compute instances, launching and / or terminating compute instances, performing memory transfer / copying operations, etc. Among other benefits, this arrangement can “free” up the main “host” set of processor(s) 1110—which no longer need to perform these operations—for other uses, such as executing compute instances for users, as well as improving security through isolation.
[0100] These management operations can, in some examples, be performed by the offload card(s) 1170A or 1170B in coordination with a hypervisor (e.g., upon a request from a hypervisor) that is executed by the other processors 1110A-1110N of the computing device 1100. However, in some examples, the virtualization manager implemented by the offload card(s) 1170A or 1170B can accommodate requests from other entities (e.g., from compute instances themselves), and / or may not coordinate with (or service) any separate hypervisor.
[0101] In some examples, an offload card 1170 may include one or more network interfaces 1140B (or other interfaces, such as those attached to storage devices), which may provide connectivity for compute instances hosted by the computing device 1100 to other systems, compute instances hosted by other computing devices, hardware devices, etc. An offload card 1170 may be utilized that is customized for a particular purpose, e.g., with additional hardware and / or specialized firmware applications as required for their specific functions. This can include, for example, an offload card 1170 specialized (e.g., with processors 1175 and / or software / firmware) for data encryption operations such as network traffic encryption / decryption, local or remote data storage encryption / decryption, etc. An offload card 1170 may also include specialized hardware or software for security operations, hypervisor type operations, or other operations. Thus, in various examples, zero, one, or multiple offload cards 1170 may be utilized as part of the computing device 1100.
[0102] In some examples, the system memory 1120 can be one example of a computer-accessible medium configured to store program instructions and data as described above. However, in other examples, program instructions and / or data can be received, sent, or stored upon different types of computer-accessible media. Generally, a computer-accessible medium can include any non-transitory storage media or memory media such as magnetic or optical media, e.g., disk or DVD / CD coupled to the computing device 1100 via the I / O interface 1130. A non-transitory computer-accessible storage medium can also include any volatile or non-volatile media such as RAM (e.g., SDRAM, double data rate (DDR) SDRAM, SRAM, etc.), read only memory (ROM), etc., that can be included in some examples of the computing device 1100 as the system memory 1120 or another type of memory. Further, a computer-accessible medium can include transmission media or signals such as electrical, electromagnetic, or digital signals, conveyed via a communication medium such as a network and / or a wireless link, such as can be implemented via the network interface 1140.
[0103] Various examples discussed or suggested herein can be implemented in a wide variety of operating environments, which in some cases can include one or more user computers, computing devices, or processing devices which can be used to operate any of a number of applications. User or client devices can include any of a number of general-purpose personal computers, such as desktop or laptop computers running a standard operating system, as well as cellular, wireless, and handheld devices running mobile software and capable of supporting a number of networking and messaging protocols. Such a system also can include a number of workstations running any of a variety of commercially available operating systems and other known applications for purposes such as development and database management. These devices also can include other electronic devices, such as dummy terminals, thin-clients, gaming systems, and / or other devices capable of communicating via a network.
[0104] Most examples use at least one network that would be familiar to those skilled in the art for supporting communications using any of a variety of widely available protocols, such as Transmission Control Protocol / Internet Protocol (TCP / IP), File Transfer Protocol (FTP), Universal Plug and Play (UPnP), Network File System (NFS), Common Internet File System (CIFS), Extensible Messaging and Presence Protocol (XMPP), AppleTalk, etc. The network(s) can include, for example, a local area network (LAN), a wide-area network (WAN), a virtual private network (VPN), the Internet, an intranet, an extranet, a public switched telephone network (PSTN), an infrared network, a wireless network, and any combination thereof.
[0105] In examples using a web server, the web server can run any of a variety of server or mid-tier applications, including HTTP servers, File Transfer Protocol (FTP) servers, Common Gateway Interface (CGI) servers, data servers, Java servers, business application servers, etc. The server(s) also can be capable of executing programs or scripts in response requests from user devices, such as by executing one or more Web applications that can be implemented as one or more scripts or programs written in any programming language, such as Java®, C, C# or C++, or any scripting language, such as Perl, Python, PHP, or TCL, as well as combinations thereof. The server(s) can also include database servers, including without limitation those commercially available from Oracle®, Microsoft®, Sybase®, IBM®, etc. The database servers can be relational or non-relational (e.g., “NoSQL”), distributed or non-distributed, etc.
[0106] Environments disclosed herein can include a variety of data stores and other memory and storage media as discussed above. These can reside in a variety of locations, such as on a storage medium local to (and / or resident in) one or more of the computers or remote from any or all of the computers across the network. In a particular set of examples, the information can reside in a storage-area network (SAN) familiar to those skilled in the art. Similarly, any necessary files for performing the functions attributed to the computers, servers, or other network devices can be stored locally and / or remotely, as appropriate. Where a system includes computerized devices, each such device can include hardware elements that can be electrically coupled via a bus, the elements including, for example, at least one central processing unit (CPU), at least one input device (e.g., a mouse, keyboard, controller, touch screen, or keypad), and / or at least one output device (e.g., a display device, printer, or speaker). Such a system can also include one or more storage devices, such as disk drives, optical storage devices, and solid-state storage devices such as random-access memory (RAM) or read-only memory (ROM), as well as removable media devices, memory cards, flash cards, etc.
[0107] Such devices also can include a computer-readable storage media reader, a communications device (e.g., a modem, a network card (wireless or wired), an infrared communication device, etc.), and working memory as described above. The computer-readable storage media reader can be connected with, or configured to receive, a computer-readable storage medium, representing remote, local, fixed, and / or removable storage devices as well as storage media for temporarily and / or more permanently containing, storing, transmitting, and retrieving computer-readable information. The system and various devices also typically will include a number of software applications, modules, services, or other elements located within at least one working memory device, including an operating system and application programs, such as a client application or web browser. It should be appreciated that alternate examples can have numerous variations from that described above. For example, customized hardware might also be used and / or particular elements might be implemented in hardware, software (including portable software, such as applets), or both. Further, connection to other computing devices such as network input / output devices can be employed.
[0108] Storage media and computer readable media for containing code, or portions of code, can include any appropriate media known or used in the art, including storage media and communication media, such as but not limited to volatile and non-volatile, removable and non-removable media implemented in any method or technology for storage and / or transmission of information such as computer readable instructions, data structures, program modules, or other data, including RAM, ROM, Electrically Erasable Programmable Read-Only Memory (EEPROM), flash memory or other memory technology, Compact Disc-Read Only Memory (CD-ROM), Digital Versatile Disk (DVD) or other optical storage, magnetic cassettes, magnetic tape, magnetic disk storage or other magnetic storage devices, or any other medium which can be used to store the desired information and which can be accessed by a system device. Based on the disclosure and teachings provided herein, a person of ordinary skill in the art will appreciate other ways and / or methods to implement the various examples.
[0109] In the preceding description, various examples are described. For purposes of explanation, specific configurations and details are set forth to provide a thorough understanding of the examples. However, it will also be apparent to one skilled in the art that the examples can be practiced without the specific details. Furthermore, well-known features can be omitted or simplified in order not to obscure the example being described.
[0110] Bracketed text and blocks with dashed borders (e.g., large dashes, small dashes, dot-dash, and dots) are used herein to illustrate optional aspects that add additional features to some examples. However, such notation should not be taken to mean that these are the only options or optional operations, and / or that blocks with solid borders are not optional in certain examples.
[0111] Reference numerals with suffix letters (e.g., 1018A-1018N) can be used to indicate that there can be one or multiple instances of the referenced entity in various examples, and when there are multiple instances, each does not need to be identical but may instead share some general traits or act in common ways. Further, the particular suffixes used are not meant to imply that a particular amount of the entity exists unless specifically indicated to the contrary. Thus, two entities using the same or different suffix letters might or might not have the same number of instances in various examples.
[0112] References to “one example,”“an example,” etc., indicate that the example described may include a particular feature, structure, or characteristic, but every example may not necessarily include the particular feature, structure, or characteristic. Moreover, such phrases are not necessarily referring to the same example. Further, when a particular feature, structure, or characteristic is described in connection with an example, it is submitted that it is within the knowledge of one skilled in the art to affect such feature, structure, or characteristic in connection with other examples whether or not explicitly described.
[0113] Moreover, in the various examples described above, unless specifically noted otherwise, disjunctive language such as the phrase “at least one of A, B, or C” is intended to be understood to mean either A, B, or C, or any combination thereof (e.g., A, B, and / or C). Similarly, language such as “at least one or more of A, B, and C” (or “one or more of A, B, and C”) is intended to be understood to mean A, B, or C, or any combination thereof (e.g., A, B, and / or C). As such, disjunctive language is not intended to, nor should it be understood to, imply that a given example requires at least one of A, at least one of B, and at least one of C to each be present.
[0114] As used herein, the term “based on” (or similar) is an open-ended term used to describe one or more factors that affect a determination or other action. It is to be understood that this term does not foreclose additional factors that may affect a determination or action. For example, a determination may be solely based on the factor(s) listed or based on the factor(s) and one or more additional factors. Thus, if an action A is “based on” B, it is to be understood that B is one factor that affects action A, but this does not foreclose the action from also being based on one or multiple other factors, such as factor C. However, in some instances, action A may be based entirely on B.
[0115] Unless otherwise explicitly stated, articles such as “a” or “an” should generally be interpreted to include one or multiple described items. Accordingly, phrases such as “a device configured to” or “a computing device” are intended to include one or multiple recited devices. Accordingly, phrases such as “a set of devices configured to” or “a collection of devices configured to” are intended to include one or more recited devices. Such one or more recited devices can be collectively configured to carry out the stated operations. For example, “a processor configured to carry out operations A, B, and C” can include a first processor configured to carry out operation A working in conjunction with a second processor configured to carry out operations B and C, where the second processor could be part of same computing device as the first processor or part of a separate computing device as the first processor.
[0116] Further, the words “may” or “can” are used in a permissive sense (i.e., meaning having the potential to), rather than the mandatory sense (i.e., meaning must). The words “include,”“including,” and “includes” are used to indicate open-ended relationships and therefore mean including, but not limited to. Similarly, the words “have,”“having,” and “has” also indicate open-ended relationships, and thus mean having, but not limited to. The terms “first,”“second,”“third,” and so forth as used herein are used as labels for the nouns that they precede, and do not imply any type of ordering (e.g., spatial, temporal, logical, etc.) unless such an ordering is otherwise explicitly indicated. Similarly, the values of such numeric labels are generally not used to indicate a required amount of a particular noun in the claims recited herein, and thus a “fifth” element generally does not imply the existence of four other elements unless those elements are explicitly included in the claim or it is otherwise made abundantly clear that they exist.
[0117] The specification and drawings are, accordingly, to be regarded in an illustrative rather than a restrictive sense. It will, however, be evident that various modifications and changes can be made thereunto without departing from the broader scope of the disclosure as set forth in the claims.
Claims
1. A computer-implemented method for code transformation comprising:receiving a code transformation request;generating a code transformation plan, using a first artificial intelligence agent, the code transformation plan comprising a sequence of steps for addressing errors in code transformation outputs associated with the request;processing a first step of the code transformation plan by,determining one or more agents and / or tools to execute the first step based on a current state of the code, an historical observation-based input, and a reward, andexecuting the first step using the determined one or more agents or tools; anddetermining an error that cannot be resolved by progressing to a subsequent step of the code transformation plan;returning state to a state that occurred prior to the first step;attempting step that is different than the first step from the state that occurred prior to the first step.
2. The computer-implemented method of claim 1, wherein the state to return to is based at least in part on one or more of an error dependency graph, a step produced artifacts dependency graph, or a substep produced artifacts dependency graph.
3. The computer-implemented method of claim 1, wherein the request to transform code is to transform the code from a first language to a second language.
4. A computer-implemented method comprising:receiving a request to transform code or a platform;generating a plan comprising a sequence of steps to transform the code or platform according to the request; andfor each step in the plan, until a stopping point has been reached,determining one or more agents and / or tools to execute the step based on a current state of the code, an historical observation-based input, and a reward,executing the step using the determined one or more agents or tools, anddetermining a next step of the plan to perform, wherein the next step is one of a subsequent step or a previously executed step.
5. The computer-implemented method of claim 4, further comprising: in response to determining a next step of the plan to perform is a subsequent step, generating a checkpoint based on the step.
6. The computer-implemented method of claim 5, wherein generating the checkpoint comprising identifying and recording a change to one or more of: state of the code after a step execution, a listing of unexplored sequence of steps paths, timestamp information, reward information for the step, or graph information for the step.
7. The computer-implemented method of claim 6, wherein the graph information for the step comprises one or more of an error dependency graph, a step produced artifacts dependency graph, or a substep produced artifacts dependency graph.
8. The computer-implemented method of claim 4, wherein the reward is configured to cause one or more agents and / or tools to rank potential next states and select a potential next state based on its ranking.
9. The computer-implemented method of claim 4, wherein determining a next step of the plan to perform is a previously executed step further comprises:selecting the previously executed step based on a checkpoint information associated with the previously executed step;determining an alternative step to proceed from the previously executed step.
10. The computer-implemented method of claim 4, wherein the next step is determined to be a previously executed step when the determined one or more agents and / or tools cannot finish the step.
11. The computer-implemented method of claim 4, wherein each step comprises a defined input, a defined output, and success criteria.
12. The computer-implemented method of claim 4, wherein the request to transform code is to transform code from a first version to a second version of a same language.
13. The computer-implemented method of claim 4, wherein the request to transform code is to transform code from a first language to a second language.
14. The computer-implemented method of claim 4, wherein the request to transform code is to transform code from a first virtual machine environment to a second virtual machine environment.
15. A system comprising:a first one or more computing devices to implement a storage service in a multi-tenant provider network; anda second one or more computing devices to implement a transformation service in the multi-tenant provider network, the transformation service including instructions that upon execution cause the transformation service to:receive a request to transform code or a platform stored using the storage service;generate a transformation plan, via an artificial intelligence agent, the transformation plan comprising a sequence of steps to fix errors from transforming the code or platform according to the request; andfor each step in the plan, until a stopping point has been reached,determine one or more agents or tools to execute the step based on a current state of the code, an historical observation-based input, and a reward, andexecute the step using the determined one or more agents, anddetermine a next step of the transformation plan to perform, wherein the next step is a subsequent step or a previously executed step.
16. The system of claim 15, wherein the request to transform code is to transform code from a first virtual machine environment to a second virtual machine environment.
17. The system of claim 15, wherein the request to transform code is to transform code from a first language to a second language.
18. The system of claim 15, wherein the request to transform code is to transform code from a first version to a second version of a same language.
19. The system of claim 15, wherein the next step is determined to be a previously executed step when the determined one or more agents and / or tools cannot finish the step.
20. The system of claim 19, wherein the previously executed step is determined by using a complex reasoning machine learning model that avoids previously determined bad paths and the execution of the executed step and when the previously executed step is determined a checkpoint for the previously executed state is reinstated.
