Skip to content

feat(polkavm): run App Manifest v2 runtimes in Dotli - #185

Open
replghost wants to merge 125 commits into
mainfrom
feat/pvm-wasm
Open

feat(polkavm): run App Manifest v2 runtimes in Dotli#185
replghost wants to merge 125 commits into
mainfrom
feat/pvm-wasm

Conversation

@replghost

@replghost replghost commented Aug 28, 2026

Copy link
Copy Markdown
Collaborator

Summary

  • run signed PolkaVM App Manifest v2 archives with framebuffer, Tri2D, and WebGPU Raster profiles
  • route canonical TrUAPI plus versioned graphics, input, audio, and UI output through the sandbox
  • keep the application runtime contract at ABI 1 and use the neutral host-frame-request / host-frame-response transport
  • keep motion input optional and permission-gated, with physical-device and pointer-emulated sources
  • consume the published UserAgentKit browser distribution through an exact package/source/checksum lock while serving only the runtime, cooperative worker, and GPU worker assets
  • retry stopped chainHead generations once across protocol and RPC-gateway resolution, and revalidate cached manifest/contenthash pairs
  • remove obsolete public pvm paths, scripts, environment variables, metrics, tests, and legacy CID cache data

Scope boundary

This PR implements the runtime-aware App work tracked by paritytech/host-rust-core#507, paritytech/host-rust-core#540, and paritytech/host-rust-core#550. The experimental polkadot-host/0.1/* computer interfaces, filesystem, TTY, process spawning, workspace orchestration, and TCP relay remain in a separate draft stacked PR pending their host-interface RFC.

Runtime provenance

  • npm package: @useragent-kit/polkavm-runtime@0.1.0
  • upstream revision: 6eb24c5fd4451ca339c82c73a308ac8af87b8e4b
  • application runtime ABI: 1
  • served package subset: runtime Wasm, cooperative worker, and GPU worker
  • package assets, source record, checksum manifest, MPL notice, and both PolkaVM license notices are pinned in scripts/polkavm-runtime.lock.json

Dependencies

Verification

  • bun run check:polkavm-runtime: verified package 0.1.0 and upstream revision 6eb24c5f…
  • bunx --bun turbo run typecheck: 13/13 workspace tasks passed
  • bunx --bun turbo run lint: 13/13 workspace tasks passed
  • bunx --bun turbo run test: 12/12 workspace test tasks passed, including production builds
  • sandbox runtime/unit suite: 45 passed
  • installed-executable cache suite: 23 passed
  • final review split across sandbox/runtime, resolver/protocol, and deployment/test surfaces; findings fixed and re-reviewed clean

The deploy workflow runs the six-product post-deploy smoke for westendli.dev, paseoli.dev, and paseo.li.

@github-actions

Copy link
Copy Markdown
Contributor

⚡ Performance Report

⚠️ No baseline found on main. This PR's results are recorded but cannot be compared.
Merge to main to establish a baseline.

@github-actions

github-actions Bot commented Aug 28, 2026

Copy link
Copy Markdown
Contributor

Bundle Size Report

Chunks over 500 KB:

