You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Round 72: Linux CI fix, clock inspection tests, app simulation tests, db_version investigation
TASK-156: Fix Linux CI
- Disabled std.log in changes_vtab.zig and sqlite/vtab.zig (segfaults on Linux)
- Added debug counter to site_identity.zig for db_version investigation
- 365 tests now passing on Linux
TASK-196: Clock table inspection tests (DONE)
- Created test-clock-internals.sh with 14 test cases (27 assertions)
- Discovered seq off-by-one divergence (Zig starts at 1, Rust at 0)
- All other clock fields match exactly
TASK-194: Real-world app simulation tests
- Created test-app-todo.sh, test-app-chat.sh, test-app-inventory.sh
- CRITICAL: Found INSERT INTO crsql_changes fails in Zig
- Rust/C passes all tests, Zig fails on sync operations
TASK-198: db_version investigation (IN PROGRESS)
- Added crsql_debug_next_dbv_calls() debug function
- Confirmed +1 divergence after ~500 ops
- Root cause not yet identified
New tasks:
- TASK-197 (triage): Fix seq off-by-one in INSERT triggers
<summary>TASK-156: Linux CI fix (RESOLVED)</summary>
108
+
109
+
**Root cause**: Zig's `std.log` (used in `changes_vtab.zig` and `sqlite/vtab.zig`) internally uses `std.io.getStdErr()` which can segfault when called from a dynamically loaded shared library on Linux because the Zig runtime isn't properly initialized in that context.
110
+
111
+
**Fixes applied**:
112
+
1.`zig/src/ffi/init.zig` — Disabled `debugLog()` function
113
+
2.`zig/src/site_identity.zig` — Replaced `std.crypto.random` with xorshift64 PRNG
**INVALIDATED**: "Zig behaves correctly under realistic application workloads."
106
+
107
+
The Zig implementation has a fundamental bug that prevents cross-device sync from working. When Device A creates data and sends changes to Device B, Device B cannot apply them via `INSERT INTO crsql_changes`.
108
+
109
+
### Recommended Follow-up
110
+
111
+
Create a new task to fix the `insertOrUpdateColumn` function in the Zig changes vtab implementation. The bug appears to be in `zig/src/changes-vtab.zig` in the `changesUpdate` path when handling new rows.
0 commit comments