Repository navigation
Conversation
Compare the single-hop wildcard with an explicit T|S match returning the same endpoints and relationship type. Keep the typed CSR plan check and let the untyped plan change as the planner improves. Check the typed labels against an independent UNION ALL over the two edge tables. Follow up on hyperdimensionalcomputingai#236.
Codex Review Summary: ✅ CompletedThis comment shows the latest Codex review activity on this pull request.
ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings. |
Contributor
Author
|
When the query returns |
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
Add the untyped
type(r)benchmark requested in #236 after #235. It measures the same 200 starting accounts and returns the same endpoints as the existing one-hop pair, with the relationship type added to each row. On v0.16.0 the untyped form took 6.83× as long in memory and 16.16× as long with lazy Lance reads as the explicit type list. Both returned the same 2,885 rows.Problem and why it matters
Our chain-of-title query asks which kind of relationship connects two known entities. The existing benchmark returns the endpoints alone. On the large fixture, both endpoint-only forms use CSR expansion. Adding
type(r)changes the untyped plan even though the engine knows both endpoint labels.Change
The comparison query changes only
[r]to[r:T|S]. Both use the existing full-row answer check, including duplicates. The tiny-graph test also obtains expected labels independently with two single-type matches, a literal label for each table, and CSR disabled.On v0.16.0, the typed plan shows two
CsrExpandExecbranches. The untyped plan shows twoPathMatchExec: endpoints csr walkbranches. The typed case asserts CSR expansion. The untyped case leaves the operator open so the same benchmark can measure a future planner improvement.Validation
The native engine for all measurements was the released v0.16.0 wheel, tagged at upstream
5160582. This patch changes the benchmark and its test only. Apple M5 Max, 128 GiB, macOS 27.0.1, Python 3.13, pylance 14.0.3, NumPy 2.5.4. The seed-0 large fixture has 200,000 accounts, 2,338,886 T edges and 200,000 S edges.[r:T|S][r]Each value is the mean of two run medians. Each new query ran 50 timed executions after warmup per run. The untyped lazy medians were 38.30 and 36.34 ms. These are two query forms on the same engine.
python/benchmarks/shapes.py run --group untypedtwice per storage mode. All 44 query executions across the four suite runs passed the harness checks. Reading the source Lance tables directly confirmed 2,685 T rows and 200 S rows, with the same full-row fingerprint in all eight new-case results (fbfaadcbe0c50829).python/python/tests/test_shape_benchmark.pypassed. The tiny suite exercised every benchmark query in both modes. A local negative control forced both new queries to return the constant'T'and confirmed that the independent check fails.All 11 queries in the measured group
Mean of the two run medians, in milliseconds.
hop_typedhop_untypedhop_anonymoustwo_hop_typedtwo_hop_untypedthree_hop_typedthree_hop_untypedmixed_typedmixed_untypedhop_type_typedhop_type_untypedReproduce the measurements
User impact
The shape report gains a one-hop untyped/typed ratio for queries that return the relationship type. The separate unknown-endpoint control from #236 remains follow-up work.