Skip to content

Conversation

@indietyp
Copy link
Member

Add Changed enum to MIR transform passes for tracking modifications

🌟 What is the purpose of this PR?

This PR adds a Changed enum to MIR transform passes to track whether a pass modified the code. This enables more efficient pass pipelines by allowing subsequent passes to be skipped when no changes were made.

🔍 What does this change?

  • Adds a new Changed enum (Yes, No, Unknown) that transform passes return to indicate modifications
  • Updates all transform pass implementations to return the appropriate Changed value
  • Modifies test harnesses to capture and display the Changed value in snapshots
  • Updates documentation to describe the new feature in the testing guide
  • Improves benchmarks to track and propagate change status through pass pipelines

🛡 What tests cover this?

  • All existing transform pass tests have been updated to include the Changed value in snapshots
  • The test harness now verifies the correct Changed value is returned

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:

  • require changes to docs which are made as part of this PR

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

The changes in this PR:

  • do not affect the execution graph

@cursor
Copy link

cursor bot commented Dec 22, 2025

PR Summary

Adds change tracking to MIR transformations and surfaces it in tests and benches.

  • Introduces Changed enum and updates TransformPass::run to return Changed with helpers (conservative, optimistic, From<bool>)
  • Refactors passes (cfg_simplify, sroa, inst_simplify, dse, dbe, dle, ssa_repair, cp) to compute and return Changed, including early exits and aggregation where applicable
  • Test harnesses now capture and snapshot Changed (formatted separator replaced with Changed: Yes/No/Unknown); all related snapshots updated
  • Benchmarks/plumbing updated to propagate and combine Changed across pipeline stages; run_bencher returns and carries values
  • Docs updated: testing skill and MIR builder guide document Changed and the new snapshot pattern; reference paths fixed from resources/* to references/*

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

@github-actions github-actions bot added area/infra Relates to version control, CI, CD or IaC (area) area/libs Relates to first-party libraries/crates/packages (area) type/eng > backend Owned by the @backend team area/tests New or updated tests labels Dec 22, 2025
Copy link
Member Author

indietyp commented Dec 22, 2025

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

@codecov
Copy link

codecov bot commented Dec 22, 2025

Codecov Report

❌ Patch coverage is 89.79592% with 10 lines in your changes missing coverage. Please review.
✅ Project coverage is 59.27%. Comparing base (86f263f) to head (eaca057).
⚠️ Report is 1 commits behind head on main.

Files with missing lines Patch % Lines
libs/@local/hashql/mir/src/pass/mod.rs 23.07% 10 Missing ⚠️
Additional details and impacted files
@@           Coverage Diff           @@
##             main    #8210   +/-   ##
=======================================
  Coverage   59.26%   59.27%           
=======================================
  Files        1191     1191           
  Lines      113436   113489   +53     
  Branches     4982     4986    +4     
=======================================
+ Hits        67232    67273   +41     
- Misses      45428    45440   +12     
  Partials      776      776           
Flag Coverage Δ
rust.hashql-compiletest 46.65% <ø> (ø)
rust.hashql-mir 88.23% <89.79%> (-0.07%) ⬇️

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.

@codspeed-hq
Copy link

codspeed-hq bot commented Dec 22, 2025

CodSpeed Performance Report

Merging this PR will improve performance by ×2.6

Comparing bm/be-258-hashql-implement-transformationpass-changed-detection (eaca057) with main (86f263f)

Summary

⚡ 7 improved benchmarks
✅ 7 untouched benchmarks
🗄️ 3 archived benchmarks run1

Performance Changes

Benchmark BASE HEAD Efficiency
complex 68.1 µs 55.7 µs +22.24%
complex 18.8 µs 8.1 µs ×2.3
diamond 50.1 µs 38.3 µs +30.7%
diamond 20.8 µs 7.9 µs ×2.6
complex 25.4 µs 12 µs ×2.1
diamond 15.5 µs 7.5 µs ×2.1
linear 11.9 µs 7 µs +69.54%

Footnotes

  1. 3 benchmarks were run, but are now archived. If they were deleted in another branch, consider rebasing to remove them from the report. Instead if they were added back, click here to restore them.

@graphite-app graphite-app bot requested review from a team December 22, 2025 12:13
@indietyp indietyp force-pushed the bm/be-258-hashql-implement-transformationpass-changed-detection branch from 17e6ab5 to 65c3381 Compare December 23, 2025 21:16
@indietyp indietyp force-pushed the bm/be-255-hashql-add-copy-propagation-pass branch from 0c57079 to 049e36c Compare December 23, 2025 21:16
@indietyp indietyp force-pushed the bm/be-258-hashql-implement-transformationpass-changed-detection branch from 65c3381 to 3d60ecf Compare December 28, 2025 11:17
@indietyp indietyp force-pushed the bm/be-255-hashql-add-copy-propagation-pass branch from 049e36c to 09dc1b6 Compare December 28, 2025 11:17
@vercel
Copy link

vercel bot commented Jan 15, 2026

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

2 Skipped Deployments
Project Deployment Review Updated (UTC)
ds-theme Ignored Ignored Preview Jan 15, 2026 3:10pm
hashdotdesign Ignored Ignored Preview Jan 15, 2026 3:10pm

@graphite-app graphite-app bot changed the base branch from bm/be-255-hashql-add-copy-propagation-pass to graphite-base/8210 January 15, 2026 14:05
@indietyp indietyp force-pushed the bm/be-258-hashql-implement-transformationpass-changed-detection branch from 0bf9c4a to eaca057 Compare January 15, 2026 15:10
@graphite-app graphite-app bot changed the base branch from graphite-base/8210 to main January 15, 2026 15:10
@graphite-app
Copy link
Contributor

graphite-app bot commented Jan 15, 2026

Merge activity

  • Jan 15, 3:10 PM UTC: Graphite rebased this pull request, because this pull request is set to merge when ready.
  • Jan 15, 3:10 PM UTC: Graphite rebased this pull request, because this pull request is set to merge when ready.
  • Jan 16, 12:45 PM UTC: A user started a stack merge that includes this pull request via Graphite.

@indietyp indietyp added this pull request to the merge queue Jan 15, 2026
Merged via the queue into main with commit abd5ba1 Jan 15, 2026
54 of 75 checks passed
@indietyp indietyp deleted the bm/be-258-hashql-implement-transformationpass-changed-detection branch January 15, 2026 15:27
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

area/infra Relates to version control, CI, CD or IaC (area) 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