Repository navigation
feat(retrieval): DIFFUSE random walk and EXPAND FROM evidence trees - #119
Merged
Merged
Conversation
…tart DIFFUSE ranks atoms and hyperedges by personalized PageRank from seed atoms on the incidence structure: atom to containing hyperedge to member, never a pairwise expansion. Hyperedge choice is weighted by type weight and the leaving atom's role factor, member choice by membership weight and the entering member's role factor. VALID AT and an evidence POLICY filter memberships, and a step with nothing admitted returns its mass to the seeds, so the walk stays a distribution. The estimate comes from local push with a deterministic order. Its residual bounds the total error of the atom scores exactly, every row carries a guaranteed upper bound, and the work is bounded by (2 - alpha) / (alpha * epsilon) incidence reads. PROPAGATE is unchanged; Hora.diffuse is the Java entry point. No issue tracks this work.
Each node's push cost is now read once, from its raw posting count, so the work bound holds outside the default tenant; evidence lookups are counted. Every seed is pushed at least once, so a seed with many memberships still spreads its mass, and when every seed is a hyperedge whose members are all filtered out the walk is refused instead of running until the budget is gone. Seed weights that overflow, a repeated THROUGH type and a repeated role factor are refused. No issue tracks this work.
EXPAND FROM returns the hyperedges best connected to seed atoms, in exact order of the value of their best chain: each step multiplies a factor in [0, 1] built from role factors, type factors, hub and size damping and, with TOWARDS (RANK ...), the hyperedge's relevance through a gate, so a weakly relevant hyperedge can still connect two relevant ones. Incident hyperedges are read 64 postings at a time and only when the frontier reaches them. Each row names the atom it was entered through and the hyperedge that atom came from, so rows form a tree rooted at the seeds, and the message bounds the value of everything not returned, also when the budget ends the run. No issue tracks this work.
Incident postings are now read 64 at a time in key order instead of the whole list at the first chunk, and an atom's hub factor is worked out once when it is settled. When the frontier passes its cap it drops its lower half, the run reports FRONTIER_TRUNCATED and the message says below which value rows may be missing. A relevance query that runs out of budget ends the run with a budget stop and a valid bound. A seed that is a hyperedge is returned and expanded, the last accepted hyperedge's members are not read, and repeated seeds, types and roles and an out-of-range MIN are refused. DIFFUSE thresholds now use the reader's own degree. No issue tracks this work.
…ffusion # Conflicts: # database/src/main/java/io/hstore/db/Reader.java # database/src/main/java/io/hstore/db/query/Ast.java # database/src/main/java/io/hstore/db/query/Executor.java # database/src/main/java/io/hstore/db/query/Parser.java # database/src/test/java/io/hstore/db/SecurityTest.java # docs/database/hora.md # docs/database/hql.md # server/src/main/java/io/hstore/server/StatementLogger.java
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.
Stacked on #115; it reads membership validity from the reverse-index postings that #115 adds. Merge #115 first, then retarget this to
main.This adds two association operators. Both run over the actual incidence structure: atom → containing hyperedge → member, never a pairwise expansion.
DIFFUSE: personalized PageRank from seed atoms (hora/Diffusion.java,Hora.diffuse).PROPAGATEkeeps its old semantics.VALID ATand an evidencePOLICYfilter memberships. A step with nothing admitted sends its mass back to the seeds.(2 - α)/(α·ε)incidence reads.EXPAND FROM: a best-first evidence tree around the seeds (hora/Expansion.java).TOWARDS (RANK …), a relevance gate.The syntax is open for renaming before merge:
Testing
DIFFUSE: checked against an independent power iteration over the same chain, for 60 random models with role factors, type filters, validity and hyperedge seeds. Per atom,p ≤ π ≤ p + residual, and the total error equals the residual exactly. Runs are deterministic, and a run cut short by the budget keeps its certificate.EXPAND FROM: checked against a fixpoint over max-product chain values for 80 random queries, including a hub with more than 64 postings. The checks cover exact values in order, a tree rooted at the seeds, a bound that holds, and budget and truncation cases.DIFFUSE: ignoring exit factors, ignoring validity, dropping dangling mass.EXPAND FROM: no hub damping, no gate, no pending bound.Independent reviews. Both operators were reviewed.
DIFFUSE: one critical issue (cost lookups unmetered outside the default tenant) and two important ones (walks from filtered-out hyperedge seeds never ending, hub seeds never pushed), all fixed with tests.EXPAND FROM: five important issues, all fixed with tests: whole posting lists read at once, an uncharged hub degree scan, silent truncation, a relevance scorer throwing on budget, and other tenants' counts leaking intoDIFFUSEthresholds.Not done here
EXPAND FROMstill uses raw cardinality and weight maxima, which include other tenants' hidden members in old stores. The design accepts this.THROUGHtakesFACTORhere butWEIGHTinDIFFUSE.