Commit Graph
34 Commits
Author SHA1 Message Date
udo f745ce9413 Deduplicate entry freshness filesystem work 2026-07-18 06:16:49 +00:00
udo 556025a779 Profile pre-dispatch WASM readiness 2026-07-18 05:43:36 +00:00
udo a5ad5042b7 Reuse loaded component units per request 2026-07-18 05:01:27 +00:00
udo 5e140d6a5a Decode request maps directly into Wasm workspaces 2026-07-18 04:21:28 +00:00
udo 516ed94032 Cache immutable Wasm server configuration encoding 2026-07-18 03:43:44 +00:00
udo a043fb8fc7 Avoid resolving loaded request entries twice 2026-07-18 03:08:01 +00:00
udo 339031b6c3 Avoid repeated warm request dispatch work 2026-07-18 02:32:28 +00:00
udo 72fd0dd53a Pre-instantiate WASM core workers 2026-07-18 01:58:01 +00:00
udo c28b446541 Profile complete Wasm request timing 2026-07-17 19:11:05 +00:00
udo 8dbff881a1 Profile request thread runtime on demand 2026-07-17 03:05:37 +00:00
root 5a5450caa8 Keep hostcall CPU profiling off hot paths 2026-07-17 02:35:03 +00:00
root c15fdc3346 Make hostcall CPU profiling configurable 2026-07-17 02:22:56 +00:00
udo 8dd307d316 Precompile native modules off request path 2026-07-16 22:51:16 +00:00
udo ee2177f4b4 Prewarm wasm workers before accepting requests 2026-07-16 21:00:46 +00:00
udo 6a02c07bcb Reuse reset MySQL connections per worker 2026-07-16 17:00:28 +00:00
udo 92baaa6299 fix: prevent stale mutation execution 2026-07-13 20:17:48 +00:00
udo cd2fa163e6 keep CLI units current during rebuilds 2026-07-13 14:20:29 +00:00
udo 97ecc6edd6 keep web requests off rebuild path 2026-07-13 12:25:42 +00:00
udo 5195ebeb25 avoid request stalls during proactive rebuilds 2026-07-13 12:12:14 +00:00
udo a6cb1c0390 fix wasm session and mysql placeholder state 2026-07-06 07:54:01 +00:00
root f2a3503ac3 configurable trans-membrance hostcall blocklist 2026-06-16 01:13:06 +00:00
root 99cd92fb4a docs 2026-06-15 21:42:50 +00:00
root 1a5c6547b9 post-W7 cleanup 2026-06-15 12:00:46 +00:00
rootandClaude Opus 4.8 4f84ac544d feat: request_perf() worker-side timing hostcall; restore demo System Info
Units run in the wasm sandbox, so my_pid/parent_pid/context.server->request_count
read as sandbox stubs — the demo System Info counters were broken, and there was
no authoritative server-side request timing available to unit code (client-side
measurement cannot see queue/dispatch latency).

Add a request_perf() unit API backed by a new uce_host_request_perf hostcall.
The native worker answers it live, returning a DValue:
  worker_pid, parent_pid, request_count,
  accept_us  = (time_start - time_init)*1e6   (entry -> dispatch wait),
  running_us = (now - time_start)*1e6         (since dispatch, live),
  total_us   = (now - time_init)*1e6          (since the request entered UCE),
  workspace_birth_us.
time_init is captured at request entry (handle_request, with a handle_complete
fallback); a RequestPerfSnapshot {pids, request_count, time_init, time_start} is
threaded from wasm_backend_serve through wasm_worker_serve onto the workspace,
and the hostcall computes the live deltas at call time. Wired like uce_host_units
(sized DValue hostcall): core_hostcalls.syms + sys.cpp/sys.h request_perf().

site/demo/index.uce System Info now uses request_perf() and shows the real worker
PID, an incrementing per-worker request count, and the timing counters.

Implemented via the pi agent (gpt-5.3-codex-spark); a review of the live numbers
caught accept_us mistakenly computed as (now - time_init) (== total_us), fixed to
the dispatch wait (time_start - time_init). Independently verified on the host:
System Info shows non-zero PIDs, incrementing count, accept_us ~50us << total_us
~2.4ms with accept+running==total; run_cli_tests --include-wasm-kill => 87 passed,
0 failed, 0 skipped.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
2026-06-15 08:18:04 +00:00
rootandClaude Opus 4.8 cf51336873 W7e: delete the native unit pipeline (.so compile + dlopen execution)
Units now run exclusively on wasm; the native generated-C++ -> clang -> .so ->
dlopen path and its request-time fallback are removed.

- Dispatch (linux_fastcgi.cpp): the 4 handle_complete branches + the CLI-socket
  path route every request through wasm (wasm_ready compiles cold/stale on
  demand); a wasm-unavailable unit now yields a clean error page
  (fail_wasm_unavailable / render_request_failure) instead of native execution.
  compiler_invoke / _cli / _websocket / _serve_http deleted.
