Skip to content

BE-500, BE-501: HashQL: Unify mixed parameter resolution in data dependency analysis#8607

Merged
indietyp merged 12 commits into
mainfrom
bm/be-500-hashql-forward-substitution-unified-param-resolution
May 29, 2026
Merged

BE-500, BE-501: HashQL: Unify mixed parameter resolution in data dependency analysis#8607
indietyp merged 12 commits into
mainfrom
bm/be-500-hashql-forward-substitution-unified-param-resolution

Conversation

@indietyp
Copy link
Copy Markdown
Member

@indietyp indietyp commented Apr 5, 2026

🌟 What is the purpose of this PR?

This PR consolidates the parameter resolution logic in the data dependency analysis by unifying the handling of graph edges and constant bindings. Previously, these two sources of parameter values were handled by separate functions, but now they are processed together in a single unified approach that can handle mixed scenarios where parameters come from both sources.

🔍 What does this change?

  • Removes the resolve_params_const function and merges its functionality into resolve_params
  • Updates resolve_params to handle both graph edges and constant bindings simultaneously using try_reduce for consensus checking
  • Adds support for the iterator_try_reduce and maybe_uninit_uninit_array_transpose library features
  • Removes the unused assert_matches feature from multiple library modules
  • Adds a new test case load_param_mixed that validates parameter resolution when predecessors provide a mix of constants and projections
  • Improves documentation to clarify that parameter resolution now handles both graph edges and constant bindings

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?

  • New test case load_param_mixed validates the unified parameter resolution logic
  • Existing data dependency analysis tests continue to cover the refactored functionality

❓ How to test this?

  1. Checkout the branch
  2. Run the data dependency analysis tests
  3. Confirm that the new load_param_mixed test passes and validates mixed parameter resolution

@vercel
Copy link
Copy Markdown

vercel Bot commented Apr 5, 2026

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

Project Deployment Actions Updated (UTC)
hash Ready Ready Preview, Comment May 28, 2026 1:36pm
petrinaut Ready Ready Preview May 28, 2026 1:36pm
2 Skipped Deployments
Project Deployment Actions Updated (UTC)
hashdotdesign Ignored Ignored Preview May 28, 2026 1:36pm
hashdotdesign-tokens Ignored Ignored Preview May 28, 2026 1:36pm

Copy link
Copy Markdown
Member Author

indietyp commented Apr 5, 2026

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

@codspeed-hq
Copy link
Copy Markdown

codspeed-hq Bot commented Apr 5, 2026

Merging this PR will not alter performance

✅ 24 untouched benchmarks
⏩ 56 skipped benchmarks1


Comparing bm/be-500-hashql-forward-substitution-unified-param-resolution (53acbb7) with bm/be-494-hashql-scc-loop-breaker-inlining (cd68cdf)

Open in CodSpeed

Footnotes

  1. 56 benchmarks were skipped, so the baseline results were used instead. If they were deleted from the codebase, click here and archive them to remove them from the performance reports.

@vercel vercel Bot temporarily deployed to Preview – petrinaut April 5, 2026 19:43 Inactive
@codecov
Copy link
Copy Markdown

codecov Bot commented Apr 5, 2026

Codecov Report

❌ Patch coverage is 90.32258% with 6 lines in your changes missing coverage. Please review.
✅ Project coverage is 59.08%. Comparing base (cd68cdf) to head (53acbb7).

Files with missing lines Patch % Lines
...l/mir/src/pass/analysis/data_dependency/resolve.rs 93.33% 1 Missing and 3 partials ⚠️
...hashql/mir/src/pass/transform/inst_simplify/mod.rs 0.00% 2 Missing ⚠️
Additional details and impacted files
@@                              Coverage Diff                               @@
##           bm/be-494-hashql-scc-loop-breaker-inlining    #8607      +/-   ##
==============================================================================
- Coverage                                       59.09%   59.08%   -0.01%     
==============================================================================
  Files                                            1343     1342       -1     
  Lines                                          129632   129546      -86     
  Branches                                         5858     5850       -8     
==============================================================================
- Hits                                            76601    76546      -55     
+ Misses                                          52124    52096      -28     
+ Partials                                          907      904       -3     
Flag Coverage Δ
apps.hash-ai-worker-ts 1.41% <ø> (ø)
apps.hash-api 0.00% <ø> (ø)
local.hash-backend-utils 2.81% <ø> (ø)
local.hash-graph-sdk 9.63% <ø> (ø)
local.hash-isomorphic-utils 0.00% <ø> (ø)
rust.hash-graph-api 2.52% <ø> (ø)
rust.hashql-compiletest 28.26% <ø> (ø)
rust.hashql-eval 75.69% <ø> (ø)
rust.hashql-mir 86.80% <90.32%> (+0.03%) ⬆️

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.

@indietyp indietyp force-pushed the bm/be-500-hashql-forward-substitution-unified-param-resolution branch from fb80624 to d2ad307 Compare April 29, 2026 15:40
@indietyp indietyp force-pushed the bm/be-494-hashql-scc-loop-breaker-inlining branch from 1bebdcc to 1cba715 Compare April 29, 2026 15:40
@indietyp indietyp force-pushed the bm/be-500-hashql-forward-substitution-unified-param-resolution branch from d2ad307 to 93fba40 Compare April 29, 2026 15:42
@indietyp indietyp force-pushed the bm/be-494-hashql-scc-loop-breaker-inlining branch from 1cba715 to 1da0f0a Compare April 29, 2026 15:42
@indietyp indietyp marked this pull request as ready for review April 29, 2026 15:42
@cursor
Copy link
Copy Markdown

cursor Bot commented Apr 29, 2026

PR Summary

Medium Risk
Changes core MIR data-dependency resolution used by downstream passes; behavior is broad but heavily covered by new and updated snapshot tests.

Overview
Unifies MIR data dependency block-parameter resolution so graph Param edges and constant Param bindings are checked together (removes resolve_params_const), using iterator_try_reduce for predecessor consensus.

resolve_params now compares fully resolved values when the query has projections (e.g. φ-nodes where (42, u) and (42, v) still agree on .0), ignores cyclic Backtrack predecessors in favor of init edges, and tightens visited-set cleanup on diverge. resolve always enters that path when either kind of Param source exists.

Also folds 0 & x0 in inst_simplify (integer annihilator) and adds/updates insta data-dependency tests and snapshots for mixed params, projected consensus, and loop cycles.

Reviewed by Cursor Bugbot for commit 53acbb7. Bugbot is set up for automated code reviews on this repo. Configure here.

Copy link
Copy Markdown

@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. No suggestions at this time.

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

@indietyp indietyp force-pushed the bm/be-500-hashql-forward-substitution-unified-param-resolution branch from ffe8840 to f3d71ce Compare April 30, 2026 08:53
Comment thread libs/@local/hashql/mir/src/pass/analysis/data_dependency/resolve.rs
Comment thread libs/@local/hashql/mir/src/lib.rs
Comment thread libs/@local/hashql/mir/src/pass/analysis/data_dependency/resolve.rs
Copy link
Copy Markdown

@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.

There are 2 total unresolved issues (including 1 from previous review).

Fix All in Cursor

❌ Bugbot Autofix is OFF. To automatically fix reported issues with cloud agents, enable autofix in the Cursor dashboard.

Reviewed by Cursor Bugbot for commit 4f7a295. Configure here.

Comment thread libs/@local/hashql/mir/src/pass/analysis/data_dependency/resolve.rs
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