File Raw Brotli Gzip
host/assets/truapi_provider_bg.wasm 5.17 MB 1.99 MB 2.33 MB
host/assets/truapi_server_bg.wasm 7.20 MB 5.29 MB 5.56 MB
host/assets/wasm/web/truapi_server_bg.wasm 7.20 MB 5.29 MB 5.56 MB
sandbox/polkavm-runtime/polkavm-browser-runtime.wasm 1.03 MB 178.3 KB 239.4 KB
Total 21.96 MB (+1.30 MB) 13.17 MB (+257.7 KB) (-40%) 14.15 MB (+327.1 KB)
All files
File Raw Brotli Gzip
host/.well-known/apple-app-site-association 505 B 505 B 505 B
host/.well-known/assetlinks.json 2.1 KB 343 B 427 B
host/assets/_md.js 6.3 KB 2.6 KB 2.8 KB
host/assets/blake2.js 11.7 KB 4.1 KB 4.7 KB
host/assets/bridge.js 147.5 KB (+4.0 KB) 35.8 KB (+1.2 KB) 42.7 KB (+1.3 KB)
host/assets/browser.js 22.9 KB 7.6 KB 8.6 KB
host/assets/client.js 10.6 KB (+379 B) 3.4 KB (+131 B) 3.9 KB (+148 B)
host/assets/hex.js 160 B 160 B 160 B
host/assets/index.css 55.2 KB (+147 B) 8.6 KB (+54 B) 9.9 KB (+54 B)
host/assets/index.js 166.0 KB (+8.3 KB) 43.6 KB (+2.2 KB) 52.3 KB (+2.7 KB)
host/assets/manifest.js 21.5 KB (-1.8 KB) 7.0 KB (-374 B) 7.7 KB (-414 B)
host/assets/network.js 6.3 KB 2.2 KB 2.5 KB
host/assets/panel.js 79.2 KB (+2.9 KB) 21.3 KB (+722 B) 24.0 KB (+765 B)
host/assets/proofs.js 29.3 KB 8.6 KB (+2 B) 9.5 KB
host/assets/resolve.js 128 B 128 B 128 B
host/assets/rolldown-runtime.js 716 B 716 B 716 B
host/assets/rpc-resolve.js 3.0 KB (+369 B) 1.2 KB (+99 B) 1.4 KB (+109 B)
host/assets/scale-ts.js 4.8 KB 2.0 KB 2.2 KB
host/assets/spans.js 2.5 KB (+232 B) 1.1 KB (+91 B) 1.2 KB (+107 B)
host/assets/src.js 84.2 KB 26.5 KB (-11 B) 29.6 KB (+2 B)
host/assets/styles.css 17.6 KB (+2.2 KB) 3.6 KB (+347 B) 4.2 KB (+370 B)
host/assets/substrate-client.js 5.8 KB 2.2 KB (-1 B) 2.5 KB
host/assets/truapi_provider_bg.wasm 5.17 MB 1.99 MB 2.33 MB
host/assets/truapi_server_bg.wasm 7.20 MB 5.29 MB 5.56 MB
host/assets/twoX.js 2.8 KB 1022 B 1.1 KB
host/assets/utils.js 3.5 KB 1.4 KB 1.5 KB
host/assets/wasm/web/README.md 13.4 KB 13.4 KB 13.4 KB
host/assets/wasm/web/package.json 371 B 371 B 371 B
host/assets/wasm/web/truapi_server.d.ts 12.6 KB 12.6 KB 12.6 KB
host/assets/wasm/web/truapi_server.js 49.7 KB 7.9 KB 9.3 KB
host/assets/wasm/web/truapi_server_bg.wasm 7.20 MB 5.29 MB 5.56 MB
host/assets/wasm/web/truapi_server_bg.wasm.d.ts 4.0 KB 4.0 KB 4.0 KB
host/assets/web.js 18.2 KB 4.6 KB (+16 B) 5.1 KB (-7 B)
host/assets/worker-runtime.js 28.9 KB (+28.8 KB) 6.8 KB (+6.7 KB) 7.8 KB (+7.7 KB)
host/assets/worker-runtime.js 106 B 106 B 106 B
host/assets/ws.js 25.8 KB 8.3 KB (-12 B) 9.2 KB (-6 B)
host/dotli.png 11.5 KB 11.5 KB 11.5 KB
host/favicon.svg 1.8 KB 1.8 KB 1.8 KB
host/host-sw.js 3.0 KB (-57 B) 1.2 KB (-23 B) 1.3 KB (-25 B)
host/icon-192.png 12.5 KB 12.5 KB 12.5 KB
host/icon-512.png 42.8 KB 42.8 KB 42.8 KB
host/index.html 33.1 KB (+62 B) 6.9 KB (+25 B) 8.4 KB (+39 B)
host/manifest.webmanifest 441 B 441 B 441 B
host/workbox.js 14.8 KB 4.6 KB 5.1 KB
sandbox/app-sw.js 11.3 KB (+1.4 KB) 3.5 KB (+319 B) 4.0 KB (+377 B)
sandbox/assets/bitswap-bridge.js 840 B 840 B 840 B
sandbox/assets/fetch.js 3.4 KB 1.2 KB (+3 B) 1.4 KB (-2 B)
sandbox/assets/index.js 174.8 KB (+51.3 KB) 49.2 KB (+14.3 KB) 57.3 KB (+16.5 KB)
sandbox/assets/index.css 55.2 KB (+147 B) 8.6 KB (+54 B) 9.9 KB (+54 B)
sandbox/favicon.svg 1.8 KB 1.8 KB 1.8 KB
sandbox/index.html 1.7 KB (+20 B) 588 B (+7 B) 797 B (+9 B)
sandbox/polkavm-runtime/LICENSE-MPL-2.0 16.3 KB 16.3 KB 16.3 KB
sandbox/polkavm-runtime/PolkaVM-LICENSE-APACHE 10.6 KB 10.6 KB 10.6 KB
sandbox/polkavm-runtime/PolkaVM-LICENSE-MIT 1023 B 1023 B 1023 B
sandbox/polkavm-runtime/SHA256SUMS 631 B 631 B 631 B
sandbox/polkavm-runtime/SOURCE.json 501 B 501 B 501 B
sandbox/polkavm-runtime/polkavm-browser-runtime.wasm 1.03 MB 178.3 KB 239.4 KB
sandbox/polkavm-runtime/polkavm-gpu-worker.js 63.8 KB 10.9 KB 12.6 KB
sandbox/polkavm-runtime/polkavm-worker.js 85.1 KB 13.8 KB 16.4 KB
Total 21.96 MB (+1.30 MB) 13.17 MB (+257.7 KB) (-40%) 14.15 MB (+327.1 KB)

