Repository navigation
Complete transitive chains when their right-hand premise arrives later - #1051
Merged
WaylandYang merged 2 commits intoOct 2, 2026
Merged
Conversation
Signed-off-by: dada-yan <BinjunYann@gmail.com>
WaylandYang
approved these changes
Oct 2, 2026
WaylandYang
left a comment
Contributor
There was a problem hiding this comment.
Thanks @Maya-Kid. The miss is real: a prefix that has left the frontier never meets a right-hand edge derived later, so the result depended on how predicate ids sort. Indexing incoming edges is the right fix, and letting a shorter proof keep extending is what makes the depth limit independent of arrival order.
What I checked beyond the tests, with a probe on synthetic graphs (dev against this branch, release build):
| Graph | dev | this branch |
|---|---|---|
| mixed predicates (transitive, sub-property, inverse), 200 nodes, 500 edges: triples | 1,814 | 2,142 |
| one transitive predicate, 300 nodes, 600 edges: triples | 8,531 | 8,535 |
| same graphs: time | 1.6 ms, 12 ms | 4.1 ms, 32 ms |
| dense, 300 nodes, 6,000 edges, at the 20,000 cap: time | 102 ms | 496 ms |
- Sound. On an untimed mixed graph, every derived triple lies inside a naive transitive closure, on both sides.
- Cost. The engine is 2 to 5 times slower, and the cap bounds it: the worst case I found is half a second. That is fine for a job that runs on rebuild. If it ever matters, the two
cloned()hop lists per edge are where I would look first.
Landing it.
This was referenced Oct 2, 2026
Merged
2 tasks done
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.
With
A q B,B p C,p ⊑ q, and transitiveq, the engine could missA q Cwhenqsorted beforep: the prefix had already left the frontier when the right-hand edge was derived. Changing predicate IDs changed the result.Index incoming edges as well as outgoing edges so a newly derived premise can complete either side of a chain. Propagation dominance now considers both the interval and proof length, allowing a shorter proof to keep extending within the existing depth limit. Covered conclusions are still emitted only once and do not spend the per-predicate output cap again; superseded propagation states are pruned.
Validation:
-D warnings, tests with PostgreSQL 16/pgvector and required DB/PDF guards, and build pass using Rust 1.98.1.