Skip to content

bench(adr-001): witness audit — full residual vs closure-restricted - #43

Merged
ruvnet merged 1 commit into
mainfrom
adr/witness-bench
May 19, 2026
Merged

ruvnet merged 1 commit into
mainfrom
adr/witness-bench

Conversation

@ruvnet

@ruvnet ruvnet commented May 19, 2026

Copy link
Copy Markdown
Owner

Summary

Empirical receipt for the witness primitive shipped in PR #41. Compares two ways to verify a SubLinear delta-solve output:

  • `full_residual`: `‖b - A·x_new‖_∞` over the whole `n`-vector. Linear in `n`.
  • `closure_audit`: `verify_sparse_solution` restricted to closure entries. SubLinear in `n`.

Smoke results (`cargo bench -- --quick witness_audit`)

n `full_residual` (Linear) `closure_audit` (SubLinear)
64 221 ns 549 ns
256 885 ns 602 ns
1024 3.57 µs 906 ns

Architectural property holds:

  • `full_residual` grows ~4× per 4× size (Linear).
  • `closure_audit` stays nearly flat: 549 → 602 → 906 ns across 16× growth in n.
  • Crossover at n ≈ 200; by n=1024 the closure-restricted audit is ~4× faster, and the gap widens linearly with n.

This is the architectural match for the SubLinear orchestrator: auditing the output costs the same complexity class as the solve itself, so trust-but-verify gating in production stays cheap.

Test plan

  • `cargo bench -- --quick witness_audit` completes successfully
  • Full CI (`cargo bench --quick` smoke job already runs on this branch)

🤖 Generated with claude-flow

Empirical receipt for the witness primitive shipped in PR #41.
Compares two ways to verify a SubLinear delta-solve output:

  - full_residual: ‖b - A·x_new‖_∞ over the whole n-vector. Linear.
  - closure_audit: verify_sparse_solution restricted to closure entries.
    SubLinear in n.

Smoke results (cargo bench -- --quick witness_audit):

  n     full_residual    closure_audit
  64    221 ns           549 ns
  256   885 ns           602 ns
  1024  3.57 µs          906 ns

full_residual grows ~4x per 4x size (Linear). closure_audit stays
nearly flat (549 → 602 → 906 ns across 16x growth in n). Crossover
at n ≈ 200; by n=1024 the closure-restricted audit is ~4x faster
and the gap widens linearly with n.

This is the architectural match for the SubLinear orchestrator:
auditing the output costs the same complexity class as the solve
itself, so trust-but-verify gating in production stays cheap.

Co-Authored-By: claude-flow <ruv@ruv.net>
@ruvnet
ruvnet merged commit 4810934 into main May 19, 2026
11 of 12 checks passed
@ruvnet
ruvnet deleted the adr/witness-bench branch May 19, 2026 15:56
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant