Skip to content

Complete transitive chains when their right-hand premise arrives later - #1051

Merged
WaylandYang merged 2 commits into
deeplethe:devfrom
Maya-Kid:codex/reasoning-order-independent
Oct 2, 2026
Merged

WaylandYang merged 2 commits into
deeplethe:devfrom
Maya-Kid:codex/reasoning-order-independent

Conversation

@Maya-Kid

@Maya-Kid Maya-Kid commented Oct 2, 2026

Copy link
Copy Markdown
Contributor

With A q B, B p C, p ⊑ q, and transitive q, the engine could miss A q C when q sorted before p: 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:

  • New late-premise regressions failed before the fix. All 95 reason tests pass, covering subproperty/inverse orderings, multiround arrivals, complete ordered premises, time intersections, a 12-premise shortcut, and the 20,000-output cap.
  • An independent real-Rust differential run over 1,000 deterministic graphs preserved all 171,525 baseline conclusion intervals, with no duplicate exact conclusions, oversized proofs, or lost temporal coverage.
  • Workspace formatting, clippy with -D warnings, tests with PostgreSQL 16/pgvector and required DB/PDF guards, and build pass using Rust 1.98.1.
  • The unchanged web baseline passes its 223 tests and production build, including typecheck and style guard.

Signed-off-by: dada-yan <BinjunYann@gmail.com>

@WaylandYang WaylandYang left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.

@WaylandYang
WaylandYang merged commit 52d539f into deeplethe:dev Oct 2, 2026
6 checks passed
@Maya-Kid
Maya-Kid deleted the codex/reasoning-order-independent branch October 15, 2026 03:29
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants