Skip to content

BE-315: HashQL: Add GraphReadFilter source variant to MIR#8323

Merged
indietyp merged 2 commits intomainfrom
bm/be-315-hashql-differentiate-between-graphfilter-sources
Feb 9, 2026
Merged

BE-315: HashQL: Add GraphReadFilter source variant to MIR#8323
indietyp merged 2 commits intomainfrom
bm/be-315-hashql-differentiate-between-graphfilter-sources

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 decisions; behavior changes are scoped but could affect optimization correctness/perf for graph read pipelines.

Overview
Introduces a new MIR body origin Source::GraphReadFilter(HirId) to explicitly represent closure bodies used as graph read |> filter(...) predicates.

Updates MIR reification to tag graph-read filter closures with this new source (by threading an explicit Source through transform_closure/lower_closure) and treats these bodies as fat-pointer closures for environment handling.

Adjusts the inliner to never inline GraphReadFilter bodies and to identify “filter” functions by body.source rather than via a callgraph filters() query. Pretty-printing and UI test snapshots are updated to render filters as {graph::read::filter@...} instead of generic {closure@...}.

Written by Cursor Bugbot for commit 1406e8d. 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 6, 2026 3:55pm
3 Skipped Deployments
Project Deployment Actions Updated (UTC)
hashdotdesign Ignored Ignored Preview Feb 6, 2026 3:55pm
hashdotdesign-tokens Ignored Ignored Preview Feb 6, 2026 3:55pm
petrinaut Skipped Skipped Feb 6, 2026 3:55pm

@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

indietyp commented Jan 25, 2026

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

@indietyp indietyp force-pushed the bm/be-315-hashql-differentiate-between-graphfilter-sources branch from 1003601 to b14194d Compare February 6, 2026 08:29
@indietyp indietyp force-pushed the bm/be-301-hashql-size-estimation-for-local-variables-and-functions branch from ec4abcb to a1f5489 Compare February 6, 2026 08:29
@indietyp indietyp force-pushed the bm/be-315-hashql-differentiate-between-graphfilter-sources branch from b14194d to 517b43b Compare February 6, 2026 09:37
@github-actions github-actions bot dismissed TimDiekmann’s stale review February 6, 2026 09:37

Your organization requires reapproval when changes are made, so Graphite has dismissed approvals. See the output of git range-diff at https://github.com/hashintel/hash/actions/runs/21745833243

@indietyp indietyp force-pushed the bm/be-315-hashql-differentiate-between-graphfilter-sources branch from 517b43b to 4b1ba4c Compare February 6, 2026 10:04
TimDiekmann
TimDiekmann previously approved these changes Feb 6, 2026
Base automatically changed from bm/be-301-hashql-size-estimation-for-local-variables-and-functions to main February 6, 2026 15:48
@indietyp indietyp force-pushed the bm/be-315-hashql-differentiate-between-graphfilter-sources branch from 4b1ba4c to 1406e8d Compare February 6, 2026 15:49
@vercel vercel bot temporarily deployed to Preview – petrinaut February 6, 2026 15:49 Inactive
@github-actions github-actions bot dismissed TimDiekmann’s stale review February 6, 2026 15:49

Your organization requires reapproval when changes are made, so Graphite has dismissed approvals. See the output of git range-diff at https://github.com/hashintel/hash/actions/runs/21756655265

@graphite-app
Copy link
Contributor

graphite-app bot commented Feb 6, 2026

Merge activity

  • Feb 6, 3:50 PM UTC: Graphite rebased this pull request, because this pull request is set to merge when ready.

@indietyp indietyp added this pull request to the merge queue Feb 9, 2026
Merged via the queue into main with commit d675c2b Feb 9, 2026
50 checks passed
@indietyp indietyp deleted the bm/be-315-hashql-differentiate-between-graphfilter-sources branch February 9, 2026 14:08
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