-
Notifications
You must be signed in to change notification settings - Fork 5.4k
Deterministic printing of IR values #7490
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: master
Are you sure you want to change the base?
Conversation
...ld_pass/language/panic_expression/panic_const_eval_string_slices_not_in_bytecode/stdout.snap
Outdated
Show resolved
Hide resolved
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is the final PR Bugbot will review for you during this billing cycle
Your free Bugbot reviews will reset on December 7
Details
Your team is on the Bugbot Free tier. On this plan, Bugbot will review limited PRs each billing cycle for each member of your team.
To receive Bugbot reviews on all of your PRs, visit the Cursor dashboard to activate Pro and start your 14-day free trial.
Closes #4517
Note
Make IR printing deterministic by deriving stable SSA names and emitting constants separately; normalize metadata/operand printing, remove inlined folded instructions, and update tests and snapshots accordingly.
sway-ir/src/printer.rsto make SSA value names deterministic by derivingNamer::default_name()fromslotmap::Key::data()(e.g.,v<idx>v<gen>), and introducedmaybe_constant_to_docto emit constant definitions once and refer to them by stable IDs. Adjusted instruction printing to emit constant definitions separately and to reference them via generated IDs, improving reproducibility.combine_cmpnow replaces folded compare instructions with a standalone constant and removes the original instruction; tests updated to matchconst <ty> <value>and to use$ID/$VARregex placeholders rather than brittlev0literals.Metadatumtextual format (e.g.,!1 = !0,a_struct …,(… …)), ensuring stable, concise output;MetadataNamernow assigns deterministic indices.regex: VAR=v\d+v\d+,$ID = …,$VARreuse) and to expect separate constant definitions and stable value IDs. Regenerated E2E snapshots (e.g., array_repeat, logging, transmute, main_args) reflecting new deterministic naming.constants.rstest expectations; adjustedget_storage_keyand store/load prints to reference$VARplaceholders; addedslotmap::Keyimport.Written by Cursor Bugbot for commit 00b14d7. This will update automatically on new commits. Configure here.