hazel icon indicating copy to clipboard operation
hazel copied to clipboard

Fix missing nested instrumentation

Open tonyfettes opened this issue 1 year ago • 6 comments

When the instrumentations is nested, old implementation would remove the outer ones to optimize for the size of stepper expression. However, this cause the regression that nested instrumentation won't work and stepper can't fallback to correct pause/skip behavior when a instrumented sub-expression finished evaluation.

tonyfettes avatar Feb 16 '24 10:02 tonyfettes

@tonyfettes what is an example that would demonstrate the difference between the old and new code?

@Negabinary can you approve this PR before we merge into dev?

cyrus- avatar Feb 27 '24 04:02 cyrus-

as long as @tonyfettes is fine with the last couple changes I pushed to this branch, I'm happy with it

Negabinary avatar Feb 27 '24 14:02 Negabinary

@cyrus-

Example:

eval 1 + 2 + 3 + 4 in
pause 3 + 3 + 4 in
1 + 2 + 3 + 4

Actual behavior on dev:

== 3 + 3 + 4
== 6 + 4
== 10
image

Expected behavior:

== 3 + 3 + 4
== 10
image

Current behavior:

== 6 + 4
== 10

image

Replace s.next with changed next' would fix the issue, but I'm not sure if would break the saving of stepper state.

tonyfettes avatar Feb 28 '24 04:02 tonyfettes

@tonyfettes marking this as draft until you resolve the issues you mentioned on Slack

cyrus- avatar Feb 29 '24 05:02 cyrus-

debug seems to prevent further steps

image

cyrus- avatar May 03 '24 02:05 cyrus-

@cyrus pause works, but debug don't. It works on mini-stepper, so I suspect there are some bugs when we are generating/displaying the evaluation contexts. I have been long not working on the hazel codebase and might need read some code to regain momentumn.

I'm marking this is a draft for now until the bug is fixed.

tonyfettes avatar May 03 '24 14:05 tonyfettes

Going to go ahead and merge this and we can make a separate PR for the debug issue.

cyrus- avatar May 28 '24 02:05 cyrus-