Repository navigation
warren-core: IdMap<K: IdKeys> with FixedKeys (M10 step 2) - #56
Merged
Merged
Conversation
The id map becomes generic over its key storage (DESIGN.md §5.7): IdMap<K> holds the keys and the tombstones, and IdKeys has what the shared logic needs of a key storage: lookups both ways, in_order, renumber, compacted and rebuild. The rebuild's merge walk stays in IdMap, feeding a KeysRebuild in key order, so TextKeys can reuse it. FixedKeys<E> is today's pairs and inverse, unchanged; segment encoding and from_segments stay on IdMap<FixedKeys<E>>. EdgeIntake, GraphVersion, compact, diff, shared_dense_ids and align_ids/align_graph are generic over K. external_id returns a reference. pg_warren names IdMap<FixedKeys<E>> where it named IdMap<E>. No behaviour change: tests change only where the types did. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_012Rxfe2L3iVjSwSBPdUu1Ke
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_012Rxfe2L3iVjSwSBPdUu1Ke
# Conflicts: # DESIGN.md
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.
This is M10 step 2 (DESIGN.md §5.7). It makes the id map generic over how it stores ids, with no change in behaviour, so step 3 can add
TextKeyswithout touching callers again.Shape
IdMap<K: IdKeys>holdskeys: Kand the tombstones. The rebuild's merge walk (tombstone, keep or append) stays inIdMap::merge, so a new key storage only has to supply its storage.trait IdKeys:Key: ?Sized + Ord,Ids: NodeIds,Rebuild: KeysRebuild<Self>;dense_idandkey, withexternal_idreturning a reference;in_order,renumber,compacted, and arebuildthat reserves exactly.FixedKeys<E>holds today's pairs and inverse unchanged. The parts that only apply to fixed ids stay onIdMap<FixedKeys<E>>: segments, shared views andfrom_parts.K:EdgeIntake,GraphVersion, compaction,diff, the degree counts and distance alignment.IdMap<FixedKeys<E>>. SplittingIdDatumis left to step 4.IdMap::renumberbuilds the new tombstones first, so a failed memory charge changes nothing.GraphVersiongets hand-writtenClone/Copy, because a derive would requireK: Copy.decode_id_mapis updated.§5.7 records the trait as built.
Checked locally
-D warnings, rustdoc with-D warnings, and the core-isolation check.cargo pgrx test pg16: 636 passed, before main (withset_owner) was merged in. CI covers the merged tree.Generated by Claude Code