W7f: sweep dead/legacy/fallback leftovers after native-pipeline removal
Post-deletion cleanup (units run only on wasm): - types.h/compiler.cpp: drop the native-era SharedUnit fields so_name, bin_file_name, and the opt_so_optional cache-mode plumbing (no native optional .so path remains). The per-unit compile lock is re-keyed from so_name+.lock to wasm_name+.lock (still per-unit). - unit_info() and to_string(SharedUnit*) no longer expose .so artifact fields. - backend.h: drop the stale "+ fallback-token gate" comment. - Docs/comments corrected to wasm-only reality: README, tests/README, site/doc C++ preprocessor + error_pages + unit_info pages, site/info intro, site/demo/unit-browser artifact card; the Phase-5 native-vs-wasm benchmark harness (tests/wasm_benchmark.py) reframed for the wasm-only backend. Audit confirmed no live references remain to so_handle, load_shared_unit, compiler_load_shared_unit, compiler_invoke*/_cli/_websocket/_serve_http, COMPILE_SCRIPT/COMPILE_WASM_UNITS, or the native export-symbol constants; request_ref_handler/dv_call_handler are kept (live wasm funcref casts). Swept via the pi agent (delegated to a gpt-5.3-codex-spark sub-model); independently re-verified on the host: run_cli_tests --include-wasm-kill => 87 passed, 0 failed, 0 skipped. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
This commit is contained in:
+2
-2
@@ -6,8 +6,8 @@
|
||||
// backend.cpp — so it does not have to compile worker.cpp + wasmtime.hh on
|
||||
// every build. Include only after uce_lib.h (needs Request / String).
|
||||
|
||||
// True if this request should be served by the wasm backend (config + artifact
|
||||
// + fallback-token gate); handler-agnostic, the caller names the handler.
|
||||
// True if this request can be served by the wasm backend for the named unit
|
||||
// artifact; handler-agnostic, the caller names the handler.
|
||||
bool wasm_backend_should_handle(Request& request, const String& entry_unit);
|
||||
|
||||
// Serve a request through a wasm workspace by invoking a named unit handler —
|
||||
|
||||
+6
-6
@@ -564,7 +564,7 @@ static void wasm_run_once(const String& resolved, Request& request)
|
||||
return;
|
||||
String previous_unit = request.resources.current_unit_file;
|
||||
request.resources.current_unit_file = resolved;
|
||||
request_ref_handler once_handler = (request_ref_handler)(uintptr_t)once_slot;
|
||||
WasmRequestHandler once_handler = (WasmRequestHandler)(uintptr_t)once_slot;
|
||||
once_handler(request);
|
||||
request.resources.current_unit_file = previous_unit;
|
||||
}
|
||||
@@ -597,7 +597,7 @@ DValue* unit_call(String file_name, String function_name, DValue* call_param)
|
||||
String previous_unit = context->resources.current_unit_file;
|
||||
if(resolved != "")
|
||||
context->resources.current_unit_file = resolved;
|
||||
request_ref_handler handler_fn = (request_ref_handler)(uintptr_t)slot;
|
||||
WasmRequestHandler handler_fn = (WasmRequestHandler)(uintptr_t)slot;
|
||||
handler_fn(*context);
|
||||
context->resources.current_unit_file = previous_unit;
|
||||
return(0);
|
||||
@@ -614,7 +614,7 @@ DValue* unit_call(String file_name, String function_name, DValue* call_param)
|
||||
String previous_unit = context->resources.current_unit_file;
|
||||
if(resolved != "")
|
||||
context->resources.current_unit_file = resolved;
|
||||
dv_call_handler handler_fn = (dv_call_handler)(uintptr_t)slot;
|
||||
WasmDValueCallHandler handler_fn = (WasmDValueCallHandler)(uintptr_t)slot;
|
||||
DValue* result = handler_fn(call_param);
|
||||
context->resources.current_unit_file = previous_unit;
|
||||
if(result)
|
||||
@@ -644,7 +644,7 @@ void component_render(String name, DValue props, Request& request)
|
||||
request.resources.current_unit_file = resolved;
|
||||
// a wasm function pointer is its index in the shared funcref table; the
|
||||
// host returned the handler's slot, so this is a plain call_indirect
|
||||
request_ref_handler handler_fn = (request_ref_handler)(uintptr_t)slot;
|
||||
WasmRequestHandler handler_fn = (WasmRequestHandler)(uintptr_t)slot;
|
||||
handler_fn(request);
|
||||
request.resources.current_unit_file = previous_unit;
|
||||
}
|
||||
@@ -680,7 +680,7 @@ void unit_render(String file_name, Request& request)
|
||||
String previous_unit = request.resources.current_unit_file;
|
||||
if(resolved != "")
|
||||
request.resources.current_unit_file = resolved;
|
||||
request_ref_handler handler_fn = (request_ref_handler)(uintptr_t)slot;
|
||||
WasmRequestHandler handler_fn = (WasmRequestHandler)(uintptr_t)slot;
|
||||
handler_fn(request);
|
||||
request.resources.current_unit_file = previous_unit;
|
||||
}
|
||||
@@ -706,7 +706,7 @@ void uce_wasm_invoke_entry(const char* path, size_t path_len, const char* handle
|
||||
String previous_unit = context->resources.current_unit_file;
|
||||
if(resolved != "")
|
||||
context->resources.current_unit_file = resolved;
|
||||
request_ref_handler handler_fn = (request_ref_handler)(uintptr_t)slot;
|
||||
WasmRequestHandler handler_fn = (WasmRequestHandler)(uintptr_t)slot;
|
||||
handler_fn(*context);
|
||||
context->resources.current_unit_file = previous_unit;
|
||||
}
|
||||
|
||||
+1
-1
@@ -1090,7 +1090,7 @@ private:
|
||||
}
|
||||
|
||||
if(!file_exists_host(worker.unit_wasm_path(resolved)) || compiler_unit_needs_recompile(context, resolved, 0))
|
||||
get_shared_unit(context, resolved, true);
|
||||
get_shared_unit(context, resolved);
|
||||
|
||||
size_t unit_index = 0;
|
||||
String error = load_unit(resolved, unit_index);
|
||||
|
||||
Reference in New Issue
Block a user