Skip to content

Build again after #1203: cmd_trace and the rich-text tests take their app - #1225

Merged
transfix merged 1 commit into
masterfrom
fix/master-build-after-1203
Nov 14, 2026
Merged

transfix merged 1 commit into
masterfrom
fix/master-build-after-1203

Conversation

@transfix

Copy link
Copy Markdown
Owner

Master doesn't build since #1203 merged (7ead20e, still so at 69c7091). #1203 gives every cvc command its app as an argument, removes cvc_app() and makes cvc::ariadne::load_string take the app. #1168 and #1180 merged just before it, and their new code still uses the old forms:

MSVC, with these two files fixed: error C2660: 'cvc::ariadne::load_string': function does not take 1 arguments (ariadne_runtime_test.cpp lines 8855, 8904 and 9000), and cvc_app undeclared in cmd_trace.

Checked

  • Windows (MSVC, Ninja, cvcGL on), on 69c7091 with this change: the whole tree builds with no errors (ninja -k 0). ctest -R "AriadneRichText|CvcCliTest" passes, 197/197, including all 8 AriadneRichText tests and CvcCliTest.TraceInfoAndVerifyReplayASession.
  • clang-format is clean on the changed lines.

Every open PR's CI builds its merge with master, so until this lands, each one fails at cvc-cli or ariadne_runtime_test whatever its own change is. #1171 already has the same cmd_trace change; the two merge cleanly.

… 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.
@transfix
transfix enabled auto-merge (squash) November 14, 2026 08:27
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
Master gained #1203 (this branch's base), #1192 (state_exec Stage S,
several steps a pick) and ten others.

Conflicts, both #1192's run code against this branch's registry work:
- async_scheduler.cpp: the slice setters from #1192, set_cycle_registry
  from here (it also gives the evaluator the registry). The cycle check
  takes the registry in the evaluation context (the one given, else its
  evaluator's own) where #1192 fell back to the thread's own, which this
  branch removes; collect_cycles_if_due now takes a registry. A run's
  steps go through the same context as its first; step_run's drain check
  is check_not_in_kernel, as step_once's is.
- state_exec_groups_test.cpp: OC01's caller-pumped case keeps #1192's one
  step a pick and this branch's watched group. The file's note on leaks no
  longer speaks of a thread's own registry.

Semantic, not textual:
- #1192's Slices tests: SL04's spin-step and SL08's heavy take call_args
  and reach their context through it (eval_deadline_check(a.context()),
  a.context()->data), as this branch's other natives do.
- cvc-cli's trace command (#1168) takes its app, and #1180's three
  rich-text tests pass theirs to load_string. Both landed after #1203's
  last master merge and still used what #1203 removed, so master does not
  build at 7ead20e or 69c7091; #1225 makes the same change there.

Checked on Windows (MSVC Release): full build; groups 28/28; Slices and
run-budget tests 19/19; rich text and heap 10/10; the cycle collector and
registry tests, pycvc_ariadne, CvcCliTest.TraceInfoAndVerifyReplayASession
and state_exec_async_test_slice256, 20/20.
transfix added a commit that referenced this pull request Nov 14, 2026
Conflict in src/cvc/world/generated_world.cpp: master's #1203 made the
terrain generators each app's own (generators(app), terrainFrom), and
#1215 had put the shore edge (shore_terrain) in the old make_terrain.
shore_terrain now sits beside terrainFrom, which wraps any app's
generator in it, so make_terrain(app, p) and to_world_params(app, p)
both get the shore.

#1203 also broke code that only feat/world-gym has: its edge and gym
tests call generate_world, make_terrain and load_string without an app.
They make one first now.

cvc-cli's cmd_trace and three ariadne_runtime_test rich-text tests do
not build on master itself after #1203. This takes #1225's fix for them
line for line, so that #1170 builds; the two merge cleanly either way.
transfix added a commit that referenced this pull request Nov 14, 2026
cmd_trace (#1168) still had the old command signature and called cvc_app(), which #1203
removed, so cvc-cli did not build on master. It now takes the app like the other commands
and replays the trace in it. The same change as #1225's, so either can land first.
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
transfix merged commit 4c4a590 into master Nov 14, 2026
27 checks passed
@transfix
transfix deleted the fix/master-build-after-1203 branch November 14, 2026 15:47
transfix added a commit that referenced this pull request Nov 14, 2026
…urfaces

A clean merge. #1225 makes master build again after #1203; its cmd_trace
change is the one this branch already had. The diff against master is only
this PR's own 14 files again.
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.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant