Skip to content

feat: sandboxed numeric WASM SQL UDFs - #2548

Draft
Aming9303 wants to merge 3 commits into
getdozer:mainfrom
Aming9303:feat/wasm-udf-1653
Draft

Aming9303 wants to merge 3 commits into
getdozer:mainfrom
Aming9303:feat/wasm-udf-1653

Conversation

@Aming9303

@Aming9303 Aming9303 commented Nov 2, 2026 •

Copy link
Copy Markdown

Summary

Independent AI-authored (Codex) implementation for #1653, following the disclosed attempt at #1653 (comment). No competing patch was copied.

  • Add config: !Wasm to the current tagged UDF configuration; optional export defaults to SQL function name.
  • Execute exported AssemblyScript numeric functions through wasmi, integrated with SQL expression construction, type inference and evaluation.
  • No imports/WASI or host capabilities; bounded module size, fuel, memory and tables, with fresh state each evaluation.
  • Explicit errors for signatures, integer overflow, non-finite numbers, traps and resource exhaustion; NULL propagation.
  • Check in a real AssemblyScript 0.27.31 source/binary fixture and document compilation, ABI and limits in dozer-sql/expression/WASM.md.

Actual validation

Windows GNU Rust 1.83, protoc 25.3:

  • Expression library: 38 passed, including 11 new WASM tests.
  • SQL library: 215 passed, 1 pre-existing ignored.
  • Actual statement_to_pipeline / DagExecutor source-to-sink regression: 10 records through WASM SQL projection, all sink values asserted Int(42).
  • UDF YAML configuration: 2 passed.
  • Real compiled AssemblyScript through the SQL builder: calculate(20,22) -> Int(42), calculate(1.25) -> Float(2.5).
  • Formatting and git diff --check passed. Existing unrelated compiler warnings remain.
  • CLI build check was attempted on both this branch and clean origin/main at 8b0b4cc. The initial missing-C-compiler failure was resolved with a checksum-verified portable GCC, set through process-local CC/AR (no system PATH change). Both branches now stop at the existing locked time 0.3.34 inference incompatibility with Rust 1.83 (E0282, Rust 1.80 API change). No unrelated dependency upgrade is included. This is not a successful CLI check.
  • Follow-up: with an isolated Rust 1.79 toolchain and process-local CC/CXX/AR, cargo check -p dozer-cli --bin dozer --locked passed. This bypasses the historical toolchain incompatibility without changing dependencies. The CLI build script regenerated json_schemas/dozer.json with the new Wasm variant and WasmConfig; that schema is included. This is a compile check, not a built/running CLI binary.
  • Binary follow-up: cargo build -p dozer-cli --bin dozer --locked passed on Rust 1.79. A missing Windows shlwapi import library at final link was resolved through process-local LIBRARY_PATH using the verified portable compiler distribution; no dependency changes. The resulting executable returned dozer 0.4.0 for --version, and --help completed successfully. This is an actual binary/entrypoint smoke test, not a full externally connected service deployment.

Draft / remaining evidence

A short video of the actual SQL-builder tests and a screenshot have been recorded and visually checked locally. Public attachment publication is awaiting the account owner's specific approval after a safety review blocked the upload. No public demo link is claimed yet. This draft is not a completed bounty submission or an assertion of acceptance/payment; /claim will be added with the required evidence once ready.

This is a numeric scalar ABI (i32/i64/f32/f64), not managed AssemblyScript strings/arrays/objects. No imports are supported. A full externally connected CLI service deployment, all optional feature combinations, and benchmark/performance claims have not been validated. Actual binary startup smoke and the in-process source-to-sink DAG regression are distinct validation layers. No agreement/CLA has been signed by the agent.

@CLAassistant

Copy link
Copy Markdown

CLA assistant check
Thank you for your submission! We really appreciate it. Like many open source projects, we ask that you sign our Contributor License Agreement before we can accept your contribution.
You have signed the CLA already but the status is still pending? Let us recheck it.

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.

2 participants