Commit: 85eae89

@replghost

replghost commented Aug 28, 2026

Copy link
Copy Markdown
Collaborator Author

@justraman the PVM change is green across formatting, build, unit, functional, and the canonical seven-app Dotli matrix. The broad host-playground E2E remains red on the same account, allowance, and navigation failures as current main (the latest main Tests runs also fail); it does not exercise this PVM path. Could you review the runtime adapter so this can follow host-rust-core#540?

@replghost

Copy link
Copy Markdown
Collaborator Author

Revended reviewed host-rust-core commit 56c67a306fc276129829f94db85a622061e17882. Re-ran the canonical matrix on this exact vendor: Doom, Quake, Duke3D, NES, egui kitchen sink, GPU Cube, and Scene Lab all passed through Dotli's compiler backend.

@replghost

Copy link
Copy Markdown
Collaborator Author

CI diagnosis: the red E2E job is not specific to this branch.

  • main has the same host-playground product-account failures in runs 33158665346 and 33112105412.
  • I reran this PR's failed jobs as attempt 2 of 33206120102; pairing and product loading succeeded, then accounts-provider-product remained pending and the dependent TrUAPI cases cascaded.
  • Unit, Functional, bundle, lint, and the independent seven-app PolkaVM browser matrix pass.

No Dotli source change is justified for this shared signer/product-account path; the check needs the external E2E dependency restored or the repository's existing external-outage policy applied.

@replghost

Copy link
Copy Markdown
Collaborator Author

westendli.dev deployment 33225654653 completed successfully for f1c2e68, but live verification is blocked by stale environment infrastructure:

  • westendli.dev and wildcard subdomains resolve to 151.115.144.84.
  • Ports 80 and 443 on that address are unreachable.
  • The other staging domains resolve to the current shared staging host 51.159.177.252.
  • The repository Makefile declares every non-production environment, including dev-westend, on the shared staging box.

