SY-3680: Fix Issues with Arc Channel Analysis#1940
Merged
emilbon99 merged 4 commits intoFeb 5, 2026
Conversation
Contributor
sy-nico
requested changes
Feb 5, 2026
sy-nico
left a comment
Contributor
There was a problem hiding this comment.
Chatted offline and left screenshots
…nnax into sy-3680-cannot-use-an-arc-function-twice
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.


Issue Pull Request
Linear Issue
Fixes:
SY-3680
SY-3679
Description
Basic Readiness
Greptile Overview
Greptile Summary
Fixed two critical Arc language bugs and one C++ error handling bug:
Core Fixes:
analyzeStatefulVariableChannelswhen creating nodes, preventing shared state between multiple function invocationsxerrors::Error::matches()to provide end iterator for both ranges, preventing undefined behavior when pattern is longer than error typeReadChannelValue()to check for emptyMultiSeriesbefore accessing last elementTest Coverage:
All fixes include comprehensive test coverage with regression tests, integration tests, and edge case validation.
UI Improvements:
Enhanced Arc editor UX by enabling
scrollBeyondLastLine, repositioning controls to full width with gradient overlay, and removing problematic platform-specific font override.Confidence Score: 5/5
Important Files Changed
Sequence Diagram
sequenceDiagram participant User as Arc Program participant Analyzer as Statement Analyzer participant TextAnalyzer as Text Analyzer participant State as Runtime State participant WASM as WASM Runtime Note over User,WASM: Issue 1: Channel values in stateful vars User->>Analyzer: counter $= counter_ch Analyzer->>Analyzer: Check if varType is Chan Analyzer->>Analyzer: Unwrap() to get value type Analyzer->>User: Store value type (f32), not channel Note over User,WASM: Issue 2: Reusing functions with channel config User->>TextAnalyzer: increment{counter=counter_1} TextAnalyzer->>TextAnalyzer: sym.Channels.Copy() TextAnalyzer->>TextAnalyzer: slices.Clone(config) TextAnalyzer->>User: Create node with independent channels User->>TextAnalyzer: increment{counter=counter_2} TextAnalyzer->>TextAnalyzer: sym.Channels.Copy() TextAnalyzer->>User: Create separate node with own channels Note over User,WASM: Runtime: Reading channel values WASM->>State: ReadChannelValue(key) State->>State: Check if key exists State->>State: Check if len(ms.Series) > 0 State->>State: Return ms.Series[len(ms.Series)-1] State->>WASM: Return last series safely Note over User,WASM: C++ Error Matching Fix User->>State: error.matches("long.pattern") State->>State: std::mismatch with both end iterators State->>User: Return false (no out-of-bounds)