Skip to content

IR tests snapshots#7654

Merged
ironcev merged 5 commits into
masterfrom
xunilrj/ir-tests-snapshots
Jun 11, 2026
Merged

IR tests snapshots#7654
ironcev merged 5 commits into
masterfrom
xunilrj/ir-tests-snapshots

Conversation

@xunilrj

@xunilrj xunilrj commented Jun 11, 2026

Copy link
Copy Markdown
Contributor

Description

This PR is a necessary change for #7646.

Some IR tests have a bug: their harness is expecting some passes to return modified = true even when the pass is not modifying anything. To make sure that #7646 is NOT changing the optimisation itself, but only fixing the modified flag, I am creating this PR.

The idea is that #7646 snapshot tests will have only the flag changed, not their optimisation.

Checklist

  • I have linked to any relevant issues.
  • I have commented my code, particularly in hard-to-understand areas.
  • I have updated the documentation where relevant (API docs, the reference, and the Sway book).
  • I have added tests that prove my fix is effective or that my feature works.
  • I have added (or requested a maintainer to add) the necessary Breaking* or New Feature labels where relevant.
  • I have done my best to ensure that my PR adheres to the Fuel Labs Code Review Standards.
  • I have requested a review from the relevant team or maintainers.

@xunilrj xunilrj requested review from a team as code owners June 11, 2026 19:50
@xunilrj xunilrj self-assigned this Jun 11, 2026
@xunilrj xunilrj temporarily deployed to fuel-sway-bot June 11, 2026 19:55 — with GitHub Actions Inactive
@ironcev ironcev temporarily deployed to fuel-sway-bot June 11, 2026 21:14 — with GitHub Actions Inactive
@cursor

cursor Bot commented Jun 11, 2026

Copy link
Copy Markdown

PR Summary

Low Risk
Test harness and snapshot files only; compiler optimization logic is not changed in this diff.

Overview
Adds insta snapshot coverage for sway-ir optimization pass tests so each .ir fixture records the pass’s Modified boolean plus a unified before/after IR diff (with ANSI stripped via vte).

The harness in tests.rs now runs only *.ir files, builds that diff with prettydiff, writes *.ir.snap next to the test, and still enforces FileCheck on the optimized IR. A large set of new snapshots under sway-ir/tests/** captures current pass behavior (DCE, inline, mem2reg, demote_*, etc.) as a baseline ahead of fixing incorrect modified reporting.

Minor tooling tweaks: perf-snapshot-historical is enabled on macOS in the justfile, and a trailing newline is fixed on test-forc-fmt-check-panic.

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

@ironcev ironcev enabled auto-merge (squash) June 11, 2026 21:15
@ironcev ironcev added the testing General testing label Jun 11, 2026

@cursor cursor Bot left a comment

Copy link
Copy Markdown

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.

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 c044fa7. Configure here.

Comment thread sway-ir/tests/tests.rs
@ironcev ironcev merged commit baa7a25 into master Jun 11, 2026
41 checks passed
@ironcev ironcev deleted the xunilrj/ir-tests-snapshots branch June 11, 2026 22:55
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

testing General testing

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants