Repository navigation
Conversation
Resolve sends and receives through their elaborated channel bindings. Use those bindings in the interpreter, JIT callbacks, scheduler notifications, and CLI input/output so distinct queues stay separate and shared loopbacks keep working.
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.
A proc-scoped input and output may share a name and bind to two different queues. During work on #5531 we found that both the interpreter and the JIT could consume a proc’s own output.
Reproducer
The two streaming interfaces below are separate queues named
port. The token from the first send makes the receive wait until the proc has sent7.Save the IR as
handshake.irand run one tick with no input.Before the fix, the receive consumed the
7from the output queue, so the final send leftbits[8]:0x8onport. With the fix, the receive blocks on the empty input queue andbits[8]:0x7remains on the output. Running with--backend=serial_jitgives the same results.Runtime changes
Resolve channel operations against the send or receive binding of the executing proc instance. Use the matching interface for the payload type and for the queue reported to the scheduler. The JIT retains its compiled index per name and binds the two queues to its existing send and receive callbacks. AOT objects that baked in the wrong receive payload width need recompilation. When both interfaces are bound to one loopback, both operations use that queue.
eval_proc_mainnow uses the receive binding for supplied inputs and the send binding for expected outputs, including when wiring RAM model requests and responses. A lookup without a direction reports ambiguity when the name identifies distinct queues. Package-scoped channels keep their single-queue behavior.Tests
The optimized
//xls/...sweep passed all 2,251 selected targets. Native regressions cover send-before-receive, different payload widths, and a child instantiated with both loopback and distinct queues. CLI regressions exercise the interpreter and JIT. The sweep excludedcontrib,dev_tools,visualization, and five individual targets.