Skip to content

chore: add scriptc 0.4.0 native compilation experiment - #176

Draft
jlucaso1 wants to merge 4 commits into
mainfrom
experiment/scriptc-0.4.0
Draft

jlucaso1 wants to merge 4 commits into
mainfrom
experiment/scriptc-0.4.0

Conversation

@jlucaso1

@jlucaso1 jlucaso1 commented Oct 21, 2026 •

Copy link
Copy Markdown
Member

The full example cannot currently compile and initialize under scriptc 0.4.0. This draft preserves its dependency graph and Node behavior, adds an explicit offline smoke mode, and records reproducible compiler and bridge blockers instead of claiming native support.

The offline path exercises real bridge SHA-256, key agreement, protobuf and temporary file persistence without constructing a socket, reading existing auth, or pairing an account. Named builtin imports, an explicit logger type and property access remove initial frontend blockers. Normal bot handlers and diagnostic commands remain present.

The experiment pins the official compiler archive and SHA-256, Node and action versions, and uses the committed npm lockfile. Its CI job builds native objects, links and runs a scalar WASM control and the real bridge import, checks expected failures, analyzes and attempts the full example, and uploads diagnostics/link recipes/output. A green experiment job means the documented blockers reproduce, not that the example works natively.

Observed blockers:

  • Default package selection rejects minified bridge JS; explicit selection advances compilation.
  • Full-example build and coverage report default-import/frontend and Node API lowering failures, including recursive rm options.
  • The real bridge import compiles to an ELF executable but initialization throws SC2020 for FinalizationRegistry.
  • The published WASM enables SIMD, confirmed in bridge v0.26.0 Cargo configuration and scriptc coverage. The native loader returns validate=false and throws CompileError.
  • File persistence still needs its real native-addon-backed kernel lock. No no-op finalizer or unlocked persistence fallback was added.

Local validation: npm ci --ignore-scripts; lint; format check; build; package check; host-boundary check; npm test with 1,799 passes and one existing skip; separate guarded offline integration; native scalar WASM execution returning 42; real bridge and WASM failure reproductions; full-entry coverage/build attempts. Local linking used the documented native-link-info recipe with GCC because clang/sudo were unavailable; CI uses clang.

See experiments/scriptc/README.md for exact commands, hashes, official sources, results, dynamic-import/assets/crypto/TLS/persistence limitations and next steps. Native socket/TLS integration was not reached. No real-account end-to-end run, merge or release is part of this experiment.


Summary by cubic

Adds a scriptc 0.4.0 proof-of-concept that records why the full example cannot compile and initialize natively, instead of claiming native support. The second commit preserves upstream reproductions and a local filesystem prototype for issues the PR couldn't publish upstream.

The experiment preserves the normal Node example, adds an --offline-smoke mode that exercises real bridge SHA-256, key agreement, and protobuf, and persists synthetic bytes through the ordinary session and atomic meta namespaces using the real file store and snapshot transactions — without creating a socket or touching auth. A negative regression confirms the smoke fails when the native lock module can't load. The official compiler archive and SHA-256 are pinned.

  • CI builds and links native objects, runs a scalar WASM control and the real bridge import, checks expected failures, and uploads each attempt's fresh results directory and status.
  • A green job means the documented blockers reproduce, not that the example works natively; a harness regression verifies failed reruns never reuse a previous verdict or binary.
  • The upstream follow-up adds drafted issue reproductions for fs.promises.rm options, file URL reads, and lost WASM rejection reasons, plus a compiler patch. GitHub denied issue publication with HTTP 403, so these are review drafts, not published issues.

Documented blockers

  • Default package selection rejects the minified bridge JS; explicit --npm-static selection advances compilation.
  • The full-example build and coverage fail on default-import, frontend, and Node API lowering, including recursive rm options.
  • The compiled bridge import throws SC2020 at new FinalizationRegistry before any crypto runs.
  • The published bridge WASM enables SIMD, which scriptc 0.4.0 does not support; the native loader returns validate=false and throws CompileError.
  • File persistence still needs its real native-addon kernel lock; no no-op finalizer or unlocked persistence fallback was added.
  • Native socket/TLS integration was not reached.

