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

Medium Risk
Touches MIR reification and inlining classification logic; mis-tagging filter closures could change optimization behavior or call graph assumptions, but scope is limited and covered by updated golden MIR tests.

Overview
Adds a new MIR body origin, Source::GraphReadFilter(HirId), to distinguish graph-read filter closures from normal closures.

Updates reification so transform_closure/lower_closure accept an explicit Source, and graph-read filter lowering now produces bodies tagged as GraphReadFilter (treated as fat pointers like closures/ctors).

Adjusts inlining and analysis to reflect the new source: GraphReadFilter bodies are marked Never inline in cost analysis, the inliner’s filter set is built by checking body.source (removing CallGraph::filters()), and MIR text output renders filters as graph::read::filter@.... Golden UI test outputs are updated accordingly.

Written by Cursor Bugbot for commit 1003601. 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.

Project Deployment Actions Updated (UTC)
hash Ready Ready Preview, Comment Feb 2, 2026 4:42pm
petrinaut Error Error Feb 2, 2026 4:42pm
2 Skipped Deployments
Project Deployment Actions Updated (UTC)
hashdotdesign Ignored Ignored Preview Feb 2, 2026 4:42pm
hashdotdesign-tokens Ignored Ignored Preview Feb 2, 2026 4:42pm

@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

@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 86.93%. Comparing base (784af93) to head (58566d5).

Additional details and impacted files
@@                                          Coverage Diff                                           @@
##           bm/be-301-hashql-size-estimation-for-local-variables-and-functions    #8323      +/-   ##
======================================================================================================
+ Coverage                                                               83.92%   86.93%   +3.00%     
======================================================================================================
  Files                                                                     293      154     -139     
  Lines                                                                   43595    21334   -22261     
  Branches                                                                 1178      539     -639     
======================================================================================================
- Hits                                                                    36588    18546   -18042     
+ Misses                                                                   6588     2584    -4004     
+ Partials                                                                  419      204     -215     
Flag Coverage Δ
rust.hashql-compiletest 46.65% <ø> (ø)
rust.hashql-core ?
rust.hashql-eval ?
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
@indietyp indietyp force-pushed the bm/be-301-hashql-size-estimation-for-local-variables-and-functions branch from 2fe1a32 to 6f5ce87 Compare January 29, 2026 20:48
@indietyp indietyp force-pushed the bm/be-315-hashql-differentiate-between-graphfilter-sources branch from f97b485 to 5d50f7f Compare January 29, 2026 20:48
@indietyp indietyp force-pushed the bm/be-301-hashql-size-estimation-for-local-variables-and-functions branch from 6f5ce87 to 784af93 Compare January 30, 2026 10:36
@indietyp indietyp force-pushed the bm/be-315-hashql-differentiate-between-graphfilter-sources branch from 5d50f7f to 58566d5 Compare January 30, 2026 10:36
@indietyp indietyp force-pushed the bm/be-301-hashql-size-estimation-for-local-variables-and-functions branch from 784af93 to f0ffcbc Compare January 30, 2026 23:24
@indietyp indietyp force-pushed the bm/be-315-hashql-differentiate-between-graphfilter-sources branch from 58566d5 to 8f66e92 Compare January 30, 2026 23:24
@indietyp indietyp force-pushed the bm/be-301-hashql-size-estimation-for-local-variables-and-functions branch from f0ffcbc to ec4abcb Compare February 2, 2026 16:36
@indietyp indietyp force-pushed the bm/be-315-hashql-differentiate-between-graphfilter-sources branch from 8f66e92 to 1003601 Compare February 2, 2026 16:36
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.

3 participants