Repository navigation
defk-9p6.29: threshold_cross, an early-exit loop in Elixir, a kernel and Nx defn with EXLA - #76
Merged
Merged
Conversation
…and Nx defn with EXLA
…gaps, performance 3.10, tables
…ges over four runs
DanielLuning
pushed a commit
that referenced
this pull request
Oct 20, 2026
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.
Merge #74, then #75, first. This branch builds on
defk-9p6.30/tape-csv(the same tables, README rows and scoreboard).What changed
examples/threshold_cross.exs: the first packet whose running total passes a byte budget. The loop is sequential, stops early and is integer-exact. It is written four ways: Elixir (E1, E2 with four packets per clause), a kernel (Enum.reduce_while),defnwithwhileand a stop flag, anddefnwithcumulative_sum+argmax. EXLA runs on resident tensors, oneNx.Defn.compile/3per shape.docs/scope.md: the sentence "not measured against EXLA yet" is replaced by the numbers.docs/research/nx-boundary.md: the open question is now a list of measured numbers.docs/performance.md3.10._tables.exs, the READMEs (regenerated), an example bullet.examples/scoreboard.json: a quiet row at 3602f17 (--freshfrom a clean tree).Results
Per call, µs, with the budget passed at 25%. Two runs; the first shared the machine with a
mix ci, so these are provisional.whileis 11.7-13.2x slower than the kernel.whileup to 1M packets and is level at 16M. Thecumulative_sumform is slower than Elixir at every size.How it was checked
mix cigreen in the worktree (2305 passed).Agreement: all sides give the same index on 80 inputs, including the kernel's Elixir mode. An empty input works in the kernel;
Nx.from_binary(<<>>)raises.Touches a promised surface (kernel subset, runtime contract, public API, error codes)? Then a
CHANGELOG.mdentry, and a deprecation for a rename or removal (docs/guides/stability.md).Touches
test/stability/? A frozen file is never edited; a release adds a directory (docs/agents/stability.md).