Repository navigation
ariadne_wasm_transform_test: the runtime registers the engine on its app (master builds again) - #1229
Merged
Merged
Conversation
…app (master builds again) #1197's ariadne_wasm_browser_test.cpp (built natively as ariadne_wasm_transform_test wherever wasmtime is found, and in the wasm-guests node job) still called register_script_engine(engine) and unregister_script_engine("wasm"), which #1203 replaced with the (app, ...) forms. #1197's CI ran before #1203 landed, so master at accadc3 doesn't compile it. As #1203 did for ariadne_wasm_test.cpp: SetUp no longer registers the engine, and the TearDown that unregistered it goes. Each of the file's 18 AppRuntimes already calls use_script_engine(engine), which registers it on that runtime's app.
transfix
enabled auto-merge (squash)
November 14, 2026 08:57
… app #1203 gives every cvc command its app as an argument, removes cvc_app() and makes cvc::ariadne::load_string take the app. It merged after #1168 and #1180, whose new code still used the old forms, so master does not build: - src/cvc-cli/main.cpp: cmd_trace (#1168) takes cvc::app & like the other commands and replays on it, not cvc_app(). - src/cvc/tests/ariadne_runtime_test.cpp: #1180's three AriadneRichText tests pass their app to load_string; each already makes one.
Owner
Author
transfix
added a commit
that referenced
this pull request
Nov 14, 2026
…s), so py_console's CI builds
transfix
added a commit
that referenced
this pull request
Nov 14, 2026
…e browser test's fixture) into feat/wasm-weighted-gas
transfix
added a commit
that referenced
this pull request
Nov 14, 2026
…wser (G2, second part) (#1206) A guest's work now counts the same on wasmtime and in the browser, and however a call is sliced. - meter.h/.cpp: the gas pass, in C++. It reads a core module, charges each metered block's cost against a new exported i64 global, ari_gas, inline, and calls a new import, ari.gas(cost), only when the slice can't pay for the block. A block starts at a function's entry and after loop, if, else, end and the conditional branches. An instruction costs what wasmtime's fuel charges. The new import shifts every defined function's index, in calls, ref.func, element segments, exports, the start function and the name section. ari_gas starts at the start function's allowance. - It refuses GC types and instructions, the legacy exception handling, components, and code that names a global index the pass's own would take. A module that imports ari.gas already is left as it is. - It's C++ rather than paritytech/wasm-instrument, which the roadmap named: that crate and its parser, parity-wasm, haven't changed since 2022, and parity-wasm doesn't read reference types, which LLVM 19 turns on by default for wasm32. - meter_main.cpp: ari_wasm_meter, the pass as a command. Under Emscripten it runs in node. - cvc_ariadne_wasm_transform: binaryen reads the guest, ari_wasm_meter meters it, then wasm-opt --asyncify --pass-arg=asyncify-imports@ari.* -O1. This replaces --log-execution. - wasmtime validates and meters each module it compiles. A poll sets ari_gas to its slice; ari.gas is an async import that ends the poll. When a charge ends a slice, the next slice is at least that block's cost. Fuel stays on as a backstop (16 units per unit of gas). A start function past its allowance traps instead of hanging. - browser_runtime.cpp pauses at ari.gas instead of counting log_execution checks. The page sets ari_gas before each call, and the gas the guest took is the call's. kFuelPerCheck is gone. - Call::poll(gas), gas_used() and Instance::run(..., gas, ...) replace the fuel names. - Tests: WasmGasTest (ariadne_wasm_test). A module naming functions everywhere runs as it did. count(1000) costs 8001 in slices of 1, 7, 8, 100, 4096 and in one. A module is metered once. What the pass can't read is refused, and every prefix of a module is read or refused. A start function that never ends is refused. WasmTransformed.ASpinCountsTheSameOnBothBackends: the transformed guest's spin costs 24,000,001 in one slice and in 376 of 64,000, on wasmtime and in the browser. - The WASI guest (#1199) is metered and Asyncified in the transform too, and the transform passes binaryen CVC_WASM_GUEST_FEATURES on both runs. - The branch also carries the compile fixes for #1203's API change that #1225 and #1229 bring to master (cmd_trace, the rich-text tests' load_string, the browser test's fixture), which master may have first.
transfix
added a commit
that referenced
this pull request
Nov 14, 2026
CI at 9d002d1 built it on master as of 09:28, after #1197 added ariadne_wasm_browser_test.cpp with register_script_engine calls that predate #1203 (all three package-linux lanes and wasm-guests failed to compile it). Master fixed that in #1229, and the load_string calls #1169 left in the loader and chart tests in #1190. This merge takes master as it is now, so CI builds on those fixes. No conflicts. Master's new natives (#1190's file-pick and http-upload, #1195's py_console, #1169's chart) build against this branch's call_args context as they are. Checked on Windows (MSVC Release): full build; the Ariadne, net, HTTP, state_exec, groups, slices, async-call, cycle-registry and multi-app ctests, 1336/1336. ariadne_wasm_browser_test is not built here (it needs wasmtime or Emscripten); master's CI builds it.
transfix
added a commit
that referenced
this pull request
Nov 14, 2026
…#1222-#1225, #1229) Master's #1190 (file-pick and http-upload) was written for a single async host; this branch runs an isolated document's programs on its own group's host, on a pool worker in an `any` group. - net_intrinsics.cpp: StartedRequest takes master's deliver()/on_outcome, settling through the host's finisher. http-upload is its own provider, `any` as the requests are: it parks on the calling program's host (ictx.host), takes its progress path from ictx.root_path (no tree walk on a worker), and a started upload (a browser page) keeps the host's finisher, not the host. - ariadne.cpp: file-pick, file-info and file-forget bind into the program's env as they are, in every group (install_backend_verbs), not through the backend verbs' host_proxied wrapper, which cannot park an async verb. file-pick parks on the program's own host, claims the Runtime's picker hub under its lock where it is called, and opens the picker on the host thread (exec_pool::run_on_host; inline when called there). Its answer goes through the host's finisher, as the host may be gone by then. - ci.yml: the sanitizer list keeps this branch's tests and master's point_classes_test. - STATE_EXEC_THREADED.md: rows for http-upload, the file verbs, and the contours and point-classes providers. The last two are registered without a kind, so they are host_only, and an isolated document in an app that installs them goes to a host-affinity group. - New test: AriadneIsolatedDocs.FilePickOpensItsPickerOnTheFramesThread.
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.
Master at
accadc35doesn't compileariadne_wasm_transform_test. #1197'ssrc/cvc/tests/ariadne_wasm_browser_test.cppstill callsregister_script_engine(engine)andunregister_script_engine("wasm"). #1203 replaced both with the(app, ...)forms, and #1197's CI ran before #1203 landed. The file builds natively wherever wasmtime is found, and in the wasm-guests node job.The fix follows what #1203 did for
ariadne_wasm_test.cpp:SetUpno longer registers the engine;TearDownthat unregistered it is gone.All 14 tests' 18
AppRuntimes already calluse_script_engine(engine), which registers the engine on that runtime's app.#1206 carries the same change, so whichever lands second takes master's copy.