Skip to content

Commit 71be829

Browse files
feat(zig): add oracle parity tests for cross-open, boundary values, config isolation, stress (Round 56)
done
1 parent 948ab8e commit 71be829

13 files changed

+2472
-210
lines changed

.tasks/DELEGATE_WORK_HANDOFF.md

Lines changed: 144 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -68,6 +68,150 @@ Artifacts:
6868

6969
---
7070

71+
## Round 2025-12-20 (56) — Cross-open, boundary values, config isolation, and stress tests (4 tasks)
72+
73+
**Tasks executed**
74+
- `.tasks/done/TASK-136-cross-open-modification-parity.md`
75+
- `.tasks/done/TASK-137-boundary-value-edge-cases.md`
76+
- `.tasks/done/TASK-138-config-isolation-test.md`
77+
- `.tasks/done/TASK-139-stress-performance-tests.md`
78+
79+
**Commits**
80+
- (pending commit)
81+
82+
**Environment**
83+
- OS: darwin (macOS ARM64)
84+
- Tooling: nix, zig (via nix), bash
85+
86+
**Commands run (exact)**
87+
```bash
88+
bash zig/harness/test-cross-open-parity.sh
89+
bash zig/harness/test-boundary-values.sh
90+
bash zig/harness/test-config.sh
91+
bash zig/harness/test-stress.sh
92+
```
93+
94+
**Outputs (paste)**
95+
96+
<details>
97+
<summary>TASK-136: Cross-open parity (17 pass, 3 known-fail)</summary>
98+
99+
```text
100+
Cross-Open Parity Test Summary
101+
102+
Results:
103+
PASSED: 17
104+
FAILED: 0
105+
KNOWN_FAIL: 3 (cross-implementation modification not yet supported)
106+
SKIPPED: 0
107+
108+
Working:
109+
- XO-001: Zig creates -> Rust reads
110+
- XO-002: Rust creates -> Zig reads
111+
- site_id preserved across implementations
112+
- db_version readable across implementations
113+
114+
Known limitations (trigger schema incompatibility):
115+
- XO-003: Zig creates -> Rust modifies (fails - trigger functions differ)
116+
- XO-004: Rust creates -> Zig modifies (fails - trigger functions differ)
117+
- XO-006: Alternating modification (fails)
118+
```
119+
</details>
120+
121+
<details>
122+
<summary>TASK-137: Boundary value edge cases (7 pass, 1 fail)</summary>
123+
124+
```text
125+
Boundary Value Edge Case Test Summary
126+
127+
PASS: 7
128+
FAIL: 1
129+
SKIP: 0
130+
131+
Passing:
132+
- EC-010: MAX_INT64 (9223372036854775807)
133+
- EC-011: MIN_INT64 (-9223372036854775808)
134+
- EC-012: MAX_FLOAT (1.79769313486232e+308)
135+
- EC-013: 1MB text
136+
- EC-014: 1MB blob
137+
- EC-020: Emoji (🎉🚀🌈🦄💯)
138+
- Bidirectional: Zig -> Rust MAX_INT64
139+
140+
Failing:
141+
- EC-021: NULL bytes in text - Zig truncates at first NUL byte
142+
(Rust: 'hello\0world' = 11 bytes, Zig: 'hello' = 5 bytes)
143+
```
144+
</details>
145+
146+
<details>
147+
<summary>TASK-138: Config isolation (15 pass, 1 fail)</summary>
148+
149+
```text
150+
Config Isolation Test Summary
151+
152+
PASSED: 15
153+
FAILED: 1
154+
155+
Failing:
156+
- Default value parity: Zig defaults merge-equal-values to 1, Rust defaults to 0
157+
(Reference: core/src/ext-data.c:72 sets default = 0)
158+
159+
Key findings:
160+
- Config IS persisted to database (crsql_config table), not per-connection
161+
- Both implementations have same persistence behavior (PASS)
162+
- Default value differs (FAIL - Zig should match Rust default of 0)
163+
```
164+
</details>
165+
166+
<details>
167+
<summary>TASK-139: Stress tests (12 pass)</summary>
168+
169+
```text
170+
STRESS TEST SUMMARY
171+
172+
Mode: CI (reduced iterations)
173+
PASSED: 12
174+
FAILED: 0
175+
176+
ST-002: Large batch inserts (10k rows) - memory bounded
177+
- Time: 0.19s
178+
- All rows and changes recorded correctly
179+
180+
ST-003: Concurrent row operations (100 rows x 3 ops) - no deadlock
181+
- Time: 0.10s
182+
- All data integrity checks passed
183+
184+
ST-004: Rapid INSERT/DELETE cycles (20 cycles) - clock consistent
185+
- Time: 0.14s
186+
- Final causal length and db_version correct
187+
```
188+
</details>
189+
190+
**Files created:**
191+
- `zig/harness/test-cross-open-parity.sh` (new, ~26KB)
192+
- `zig/harness/test-boundary-values.sh` (new, ~29KB)
193+
- `zig/harness/test-config.sh` (expanded, ~39KB)
194+
- `zig/harness/test-stress.sh` (new, ~20KB)
195+
196+
**Reproduction steps (clean checkout)**
197+
1. `git clone <repo> && cd cr-sqlite`
198+
2. `bash zig/harness/test-cross-open-parity.sh` — verify 17 pass, 3 known-fail
199+
3. `bash zig/harness/test-boundary-values.sh` — verify 7 pass, 1 fail
200+
4. `bash zig/harness/test-config.sh` — verify 15 pass, 1 fail
201+
5. `bash zig/harness/test-stress.sh` — verify 12 pass
202+
203+
**Known gaps / unverified claims**
204+
- Cross-open modification (XO-003, XO-004, XO-006) blocked by trigger schema incompatibility
205+
- NULL byte handling (EC-021) is a real bug in Zig implementation
206+
- Config default (merge-equal-values) is a real parity bug in Zig implementation
207+
- CI integration not verified this round (local runs only)
208+
209+
**Follow-up tasks needed (to be created in triage):**
210+
1. Fix Zig NULL byte truncation in text sync
211+
2. Fix Zig merge-equal-values default to match Rust (0, not 1)
212+
213+
---
214+
71215
## Round 2025-12-20 (55) — Wire format, PK blob, merge value, and CL parity tests (4 tasks)
72216

73217
**Tasks executed**

.tasks/active/TASK-136-cross-open-modification-parity.md

Lines changed: 0 additions & 56 deletions
This file was deleted.

.tasks/active/TASK-137-boundary-value-edge-cases.md

Lines changed: 0 additions & 58 deletions
This file was deleted.

.tasks/active/TASK-138-config-isolation-test.md

Lines changed: 0 additions & 46 deletions
This file was deleted.

.tasks/active/TASK-139-stress-performance-tests.md

Lines changed: 0 additions & 39 deletions
This file was deleted.

0 commit comments

Comments
 (0)