Skip to content

test: add CDC shift-resilient chunking tests (T-028a/b/c)#40

Merged
aimsise merged 2 commits intomainfrom
test/T-028-shift-resilient-cdc
Apr 2, 2026
Merged

test: add CDC shift-resilient chunking tests (T-028a/b/c)#40
aimsise merged 2 commits intomainfrom
test/T-028-shift-resilient-cdc

Conversation

@aimsise
Copy link
Copy Markdown
Owner

@aimsise aimsise commented Apr 2, 2026

Summary

  • T-028a: BuzHash prefix invariance test — 1バイト挿入前のチャンクが不変であることを検証
  • T-028b: Rabin prefix invariance test — 同上を Rabin アルゴリズムで検証
  • T-028c: BuzHash suffix reuse test — 1バイト挿入後のチャンク再利用率を検証 (閾値 total - 3)

共有ヘルパー (_make_data(), _make_shifted(), _chunks_before_offset(), _assert_prefix_invariant()) でテスト間の重複を排除。

Scope

  • tests/test_chunking.py のみ (テスト5本: 既存2 + 新規3)

Test plan

  • pytest tests/test_chunking.py -v — 5 tests passed
  • ruff check . — All checks passed
  • Full test suite — 261 passed, 8 skipped

🤖 Generated with Claude Code

Helix and others added 2 commits April 3, 2026 02:49
Add test_cdc_buzhash_shift_resilient_prefix to directly verify that CDC
boundaries do not change when a byte is inserted before the test offset.
This complements existing determinism tests by asserting shift-resilient
property: chunks before the insertion point remain unchanged after a 1-byte
insertion, validating the core CDC guarantee used for efficient diff transfer.

Use high-entropy SHA-256 block data (125 KiB) and config (min_size=512) to
ensure natural boundary distribution. Cache data generation with @lru_cache
to avoid redundant hash computation in future subtests (T-028b/c).

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
…28b/c)

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
@aimsise aimsise merged commit 3814cab into main Apr 2, 2026
6 checks passed
@aimsise aimsise deleted the test/T-028-shift-resilient-cdc branch April 2, 2026 18:02
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