Repository navigation
bench: add a generated shape suite as the third benchmark - #226
Merged
Merged
Conversation
The two SF1 suites write each question one way, over one graph, so they missed every gap listed in #223. This suite generates a seeded graph with hubs, wide text columns and shuffled ids, and runs groups of general multi-hop shapes: one question phrased several ways, cycles and pattern predicates through a hub of growing degree, CALL per row, filtered OPTIONAL MATCH, wide columns, counts against rows, and LIMIT without ORDER BY. Each group reports a headline ratio against its ideal. Queries that ask the same question must agree, each must reach the operator it measures, and each runs in its own process so its peak memory is reported. The report compares two wheels. CONTRIBUTING names it as the third suite.
5 of 16 tasks
Deploying lance-csr with
|
| Latest commit: |
eb3430f
|
| Status: | ✅ Deploy successful! |
| Preview URL: | https://69c8f710.lance-csr.pages.dev |
| Branch Preview URL: | https://bench-shape-suite.lance-csr.pages.dev |
prrao87
marked this pull request as ready for review
November 27, 2026 23:59
CONTRIBUTING.md, the docs contributing page, the README and AGENTS.md now name graph-benchmark-ldbc, graph-benchmark-ldbc-complex and the shape suite as a numbered requirement, so a claim backed by only one or two of them is plainly incomplete.
CALL { ... } subqueries are a Neo4j extension, not openCypher, so the suite no longer tracks their planning cost.
This was referenced Nov 28, 2026
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.
Closes #224.
Why
The two SF1 suites write each question one way, over one graph, so every gap listed in #223 was invisible to them and found only with one-off scripts. A planner change can't be judged on general multi-hop shapes (anchored paths, cycles through hubs, filtered optional hops, wide columns) without a suite that contains them. This adds that suite to the repository, generated on demand, and makes it the third suite a performance claim reports.
What changed
A seeded graph generator writes two graphs to Lance in seconds:
Accountgraph with shuffled ids, a unique name, a half/half column, 500-byte notes, a heavy-tailed out-degree with a few out-hubs, 20% of edges aimed at ten in-hubs, and a relationship property;Ringgraph of triangles beside a hub whose degree is the only thing that changes between levels.tinyis for the test,small(20,000 accounts, hub degrees up to 100,000) runs in under a minute per pass, andlarge(200,000 accounts) is for final numbers.Seven query groups, including the two added to Add a generated shape benchmark as the third regression suite #224: phrasing, selectivity and hop order, count against rows, hubs (cycle, cycle with a hub at both ends, pattern predicate, each with and without the CSR), filtered
OPTIONAL MATCH, wide columns, and early exit (LIMITwithoutORDER BY). Add a generated shape benchmark as the third regression suite #224's per-rowCALLgroup is left out:CALL { … }subqueries are a Neo4j extension, not openCypher, so their planning cost isn't something this suite tracks.Checks on every run. Queries that ask the same question must return the same answer, and each query must reach the operator it measures (for example,
PathExistsExecfor the pattern predicate, or a realCsrExpandExecfor early exit). A run fails on a mismatch or a query error; a timeout is reported as a slow result.Memory. Each query runs in its own process, so the runner reports its peak memory growth, and it reports the resident size of the CSR and node indexes for each graph.
A report prints Markdown for each mode: group headlines against their ideal, every query's time and peak memory for two labelled builds, index sizes, and the gap between repeated
mainruns.A performance claim now needs all three suites.
CONTRIBUTING.mdlists them as a numbered requirement (graph-benchmark-ldbc, graph-benchmark-ldbc-complex, the shape suite), each in both modes, and adds a harness that runs the shape suite against themainand branch wheels the same way as the other two. The docs contributing page, the README andAGENTS.mdsay the same, and the docs' micro-benchmark table marksshapes.pyas a suite rather than a micro-benchmark.Validation
tinygraph and runs every query once inmemoryandlazymode. It checks that answers agree, that every query reaches its operator, and that the phrasing groups have non-empty answers. It runs in about 7 seconds on a debug build. Ruff, the strict docs build andtypospass. CI has not run yet.largegenerates and runs end to end (onememorypass, about 45 seconds).Baseline on
main(cd386ef, which includes #225). Release wheel,smallgraph, two runs per mode; the run-to-run geomean was 0.998 in memory and 1.002 in lazy, with no query moving more than 15%.004 in memory and 0.998 in lazy, with no query moving more than 15%. Headlines, with the per-query tables below:Index resident size: 19 MiB for the
Accountgraph (built in 20 ms) and 31 MiB for theRinggraph (25 ms).These match the gaps #223 describes, with one addition #223 doesn't list: the 2.9× (memory) and 7.3× (lazy) phrasing spread left after #225 is entirely named against unnamed paths. A named path's
PathMatchbuilds a node inventory from the wholeAccounttable even forcount(*), a peak of 92 MiB against 2 MiB for the unnamed form in lazy mode.Machine: Apple M5 MacBook Pro, 24 GB, macOS 26.6.2.
Every query on the baseline
memory: small graph (20,000 accounts, 229,517 T edges, hub degrees [10, 1000, 10000, 100000])
Runs: main x2.
main run-to-run geomean: 0.998; largest single-query gap 15%.
lazy: small graph (20,000 accounts, 229,517 T edges, hub degrees [10, 1000, 10000, 100000])
Runs: main x2.
main run-to-run geomean: 1.002; largest single-query gap 7%.
🤖 Generated with Claude Code