feat: keys-only projection for axis reads on the unified PathQuery - #827
Conversation
run_path_query served every ReadMode::Axis read through the resolving indexed-axis reads, so the unified path had no way to ask for the ranking pairs alone: a caller that only ranks paid up to k primary point reads per page — through its own transaction, after the pinned secondary page was collected, so outside the iterator's view when that transaction is None — for values it discards. #824 gave the standalone API a keys-only shape; this gives the PathQuery vocabulary the same. AxisQuery gains `projection: AxisProjection { Entries (default), Keys }`, encoded as a trailing frozen tag byte; `validate` rejects Keys on the traversals that list no entries (rank-of-key, value-range aggregates). run_path_query routes a Keys read through the _keys reads and returns AxisKeys / BranchedAxisKeys (absent branches None, as for entries); AxisEntries::to_keys is the projection. The projection is an unproved-read choice: a proof always carries the values and verification yields entries, so prover and verifier treat Keys exactly as Entries — a keys read is a strict projection of the verified page, which a test pins. PathQuery::new_axis(path, axis_query) builds a read from an already-configured AxisQuery. Tests: keys == entries projected on every axis, both directions, with and without an offset, for ranked-page and bounded traversals; branched keys == branched entries projected including absent branches; keys == verified entries projected; fewer seeks and loaded bytes; rejection on non-listing traversals; projection round-trips with a frozen tag and an unknown tag is rejected. Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
|
Warning Review limit reached
Next review available in: 28 minutes Limit details: You’ve used the included review currently available. You've used all free OSS reviews for now. Wait for the free limit to reset to keep reviewing this public repository. How can I continue?Wait for the limit to reset, then comment An organization admin can change what happens after included review limits in Billing. How do review limits work?CodeRabbit enforces per-developer PR review limits within each organization. For paid Pro and Pro+ reviews, CodeRabbit uses a developer's included PR review attempts over the past 7 days to set the current hourly allowance. At typical activity levels, the full plan allowance applies. Higher sustained activity can lower the allowance until earlier attempts leave the 7-day window. Please refer docs for additional details. Review details⚙️ Run configurationConfiguration used: defaults Review profile: CHILL Plan: Pro Plus Run ID: 📒 Files selected for processing (10)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
Codecov Report❌ Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## develop #827 +/- ##
===========================================
+ Coverage 92.39% 92.41% +0.01%
===========================================
Files 288 288
Lines 87906 88135 +229
===========================================
+ Hits 81219 81447 +228
- Misses 6687 6688 +1
🚀 New features to boost your workflow:
|
Follow-up to #824.
Why
run_path_queryserved everyReadMode::Axisread through the resolving indexed-axis reads, so the unified path had no way to ask for the ranking pairs alone. A caller that only ranks (Dash Platform's ranked / having executors, any leaderboard view) paid up tokprimary point reads per page — through its own transaction, after the pinned secondary page was collected, so outside the iterator's view whenever that transaction isNone— for values it then discards. #824 gave the standalone API a keys-only shape; this gives thePathQueryvocabulary the same, so the planned unified-path rebuild of branched ranked queries (dashpay/platform#4401) doesn't re-inherit the blocker raised on dashpay/platform#4382.What
AxisQuery.projection: AxisProjection { Entries (default), Keys }— encoded as a trailing frozen tag byte (0/1; unknown rejected).validaterejectsKeyson the traversals that list no entries (RankOfKey,AggregateOverValueRange) — enforced atclassify, so read, prove and verify agree.AxisQuery::keys_only()/with_projection()builders;PathQuery::new_axis(path, axis_query)to build a read from an already-configuredAxisQuery.run_path_queryroutes aKeysread through the_keysreads (never opens the primary) and returnsPathQueryRun::AxisKeys(AxisKeys)/BranchedAxisKeys(absent branchesNone, exactly as for entries).AxisKeys { Count | Sum | Avg }holds the(ordering_value, original_key)pairs;AxisEntries::to_keys()is the projection.Keysquery exactly asEntries(pinned by test).unified-path-query.mddocuments the field and the semantics.Tests
axis_read_projection_tests: keys == entries projected on every axis, both directions, with and without an offset, for ranked-page and bounded traversals; branched keys == branched entries projected including an absent branch; keys == verified entries projected; keys reads cost strictly fewer seeks and loaded bytes;Keysrejected on rank-of-key and value-range aggregates.grovedb-query: projection round-trips, tag frozen, unknown tag rejected, validation matrix. Fullgrovedblib suite green (2845 passed), lib clippy clean (incl.empty_line_after_doc_comments), verifier-only build unaffected.🤖 Generated with Claude Code