Skip to content

Conversation

@indietyp
Copy link
Member

🌟 What is the purpose of this PR?

Rename the SROA (Scalar Replacement of Aggregates) transformation pass to ForwardSubstitution to better reflect its actual functionality. This pass resolves place operands to their ultimate sources by tracing data dependencies through assignments, projections, and block parameters.

🔍 What does this change?

  • Renames Sroa class to ForwardSubstitution across the codebase
  • Updates documentation to clarify that this pass performs forward substitution of values through data dependencies
  • Renames the test suite from mir/pass/transform/sroa to mir/pass/transform/forward-substitution
  • Renames cp module to copy_propagation for consistency and clarity
  • Updates benchmarks to use the new class name
  • Improves documentation to better explain the differences between CopyPropagation and ForwardSubstitution

🛡 What tests cover this?

Existing tests have been preserved and renamed to match the new terminology.

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

@vercel vercel bot temporarily deployed to Preview – petrinaut December 31, 2025 11:50 Inactive
@cursor
Copy link

cursor bot commented Dec 31, 2025

PR Summary

Modernizes MIR transform naming and references for clarity and consistency.

  • Replace Sroa with ForwardSubstitution across code, compiletest suites, outputs/headers, and registration
  • Update pipelines and benches to run ForwardSubstitution (including criterion group rename and pipeline ordering)
  • Rename transform::cp to transform::copy_propagation and adjust imports (e.g., propagate_block_params) and tests/snapshot paths
  • Revise docs/comments to reference forward substitution (e.g., callgraph, inst_simplify) and clarify relation to CopyPropagation
  • Add new mir/tests/ui/pass/forward_substitution snapshots and retire sroa ones

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

Copy link
Member Author

indietyp commented Dec 31, 2025

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.

@codecov
Copy link

codecov bot commented Dec 31, 2025

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 59.78%. Comparing base (9530312) to head (0fc7994).

Additional details and impacted files
@@                              Coverage Diff                              @@
##           bm/be-263-hashql-implement-mir-builder-macro    #8230   +/-   ##
=============================================================================
  Coverage                                         59.78%   59.78%           
=============================================================================
  Files                                              1066     1066           
  Lines                                            106191   106191           
  Branches                                           4478     4478           
=============================================================================
  Hits                                              63488    63488           
  Misses                                            41963    41963           
  Partials                                            740      740           
Flag Coverage Δ
rust.hashql-compiletest 46.65% <ø> (ø)
rust.hashql-mir 87.22% <100.00%> (ø)

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.

@augmentcode
Copy link

augmentcode bot commented Dec 31, 2025

🤖 Augment PR Summary

Summary: Renames the MIR transform pass formerly called SROA to ForwardSubstitution to better match what the pass actually does (resolving place operands to their ultimate sources via data-dependency tracing).

Changes:

  • Rename pass implementation and public exports (Sroa �e2 ForwardSubstitution) and update module wiring in hashql_mir::pass::transform.
  • Expand/adjust docs to describe forward substitution behavior and how it combines with DSE to enable SROA-like aggregate decomposition.
  • Rename cp module to copy_propagation and update internal imports (e.g., propagate_block_params) accordingly.
  • Update compiletest suites: add/rename suite to mir/pass/transform/forward-substitution and run it in the MIR pipeline before InstSimplify.
  • Update MIR benchmarks to use ForwardSubstitution and rename benchmark group from sroa to forward_substitution.
  • Migrate/rename UI tests and snapshots from sroa/cp directories to forward_substitution/copy_propagation.

Technical Notes: This is primarily a semantic rename and documentation clarification; functional behavior should remain the same, with ForwardSubstitution positioned as the more comprehensive propagation pass vs CopyPropagation.

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

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

@codspeed-hq
Copy link

codspeed-hq bot commented Dec 31, 2025

CodSpeed Performance Report

Merging #8230 will degrade performance by 13.38%

Comparing bm/be-264-hashql-rename-sroa-to-projectionforwarding (0fc7994) with bm/be-263-hashql-implement-mir-builder-macro (b7fd7d0)1

Summary

❌ 1 (👁 1) regression
✅ 13 untouched
🆕 3 new

Benchmarks breakdown

Benchmark BASE HEAD Efficiency
🆕 linear N/A 8 µs N/A
🆕 diamond N/A 16.7 µs N/A
👁 diamond 6.5 µs 7.5 µs -13.38%
🆕 complex N/A 22.8 µs N/A

Footnotes

  1. No successful run was found on bm/be-263-hashql-implement-mir-builder-macro (9530312) during the generation of this report, so f01101c was used instead as the comparison base. There might be some changes unrelated to this pull request in this report.

@vercel vercel bot temporarily deployed to Preview – petrinaut December 31, 2025 12:16 Inactive
@graphite-app graphite-app bot requested review from a team December 31, 2025 12:17
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