Repository navigation
e-stepper: work out the store at a step from the steps before it - #185
Open
martin-henz wants to merge 1 commit into
Open
martin-henz wants to merge 1 commit into
martin-henz wants to merge 1 commit into
Conversation
…nes before it An evaluator can then put a frame or an object that has become unreachable in the step where it does, and in none after it, instead of repeating all of them in every step (py-slang#611: the steps of a loop that makes a frame in each iteration grew with the square of their number). An evaluator that does repeat them gives the same store. Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
🦋 Changeset detectedLatest commit: b55d4f8 The changes in this PR will be included in the next version bump. Not sure what this means? Click here to learn what changesets are. Click here if you're a maintainer who wants to add another changeset to this PR |
This branch has not been deployed
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Plugin side of source-academy/py-slang#611 (py-slang PR #612). Idea from @martin-henz: what is unreachable stays unreachable, so it need not be repeated in the steps after it.
Protocol.
EStepperStep.frames/.heapare now documented (common-e-stepper) as the reachable frames and objects plus those that become unreachable in this step. A host works out the store at a step from that step and the ones before it: the latest version of every frame and object, those the step itself does not have being unreachable. An evaluator that still repeats them in every step gives exactly the same store, so the change is compatible both ways.Plugin.
storeAt(steps, index)(src/web/e-stepper/src/store.ts) does this, incrementally (moving on by one step adds that step's items only) and in creation order, the global frame first.EStepperViewuses it for the diagram, the frame colours, the object lookup and the availability of "Clear Unreachable Objects". When the frontend lends its CSE diagram nothing changes: that one already takes the unreachable frames from the earlier snapshots.Rollout. Release this first: with the new py-slang and the old plugin the older unreachable frames would be missing from the plugin's own diagram (the frontend's diagram is not affected).
Two changesets, one per package (
web-e-stepperis ignored,common-e-stepperis not, so they are not mixed): patch for each (the common one is the documentation of the type).Checked: prettier, eslint (no errors),
yarn vitest run src/web/e-stepper src/common/e-stepper(94 tests), includingstore.test.tsand a view test for a frame that became unreachable in an earlier step.🤖 Generated with Claude Code