Conversation
There was a problem hiding this comment.
Code Review
This pull request introduces a "Pair Visualisation" feature to the CSE Machine, enabling stream lineage visualization through a new toggleable mode. The changes include state management for streamsPointSteps, new arrow components, and logic to link array values to their originating functions. Feedback focuses on removing non-portable local file paths in package.json, deleting an accidentally committed build artifact, and cleaning up leftover debug logs, commented-out code, and redundant logic in the FnValue component.
…into streamVis Please enter a commit message to explain why this merge is necessary, fix
Removed local resolution for 'js-slang' package.
Updated js-slang package version from local to 1.0.89.
Coverage Report for CI Build 25439972761Coverage decreased (-0.09%) to 41.265%Details
Uncovered Changes
Coverage Regressions1 previously-covered line in 1 file lost coverage.
Coverage Stats💛 - Coveralls |
| // Clear arrows to prevent duplicates from multiple draw calls | ||
|
|
||
| if (pairs != undefined) { | ||
| for (const pair of pairs) { | ||
| const target = Layout.values.get(pair); | ||
| if (target) { | ||
| this.addArrow(target); | ||
| } | ||
| } | ||
| } | ||
| } |
This comment was marked as outdated.
This comment was marked as outdated.
Sorry, something went wrong.
RichDom2185
left a comment
There was a problem hiding this comment.
I can reproduce the issue flagged by Prof @martin-henz. It's a blocker

Description
Created new panel in CSE machine for Stream Visualization (pairs and nullary functions belonging to streams).
Displays results from streamViz js-slang PR (source-academy/js-slang#1939). Specifically, we use results from streamLineage from the Context object to draw dotted arrows from a nullary function to the pair(s) it returns.
The map streamLineage (Found in context object, types.ts) that maps the ID of nullary functions to the pairs it returns.
Everytime a CALL0 is called in the control, we push a tuple (nullaryFnID, controlStackHeight) to the pendingStreamFnStack[]. Within generateCSEMachineStateStream, we check the whether the height of the control stack has reached the height of i-1, where i is the controlStackHeight when we pendingStreamFnStack.peek(). If so, we pop pendingStreamFnStack.pop() and we add the pair that is at the top of the stash to the array of pairs that the nullaryFnID maps to, using streamLineage.
See also frontend issue: #3727
Type of change
How to test
Checklist