Repair requires provisioning the westendli.dev, *.westendli.dev, and *.app.westendli.dev nginx/certificate configuration on the current staging host and updating the Cloudflare DNS records. The build artifacts are already deployed; no Duke republish is needed.

@replghost

Copy link
Copy Markdown
Collaborator Author

Cold first-load Bitswap failure reproduced and fixed in eac7311.

Reproduction against a fresh Chromium profile on chinpokomon-pvm.westendli.dev failed twice with bitswap_v1_get code -32810: No connected peers have the CID requested. Retrying after the Bulletin connection warmed fetched the same CID successfully, proving a peer-discovery race rather than missing content.

The host now gives -32810 a bounded five-retry discovery window only until its first successful Bitswap block. After one success, -32810 remains terminal, so genuinely missing interior blocks do not consume the 180-second budget.

Verification:

  • focused regression: 1 passed
  • @dotli/ui typecheck: passed
  • @dotli/ui lint: passed
  • full host/sandbox/protocol production build: passed
  • fresh-profile browser smoke with the patched host bundle against the live westendli protocol/sandbox: content fetched on the first page load and reached PolkaVM ready (data-polkavm-ready=true) without pressing Retry

Reverts bd767c5 and 52b4b9f. Every App published by polkavm-app-kit declares runtime abiVersion 1 — the only version polkavm-app-abi-v1.md defines, and the value prepare-app.mjs enforces — so the strict-2 gate refused all 15 of them on chain. The runtime pin returns to @parity/pvm-browser-runtime 0.1.15 (host-runtime ffd72864), which carries the safe-area and virtual-keyboard inset ABI that 0.6.28 (cc9940b6) predates.
@replghost

Copy link
Copy Markdown
Collaborator Author

Final code review is complete and all findings are fixed in 8595bde. CI, westendli.dev deployment, and the six-product post-deploy smoke are green. The admin squash merge is currently blocked by the repository rule requiring approval from someone other than the last pusher; one requested reviewer approval will unblock it.

@replghost

Copy link
Copy Markdown
Collaborator Author

Consolidated the Zed follow-ups here instead of maintaining parallel PRs #216 and #217. Latest branch commit: 249395a.

Included:

Verification on the consolidated branch: host/sandbox/protocol build passed with the CI network configuration; all 41 focused sandbox PolkaVM runtime tests passed; browser runtime asset identity/checksums verified against @useragent-kit/polkavm-runtime 0.1.1 / runtime source 08cb7401087f8b715dc4f1be0007753caa4bd7c2. Prior direct browser smoke verified framebuffer resizing and cached reload. Full functional CI remains required; local Playwright browser launches previously terminated before the test assertions.

Removed deploy: westendli.dev before pushing to prevent an implicit deployment. This is source consolidation only; the live build was not replaced. No native host work or new ABI was introduced.

@replghost

Copy link
Copy Markdown
Collaborator Author

The user explicitly selected draft computer PR #215 as the branch to deploy to westendli.dev, then approved restoring it after this PR's deployment superseded it. I removed this PR's deploy: westendli.dev label and cancelled/force-cancelled deployment run 34301723665. Other checks and integration work are untouched.

Latest #185 (36a2129) is merged into #215 as c256ccc; restoration run: https://github.com/paritytech/dotli-community/actions/runs/34302321041.

Please keep westendli.dev deployment ownership on #215 for this computer task. Do not re-add the deployment label here without an explicit user decision to switch the deployed branch; the workflow concurrency key is per PR, so two labeled PRs can overwrite the same environment.

@github-actions

github-actions Bot commented Sep 9, 2026

Copy link
Copy Markdown
Contributor

E2E Product suite failed on 7e189b0680267d64e018af3ef59c4060d038cca0 — suite did not produce results.

Failed tests:

  • (no results.json — suite likely crashed before any tests ran)

Logs: https://github.com/paritytech/dotli-community/actions/runs/34384639876
Artifacts: e2e-product-results (uploaded above) — open the failed test's trace.zip with npx playwright show-trace.

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

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant