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
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.
cdleary
force-pushed
the
cdleary/2026-11-23-proc-runtime-c-api
branch
from
November 24, 2026 05:28
952de66 to
b3edb28
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 constructors take an existing package. Callers use the same operations for channel I/O, ticking, taking trace messages, and freeing the runtime.The package must outlive the runtime. Free the runtime before rewriting IR it uses. To run
xls_schedule_and_codegen_packagewhile the runtime is live, use a separate package. For proc-scoped channels, each runtime uses the top selected at creation, even if the caller later selects another package top. Writes borrow the input value. A successful try-read returns a caller-owned value to free withxls_value_free, or null if the queue is empty. On failure, try-read returns false and an error string to free withxls_c_str_free.xls_proc_runtime_take_trace_messagestransfers traces from the latest tick, including those 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,232 selected targets, including channel I/O, ownership, top reselection, and trace regressions on both backends, plus the C API symbol export check. The sweep excludedcontrib,dev_tools,visualization, and five individual targets.