perf(npm): binary kernel transport, faster device e2e, and CI fixes (ADR-368/373 amendments)

CI fixes (both failures on PR #2062 were in this branch):
- harness/ruview: remove `2.11.0` literals from training remedies; the
  ADR-265 D3 version-literal gate rejects them.
- ruview-kernel workflow: install wasm32 for the toolchain pinned by
  v2/rust-toolchain (the action only added it to `stable`); build.mjs now
  fails fast with the exact `rustup target add` remedy.

Kernel optimization (ADR-368 amendment):
- New `analyze_flat` / `session_push_flat` ops via `call_f64`: WASM
  `rvk_call_f64` (alignment-agnostic bytes) and napi `callF64(Float64Array)`.
  `analyze()`/`session.push()` pack uniform frames automatically; irregular
  input keeps the JSON path and its per-frame errors. `analyzeFlat()` is the
  zero-copy entry. Shared `Session::step` makes both paths byte-identical on
  identical f64 inputs (Rust test), and the binary path avoids serde_json's
  non-correctly-rounded float parsing.
- MEASURED (`ruview-kernel bench --seconds 120`, one Linux x64 host):
  2.82x (wasm) and 2.45x (napi) faster than the JSON transport.
- Profiled remaining cost (examples/profile_stages.rs): heart-rate ACF in
  wifi-densepose-vitals dominates; left for a separate, output-reviewed
  change. Rejected WASM +simd128 and opt-level=s after three measured runs
  (bench/wasm-variants.mjs).

Device e2e (ADR-373 amendment):
- test/e2e/devices.e2e.mjs + `npm run test:e2e:devices` + new workflow
  ruview-device-e2e.yml: pty-emulated MR60BHA2 and RPLIDAR through real
  pyserial, a UDP ESP32 node, and the real iPhone relay, via the CLI.
- mmWave auto-detect keeps probe frames and reads only the remainder;
  iPhone LiDAR gains max_frames and returns immediately when refused.
  Suite wall time 19.6 s -> 5.6 s (MEASURED, dev container).

Co-Authored-By: claude-flow <ruv@ruv.net>
Claude-Session: https://claude.ai/code/session_015H55jmprfz4oHWXSFbX5rf
This commit is contained in:
Claudeandclaude-flow committed 2026-10-01 14:45:55 +00:00
1 parent 6112a185df
commit 43f16e5638
28 files changed
+1018 -128

No files matched your search

+68
View File
@@ -0,0 +1,68 @@
# ADR-373/374 — device-access end-to-end through the real @ruvnet/ruview CLI.
# MR60BHA2 (60 GHz) and RPLIDAR are emulated on pseudo-terminals and read via
# real pyserial; an ESP32 node is emulated over UDP; the iPhone LiDAR path
# uses the repository's real relay. All results are SYNTHETIC: this proves
# the transports and parsers, not hardware behaviour.
name: ruview device e2e
on:
push:
branches: [main]
paths:
- 'harness/ruview/src/**'
- 'harness/ruview/bin/**'
- 'harness/ruview/test/e2e/**'
- 'integrations/iphone-lidar/web/**'
- '.github/workflows/ruview-device-e2e.yml'
pull_request:
paths:
- 'harness/ruview/src/**'
- 'harness/ruview/bin/**'
- 'harness/ruview/test/e2e/**'
- 'integrations/iphone-lidar/web/**'
- '.github/workflows/ruview-device-e2e.yml'
permissions:
contents: read
concurrency:
group: ruview-device-e2e-${{ github.ref }}
cancel-in-progress: true
jobs:
devices:
runs-on: ubuntu-latest
timeout-minutes: 15
steps:
- uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
with:
persist-credentials: false
- uses: actions/setup-node@820762786026740c76f36085b0efc47a31fe5020 # v7.0.0
with:
node-version: '22'
- uses: actions/setup-python@ece7cb06caefa5fff74198d8649806c4678c61a1
with:
python-version: '3.12'
- name: Install pyserial
run: python -m pip install pyserial==3.5
- name: Install the iPhone LiDAR relay
working-directory: integrations/iphone-lidar/web
run: npm ci --ignore-scripts
- name: Install harness
working-directory: harness/ruview
run: npm ci --ignore-scripts
# Missing prerequisites fail instead of skipping (RUVIEW_E2E_REQUIRE).
# The suite links each emulator pty to /dev/ttyRUVIEWE2E<n> with
# `sudo -n`, because the harness refuses /dev/pts/* port names.
- name: Device e2e (SYNTHETIC devices)
working-directory: harness/ruview
env:
RUVIEW_E2E_REQUIRE: '1'
run: npm run test:e2e:devices
+6
View File
@@ -60,6 +60,12 @@ jobs:
with:
targets: wasm32-unknown-unknown
# v2/rust-toolchain pins its own channel; the target must be installed
# for that toolchain, not only for the action's default `stable`.
- name: Add wasm32 target to the pinned v2 toolchain
working-directory: v2
run: rustup target add wasm32-unknown-unknown
- name: Cache cargo
uses: Swatinem/rust-cache@e18b497796c12c097a38f9edb9d0641fb99eee32
with: