Diffinery

homeflare/celldpublic

38 lines · 2.0 KBRaw History
1# Golden fixtures — provenance (IMMUTABLE)
2
3Captured from the **real** upstream tooling. Do not edit or regenerate these
4fixtures from celld-ltx. A mismatch means the implementation is wrong.
5
6| Source tool | Version | Provenance |
7|-------------|---------|-----------|
8| `litestream` | built from tag **v0.5.11** (commit `016c3687…`) | `reference/litestream-go` |
9| `sqlite3` | 3.51.0 | system |
10
11## Files
12
13- **`replica/`** — a full file-replica tree produced by `litestream replicate -once`
14 (deterministic, no background timing). Layout: `ltx/<level>/<minTXID>-<maxTXID>.ltx`.
15 Contents are **L0-only** (level `0`): a snapshot at TXID 1 plus 5 single-txn L0
16 files (TXIDs 2–6). The real binary restores this tree and the result equals the
17 source under the logical equality oracle.
18 - SQL sequence: `PRAGMA journal_mode=WAL`; `CREATE TABLE kv(k TEXT PRIMARY KEY,
19 v TEXT NOT NULL)`; seed `('a','1'),('b','2'),('c','3')`; then 5 iterations each
20 `INSERT ('k$i','v$i')` + `UPDATE kv SET v='upd$i' WHERE k='a'`, each flushed
21 with `replicate -once`.
22
23- **`sample.wal`** — a raw **SQLite** WAL file (16,512 bytes) for the `wal.rs`
24 parser (T1). Produced by sqlite3 3.51.0 in WAL mode with `wal_autocheckpoint=0`,
25 20 inserts + an update across 2 commits, copied while a second connection held a
26 read transaction (so the close-time checkpoint could not truncate it). Header
27 magic `0x377f0682` (big-endian salt variant), page size 4096.
28
29## How celld-ltx uses these
30Reader tests **decode** these bytes and assert structural fields (TXIDs, page
31numbers, checksums, frame counts). Writer byte-fidelity is **not** asserted by
32comparison against these files because LTX headers embed timestamps and are not
33bit-reproducible. Differential test D1 proves it against the real binary.
34
35## Reproduce
36`scripts/capture-golden.sh` regenerates an equivalent tree from a `litestream`
37binary built at tag v0.5.11. The bytes are not identical run-to-run (timestamps),
38but the structure and the round-trip property are.