Written for commit 7a9afc6. Summary will update on new commits.

Turn on auto-fix

Upstream follow-up is preserved under experiments/scriptc/upstream: three reviewed issue drafts, a local filesystem prototype patch and its regression test. The filesystem cases reproduce on 0.4.0 and unmodified main 94aa7065f17fdeeb31094ffcb71885b0d671b5ba. The independent WASM reproduction is reduced to 29 bytes and is now exercised by the experiment CI.

Publishing the issues to vercel-labs/scriptc was denied by GitHub with 403 Resource not accessible by integration. No upstream issue or PR was created. The reports remain drafts pending an authorized connection; no alternate publication route was attempted. The local prototype passes frontend build/IR regression, lint and C syntax checks. Patched main native execution is not claimed: the available release pack is ABI 22 and main requires ABI 23.

The offline smoke now verifies write/flush/reopen/delete in both session and atomic meta storage, including failure when the native lock addon cannot load. Each harness attempt uses a fresh results directory and records its status. CI uploads only that attempt's directory and reports a verdict only for a completed attempt. Three focused regressions, the full local experiment, lint, formatting, the library build, package checks and 1,799 general tests with one existing skip passed locally.

Current head: 7a9afc61be8d49067199c34e2fff06d73ff9c3bc. Main CI and the scriptc experiment both completed successfully for this exact head. The experiment logs confirm the same fresh run-Q0DCW2 directory for execution, artifact upload and status-based reporting. Current-run evidence is retained for seven days; its reported archive SHA-256 is 4b3374b7dec83770cc054bb31eb7b4add8c25bebbc582674ff736f61924bc7ac. The complete native example remains BLOCKED; these changes strengthen the harness without changing the documented compiler limitations. The experiment continues to check out the exact PR head and retain its pinned WASM integrity assertion.

@coderabbitai

coderabbitai Bot commented Oct 21, 2026

Copy link
Copy Markdown

Important

Draft PR not reviewed

Draft PRs are not automatically reviewed by default.

  • Trigger a manual review

To automatically review draft PRs, update your CodeRabbit configuration:

reviews:
  auto_review:
    drafts: true
  • Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

@pkg-pr-new

pkg-pr-new Bot commented Oct 21, 2026 •

Copy link
Copy Markdown
npm i https://pkg.pr.new/@oxidezap/baileyrs@176

commit: 7a9afc6

@greptile-apps

greptile-apps Bot commented Oct 21, 2026 •

Copy link
Copy Markdown

RetriggerView in GreptileConfidence Score: 5/5

[Medium impact] The follow-up appears safe to merge as a blocked native-compilation experiment.

Summary

This draft adds a scriptc experiment that records native compilation blockers rather than claiming native support.

  • The example can run real bridge and file-store checks without opening a bot connection.
  • CI records repeatable scriptc 0.4.0 probes without treating blockers as native support.
  • Compiler follow-up notes and patches stay local to this repository.

Reviews (3) · Last reviewed commit: "chore: exercise atomic auth and isolate ..." · Reviewed by Greptile

Comment thread Example/offline-smoke.ts Resolved
Comment thread experiments/scriptc/run.mjs Resolved
@jlucaso1

Copy link
Copy Markdown
Member Author

@codex review

@chatgpt-codex-connector

chatgpt-codex-connector Bot commented Oct 21, 2026 •

Copy link
Copy Markdown

Codex Review Summary

This comment shows the latest Codex review activity on this pull request.

Review Status Commit Review trigger
📝 Code Review ✅ Completed 2026-10-21T01:33:04.566182Z 2f286c7 Manual request
ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review" or "@codex security review".

Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings.

@chatgpt-codex-connector

Copy link
Copy Markdown

Codex Review: Didn't find any major issues. Already looking forward to the next diff.

Reviewed commit: 2f286c7a92

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant