Skip to content

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

Open
replghost wants to merge 288 commits into
feat/pwa-walletfrom
feat/pvm-wasm
Open

replghost wants to merge 288 commits into
feat/pwa-walletfrom
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, WebGPU Raster, and WebGPU profiles
  • route canonical TrUAPI plus versioned core clocks and entropy, graphics, input, audio, UI output, and mediated camera input through the sandbox
  • keep the application runtime contract at ABI 1 and use the neutral host-frame-request / host-frame-response transport
  • keep motion and camera input optional and permission-gated
  • vendor exact @parity/polkavm-browser-runtime 0.3.0 assets and provenance while serving only the runtime, cooperative worker, and GPU worker assets
  • key cached runtime artifacts by content digest and retry transient WebGPU device restoration
  • 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 is the native #540 / PolkaVM browser-runtime integration. Chat v2 account authority is isolated in #255 (feat/chat-v2-host-runtime), stacked above this PR and paired with native host #709. Experimental browser-wallet UI and session integration live in #238 (feat/pwa-wallet), this PR’s base. The wallet and shared non-Chat host SDK are inherited; this PR’s own diff remains the PolkaVM browser integration. The browser stack is main → #238 → #185 → #255. #226 and #236 are historical merged PRs; #255 is the active Chat integration replacement.

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 the separate draft PR #215 pending their host-interface RFC.

Generic host.core wall clock, monotonic clock, and secure randomness are part of this App runtime integration, not the experimental computer-interface scope.

Runtime provenance

The TrUAPI client and native-host browser packages remain sourced from host-rust-core#540 at 749cf906bb3c8c26f484bf86845a33aac4b8d816, not the Chat #709 branch. Their package and binary digests are recorded in vendor/truapi-host.lock.json; this update does not change those packages.

Dependencies

Verification

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

Historical runtime refresh (not deployed)

Earlier staging verification above is historical. No deployment was dispatched for this update.

For local retesting after pulling these vendored package updates, run bun install --force --frozen-lockfile to refresh cached local-file dependencies before starting the existing development/build commands.

Comfortable play update (forwarded to #255)

  • Host Menu, Resume, declared Controls, Change Game / Choose file, Retry, and original-launcher recovery; accessible modal focus and Alt-M shortcut. Escape closes an open menu without taking Escape away from gameplay.
  • Explicit pause and visibility remain independent; release held input, freeze guest time, stop queued audio, and resume only with the matching runtime protocol.
  • Empty, unsupported, failed-read, and guest-rejected file selections retain recovery actions. Local file bytes remain inside the sandbox.
  • Generic runtime/manifest integration only: no Chat authority or wallet changes. Supafaust cartridge math and guest help are in paritytech/polkavm-app-kit#68.
  • Verification: all 60 sandbox tests, sandbox production build/typecheck, changed-module lint, resolver typecheck and 19 manifest tests, and exact runtime asset checks passed. Local Chromium exercised file recovery, pause/resume, and cancellation of an in-flight read during teardown.
  • No deployment label was added here. These updates were forwarded to feat(chat): restore separate Chat authority integration above PolkaVM #255 and deployed through that top layer to paseo.fyi; feat(polkavm): run App Manifest v2 runtimes in Dotli #185 remains open above feat(wallet): add an opt-in debug-only browser test wallet #238.

Menu alignment follow-up fbf77a75 anchors the pause menu below its top-right trigger. The deployed #255 surface was verified at desktop and narrow/landscape sizes, including viewport containment and scrolling.

@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/bridge.js 785.1 KB (+631.8 KB) 169.4 KB (+133.4 KB) 218.4 KB (+175.3 KB)
host/assets/truapi_provider_bg.wasm 5.24 MB 1.99 MB 2.34 MB
host/assets/truapi_server_bg.wasm 7.61 MB (+227.9 KB) 5.38 MB (+60.5 KB) 5.70 MB (+85.7 KB)
host/assets/wasm/web/truapi_server_bg.wasm 7.61 MB (+227.9 KB) 5.38 MB (+60.5 KB) 5.70 MB (+85.7 KB)
sandbox/polkavm-runtime/polkavm-browser-runtime.wasm 1.07 MB 186.2 KB 250.3 KB
Total 23.83 MB (+2.55 MB) 13.59 MB (+563.0 KB) (-43%) 14.73 MB (+735.5 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/base.js 4.7 KB 1.9 KB 2.1 KB
host/assets/blake2.js 7.3 KB (-4.4 KB) 2.6 KB (-1.6 KB) 2.9 KB (-1.8 KB)
host/assets/blake2.js 4.5 KB (-7.2 KB) 1.9 KB (-2.2 KB) 2.1 KB (-2.6 KB)
host/assets/bridge.js 785.1 KB (+631.8 KB) 169.4 KB (+133.4 KB) 218.4 KB (+175.3 KB)
host/assets/browser.js 22.9 KB 7.6 KB 8.6 KB
host/assets/chain-sync.js 3.8 KB 1.5 KB (+1 B) 1.7 KB (+2 B)
host/assets/client.js 13.4 KB (+1.0 KB) 4.4 KB (+337 B) 4.9 KB (+373 B)
host/assets/hex.js 160 B 160 B 160 B
host/assets/index.css 64.2 KB (+1.7 KB) 10.1 KB (+288 B) 11.6 KB (+356 B)
host/assets/index.js 296.8 KB (+108.4 KB) 81.2 KB (+30.8 KB) 97.4 KB (+36.9 KB)
host/assets/manifest.js 21.5 KB (-1.8 KB) 7.0 KB (-364 B) 7.7 KB (-413 B)
host/assets/network.js 6.6 KB (+772 B) 2.3 KB (+283 B) 2.7 KB (+328 B)
host/assets/panel.js 118.1 KB (+27.0 KB) 31.8 KB (+7.1 KB) 36.6 KB (+8.4 KB)
host/assets/proofs.js 29.3 KB (+1 B) 8.6 KB (-8 B) 9.5 KB (+5 B)
host/assets/resolve.js 161 B 161 B 161 B
host/assets/rolldown-runtime.js 901 B (+185 B) 901 B (+185 B) 901 B (+185 B)
host/assets/rpc-resolve.js 3.1 KB (+370 B) 1.3 KB (+98 B) 1.4 KB (+118 B)
host/assets/scale-ts.js 4.8 KB 2.0 KB 2.2 KB
host/assets/spans.js 2.8 KB (+373 B) 1.2 KB (+149 B) 1.4 KB (+175 B)
host/assets/src.js 84.4 KB (+143 B) 26.6 KB (+159 B) 29.7 KB (+131 B)
host/assets/styles.css 28.0 KB (+6.9 KB) 5.7 KB (+1.1 KB) 6.7 KB (+1.3 KB)
host/assets/substrate-client.js 5.8 KB 2.2 KB (+7 B) 2.5 KB (-1 B)
host/assets/truapi_provider_bg.wasm 5.24 MB 1.99 MB 2.34 MB
host/assets/truapi_server_bg.wasm 7.61 MB (+227.9 KB) 5.38 MB (+60.5 KB) 5.70 MB (+85.7 KB)
host/assets/twoX.js 2.8 KB 1023 B (+1 B) 1.1 KB (-2 B)
host/assets/utils.js 3.5 KB 1.4 KB 1.5 KB
host/assets/wasm/web/README.md 16.8 KB 16.8 KB 16.8 KB
host/assets/wasm/web/package.json 372 B (+1 B) 372 B (+1 B) 372 B (+1 B)
host/assets/wasm/web/truapi_server.d.ts 20.6 KB (+6.5 KB) 20.6 KB (+6.5 KB) 20.6 KB (+6.5 KB)
host/assets/wasm/web/truapi_server.js 66.1 KB (+13.9 KB) 9.5 KB (+1.2 KB) 11.2 KB (+1.4 KB)
host/assets/wasm/web/truapi_server_bg.wasm 7.61 MB (+227.9 KB) 5.38 MB (+60.5 KB) 5.70 MB (+85.7 KB)
host/assets/wasm/web/truapi_server_bg.wasm.d.ts 6.4 KB (+2.1 KB) 6.4 KB (+2.1 KB) 6.4 KB (+2.1 KB)
host/assets/web.js 22.1 KB (+1.2 KB) 5.6 KB (+259 B) 6.3 KB (+306 B)
host/assets/worker-runtime.js 106 B (-32.2 KB) 106 B (-7.8 KB) 106 B (-8.9 KB)
host/assets/worker-runtime.js 41.2 KB (+8.8 KB) 9.4 KB (+1.5 KB) 10.8 KB (+1.7 KB)
host/assets/ws.js 25.8 KB (+2 B) 8.3 KB (-3 B) 9.2 KB
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 (-8 B) 1.2 KB (-9 B) 1.3 KB (-7 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 36.4 KB (+190 B) 7.3 KB (+45 B) 9.0 KB (+73 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 (+323 B) 4.0 KB (+376 B)
sandbox/assets/bitswap-bridge.js 1.1 KB 549 B (-4 B) 634 B
sandbox/assets/fetch.js 3.4 KB 1.2 KB 1.4 KB (+1 B)
sandbox/assets/index.css 64.2 KB (+1.7 KB) 10.1 KB (+288 B) 11.6 KB (+356 B)
sandbox/assets/index.js 207.5 KB (+80.8 KB) 58.1 KB (+22.0 KB) 67.9 KB (+25.9 KB)
sandbox/favicon.svg 1.8 KB 1.8 KB 1.8 KB
sandbox/index.html 2.9 KB (+56 B) 785 B (+20 B) 1.0 KB (+27 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 502 B 502 B 502 B
sandbox/polkavm-runtime/polkavm-browser-runtime.wasm 1.07 MB 186.2 KB 250.3 KB
sandbox/polkavm-runtime/polkavm-gpu-worker.js 64.2 KB 11.0 KB 12.8 KB
sandbox/polkavm-runtime/polkavm-worker.js 112.8 KB 17.7 KB 21.6 KB
Total 23.83 MB (+2.55 MB) 13.59 MB (+563.0 KB) (-43%) 14.73 MB (+735.5 KB)

Commit: ef0ba01

@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.

…185-final

# Conflicts:
#	.github/workflows/test.yml
#	apps/host/tests/e2e/global-setup.ts
#	packages/ui/src/bridge.ts
#	packages/ui/src/chat/custom-message.ts
#	packages/ui/src/chat/custom-renderer.ts
#	packages/ui/src/chat/service.ts
#	packages/ui/src/debug-wire-describe.ts
#	packages/ui/src/host-callbacks/SessionStore.ts
#	packages/ui/src/host-callbacks/UserConfirmation.ts
#	packages/ui/src/legacy-host-bridge.ts
#	packages/ui/src/styles/signing.css
#	packages/ui/src/styles/themes.css
#	packages/ui/tests/bridge.test.ts
#	packages/ui/tests/chat-custom-renderer.test.ts
#	packages/ui/tests/chat-panel.test.ts
#	packages/ui/tests/debug-wire-describe.test.ts
#	packages/ui/tests/legacy-host-bridge.test.ts
#	packages/ui/tests/user-confirmation.test.ts
#	vendor/truapi-host/dist/wasm/web/truapi_server.d.ts
#	vendor/truapi-host/dist/wasm/web/truapi_server.js
#	vendor/truapi-host/dist/wasm/web/truapi_server_bg.wasm
#	vendor/truapi-host/dist/wasm/web/truapi_server_bg.wasm.br
#	vendor/truapi-host/dist/wasm/web/truapi_server_bg.wasm.d.ts
#	vendor/truapi-host/dist/wasm/web/truapi_server_bg.wasm.gz
#	vendor/truapi-host/dist/worker-renderer.d.ts
#	vendor/truapi-host/package.json
#	vendor/truapi/dist/explorer/versions.d.ts
#	vendor/truapi/dist/explorer/versions.js
#	vendor/truapi/package.json
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