Skip to content

docs(examples): wasm-exports-demo.affine + smoke harness (closes #500) - #552

Merged
hyperpolymath merged 1 commit into
mainfrom
bindings/wasm-exports-demo-500
Jun 11, 2026
Merged

docs(examples): wasm-exports-demo.affine + smoke harness (closes #500)#552
hyperpolymath merged 1 commit into
mainfrom
bindings/wasm-exports-demo-500

Conversation

@hyperpolymath

Copy link
Copy Markdown
Owner

Summary

Lands the deferred end-to-end demo for the generic wasm_export_call binding (Tier 1 #5, #455). examples/wasm-exports-demo.affine ships one driver per WasmValue scalar kind (add_i32 / add_i64 / mul_f32 / mul_f64 + a dispatch_unknown for the runtime-dispatch case), and a smoke fixture at tests/codegen-deno/wasm_exports_demo.{affine,harness.mjs} round-trips each through a hand-built 120-byte wasm module exporting all four shapes.

The harness asserts both the raw module exports and the AS-side wrappers at appropriate precision: exact for i32/i64 (including values past i32 range, exercising the i64 BigInt boundary), 1e-5 for f32, 1e-12 for f64.

docs/bindings-roadmap.adoc Tier-1 row 5 grows a pointer to the new example so future readers find the canonical end-to-end demo.

Test plan

  • dune build clean
  • dune test — 375/375 (was 374; +1 from examples/ auto-discovery picking up the new file)
  • bash tools/run_codegen_deno_tests.sh — all codegen-deno harnesses green, including new wasm_exports_demo.harness.mjs
  • AS frontend accepts examples/wasm-exports-demo.affine (affinescript check)

Closes

Refs

🤖 Generated with Claude Code

#455 (Tier 1 #5) shipped the generic `wasm_export_call(exports, name,
args: [WasmValue]) -> WasmValue` surface; the inline smoke at
`tests/codegen-deno/wasm_call.{affine,harness.mjs}` covered the legacy
`wasmCall` only. A stand-alone, copy-paste-ready example was deferred
per the owner's #455 scope breakdown — this lands it.

`examples/wasm-exports-demo.affine` ships one driver per `WasmValue`
scalar kind so downstream consumers have a faithful 4-step template
(marshal -> call -> marshal-back -> cast) for each:

  - add_i32_via_wasm  (i32 + i32 -> i32)
  - add_i64_via_wasm  (i64 + i64 -> i64, BigInt at host boundary)
  - mul_f32_via_wasm  (f32 + f32 -> f32, Math.fround rounding)
  - mul_f64_via_wasm  (f64 + f64 -> f64, full precision)
  - dispatch_unknown  (wv_kind-driven runtime dispatch — the rare case)

`tests/codegen-deno/wasm_exports_demo.{affine,harness.mjs}` mirrors
the example surface and round-trips each driver through a hand-built
120-byte wasm module exporting all four scalar shapes — the harness
asserts both the raw module exports and the AS-side wrappers
match expectations at the appropriate precision (1e-5 for f32,
1e-12 for f64, exact for the integer paths including values past i32
range to exercise the i64 BigInt boundary).

`docs/bindings-roadmap.adoc` Tier-1 row 5 grows a `*Generic
export-call shipped #455*` clause + a pointer to the new example +
smoke-test so future readers find the canonical end-to-end demo.

375/375 dune tests + all codegen-deno harnesses green (was 374; +1
from examples/ auto-discovery).

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
Signed-off-by: hyperpolymath <6759885+hyperpolymath@users.noreply.github.com>
@hyperpolymath
hyperpolymath enabled auto-merge (squash) June 11, 2026 08:53
@github-actions

Copy link
Copy Markdown

🔍 Hypatia Security Scan

Findings: 91 issues detected

Severity Count
🔴 Critical 2
🟠 High 19
🟡 Medium 70

⚠️ Action Required: Critical security issues found!

View findings
[
  {
    "reason": "Action perpolymath/standards/.github/workflows/governance-reusable.yml@main\n needs attention",
    "type": "unpinned_action",
    "file": "governance.yml",
    "action": "pin_sha",
    "rule_module": "workflow_audit",
    "severity": "medium"
  },
  {
    "reason": "Action ons/checkout@v6\n    needs attention",
    "type": "unpinned_action",
    "file": "publish-jsr.yml",
    "action": "pin_sha",
    "rule_module": "workflow_audit",
    "severity": "medium"
  },
  {
    "reason": "Action land/setup-deno@v2\n    needs attention",
    "type": "unpinned_action",
    "file": "publish-jsr.yml",
    "action": "pin_sha",
    "rule_module": "workflow_audit",
    "severity": "medium"
  },
  {
    "reason": "Issue in affine-vscode-publish.yml",
    "type": "missing_timeout_minutes",
    "file": "affine-vscode-publish.yml",
    "action": "flag",
    "rule_module": "workflow_audit",
    "severity": "medium"
  },
  {
    "reason": "Issue in casket-pages.yml",
    "type": "missing_timeout_minutes",
    "file": "casket-pages.yml",
    "action": "flag",
    "rule_module": "workflow_audit",
    "severity": "medium"
  },
  {
    "reason": "Issue in casket-pages.yml",
    "type": "missing_timeout_minutes",
    "file": "casket-pages.yml",
    "action": "flag",
    "rule_module": "workflow_audit",
    "severity": "medium"
  },
  {
    "reason": "Issue in casket-pages.yml",
    "type": "missing_timeout_minutes",
    "file": "casket-pages.yml",
    "action": "flag",
    "rule_module": "workflow_audit",
    "severity": "medium"
  },
  {
    "reason": "Issue in ci.yml",
    "type": "missing_timeout_minutes",
    "file": "ci.yml",
    "action": "flag",
    "rule_module": "workflow_audit",
    "severity": "medium"
  },
  {
    "reason": "Issue in ci.yml",
    "type": "missing_timeout_minutes",
    "file": "ci.yml",
    "action": "flag",
    "rule_module": "workflow_audit",
    "severity": "medium"
  },
  {
    "reason": "Issue in ci.yml",
    "type": "missing_timeout_minutes",
    "file": "ci.yml",
    "action": "flag",
    "rule_module": "workflow_audit",
    "severity": "medium"
  }
]

Powered by Hypatia Neurosymbolic CI/CD Intelligence

@hyperpolymath
hyperpolymath disabled auto-merge June 11, 2026 10:12
@hyperpolymath
hyperpolymath merged commit 3ee4a21 into main Jun 11, 2026
27 checks passed
@hyperpolymath
hyperpolymath deleted the bindings/wasm-exports-demo-500 branch June 11, 2026 10:13
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

1 participant