Skip to content

Track nested scopes during debugging#1442

Merged
swernli merged 2 commits into
mainfrom
swernli/issue1436
Apr 29, 2024
Merged

Track nested scopes during debugging#1442
swernli merged 2 commits into
mainfrom
swernli/issue1436

Conversation

@swernli
Copy link
Copy Markdown
Collaborator

@swernli swernli commented Apr 29, 2024

This adds new execution graph nodes for pushing and popping variable scopes that are used only while debugging (like statement nodes) so that the evaluator can correctly respond to local variable requests during debugging.

Fixes #1436

This adds new execution graph nodes for pushing and popping variable scopes that are used only while debugging (like statement nodes) so that the evaluator can correctly respond to local variable requests during debugging.

Fixes #1436
@github-actions
Copy link
Copy Markdown

Benchmark for 83102a4

Click to view benchmark
Test Base PR %
Array append evaluation 339.4±10.86µs 338.6±1.79µs -0.24%
Array literal evaluation 171.1±1.29µs 183.1±7.23µs +7.01%
Array update evaluation 419.8±8.47µs 421.7±2.78µs +0.45%
Core + Standard library compilation 18.7±0.92ms 19.0±1.10ms +1.60%
Deutsch-Jozsa evaluation 5.0±0.05ms 5.1±0.05ms +2.00%
Large file parity evaluation 33.7±0.54ms 33.8±0.69ms +0.30%
Large input file compilation 12.1±0.46ms 12.0±0.33ms -0.83%
Large input file compilation (interpreter) 48.7±1.72ms 49.0±1.97ms +0.62%
Large nested iteration 33.0±0.81ms 33.3±0.82ms +0.91%
Perform Runtime Capabilities Analysis (RCA) on Deutsch-Jozsa sample 1521.5±61.69µs 1543.3±178.06µs +1.43%
Perform Runtime Capabilities Analysis (RCA) on large file sample 8.0±0.25ms 7.9±0.18ms -1.25%
Perform Runtime Capabilities Analysis (RCA) on teleport sample 1439.5±82.58µs 1436.6±63.85µs -0.20%
Perform Runtime Capabilities Analysis (RCA) on the core and std libraries 21.7±0.30ms 21.9±0.39ms +0.92%
Teleport evaluation 80.8±4.18µs 82.9±5.07µs +2.60%

Comment thread compiler/qsc_lowerer/src/lib.rs
@swernli swernli enabled auto-merge April 29, 2024 20:26
@github-actions
Copy link
Copy Markdown

Benchmark for 7b561c4

Click to view benchmark
Test Base PR %
Array append evaluation 339.8±5.01µs 339.1±1.21µs -0.21%
Array literal evaluation 190.2±4.01µs 179.8±1.18µs -5.47%
Array update evaluation 421.1±1.56µs 420.7±1.55µs -0.09%
Core + Standard library compilation 17.8±1.35ms 19.4±1.18ms +8.99%
Deutsch-Jozsa evaluation 5.0±0.06ms 5.1±0.05ms +2.00%
Large file parity evaluation 33.6±0.14ms 33.7±0.15ms +0.30%
Large input file compilation 13.0±0.50ms 11.3±0.18ms -13.08%
Large input file compilation (interpreter) 50.8±2.39ms 45.2±1.87ms -11.02%
Large nested iteration 33.2±0.35ms 33.3±0.23ms +0.30%
Perform Runtime Capabilities Analysis (RCA) on Deutsch-Jozsa sample 1544.7±142.80µs 1491.9±28.03µs -3.42%
Perform Runtime Capabilities Analysis (RCA) on large file sample 8.0±0.17ms 7.7±0.11ms -3.75%
Perform Runtime Capabilities Analysis (RCA) on teleport sample 1439.7±41.10µs 1418.2±34.39µs -1.49%
Perform Runtime Capabilities Analysis (RCA) on the core and std libraries 21.3±0.47ms 21.5±0.42ms +0.94%
Teleport evaluation 80.0±4.13µs 84.0±8.59µs +5.00%

@swernli swernli added this pull request to the merge queue Apr 29, 2024
Merged via the queue into main with commit a1ecd06 Apr 29, 2024
@swernli swernli deleted the swernli/issue1436 branch April 29, 2024 21:24
swernli added a commit that referenced this pull request May 15, 2024
Changes introduced in #1442 to enable debugger tracking of variable scopes caused a bug if a program used callables with early returns, namely those returns would not pop an added scopes and later execution would read/write the wrong variable states. This fixes  the issue by introducing a debug-only return node that triggers a frame leave handling in the environment. This needs to be debug only because it should not be used during partial evaluation.
github-merge-queue Bot pushed a commit that referenced this pull request May 15, 2024
Changes introduced in #1442 to enable debugger tracking of variable
scopes caused a bug if a program used callables with early returns,
namely those returns would not pop any added scopes and later execution
would read/write the wrong variable states. This fixes the issue by
introducing a debug-only return node that triggers a frame leave
handling in the environment. This needs to be debug only because it
should not be used during partial evaluation.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Evaluator produces confusing locals view while debugging

2 participants