Add the TiledTree lifecycle wrapper#55
Draft
achamayou wants to merge 4 commits into
Draft
Conversation
Introduce merklecpp_tiles.h with the tlog-tiles tile geometry constants, tile index encoding, TileRef, and a hardened TileStoreT: strict full-tile and entry-bundle codecs/I/O, atomic replacement, directory/file durability, validation, and temp-file cleanup, with no internal synchronization (callers must serialize access). Add focused tiles_store tests covering path layout, atomic durable writes, corruption/truncation handling, and concurrent same-tile writes. Store durability-retry tests that exercise TileWriter are deferred to the next branch, which also adds the entry-bundle writer. Wire tiles_store into the test suite, add merklecpp_tiles.h to the Doxygen input set, and run clang-tidy on it in CI. Start the normative tiled-storage design doc with goals, background, the tile/merklecpp mapping, file layout, architecture overview, the header/TileStoreT API sections, and the entry-bundle format (its writer arrives in the next branch). Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Add TileWriterT (progressive full-tile writes with all-level rollups and bounded contiguous-prefix recovery) and EntryBundleWriterT (mirrors the writer for optional entry bundles). Both are incremental: existing full tiles/bundles are immutable and never rewritten, resume is idempotent, and recovery is caller-validated (the caller supplies the tree/entry state and re-derives it consistently across restarts). Add tiles_writer and tiles_entries tests covering exact full-tile/bundle counts at several sizes, incremental/idempotent writes, interior-hole repair on resume, and bounded recovery against sparse indices. Move the store durability-retry tests that exercise TileWriter into tiles_store, now that the writer exists. Document the write path, compaction integration, and entry-bundle writer in the design doc, and add the size-256/70000 worked examples. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Add HashSourceT (abstract subtree-root resolver), TileHashSourceT (resolves from full tiles, with an LRU tile cache), ProofEngineT (inclusion/consistency proofs and their verifiers, built on mth_range), MemoryHashSourceT (resolves from a resident in-memory tree), and CombinedHashSourceT (memory first, falling back to tiles). Add the sole essential core change: TreeT::subtree_root(), a read-only, non-hashing accessor that lets proofs be served from the resident tree, plus the <limits> include it needs. No other merklecpp.h changes. Add tiles_proofs tests, cross-checking tile-derived inclusion and consistency proofs against merkle::TreeT as the oracle across a range of sizes, including tile-boundary crossings. Move the memory-only subtree_root proof coverage and the ProofEngineProbe hostile-arithmetic edge cases here from tree coverage, since they exercise the proof engine and core accessor rather than TiledTree lifecycle. Add tiles_level2 for end-to-end coverage of the level-2 tile path. Introduce the LONG_TESTS CMake option, gate tiles_level2 behind it, and enable it in CI (and CodeQL) so long-running tile coverage runs on pull requests. Document the compatibility statement, the optional core accessor, and the HashSource/ProofEngineT API and algorithms in the design doc. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Add TiledTreeT: a fresh-only tiled tree (rejects an existing tile namespace rather than adopting it), append/flush/root, flushed/ immutable size tracking, interrupted-flush recovery (a failed flush seals the attempted full-tile boundary without advancing flushed size), optional compaction with configurable retention, a rollback boundary that only ever permits retracting the un-tiled frontier, noexcept move construction with no copy, mixed tile+memory proofs, and an explicit no-internal-synchronization / external-serialization contract for the store and tree it wraps. Add tiles_tree tests covering the empty tree, move construction, fresh-only rejection of an existing tile namespace, flush/compaction (including exact-multiple and retention-margin cases), and rollback (pre-flush, post-flush, exact-boundary, compacted, and interrupted- flush recovery). The memory-only subtree_root/ProofEngineProbe cases already moved to tiles_proofs are not duplicated here. Add tiles_hashes, exercising the tiled tree, writer and proof engine under SHA384/SHA512, and wire the OpenSSL 384/512 aliases for every tiled-storage component. Document the TiledTreeT API, the flush/compaction invariants and progressive-production algorithm, pruning, and the consolidated lifecycle/safety risks and edge cases in the design doc. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
achamayou
force-pushed
the
achamayou/tiles-proofs
branch
from
July 25, 2026 21:13
1d868c1 to
77c129a
Compare
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.
Summary
Part 4 of the tiled-storage stack; depends on #54.
TiledTreeT, combining an in-memory tree, durable tile store, writer, and mixed proof sources;TiledTreeTfresh-only and reject adoption of an unrelated existing tile namespace;Stack
TiledTreelifecycleValidation
tiles_treetiles_hasheswithOPENSSL=ON