Fix SQLite bounded adjacency prefix parity - #301
Merged
Conversation
Contributor
Author
|
CI follow-up: dependency-policy failed because crates.io yanked chacha20 0.10.1 after the existing lockfiles were published. Commit 9939af8 updates only the main and fuzz lock entries to non-yanked 0.10.2. Both cargo-deny policy invocations now report advisories, bans, licenses, and sources OK; cargo check --workspace --locked also passes. |
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
Motivation
On the Django repository, SimpleTestCase::assertRaisesMessage has 2,312 callers. With max-edges 500 and max-nodes 500, graph.json and SQLite both reported truncation but returned different edge subsets because SQLite bounded each endpoint-ordered index scan before the global edge-ID merge.
This change makes bounded selection backend-neutral and fails closed for sidecars that cannot provide those semantics.
Verification
Against the final compass-v0.3.22 base:
Additional qualification with the same source patch before the final rebase:
Real-repository verification used Django commit c9eb16a87e60c305fb3651459639f647cce498db: 76,570 nodes and 192,081 edges. The formerly divergent bounded callers query produced byte-identical 500-edge responses from both engines with SHA-256 a11a5acbffb1e0c04a25f92d2e6bfdc73c660855f39d51efe1aa1edf730518df. SQLite completed in 11.13 seconds at about 127 MiB peak RSS; cold JSON completed in 102.09 seconds at about 1.20 GiB peak RSS.
The existing macOS large unwind-table linker warning was observed; it did not affect the checks.
Compatibility and documentation
The canonical graph.json contract is unchanged. New sidecars carry the edge-ID-ordered adjacency capability. Existing sidecars remain usable for status, validation, backup, export, and recovery, but directional store queries require rebuilding with:
MIGRATION.md, COMPATIBILITY.md, the store operations guide, the query-engine implementation guide, and CHANGELOG.md document the behavior.
Checklist