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:
root
2026-06-14 23:43:16 +00:00
co-authored by Claude Opus 4.8
parent cf51336873
commit bfd6d33829
21 changed files with 80 additions and 154 deletions
+1 -1
View File
@@ -10,7 +10,7 @@ scripts/run_cli_tests.sh --include-wasm-kill
scripts/run_cli_tests.sh --list
```
`--include-wasm-kill` adds the wasm trap/loop/recurse kill cases and should be used when `WASM_BACKEND_ENABLED=1`.
`--include-wasm-kill` adds the wasm trap/loop/recurse kill cases and should be used for the normal wasm-only runtime gate.
The script reads `CLI_SOCKET_PATH` from `/etc/uce/settings.cfg` unless `UCE_CLI_SOCKET` is set.
+21 -23
View File
@@ -1,9 +1,10 @@
#!/usr/bin/env python3
"""Phase 5 native/WASM benchmark harness.
"""Current wasm-runtime HTTP benchmark harness.
This runner intentionally has no third-party dependencies. It records a warmed
native HTTP baseline now and can compare against a future wasm worker by passing
--wasm-base-url. Results are written as JSON plus a small Markdown table.
This runner intentionally has no third-party dependencies. It measures one or
more HTTP endpoints served by the wasm-only UCE runtime. Optionally pass a prior
benchmark JSON as a baseline; old native baselines are treated as historical
reference data only, not as a runnable backend mode.
"""
from __future__ import annotations
@@ -95,14 +96,14 @@ def measure_backend(backend: str, base_url: str, host_header: str, targets: list
return results
def compare(results: list[Measurement]) -> list[str]:
native = {r.target: r for r in results if r.backend == "native"}
def compare(results: list[Measurement], baseline_label: str) -> list[str]:
baseline = {r.target: r for r in results if r.backend == baseline_label}
lines = ["| target | backend | median ms | mean ms | budget | status |", "|---|---:|---:|---:|---|---|"]
for result in results:
budget = "baseline"
budget = "baseline" if result.backend == baseline_label else "n/a"
status = "PASS" if result.ok else "FAIL"
if result.backend != "native" and result.target in native:
limit = native[result.target].median_ms * 2.0
if result.backend != baseline_label and result.target in baseline:
limit = baseline[result.target].median_ms * 2.0
budget = f"{limit:.1f} ms"
if result.median_ms > limit:
status = "FAIL"
@@ -119,33 +120,30 @@ def build_targets() -> list[Target]:
def main() -> int:
parser = argparse.ArgumentParser(description="Phase 5 native/wasm benchmark harness")
parser.add_argument("--native-base-url", default="http://localhost:80")
parser.add_argument("--wasm-base-url", default="", help="optional wasm worker URL; omitted until worker exists")
parser.add_argument("--backend-label", default="native", help="label for --native-base-url measurements when running one backend at a time")
parser.add_argument("--compare-native-json", default="", help="optional prior native benchmark.json for budget comparison")
parser = argparse.ArgumentParser(description="UCE wasm-runtime HTTP benchmark harness")
parser.add_argument("--base-url", "--native-base-url", dest="base_url", default="http://localhost:80", help="runtime base URL (legacy alias --native-base-url is accepted)")
parser.add_argument("--backend-label", default="wasm", help="label for this run's measurements")
parser.add_argument("--compare-baseline-json", "--compare-native-json", dest="compare_baseline_json", default="", help="optional prior benchmark.json for budget comparison")
parser.add_argument("--baseline-label", default="native", help="backend label in the prior JSON to use as the budget baseline")
parser.add_argument("--host-header", default="uce.openfu.com")
parser.add_argument("--warmups", type=int, default=2)
parser.add_argument("--samples", type=int, default=20)
parser.add_argument("--timeout", type=float, default=10.0)
parser.add_argument("--out-dir", default="/tmp/uce/wasm-phase5")
parser.add_argument("--out-dir", default="/tmp/uce/wasm-benchmark")
args = parser.parse_args()
targets = build_targets()
results: list[Measurement] = []
if args.compare_native_json:
for row in json.loads(Path(args.compare_native_json).read_text()):
if args.compare_baseline_json:
for row in json.loads(Path(args.compare_baseline_json).read_text()):
row.setdefault("backend", args.baseline_label)
results.append(Measurement(**row))
results.extend(measure_backend(args.backend_label, args.native_base_url, args.host_header, targets, args.warmups, args.samples, args.timeout))
if args.wasm_base_url:
results.extend(measure_backend("wasm", args.wasm_base_url, args.host_header, targets, args.warmups, args.samples, args.timeout))
results.extend(measure_backend(args.backend_label, args.base_url, args.host_header, targets, args.warmups, args.samples, args.timeout))
out_dir = Path(args.out_dir)
out_dir.mkdir(parents=True, exist_ok=True)
(out_dir / "benchmark.json").write_text(json.dumps([asdict(r) for r in results], indent=2) + "\n")
md_lines = ["# Phase 5 benchmark report", "", *compare(results), ""]
if not args.wasm_base_url and args.backend_label == "native" and not args.compare_native_json:
md_lines.append("WASM worker URL was not provided; this report is the native baseline that future wasm runs compare against.")
md_lines = ["# UCE wasm benchmark report", "", *compare(results, args.baseline_label), ""]
(out_dir / "benchmark.md").write_text("\n".join(md_lines) + "\n")
print("\n".join(md_lines))
print(f"wrote {out_dir / 'benchmark.json'} and {out_dir / 'benchmark.md'}")