Skip to content

VS Code could show more helpful UI for infinite loops and recursions in user code (QIR generation) #2661

@minestarks

Description

@minestarks

Partial evaluation, and therefore QIR generation, is inherently susceptible to infinite loops and out-of-memory conditions since we're executing user code. So we can't prevent these fully.

However, the way these conditions are surfaced in the UI is not helpful. It looks like a bug in the extension, rather than a problem in the user code. I think we can do better by catching some of these fatal conditions and wrap them in a more helpful user message that tells them what to look for.

(If we wanted to get fancy, we can emit warnings from the evaluator itself if we detect that no progress is being made, but that would be pretty fancy. This issue is just about the UI.)

Current UI:

infinite loops (after a rather long timeout):

while 0 == 0 {}
Image

infinite recursion in classical functions:

function Foo() : Unit {
    Foo();
}
image

infinite recursion in operations:

operation Foo() : Unit {
    Foo();
}
image

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions