Skip to content

Conversation

@indietyp
Copy link
Member

🌟 What is the purpose of this PR?

Add support for graph read filter closures in MIR by introducing a new GraphReadFilter source variant. This allows the compiler to properly handle and optimize filter closures used in graph read operations.

🔍 What does this change?

  • Add a new Source::GraphReadFilter variant to represent MIR generated from filter closures in graph read operations
  • Update the transform_closure method to accept a source parameter instead of constructing it internally
  • Modify the inlining analysis to never inline graph read filters
  • Replace the filters method in the callgraph with direct source type checking
  • Update pretty printing to properly display graph read filters
  • Ensure graph read filters are properly handled throughout the MIR pipeline

Pre-Merge Checklist 🚀

🚢 Has this modified a publishable library?

This PR:

  • does not modify any publishable blocks or libraries, or modifications do not need publishing

📜 Does this require a change to the docs?

The changes in this PR:

  • are internal and do not require a docs change

🕸️ Does this require a change to the Turbo Graph?

The changes in this PR:

  • do not affect the execution graph

🛡 What tests cover this?

  • Existing MIR tests should cover this functionality

❓ How to test this?

  1. Checkout the branch
  2. Run tests that involve graph read operations with filters
  3. Confirm that filters are properly handled and not inlined

@cursor
Copy link

cursor bot commented Jan 25, 2026

PR Summary

Adds first-class MIR support for graph-read filter closures and wires it through the pipeline.

  • Introduces Source::GraphReadFilter in body::Source
  • Reify: transform_closure/lower_closure now accept a Source; graph-read lowering emits GraphReadFilter sources
  • Inlining: treats GraphReadFilter as Never inline; filter detection now based on body.source (removes callgraph filters() usage)
  • Pretty printing: renders graph::read::filter in signatures and references
  • Callgraph: no functional change to edges; removes filters() helper
  • Updates UI tests to expect new graph::read::filter names

Written by Cursor Bugbot for commit f97b485. This will update automatically on new commits. Configure here.

@vercel
Copy link

vercel bot commented Jan 25, 2026

The latest updates on your projects. Learn more about Vercel for GitHub.

2 Skipped Deployments
Project Deployment Review Updated (UTC)
hashdotdesign Ignored Ignored Preview Jan 25, 2026 11:51am
hashdotdesign-tokens Ignored Ignored Preview Jan 25, 2026 11:51am

@vercel vercel bot temporarily deployed to Preview – petrinaut January 25, 2026 11:31 Inactive
@github-actions github-actions bot added area/libs Relates to first-party libraries/crates/packages (area) type/eng > backend Owned by the @backend team labels Jan 25, 2026
This was referenced Jan 25, 2026
Copy link
Member Author

Warning

This pull request is not mergeable via GitHub because a downstack PR is open. Once all requirements are satisfied, merge this PR as a stack on Graphite.
Learn more

This stack of pull requests is managed by Graphite. Learn more about stacking.

@codspeed-hq
Copy link

codspeed-hq bot commented Jan 25, 2026

Merging this PR will not alter performance

✅ 21 untouched benchmarks


Comparing bm/be-315-hashql-differentiate-between-graphfilter-sources (f97b485) with bm/be-301-hashql-size-estimation-for-local-variables-and-functions (2fe1a32)

Open in CodSpeed

@augmentcode
Copy link

augmentcode bot commented Jan 25, 2026

🤖 Augment PR Summary

Summary: Introduces a dedicated MIR Source::GraphReadFilter kind for graph-read filter closures so they can be identified and treated specially throughout the MIR pipeline.

Changes:

  • Adds Source::GraphReadFilter and threads an explicit Source into closure lowering.
  • Marks graph-read filters as InlineDirective::Never in inlining analysis.
  • Updates inliner “filter” detection to use Source classification instead of callgraph helper iteration.
  • Extends MIR text pretty-printing to render graph-read filter bodies with a distinct label.

🤖 Was this summary useful? React with 👍 or 👎

Copy link

@augmentcode augmentcode bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Review completed. 1 suggestions posted.

Fix All in Augment

Comment augment review to trigger a new review at any time.

Copy link

@cursor cursor bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Cursor Bugbot has reviewed your changes and found 1 potential issue.

Bugbot Autofix is OFF. To automatically fix reported issues with Cloud Agents, enable Autofix in the Cursor dashboard.

@vercel vercel bot temporarily deployed to Preview – petrinaut January 25, 2026 11:51 Inactive
@github-actions github-actions bot added the area/tests New or updated tests label Jan 25, 2026
@codecov
Copy link

codecov bot commented Jan 25, 2026

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 66.47%. Comparing base (2fe1a32) to head (f97b485).

Additional details and impacted files
@@                                          Coverage Diff                                           @@
##           bm/be-301-hashql-size-estimation-for-local-variables-and-functions    #8323      +/-   ##
======================================================================================================
- Coverage                                                               66.47%   66.47%   -0.01%     
======================================================================================================
  Files                                                                     762      762              
  Lines                                                                   67684    67681       -3     
  Branches                                                                 3799     3799              
======================================================================================================
- Hits                                                                    44991    44988       -3     
  Misses                                                                  22158    22158              
  Partials                                                                  535      535              
Flag Coverage Δ
rust.hashql-compiletest 46.65% <ø> (ø)
rust.hashql-mir 89.22% <100.00%> (-0.01%) ⬇️

Flags with carried forward coverage won't be shown. Click here to find out more.

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

@graphite-app graphite-app bot requested review from a team January 25, 2026 11:59
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

area/libs Relates to first-party libraries/crates/packages (area) area/tests New or updated tests type/eng > backend Owned by the @backend team

Development

Successfully merging this pull request may close these issues.

2 participants