Repository navigation
Conversation
Adds a default-off `witness-signing` feature exposing rvf_witness_ed25519_sign/verify exports, reusing the existing Message I/O buffer so the default Cognitum tile build is unaffected. Closes the gap flagged by three prior nightly runs (ADR-340, ADR-343, and the 2026-09-16 witness-signer-agent-memory run): no real WASM artifact had ever measured this primitive's cost at the edge. Co-Authored-By: claude-flow <ruv@ruv.net> Claude-Session: https://claude.ai/code/session_01TtFC4EMG4oAHkoC17vZnsK
Loads the compiled rvf-wasm witness-signing artifact via wasmtime (Cranelift) and measures real sign/verify latency against the same rvf_types::ed25519 primitive called natively, plus a startup cross-compatibility assertion (native<->wasm signature interop). Co-Authored-By: claude-flow <ruv@ruv.net> Claude-Session: https://claude.ai/code/session_01TtFC4EMG4oAHkoC17vZnsK
Records the measured, mixed result: default build and native<->wasm wire compatibility are unaffected (ACCEPT), but both the 60 KB binary-size budget and the 5x signing-latency budget are exceeded (REJECT) while verification-latency (3.60x) holds. Also documents a pre-existing, unrelated discrepancy: the baseline tile already measures ~39 KB after wasm-opt -Oz, not the <8 KB its own module doc claims. Co-Authored-By: claude-flow <ruv@ruv.net> Claude-Session: https://claude.ai/code/session_01TtFC4EMG4oAHkoC17vZnsK
Co-Authored-By: claude-flow <ruv@ruv.net> Claude-Session: https://claude.ai/code/session_01TtFC4EMG4oAHkoC17vZnsK
…8/0349) The Security audit / cargo-audit checks on this PR failed on four rustls advisories published 2026-10-14, unrelated to this PR's rvf-wasm witness-signing change: rustls is a transitive dependency at the root workspace level (crates/rvf has its own separate Cargo.lock, untouched by this fix), and main's own most recent scheduled supply-chain run (2026-10-13, run 38377957804) already fails the identical way. Same validated fix already landed on a sibling nightly branch (claude/focused-darwin-rkdqv7, commit 60e1c69); ported here rather than re-derived. Verified with `cargo check -p ruvector-core`. Co-Authored-By: claude-flow <ruv@ruv.net> Claude-Session: https://claude.ai/code/session_01TtFC4EMG4oAHkoC17vZnsK
CI: Security audit / cargo-audit — investigated, partially fixed, rest is pre-existingBoth Fixed and pushed ( Not fixed — pre-existing, out of this PR's scope: the remaining 9 findings are all Generated by Claude Code |
Hypothesis
Three prior nightly runs (ADR-340, ADR-343, and the 2026-09-16
witness-signer-agent-memoryrun) flagged the same open question withoutclosing it: what does WASM binary size and signing/verification latency
actually cost for the Ed25519 witness-signing primitive
(
rvf_types::ed25519) thatruvector-retrieval-receiptandruvector-agent-memoryboth depend on? None measured it against a realcompiled WASM artifact.
This run adds an opt-in, default-off
witness-signingfeature torvf-wasm(the actual Cognitum-tile WASM microkernel, which alreadydepends on the signing crates but ships with signing compiled out) and
measures it for real:
wasm-opt -Ozbinary size, andwasmtime-hosted(Cranelift) latency vs. native.
Architecture
crates/rvf/rvf-wasm/src/witness.rs(new):rvf_witness_ed25519_sign/rvf_witness_ed25519_verify, reusing the tile's existing 2048-byteMessage I/O buffer — no growth of the 8 KB
DATA_MEMORYlayout.crates/rvf/rvf-wasm/Cargo.toml:witness-signing = ["rvf-types/ed25519"],default off.
crates/rvf/benches/benches/witness_wasm_bench.rs(new): loads thecompiled
.wasmviawasmtime, asserts native↔wasm cross-compatibility,then benchmarks sign/verify natively vs. in-wasm.
docs/adr/ADR-361-rvf-wasm-witness-signing-feature.md+docs/research/nightly/2026-10-17-wasm-witness-signing-cost/(README +gist): full methodology, raw results, limitations, next research.
Files Changed
crates/rvf/rvf-wasm/{Cargo.toml,src/lib.rs,src/witness.rs}crates/rvf/benches/{Cargo.toml,benches/witness_wasm_bench.rs}crates/rvf/Cargo.lockdocs/adr/ADR-361-rvf-wasm-witness-signing-feature.mddocs/research/nightly/2026-10-17-wasm-witness-signing-cost/{README.md,gist.md}Benchmark Command
Real Benchmark Results
Binary size (
wasm-opt -Oz): baseline 39,087 B → witness-signing103,793 B → delta 64,706 B (threshold: ≤60,000 B → FAIL).
Baseline re-verified byte-identical to unmodified
mainviagit stash.Latency (criterion median, wasmtime/Cranelift vs. native):
Correctness:
rvf-wasmlib tests 6/6 (feature off, unchanged) and8/8 (feature on, 2 new). Native↔wasm cross-compatibility assertion:
PASS (signatures byte-identical both directions, tamper correctly
rejected).
Acceptance Result
Reported as a genuinely mixed result — thresholds were fixed before
benchmarking and were not relaxed afterward. The new code is correct and
safe to merge as an opt-in, off-by-default feature; its measured cost does
not clear the budget this run pre-committed to, and that is the headline
finding, not a footnote.
A side-finding unrelated to this change: the pre-existing baseline tile
(feature off) measures ~39 KB after
wasm-opt -Oz, not the "<8 KB" its ownmodule doc claims — flagged, not root-caused, in the ADR's Open Questions.
Darwin / Flywheel
No live Darwin evolutionary search this run (this is infrastructure
measurement, not a population search). No in-repo Flywheel/witness-chain
tool for nightly-research provenance exists (consistent with every prior
run's identical finding); this PR's documents and raw benchmark output are
the retained evidence.
Security Review
No new attack surface: the new exports operate on caller-controlled,
fixed-offset buffers in the tile's existing linear memory, matching every
other export's convention. The feature is additive and off by default; no
existing export's signature or behavior changes. Full detail in ADR-361's
Security section.
Main Limitations
Steady-state call latency only (no cold-start/instantiation cost measured
in the loop);
wasmtime/Cranelift on x86_64 is a real WASM runtime but notliteral Cognitum hardware or a browser
wasm-bindgenpath; one fixed96-byte message size; the sign-vs-verify latency asymmetry is not
root-caused. Full list in the nightly README's Limitations section.
Production Recommendation
Ship as an opt-in feature (already the case in this PR) so a deployment
can decide deliberately whether the ~65 KB / up to ~8.8x latency cost is
worth tamper-evident signing for its specific tile. Do not enable by
default. Next step before wider adoption: evaluate a smaller
no_stdEd25519 implementation against this PR's exact benchmark harness (Next
Research item 2 in the nightly report).
🤖 Generated with claude-flow
https://claude.ai/code/session_01TtFC4EMG4oAHkoC17vZnsK
Generated by Claude Code