Repository navigation
Conversation
cdleary
force-pushed
the
cdleary/2026-11-23-proc-runtime-c-api
branch
2 times, most recently
from
November 23, 2026 19:14
3eeabcd to
952de66
Compare
cdleary
marked this pull request as ready for review
November 23, 2026 20:04
cdleary
added a commit
to xlsynth/xlsynth
that referenced
this pull request
Nov 23, 2026
…l I/O in the C API Bind proc-scoped channel lookup to the elaborated top. Expose caller-owned reads and per-tick trace messages through the C API. Upstream-head: 952de66
cdleary
force-pushed
the
cdleary/2026-11-23-proc-runtime-c-api
branch
from
November 24, 2026 05:28
952de66 to
b3edb28
Compare
cdleary
added a commit
to xlsynth/xlsynth
that referenced
this pull request
Nov 24, 2026
Let callers select an interpreter or JIT runtime when creating a proc network. Both use the same tick, channel I/O, trace transfer, and lifetime contracts. Upstream-head: b3edb28
cdleary
added a commit
to xlsynth/xlsynth
that referenced
this pull request
Nov 24, 2026
Let callers select an interpreter or JIT runtime when creating a proc network. Both use the same tick, channel I/O, trace transfer, and lifetime contracts. Upstream-head: b3edb28
cdleary
added a commit
to xlsynth/xlsynth
that referenced
this pull request
Nov 24, 2026
Let callers select an interpreter or JIT runtime when creating a proc network. Both use the same tick, channel I/O, trace transfer, and lifetime contracts. Upstream-head: b3edb28
cdleary
force-pushed
the
cdleary/2026-11-23-proc-runtime-c-api
branch
from
November 28, 2026 18:27
b3edb28 to
42effaa
Compare
Expose ticking, channel I/O and trace collection on a borrowed package. Reject ambiguous proc-scoped queue bindings before creating either backend, while supporting intentional shared-queue loopbacks.
cdleary
force-pushed
the
cdleary/2026-11-23-proc-runtime-c-api
branch
from
November 28, 2026 18:36
42effaa to
7210d1f
Compare
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.
Expose interpreter and JIT proc runtimes through the C API.
xls_proc_runtime_createcreates an interpreter.xls_proc_runtime_create_jitcompiles the procs at creation so subsequent ticks reuse native code. Both take an existing package and share the same operations for ticking, channel I/O, taking trace messages, and freeing the runtime.Proc-scoped channel names
XLS permits a proc to declare an input and an output with the same name. During testing we found that both native runtimes can select the wrong queue when those interfaces bind to distinct queues. For example, a proc sent
7on its output and then waited for input. With no input supplied, it consumed its own output. The receive should have blocked and left7available to the caller.Both C constructors check for this ambiguity before creating the interpreter or compiling the JIT. If a reachable proc instance binds same-name interfaces to distinct queues, creation returns false, clears the runtime output, and identifies the proc instance and channel in
error_out. A child whose two interfaces bind to one loopback queue is supported. The native fix for both runtimes is proposed in #5569. Once it lands, the C API can select boundary queues by direction and remove this guard.C API behavior
The package must outlive the runtime. Free the runtime before rewriting IR it uses, and use a separate package for
xls_schedule_and_codegen_packagewhile the runtime is live. Proc-scoped channel I/O uses the top selected at creation, even if the caller later selects another package top. Writes select inputs and borrow the caller’s value. Try-reads select outputs and return true with an owned value or null for an empty queue. Package-scoped channels retain their name lookup. Callers free returned values withxls_value_freeand error strings withxls_c_str_free.xls_proc_runtime_take_trace_messagestransfers traces from the latest tick, including traces emitted before an assertion failure. A second take returns an empty list. The next tick discards any untaken traces. Callers release the array withxls_trace_messages_free.Tests
The optimized
//xls/...sweep passed all 2,251 selected targets, including constructor rejection and shared-loopback execution on both backends. The sweep excludedcontrib,dev_tools,visualization, and five individual targets.