Skip to content

Commit 0e42872

Browse files
docs: add hypothesis invalidation tasks (TASK-127, TASK-128)
1 parent e0e1c48 commit 0e42872

File tree

3 files changed

+54
-0
lines changed

3 files changed

+54
-0
lines changed
Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,27 @@
1+
# TASK-127: Experimentally invalidate "full parity" hypothesis
2+
3+
## Goal
4+
The current hypothesis is that the Zig implementation has achieved full oracle parity with the Rust/C implementation (18/18 tests pass).
5+
We need to **invalidate** this hypothesis experimentally by finding at least one divergence that is not yet covered by our test suite.
6+
7+
## Scope
8+
- Create a new test harness `zig/harness/test-fuzz-parity.sh` (or similar).
9+
- Implement a simple stochastic/fuzzing approach:
10+
- Generate random schemas (tables with random column types, PKs).
11+
- Generate random operations (INSERT, UPDATE, DELETE, transactions).
12+
- Run identical SQL against both Zig (loadable ext) and Rust/C (oracle via sqlite-cr wrapper).
13+
- Compare `crsql_changes`, `crsql_db_version`, `crsql_site_id`, and table contents.
14+
- Run the fuzzer until a divergence is found.
15+
16+
## Files to Modify
17+
- `zig/harness/test-fuzz-parity.sh` (new)
18+
- `zig/harness/test-parity.sh` (optional, to include the new test)
19+
20+
## Acceptance Criteria
21+
- [ ] A new test script `zig/harness/test-fuzz-parity.sh` exists.
22+
- [ ] The script runs against both Zig and Rust/C oracle.
23+
- [ ] The script identifies at least one divergence (a "counter-example" to the full parity hypothesis).
24+
- [ ] The divergence is documented in the completion notes.
25+
26+
## Parent Docs
27+
- `research/zig-cr/92-gap-backlog.md`
Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
# TASK-128: Expand parity suite with invalidation findings
2+
3+
## Goal
4+
Once TASK-127 has identified divergences (invalidating the "full parity" hypothesis), we must expand our regression test suite to cover these edge cases permanently.
5+
6+
## Scope
7+
- Analyze the divergence(s) found in TASK-127.
8+
- Create deterministic reproduction cases in the appropriate `zig/harness/test-*.sh` script (or create a new one if needed).
9+
- Fix the divergence in the Zig implementation (if it's a bug) or document it as a known limitation.
10+
- Verify the fix with the new test case.
11+
12+
## Files to Modify
13+
- `zig/harness/test-*.sh` (existing suites)
14+
- `zig/src/*.zig` (implementation fixes)
15+
16+
## Acceptance Criteria
17+
- [ ] Deterministic regression tests exist for all divergences found in TASK-127.
18+
- [ ] Zig implementation passes these new tests.
19+
- [ ] `make -C zig test-parity` includes these new tests.
20+
21+
## Parent Docs
22+
- `research/zig-cr/92-gap-backlog.md`
23+
- `.tasks/backlog/TASK-127-experimental-parity-invalidation.md`

research/zig-cr/92-gap-backlog.md

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,10 @@
1111

1212
## Now (next parallel assignments)
1313

14+
### Hypothesis Invalidation (Next Priority)
15+
- [ ] **TASK-127** — Experimentally invalidate "full parity" hypothesis via fuzzing `.tasks/backlog/TASK-127-experimental-parity-invalidation.md`
16+
- [ ] **TASK-128** — Expand parity suite with findings from TASK-127 `.tasks/backlog/TASK-128-expand-parity-suite.md`
17+
1418
All oracle parity tests pass. Zig implementation is now wire-compatible with Rust/C oracle.
1519

1620
### Open Gaps (Parity Divergences)

0 commit comments

Comments
 (0)