|
1 | 1 | # Test & Benchmark Requirements |
2 | 2 |
|
3 | | -## Current State |
4 | | -- Unit tests: 684 pass / 0 fail / 16 ignored (556 in main crate + 128 across other crates) |
5 | | -- Integration tests: partial (echidnabot has integration tests) |
6 | | -- E2E tests: NONE |
7 | | -- Benchmarks: 1,035 benchmark files (likely V-lang prover benchmarks) |
| 3 | +## Current State (updated 2026-04-04) |
| 4 | + |
| 5 | +- Unit tests: 756 pass / 0 fail / 16 ignored |
| 6 | + - 556 in main crate, 200 across integration/property/aspect/E2E suites |
| 7 | +- Integration tests: full (echidnabot + prover backends) |
| 8 | +- E2E tests: COMPLETE (tests/e2e_prover_test.rs — 10 tests) |
| 9 | +- P2P property tests: COMPLETE (tests/p2p_property_tests.rs — ~1,000 proptest cases) |
| 10 | +- Aspect tests: COMPLETE (tests/aspect_tests.rs — 12 tests) |
| 11 | +- Julia smoke tests: COMPLETE (tests/julia/smoke_test.jl — 63 tests) |
| 12 | +- Shell validation: COMPLETE (tests/shell/validate_scripts.sh — 68 checks) |
| 13 | +- Benchmarks: BASELINED (benches/proof_benchmarks.rs — 13 Criterion functions) |
8 | 14 | - panic-attack scan: NEVER RUN |
9 | 15 |
|
10 | | -## What's Missing |
11 | | -### Point-to-Point (P2P) |
12 | | -**Source counts:** 146 Rust + 6,694 V + 34 Zig + 42 Idris2 + 33 ReScript + 52 Julia + 39 JS + 226 Shell |
13 | | - |
14 | | -#### Rust crate (146 files, ~684 tests — BEST tested component): |
15 | | -- 79 files with #[test] in main crate — good inline test coverage |
16 | | -- 3 files with #[test] in echidnabot — minimal |
17 | | -- fuzz/ crate exists (Cargo.toml) — verify fuzzing actually runs |
18 | | -- 9 ignored tests need investigation |
19 | | - |
20 | | -#### V-lang prover (6,694 files — ZERO tests): |
21 | | -- This is the bulk of the codebase |
22 | | -- Prover correctness is critical — needs property-based testing |
23 | | -- All proof dispatch, verification, and formal reasoning untested |
24 | | - |
25 | | -#### Zig FFI (34 files — 7 test files): |
26 | | -- Reasonable ratio but verify coverage |
27 | | - |
28 | | -#### Idris2 ABI (42 files — ZERO tests): |
29 | | -- Formal verification definitions should be self-verifying |
30 | | -- But runtime behavior still needs integration testing |
31 | | - |
32 | | -#### Julia (52 files — ZERO tests): |
33 | | -- Likely analysis/reporting scripts — need at least smoke tests |
34 | | - |
35 | | -#### ReScript (33 files — ZERO tests): |
36 | | -- Dashboard/UI components — need render and interaction tests |
37 | | - |
38 | | -#### Shell (226 files — ZERO tests): |
39 | | -- Scripts need at least --help and dry-run validation |
40 | | - |
41 | | -### End-to-End (E2E) |
42 | | -- Full prover workflow: input problem -> preprocess -> prove -> verify result |
43 | | -- Echidnabot: receive repo event -> analyze -> report findings |
44 | | -- Dashboard: load data -> display results -> filter/search |
45 | | -- Proof dispatch: select prover backend -> route -> collect results |
46 | | -- VeriSimDB integration: write proof results -> query -> aggregate |
47 | | -- Dodeca-API interaction |
48 | | -- Report generation pipeline |
49 | | - |
50 | | -### Aspect Tests |
51 | | -- [ ] Security (proof validation bypass, malicious input to prover, echidnabot webhook injection) |
52 | | -- [ ] Performance (prover on large problems, proof verification latency) |
53 | | -- [ ] Concurrency (parallel proof attempts, concurrent echidnabot webhook processing) |
54 | | -- [ ] Error handling (unsolvable problems, prover timeout, malformed input) |
55 | | -- [ ] Accessibility (dashboard UI) |
56 | | - |
57 | | -### Build & Execution |
58 | | -- [x] cargo build — compiles |
59 | | -- [x] cargo test — 684 pass, 0 fail, 16 ignored |
60 | | -- [ ] V build — not verified |
61 | | -- [ ] Zig build — not verified |
62 | | -- [ ] echidnabot binary — not verified |
63 | | -- [ ] Self-diagnostic — none |
64 | | - |
65 | | -### Benchmarks Needed |
66 | | -- Prover throughput on standard benchmark suites |
67 | | -- Proof verification latency |
68 | | -- VeriSimDB write/query performance |
69 | | -- Echidnabot analysis speed per repo |
70 | | -- Verify 1,035 existing benchmark files actually run (V-lang prover benchmarks?) |
| 16 | +## Benchmark Status (verified 2026-04-04) |
| 17 | + |
| 18 | +**The 1,035 .v files are Coq proof files from external_corpora/ — NOT runnable benchmarks.** |
| 19 | +- `external_corpora/CoqGym/` — 6,678 Coq proofs (training/ML corpus data) |
| 20 | +- `proofs/coq/` — 16 project Coq proof files |
| 21 | +- These are NOT V-lang files and NOT benchmark runners |
| 22 | + |
| 23 | +**Real Criterion benchmarks exist in `benches/proof_benchmarks.rs`:** |
| 24 | +- `bench_proof_state_construction` (5 goal-count variants) |
| 25 | +- `bench_term_construction` (4 depth variants) |
| 26 | +- `bench_prover_creation` (8 provers) |
| 27 | +- `bench_prover_detection` (8 file extensions) |
| 28 | +- `bench_trust_computation` (3 scenarios: max_trust, single_prover, dangerous) |
| 29 | +- `bench_axiom_scanning` (4 patterns) |
| 30 | +- `bench_mutation_generation` |
| 31 | +- `bench_pareto_frontier` (3 point-count variants) |
| 32 | +- `bench_statistics_tracking` |
| 33 | +- `bench_ffi_kind_mapping` |
| 34 | +Run with: `cargo bench` |
| 35 | + |
| 36 | +## Ignored Test Investigation (9 tests) |
| 37 | + |
| 38 | +All 9 ignored tests are in `tests/integration_v1_2.rs`. They are **legitimately ignored** — each has a `// Requires <X> binary` comment: |
| 39 | +- 2 tests: `#[ignore] // Requires ACL2 binary` |
| 40 | +- 2 tests: `#[ignore] // Requires PVS binary` |
| 41 | +- 2 tests: `#[ignore] // Requires HOL4 binary` |
| 42 | +- 3 tests: `#[ignore] // Requires prover binaries` |
| 43 | + |
| 44 | +**No action needed.** These test real prover binary invocation and must remain |
| 45 | +skipped until ACL2/PVS/HOL4 are installed in the CI environment. The ignore |
| 46 | +reason is clearly documented. |
| 47 | + |
| 48 | +(Note: TEST-NEEDS.md said "9 ignored" but `cargo test` shows 16 ignored total. |
| 49 | +The additional 7 are in `tests/test_neural_integration.rs` requiring the Julia |
| 50 | +server running on port 8081.) |
| 51 | + |
| 52 | +## What's Covered |
| 53 | + |
| 54 | +### Point-to-Point (P2P) — tests/p2p_property_tests.rs |
| 55 | +- [x] Dispatch determinism: same input → same trust level (proptest, 500 cases) |
| 56 | +- [x] ProofState serialisation: arbitrary states survive JSON roundtrip (200 cases) |
| 57 | +- [x] Reject danger caps trust at Level2 (proptest, 200 cases) |
| 58 | +- [x] Safe danger >= Warning danger (proptest, 200 cases) |
| 59 | +- [x] ProverFactory correct kind (proptest, 50 cases) |
| 60 | +- [x] AxiomTracker stateless / idempotent (proptest, 200 cases) |
| 61 | +- [x] ProverKind JSON roundtrip (proptest, 50 cases) |
| 62 | +- [x] TrustLevel ordering consistent with value() (proptest, 200 cases) |
| 63 | +- [x] DispatchConfig clone preserves fields (proptest, 100 cases) |
| 64 | + |
| 65 | +### End-to-End (E2E) — tests/e2e_prover_test.rs |
| 66 | +- [x] All 48 prover backends instantiate via ProverFactory |
| 67 | +- [x] DispatchConfig defaults are safe (invariant check) |
| 68 | +- [x] Trust pipeline — all 5 levels produce correct ordering |
| 69 | +- [x] Reject axiom prevents Level3+ trust |
| 70 | +- [x] Axiom tracker detects sorry/Admitted/believe_me |
| 71 | +- [x] Z3 full dispatch workflow (skips if binary absent) |
| 72 | +- [x] Malformed input returns error, not panic |
| 73 | +- [x] Missing binary returns error (not false success) |
| 74 | +- [x] DispatchResult JSON roundtrip (all fields) |
| 75 | +- [x] Dispatcher respects timeout config |
| 76 | +- [x] select_prover heuristic coverage |
| 77 | + |
| 78 | +### Aspect Tests — tests/aspect_tests.rs |
| 79 | +- [x] Security: malicious input no high trust |
| 80 | +- [x] Security: no proof cert from arbitrary string |
| 81 | +- [x] Security: zero timeout no panic |
| 82 | +- [x] Concurrency: parallel dispatches isolated (8 workers) |
| 83 | +- [x] Concurrency: axiom tracker stateless (16 workers) |
| 84 | +- [x] Error handling: impossible trust requirement |
| 85 | +- [x] Error handling: config validation |
| 86 | +- [x] Error handling: DispatchResult edge cases |
| 87 | +- [x] Trust: DangerLevel total order |
| 88 | +- [x] Trust: TrustLevel values monotone |
| 89 | +- [x] Trust: compute_trust_level deterministic (100 iterations) |
| 90 | +- [x] Coverage: ProverKind::all() count >= 30, no duplicates |
| 91 | +- [x] Coverage: ProverKind JSON stable (5 canonical names) |
| 92 | + |
| 93 | +### Julia Smoke Tests — tests/julia/smoke_test.jl |
| 94 | +- [x] Syntax validation: 9 top-level scripts (api_server, run_server, train_models, etc.) |
| 95 | +- [x] Syntax validation: inference/ sub-package |
| 96 | +- [x] EchidnaML module structure |
| 97 | +- [x] api/ sub-package syntax |
| 98 | +- [x] scripts/*.jl corpus scripts (32 scripts) |
| 99 | +- [x] Directory structure (JULIA_SRC, Project.toml, entrypoints) |
| 100 | +- [x] Tokenizer unit smoke (5 properties) |
| 101 | +- [x] BOW vectorizer unit smoke (4 properties) |
| 102 | + |
| 103 | +### Shell Validation — tests/shell/validate_scripts.sh |
| 104 | +- [x] Syntax check (bash -n) on all scripts/*.sh |
| 105 | +- [x] Syntax check on tests/*.sh |
| 106 | +- [x] SPDX header check |
| 107 | +- [x] Banned pattern check (docker/npm/HTTP) |
| 108 | +- [x] --help smoke test for selected scripts |
| 109 | + |
| 110 | +**Findings from shell validation:** |
| 111 | +- scripts/install-provers.sh — missing SPDX header |
| 112 | +- scripts/mvp-smoke.sh — missing SPDX header |
| 113 | +- scripts/expand_training_data.sh — HTTP URL (should use HTTPS) |
| 114 | +- scripts/test-integration.sh — HTTP URL |
| 115 | +- scripts/test_integration.sh — HTTP URL |
| 116 | + |
| 117 | +### Benchmarks — benches/proof_benchmarks.rs |
| 118 | +- [x] Core type construction (ProofState, Term) |
| 119 | +- [x] Prover creation (8 representative backends) |
| 120 | +- [x] Prover detection from file extension |
| 121 | +- [x] Trust computation (3 scenarios) |
| 122 | +- [x] Axiom scanning (4 patterns) |
| 123 | +- [x] Mutation generation |
| 124 | +- [x] Pareto frontier (3 sizes) |
| 125 | +- [x] Statistics tracking |
| 126 | +- [x] FFI kind mapping roundtrip |
| 127 | + |
| 128 | +## Still Missing |
| 129 | + |
| 130 | +### V-lang prover (6,694 files — ZERO tests) |
| 131 | +- This is Coq formal proof code in external_corpora/ (training data) |
| 132 | +- The "V" extension here means Coq, not V-lang |
| 133 | +- Coq proofs are inherently self-verifying when compiled with coqc |
| 134 | +- No dedicated test infrastructure for the Coq corpus |
| 135 | +- **Status:** Out of scope for this blitz (requires Coq toolchain + significant effort) |
| 136 | + |
| 137 | +### Zig FFI (34 files — 7 test files) |
| 138 | +- [x] 7 test files exist |
| 139 | +- [ ] Coverage verification pending |
| 140 | + |
| 141 | +### Idris2 ABI (42 files) |
| 142 | +- Formal proofs are self-verifying (checked at type-check time) |
| 143 | +- No runtime integration tests yet |
| 144 | +- **Status:** Deferred — requires Idris2 toolchain in CI |
| 145 | + |
| 146 | +### ReScript UI (33 files — ZERO tests) |
| 147 | +- Dashboard components need render tests |
| 148 | +- **Status:** Deferred — requires Deno + ReScript test setup |
71 | 149 |
|
72 | 150 | ### Self-Tests |
73 | 151 | - [ ] panic-attack assail on own repo |
74 | 152 | - [ ] Echidnabot self-scan |
75 | 153 | - [ ] Prover correctness validation suite |
76 | 154 |
|
77 | 155 | ## Priority |
78 | | -- **HIGH** — The Rust crate is well-tested (684 tests) but the V-lang prover (6,694 files) has ZERO tests. This is a formal verification tool where prover correctness is the entire value proposition. The 1,035 benchmark files need verification — if they are actually prover benchmarks, the situation is better than it appears for performance testing. But correctness testing for the prover logic is non-negotiable and completely absent. |
| 156 | +- **CRG C COMPLETE** as of 2026-04-04 |
| 157 | +- Next priority: Fix 5 shell issues found by validation |
| 158 | +- V-lang prover testing remains the largest correctness gap but is out of scope |
| 159 | + until the Coq corpus toolchain is set up in CI |
0 commit comments