Repository navigation
test: widen property tests to joins, negation, predicates and time travel (#386) - #491
Merged
Merged
Conversation
The merge of main into v3 (d61b9a4, #488) resolved a conflict in docs/TEST_COVERAGE.md by leaving the file empty. Restore v3's version from before the merge; main's v2.0.4 edits to it are v2.x-only. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_012wXxZguv7PgKQjMMH4yJ5h
…avel (#386) tests/property_test.rs now writes random histories (batched transacts, retracts, write transactions, checkpoints) and compares random queries (1-3 joined patterns, not/not-join, a comparison predicate, :as-of, :valid-at, :any-valid-time) with a reference evaluator, in memory and against a file before and after a reopen. A write or query error fails the test; the three existing properties no longer count an error as an empty result. The temporal reference model of the model-based test (#385) moves to tests/reference_model/ and is shared by both tests. The nightly job drops from 8M to 1M cases (1M in memory, 100k file-backed, ~1.6 h locally). Mutation checks are listed in the spec. Refs #386 Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_012wXxZguv7PgKQjMMH4yJ5h
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_012wXxZguv7PgKQjMMH4yJ5h
Codecov Report✅ All modified and coverable lines are covered by tests. 📢 Thoughts on this report? Let us know! |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Refs #386 (tracker #383).
What
tests/property_test.rsgains two properties that write a random history and compare random queries with a reference evaluator:transact(1–9 facts, tx- and fact-level valid-time windows), aretract, a write transaction mixing both, or acheckpoint. Every generated statement is accepted; rejections stay with the model-based test.?ein value position,?a, constants,_), an optionalnot/not-join, an optional comparison predicate (< <= > >= = !=), and:as-of N,:valid-at T, both, or:any-valid-time.page_cache_size(4))._(each binding is then a distinct row), and a set otherwise.The temporal reference model of
tests/model_based_test.rs(#385) moves unchanged totests/reference_model/mod.rs, so both tests share the #435/#477 rules.Checking the test catches bugs
Each of these mutations fails the test:
:valid-atinclusive at:valid-to;<evaluated as<=; a predicate type error that keeps the row; the on-disk read skipping retractions; the on-disk read not hiding a triple's older transactions; in the reference,notignoring:as-of; in the reference, patterns ignoring their attribute.With the model-based generators, only 16% of queries returned any rows. The histories here favor small integers and entities and drop the hot triple, so about 35% return rows, over 13 visible facts on average.
Findings (no engine change in this PR)
#uuidliterals (PRS-070, documented), so predicate constants exclude refs. The two new regression seeds come from that.[:find ?e :where [?e :c ?v]]gives one row per?v. The test compares as sets whenever a projection could repeat rows, so it holds whichever way that goes.CI
Normal CI runs 256 in-memory and 25 file-backed cases. The nightly
property_testjob drops from 8,000,000 to 1,000,000 cases: 1M in memory (~3 ms each), 100k file-backed (~57 ms each) and 1M of each one-pattern property, about 1.6 h locally.Also
docs/TEST_COVERAGE.mdwas left empty by the merge ofmainintov3(d61b9a4, #488). The first commit restores v3's version.Spec:
docs/superpowers/specs/2026-10-08-wider-property-tests-design.md. A v2.x backport tomainfollows as a separate PR (spec §9).🤖 Generated with Claude Code
https://claude.ai/code/session_012wXxZguv7PgKQjMMH4yJ5h