SY-3685: Arc Channel and Value Assignment Bugs#1945
Merged
emilbon99 merged 15 commits intoFeb 6, 2026
Merged
Conversation
…synnax into sy-3685-arc-channel-and-value-assignment-bugs
pjdotson
requested changes
Feb 6, 2026
pjdotson
requested changes
Feb 6, 2026
pjdotson
left a comment
Contributor
There was a problem hiding this comment.
Address comment then good to merge.
| zap.Int("seqNum", res.SeqNum), | ||
| zap.Error(res.Err), | ||
| ) | ||
| } else if !res.Authorized { |
Contributor
There was a problem hiding this comment.
we should be returning nil in the sink even when res.Err != nil? Just want to make sure this is intended behavior because I am too tired to try to understand this too deeply right now.
Contributor
Author
There was a problem hiding this comment.
Initial thought was yes intentional but now I'm rethinking
…synnax into sy-3685-arc-channel-and-value-assignment-bugs
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
SY-####
Description
Basic Readiness
Greptile Overview
Greptile Summary
Fixed two critical bugs in the Arc language implementation and improved driver shutdown handling:
UnwrapChan()on expression types, allowing channel aliases (likelocal_ref := sensor) to be correctly assigned to scalar variableswatch()to be idempotent by checking handle equality, preventing false errors when re-watching the same notifierNOMINAL_SHUTDOWN_ERRORsentinel to distinguish expected runtime shutdowns from actual errors, eliminating false error logs during normal pipeline terminationAll changes include comprehensive unit tests covering the fixed scenarios. The PR description is incomplete (missing Linear issue link and checklist items), but the code changes are well-structured and properly tested.
Confidence Score: 5/5
Important Files Changed
Sequence Diagram
sequenceDiagram participant User as Arc Script participant Analyzer as Statement Analyzer participant Compiler as Statement Compiler participant Runtime as Arc Runtime participant Pipeline as Acquisition Pipeline participant EventLoop as Event Loop (Windows) Note over User,EventLoop: Channel Alias Assignment Flow User->>Analyzer: local_ref := sensor (channel alias) Analyzer->>Analyzer: Store channel type User->>Analyzer: value = local_ref (assign to scalar) Analyzer->>Analyzer: InferFromExpression() Analyzer->>Analyzer: UnwrapChan() unwrap chan f64 to f64 Analyzer->>Analyzer: Type check f64 == f64 User->>Compiler: Compile assignment Compiler->>Compiler: Generate channel read opcode Compiler->>Compiler: Generate local set for scalar Note over Runtime,Pipeline: Runtime Shutdown Flow Runtime->>Pipeline: read() returns false (closed) Pipeline->>Pipeline: Return NOMINAL_SHUTDOWN_ERROR Pipeline->>Pipeline: Check matches(NOMINAL_SHUTDOWN_ERROR) Pipeline->>Pipeline: Skip error logging Pipeline->>Pipeline: Break acquisition loop Note over EventLoop: Windows Event Loop Watch Fix User->>EventLoop: watch(notifier1) EventLoop->>EventLoop: watched_handle_ = notifier1 EventLoop-->>User: true User->>EventLoop: watch(notifier1) again EventLoop->>EventLoop: Check watched_handle_ == handle EventLoop->>EventLoop: Same handle, allow re-watch EventLoop-->>User: true (idempotent)