MILAB-6145: !!!EXPERIMENTAL DON'T MERGE!!! import :pframes-rs SDK lib#29
Draft
blackcat wants to merge 10 commits into
Draft
MILAB-6145: !!!EXPERIMENTAL DON'T MERGE!!! import :pframes-rs SDK lib#29blackcat wants to merge 10 commits into
blackcat wants to merge 10 commits into
Conversation
Opts the block into the WASM bundling pipeline by importing the SDK's new :pframes-rs lib. The upstream @milaboratories/pframes-rs-wasip2 wasm bytes flow transitively into main.plj.gz at compile time. Depends on @platforma-sdk/workflow-tengo publishing the :pframes-rs lib (milaboratory/platforma#1615). CI will be red on this branch until that SDK release ships. Runtime use of the wasm component is a follow-up — this PR only opts in to the bundling.
There was a problem hiding this comment.
Code Review
This pull request imports the @platforma-sdk/workflow-tengo:pframes-rs library into the workflow's main template and includes a corresponding changeset. These changes integrate WASM bytes into the build pipeline to enable end-to-end testing of the bundling process. I have no feedback to provide as there were no review comments.
Demonstrates how a block consumes the SDK's :pframes-rs wrapper. Returns undefined today; once the wasm runtime SDK ships (plan/tengo-wasm-call), only the wrapper internals change — this block keeps the same call site. The handle will eventually expose `.frame`, `.table`, `.axes` namespaces mapping onto the wasip2 WIT exports (see core/pframes-rs/packages/wasip2/wit/world.wit).
Replace the placeholder pframesRs.importWasm() with a real WIT call —
pframesRs.frame.buildQuery({ version: "v1", column: "abundance" }) —
matching the pattern from plan/tengo-wasm-call.
Today the SDK wrapper returns "runtime not yet wired" because the wasm
call host builtin (plapi.loadWasm) hasn't shipped yet; the block logs
and continues so rendering still completes. Once that runtime lands,
only the SDK wrapper changes and the call below starts returning a
real SpecQueryJoinEntry — this block stays as-is.
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.
Summary
Demonstrates how a block consumes the new
@platforma-sdk/workflow-tengo:pframes-rsSDK lib end-to-end.:pframes-rsfrom the workflow pulls the upstream@milaboratories/pframes-rs-wasip2wasm bytes into the compiledmain.plj.gzvia the SDK lib's build-time tag.wf.bodyinvokespframesRs.importWasm()to materialize the wasm component handle. Returnsundefinedtoday (runtime wiring is onplan/tengo-wasm-calland is a separate milestone); once the wasm-call runtime ships, only the SDK wrapper changes — this block stays as-is. The handle will expose.frame/.table/.axesnamespaces mapping onto themilaboratories:pframes/specWIT exports.Bundling impact
:pframes-rs?template.wasm?main.plj.gz@milaboratories/pframes-rs-wasip2:mainv1.1.34 (1,725,128 bytes)rarefaction-calculation.plj.gzBlockers
@platforma-sdk/workflow-tengois published. That PR ships the:pframes-rslib this branch imports.pnpm-workspace.yamlso:pframes-rsresolves.Once the wasm-call runtime SDK lands, this block will be the canonical "real wasm in a real block" smoke test.
Test plan
pnpm.overridesagainst locally-packed SDK (overrides removed before commit). Wasm bytes confirmed embedded inmain.plj.gz; sibling template confirmed wasm-free.importWasm()runtime-safe —if false { assets.importWasm(...) }keeps the literal visible to tengo-builder's regex while returningundefinedat render time, so the call site doesn't crash today.Refs
plan/tengo-wasm-callbranch PLAN.mdcore/pframes-rs/packages/wasip2/wit/world.wit