Skip to content

Minimal WAL — Durability Redesign (P0 + P1) - #399

Merged
nockawa merged 13 commits into
mainfrom
feature/393-minimal-wal
Jun 25, 2026
Merged

nockawa merged 13 commits into
mainfrom
feature/393-minimal-wal

Conversation

@nockawa

@nockawa nockawa commented Jun 25, 2026

Copy link
Copy Markdown
Collaborator

Implements the Minimal WAL durability redesign (WAL v2, Option A) — P0 + P1 of #393. The WAL carries logical truth only ((EntityId, ComponentTypeId), never pages/chunks/bufferIds); one codec, one apply routine, checkpoint v2 with A/B slot-pairing; v1 machinery (FPI, WalReplayHelper, WalSerializer, UowRegistry persistence) is deleted.

Prime directive: "It won't work because we think it will — it will work because we can prove it does."

Umbrella: #393 (P0 + P1) · also completes #395 (P1). Companion docs PR in nockawa/typhon-claude (TLA+ specs S1/S2 + design/rules) — both must merge. Close #393/#395 via /complete-task once both are merged.

What's in this PR

Program success metrics (all met)

Metric Status
One True Crash Test + full crash sweep green and in CI ✅ engine-ci.yml, fails on red
Zero Wal/Lsn/Fpi in src/Typhon.Engine/Storage/ ✅ 0 (grep-enforced)
TLC green on S1 + S2 ✅ both (in the companion docs PR)
All retired code deleted ✅ FPI retired (increment D)

Known residual (out of scope): #398 — checkpoint metadata-durability / flat-archetype enabled-bits on hard-crash-after-consolidation (P2).

🤖 Generated with Claude Code

nockawa added 13 commits June 12, 2026 06:48
…t, drop dead BitmapL3 root branch, cut SavePages

  alloc, hoist stats chunk-0 skip; +6 tests
- Short-read race: advance _fileSize only after the async write is durable (SavePages post-FlushToDisk), never authorizing a read past physical EOF.
- Grow-path latch corruption: SlotRefCount-pin the slot across the request→latch gap + bounded retry + try/finally (RequestExclusiveForGrow); never write/unlatch a slot we don't own.
- Checkpoint barrier reopen stall: seed DurableLsn to the reopen frontier alongside NextLsn (LOG-08), so CK-02 isn't an unreachable target on idle reopen.

Full suite now completes (was host-crashing on the latch bug); 20 residual failures are pre-existing/flaky (verified vs 66db27a).
WalCrc→Foundation Crc32CUtil; relocate checkpoint-LSN watermark to DurabilityWatermarks (M12 slice); de-collide File-Page-Index abbrevs.
Add identifier-scoped grep gate StorageDurabilityIdentifierGateTests.
Behavior-preserving; suite green at known baseline. Net −512 LOC.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Minimal WAL — Durability Redesign Program (P0 + P1)

1 participant