How should we evaluate module quality? Benchmarks vs. property tests vs. golden files #21
Replies: 1 comment
|
Let me share where my thinking currently lands on each approach, and why I think we need all three rather than picking one. The case for property tests as the foundationFor most of ASI:BUILD, property-based tests are the right first line. A property test captures what a module promises to be true for any valid input, not just the inputs you thought of when writing the test. For example: # From tests/test_knowledge_graph.py (paraphrased)
@given(st.lists(st.tuples(st.text(), st.text(), st.text())))
def test_kg_roundtrip(triples):
kg = KnowledgeGraph()
for s, p, o in triples:
kg.add(s, p, o)
stored = kg.query_all()
assert all(t in stored for t in triples)This catches the kind of bug where overlapping time ranges silently drop entries — something a handful of example-based tests might miss. Where property tests break down: modules with non-deterministic or approximate outputs (consciousness metrics, bio-inspired search). You can write properties like Benchmarks belong at module boundariesFor the consciousness and reasoning modules, benchmarks against known reference values are the right tool:
Benchmarks are expensive to maintain. Keep the suite small (20–50 cases) and well-documented. Golden files: only for serialization and output stabilityGolden file tests are most valuable where:
Best candidates in ASI:BUILD:
Risk: golden files become stale. They need an Proposed quality tiers
Open questions:
|
Uh oh!
There was an error while loading. Please reload this page.
The Evaluation Problem
One of the hardest parts of building ASI:BUILD is knowing when a module is actually good.
Right now our tests verify correctness — does the code run without crashing, do the data structures have the right shape, does the API contract hold? That's necessary but not sufficient. We also need semantic correctness: does a reasoning module actually reason? Does a memory consolidation module actually improve recall?
This is genuinely hard. Some thoughts on how to approach it:
Current State
Most modules have unit tests covering:
A few modules have more substantive tests —
rings/has 108 tests covering SDK client, DID auth flows, and Blackboard adapter event propagation.What We're Missing
1. Functional correctness benchmarks
For example,
consciousness/computes an IIT Φ score. But is it right? We have Issue #6 tracking a known bug where it uses entropy difference instead of the TPM-based Φ from Tononi 2014.A benchmark would:
2. Regression baselines
For modules that do learning or optimization, we need before/after snapshots:
meta_learning/: does MAML actually converge on held-out tasks?reasoning/: does the inference engine produce valid argument chains?bio_inspired/: do evolutionary algorithms improve fitness over generations?3. Cross-module integration quality
When
sensory_processing→reasoning→bio_inspiredruns a full pipeline, what does "correct" look like? We have Issue #18 open for E2E tests, but the benchmark criteria are still open.Design Question
What should the ASI:BUILD evaluation framework look like?
Option A: Pytest fixtures with golden files
Store expected outputs as JSON fixtures, assert modules produce outputs within epsilon. Simple to implement, brittle to algorithmic changes.
Option B: Property-based testing (Hypothesis)
Define invariants (monotonicity, boundedness, commutativity) and let Hypothesis generate adversarial inputs. Catches bugs golden files miss, but harder to write for ML modules.
Option C: Standalone benchmark suite (
benchmarks/directory)Separate from
tests/, runs slower, uses real datasets. CI runs only on tagged releases. Good for tracking performance over time. High investment.Option D: Community-sourced test cases
Open issues asking contributors to submit "this input should produce output Y" examples. Crowd-sourced golden files. Scales with community, but needs curation.
My current thinking
Probably a combination:
benchmarks/directory starting with 2-3 key modules, expanding over timeBut I'd love to hear what the community thinks. If you've worked on evaluation frameworks for cognitive/AI modules before — what worked, what didn't?
Particular interest in:
reasoning/without a ground-truth knowledge basememory_consolidation/— what's the right recall metric?All reactions