- compiler.cpp (-1274): removed the native .so compile (COMPILE_SCRIPT),
  load_shared_unit, dlopen/dlsym/dlclose, compiler_load_shared_unit, and the
  SharedUnit .so function-pointer fields (on_setup/on_render/on_component/
  on_websocket/on_cli/on_once/on_init) in types.h/types.cpp. compile_shared_unit
  now builds only the .wasm side-module; the .uce preprocessor/parser front-end
  is kept (it emits the C++ the wasm compile consumes).
- unit_call()/component()/once/init now resolve across units through the wasm
  host component resolver (uce_host_component_resolve) instead of native dlsym;
  configured runtime error pages render through the wasm backend.
- Dropped the WASM_BACKEND_ENABLED feature flag and dead COMPILE_SCRIPT /
  COMPILE_WASM_UNITS config; unit ABI freshness tied to UCE_UNIT_ABI_VERSION;
  guard against serving a stale .wasm for a deleted source; retired the obsolete
  W5 native-vs-wasm toggle script. Docs updated.

Implemented via the pi agent (with 3 delegated sub-reviews); independently
re-verified on the build host: run_cli_tests --include-wasm-kill => 87 passed,
0 failed, 0 skipped.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
2026-06-14 23:20:50 +00:00
rootandClaude Opus 4.8 2debd33804 W7e: wasm-preferred dispatch + compile-on-demand; harden unit ABI validator
- Dispatch (linux_fastcgi.cpp): route every request through wasm. On a
  cold/stale artifact, compile the unit on demand (get_shared_unit, forced) and
  serve wasm; native compiler_invoke* remains only as a fallback when wasm
  cannot be made ready (compile failure / backend disabled). Applies to the 4
  handle_complete branches and the CLI socket path.
- backend.cpp: delete the now-vestigial native-only fallback token gate
  (wasm_backend_native_fallback_*), empty since W7d; should_handle now gates on
  config + current artifact + healthy worker only.
- check_unit_wasm.py: skip the defense-in-depth llvm-nm allocator scan when
  llvm-nm SIGSEGVs on a degenerate-but-valid module (e.g. a unit with no
  exported handlers). Fixes site/demo/empty.uce, the last unit that could not
  produce a .wasm; forbidden allocator *exports* are still rejected.

A pi-assisted review caught that the compile-freshness check keys off the .so
mtime only, so force_recompile is required to rebuild a missing/stale .wasm; a
unit already cached in-process whose .wasm later vanished still uses native
fallback (closed in W7e stage B). Native execution is otherwise bypassed for
all real traffic.

Verified: scripts/run_cli_tests.sh --include-wasm-kill -> 87 passed, 0 failed.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
2026-06-14 18:20:12 +00:00
rootandClaude Opus 4.8 8587fbc5aa wasm runtime: central WS broker, unified handlers, W7d holdouts, membrane completeness
- WS: a dedicated broker process owns HTTP_PORT + every connection; it forwards
  renders to the worker pool over uce.sock (non-blocking) and applies ws_*
  command batches flushed back at workspace teardown. Removes the now-dead
  per-worker websocket executor (-509 lines).
- Dispatch: unify CLI / WebSocket / serve_http / page render through one
  serve_via_wasm(entry_unit, handler) path; handler string -> __uce_<handler>
  export symbol.
- W7d: rewrite zip.uce to the membrane return-value error contract (no C++
  try/catch), error-reporting.uce to genuine wasm traps instead of throw, and
  sharedunit.uce to unit_info(); empty the native-only token gate.
- Membrane: wire ls / mkdir / file_mtime through new uce_host_file_list /
  uce_host_file_mkdir / uce_host_file_mtime hostcalls (resolve_guest_file gains
  directory support). Fixes /doc/index.uce listing nothing; adds a regression
  assertion that the index enumerates items.
- Docs: add docs/wasm-runtime-architecture.md; record the W7e staged native-
  deletion plan in WASM-PROPOSAL.md.

Verified: scripts/run_cli_tests.sh --include-wasm-kill -> 87 passed, 0 failed.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
2026-06-14 17:51:51 +00:00
udo b1856c1725 chore: narrow wasm backend entrypoint API 2026-06-13 22:32:02 +00:00
udo af6500d134 fix: harden wasm w7 entrypoint paths 2026-06-13 22:08:52 +00:00
root d6421cb8f3 feat: extend wasm backend entrypoints 2026-06-13 21:50:19 +00:00
root fe83c52411 feat: membrane remaining wasm host surfaces 2026-06-13 20:10:00 +00:00
udo c84fc86e6c W6 2026-06-13 16:19:52 +00:00
udo 5a56d4f39e W5 2026-06-13 15:10:42 +00:00
udo afaa4dd7c0 feat: cut over to WASM backend 2026-06-13 08:42:31 +00:00