Repository navigation
Conversation
Contributor
Changeset suggestionThe current changeset no longer matches this PR. This review contains a corrected replacement. Why: Changeset should start with an approved active present-tense verb. Changeset does not name the affected public API confidently. Changeset is not sufficiently consumer-focused. View the proposed changeset---
'@bomb.sh/tty': minor
---
TODO: Write changeset message (inference failed: HTTP 401: {"error":{"message":"User not found.","code":401}})Review this changeset manually If this draft is correct, react with 🚀 and Cooper will commit it to this branch. |
| @@ -0,0 +1,7 @@ | |||
| --- | |||
Contributor
There was a problem hiding this comment.
Changeset needs revision.
Changeset should start with an approved active present-tense verb. Changeset does not name the affected public API confidently. Changeset is not sufficiently consumer-focused.
View the proposed replacement
---
'@bomb.sh/tty': minor
---
TODO: Write changeset message (inference failed: HTTP 401: {"error":{"message":"User not found.","code":401}})
commit: |
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.
What does this PR do?
Add a C Node-API backend so Node.js can run the existing engine as a native
.nodeaddon without a Rust rewrite. A matching packaged addon is selectedautomatically; when none is packaged, the library uses Wasm. The public
TypeScript API is unchanged. No separate issue is needed for this self-contained
backend experiment.
preparing Wasm on the native path.
Keep layout contexts on each Term, route callbacks through Clay's userData,
and isolate upstream routing state and overflow sentinels per worker.
calls after a backing buffer is detached.
checks, and a reproducible comparison with the existing rendering workloads.
Apply Clay patches to a generated copy instead of resetting the submodule.
Benchmark results
Apple M1 Max, macOS ARM64, Node.js 26.5.1. Both C targets use Clang 20.1.7 with
-O2. These are local measurements using identical TypeScript sources and thepublic APIs.
Whole-process first-render startup was essentially unchanged: 100.54 ms for
Wasm and 100.24 ms for native in this harness. The startup figures above include
module import and TypeScript loading; they are not measurements of the factory
call alone or of a transpiled npm package.
Throughput uses three alternating processes per backend, with 300 ms warmup
and seven 150 ms samples per workload per process. Startup uses 20 fresh
processes per backend after three warmups. Results are medians.
Raw results and compiler flags.
Reproduce with
make,make native, thennode bench/native.bench.ts.Validation and scope
workers, output lifetime across resize/GC, detached buffers, and absence of
Wasm preparation.
deno task fmt,deno task fmt:check,deno lint, TypeScript checks, andgit diff --checkpassed.Native execution was validated locally on macOS ARM64. Cross-platform prebuilt
binary distribution and native CI coverage are not automated by this PR; the
local build supports macOS/Linux, and other platforms retain Wasm fallback.
Type of change
Checklist
deno task test, native Node suite, native renderer checks)deno task fmt)AI-generated code disclosure