feat: make section store hashes content-aware - #147
Merged
Conversation
|
Important
This repository does not receive automatic reviews because it has fewer than 10 stars. ⚙️ Run configurationConfiguration used: defaults Review profile: CHILL Plan: Advanced Run ID: Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Content-aware
.tablassert/storekeys now invalidate cached sections when their actual local source files change, while preserving cache reuse for unchanged content.Content-Aware Store Keys
rs.xxh64_file()inrust/src/lib.rs, using streaming 8 MiB reads with bounded memory and explicitOSErrorpropagation.file_content_hash()andsection_store_key()insrc/tablassert/utils.py.build_graph_pipeline()now combines the section configuration hash with the source-file content hash.(resolved_path, mtime_ns, size)signature during a build. A changed signature triggers a fresh hash.source-file-unreadableerror with configuration, section, and path context.Store Invalidation
Performance
xxh64_filemeasured1.848 GiB/s.25.095 GiB/s.0.313 ms/fileversus configuration-only hashing.tests/bench_file_hash_bench.pyharness and a non-gated 4 MiB smoke ceiling.Documentation
file_content_hash(),section_store_key(), the combined key formula, source-edit invalidation, and the one-time rebuild after upgrading.Testing
make check→ Python 1188 passed, 43 skipped; Rust tests 109 + 10 + 14 passed, 1 ignored; clippy clean.uv run pytest -q→ 1189 passed, 43 skipped.uv run pytest tests/test_store_keying.py tests/test_store_invalidation_e2e.py tests/test_utils.py tests/test_rs.py tests/test_errors.py -n 0 -q→ passed.uv run pytest tests/test_docs_cli_coverage.py tests/test_agent_docs.py tests/test_docs_examples.py -n 0 -q --no-cov→ 32 passed.TABLASSERT_BENCH=1 uv run pytest tests/bench_file_hash_bench.py -s -n 0 -q --no-cov→ 1 passed with the benchmark results above.PYRIGHT_PYTHON_FORCE_VERSION=latest uv run pyright→ 0 errors, 0 warnings.uv run mkdocs build --strict --site-dir /tmp/tablassert-mkdocs-audit→ passed.