Reduce GetItem over struct scan plans - #9068
Draft
joseph-isaacs wants to merge 10 commits into
Draft
Conversation
Signed-off-by: Joe Isaacs <joe.isaacs@live.co.uk>
Signed-off-by: Joe Isaacs <joe.isaacs@live.co.uk>
…ecute Signed-off-by: Joe Isaacs <joe.isaacs@live.co.uk>
Signed-off-by: Joe Isaacs <joe.isaacs@live.co.uk>
Signed-off-by: Joe Isaacs <joe.isaacs@live.co.uk>
…ecute Signed-off-by: Joe Isaacs <joe.isaacs@live.co.uk>
Signed-off-by: "Joe Isaacs" <joe.isaacs@live.co.uk>
Signed-off-by: "Joe Isaacs" <joe.isaacs@live.co.uk>
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
StructScanPlanthat presents its fields to abstract reduction as aPackGetItem(Pack(...))reduction so a rooted field access becomes a physical field scan planStructFieldScanPlanlazily; sibling plan trees are never allocatedLayoutReaderScanPlanV2compatibility source for expressions that do not reduce and for old executionThis PR is stacked directly on #9005 (
ji/planning-old-execute).Laziness and performance
The benchmark uses a real
StructLayoutand instrumentsLayoutChildren::child. Every timed iteration creates a freshStructReader, so itsLazyReaderChildrencache cannot carry over from an earlier iteration. Both benchmark paths assert on every iteration that:GetItemmaterializes exactly one child.Quick local Criterion results for cold construction plus selecting the last field:
The shared width scaling comes from the existing eager struct-reader metadata/root-expression setup. The scan plan adds no sibling child-plan or child-reader materialization.
Checks
cargo +nightly fmt --allcargo test -p vortex-layout get_item_reduces_to_a_struct_field_scan_planVORTEX_SCAN_IMPL=planv2 RUSTC_WRAPPER= cargo test -p vortex-layout --all-features --lib(197 passed)cargo bench -p vortex-layout --bench scan_plan -- --quickcargo clippy -p vortex-layout --all-targets --all-features -- -D warningscargo clippy --all-targets --all-features -- -D warningsgit diff --check