Skip to content

Tier 5: WAL & Durability (#53) - #81

Merged
nockawa merged 4 commits into
mainfrom
feature/53-wal-durability
Feb 17, 2026
Merged

nockawa merged 4 commits into
mainfrom
feature/53-wal-durability

Conversation

@nockawa

@nockawa nockawa commented Feb 17, 2026

Copy link
Copy Markdown
Collaborator

Summary

Implements the complete Write-Ahead Log (WAL) subsystem for Typhon, making it a durable database engine.

Key Components (53 files, ~8400 lines added)

Component Purpose
WalCommitBuffer Lock-free MPSC ring buffer with double-buffer swap
WalWriter Dedicated thread draining buffer to WAL segments
WalSegmentManager Segment rotation, recycling, and lifecycle
WalRecovery + WalReplayHelper Crash recovery and WAL replay
CheckpointManager Background dirty page flush and WAL recycling
WalCrc Hardware-accelerated CRC32C (SSE4.2/ARM64/software fallback)
WalManager Top-level orchestrator wiring all WAL components

Test plan

  • WalCommitBufferTests — claim/publish/drain/overflow/swap/dispose semantics
  • WalCommitBufferConcurrencyTests — multi-threaded producer/consumer stress tests
  • WalCrcTests — CRC32C correctness, skip-region, hardware acceleration
  • WalSegmentHeaderTests — binary layout, initialization, CRC validation
  • WalRecordHeaderTests — 48-byte struct layout verification
  • WalSegmentManagerTests — segment allocation, rotation, recycling
  • WalSegmentReaderTests — forward/backward reading, corruption handling
  • WalWriterTests — drain loop, segment rotation, durability modes
  • WalWriterConcurrencyTests — multi-threaded write stress
  • WalManagerTests — integration of all components
  • WalRecoveryTests — crash recovery scenarios, committed/voided replay
  • CheckpointManagerTests — trigger logic, dirty page flush, WAL recycling

🤖 Generated with Claude Code

Used IMemoryAllocator for UowRegistry internal block allocation.
@nockawa
nockawa merged commit 56e6b73 into main Feb 17, 2026
5 checks passed
@nockawa
nockawa deleted the feature/53-wal-durability branch February 17, 2026 00:15
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.

1 participant