|
| 1 | +# TASK-161 — Resurrection parity test suite (consolidated) |
| 2 | + |
| 3 | +## Goal |
| 4 | +Create comprehensive resurrection tests verifying Zig matches Rust/C oracle for all CL (causal length) scenarios. |
| 5 | + |
| 6 | +## Status |
| 7 | +- State: backlog |
| 8 | +- Priority: high (cross-impl parity, CL semantics) |
| 9 | +- Parallelizable: YES (no file conflicts with other backlog tasks) |
| 10 | + |
| 11 | +## Context |
| 12 | +Consolidates TASK-161 through TASK-165 into a single test file. These scenarios from Python `test_cl_merging.py` are not covered in Zig harness: |
| 13 | + |
| 14 | +1. **Live row via sentinel**: Sentinel arrives for already-live row |
| 15 | +2. **Dead row via sentinel**: Sentinel resurrects tombstoned row |
| 16 | +3. **Live row via column**: Column update on live row (normal case with CL verification) |
| 17 | +4. **Dead row via column**: Column update resurrects tombstoned row |
| 18 | +5. **Out-of-order sync**: Changes arrive in wrong order (delete after resurrect) |
| 19 | + |
| 20 | +## Files to Modify |
| 21 | +- `zig/harness/test-resurrection-parity.sh` (new, ~400 lines) |
| 22 | +- `zig/harness/test-parity.sh` (wire in new test) |
| 23 | + |
| 24 | +## Acceptance Criteria |
| 25 | +1. Each of 5 scenarios implemented as separate test function |
| 26 | +2. Each test runs against both Zig and Rust/C oracle |
| 27 | +3. Each test compares final state (data, clock entries, CL values) |
| 28 | +4. All tests PASS with identical behavior |
| 29 | +5. Test output clearly documents any divergences found |
| 30 | + |
| 31 | +## Test Skeleton |
| 32 | +```bash |
| 33 | +#!/usr/bin/env bash |
| 34 | +# test-resurrection-parity.sh - CL resurrection scenarios |
| 35 | + |
| 36 | +test_live_via_sentinel() { |
| 37 | + # Site A: INSERT row (CL=1) |
| 38 | + # Site A: DELETE row (CL=2) |
| 39 | + # Site A: INSERT row (CL=3) - resurrection |
| 40 | + # Site B: has live row (CL=1) |
| 41 | + # Site B: receives resurrection sentinel (CL=3) |
| 42 | + # Verify: both live, CL=3 |
| 43 | +} |
| 44 | + |
| 45 | +test_dead_via_sentinel() { |
| 46 | + # Create, delete (tombstone CL=2) |
| 47 | + # Send resurrection sentinel (CL=3) |
| 48 | + # Verify: resurrected, CL=3 |
| 49 | +} |
| 50 | + |
| 51 | +test_live_via_column() { |
| 52 | + # Normal UPDATE case but verify CL advances |
| 53 | +} |
| 54 | + |
| 55 | +test_dead_via_column() { |
| 56 | + # Tombstoned row receives column update with higher CL |
| 57 | + # Should resurrect with that column value |
| 58 | +} |
| 59 | + |
| 60 | +test_out_of_order() { |
| 61 | + # Send changes in order: INSERT(CL=1), RESURRECT(CL=3), DELETE(CL=2) |
| 62 | + # Verify: row is live (CL=3 wins) |
| 63 | +} |
| 64 | +``` |
| 65 | + |
| 66 | +## Parent Docs / Cross-links |
| 67 | +- Python tests: `py/correctness/tests/test_cl_merging.py` |
| 68 | +- Supersedes: TASK-162, TASK-163, TASK-164, TASK-165 |
| 69 | +- Gap backlog: `research/zig-cr/92-gap-backlog.md` |
| 70 | + |
| 71 | +## Progress Log |
| 72 | +- 2025-12-22: Consolidated from 5 individual tasks for efficient parallel execution. |
| 73 | + |
| 74 | +## Completion Notes |
| 75 | +(Empty until done.) |
0 commit comments