Skip to content

Fix SSA transform for transitive dependencies#2946

Merged
mtdowling merged 1 commit intomainfrom
fix-ssa-nesting
Jan 27, 2026
Merged

Fix SSA transform for transitive dependencies#2946
mtdowling merged 1 commit intomainfrom
fix-ssa-nesting

Conversation

@mtdowling
Copy link
Member

When variable A references variable B, and B gets SSA-renamed, A also needs unique names even if A's expression text is identical across branches.

Example:

  1. parts = split(input, delim, 0); part1 = getAttr(parts, "[0]")
  2. parts = split(input, delim, 1); part1 = getAttr(parts, "[0]")

"parts" gets renamed to parts_ssa_1/parts_ssa_2, but "part1" wasn't being renamed despite referencing "parts". After rewriting, the expressions diverge, causing BDD validation failures.


By submitting this pull request, I confirm that my contribution is made under the terms of the Apache 2.0 license.

@mtdowling mtdowling requested a review from a team as a code owner January 27, 2026 19:26
@mtdowling mtdowling requested a review from kstich January 27, 2026 19:26
@github-actions
Copy link
Contributor

This pull request does not contain a staged changelog entry. To create one, use the ./.changes/new-change command. For example:

./.changes/new-change --pull-requests "#2946" --type feature --description "Fix SSA transform for transitive dependencies"

Make sure that the description is appropriate for a changelog entry and that the proper feature type is used. See ./.changes/README or run ./.changes/new-change -h for more information.

When variable A references variable B, and B gets SSA-renamed, A also
needs unique names even if A's expression text is identical across
branches.

Example:
1. parts = split(input, delim, 0); part1 = getAttr(parts, "[0]")
2. parts = split(input, delim, 1); part1 = getAttr(parts, "[0]")

"parts" gets renamed to parts_ssa_1/parts_ssa_2, but "part1" wasn't
being renamed despite referencing "parts". After rewriting, the
expressions diverge, causing BDD validation failures.
@mtdowling mtdowling merged commit 1efbd81 into main Jan 27, 2026
16 checks passed
@mtdowling mtdowling deleted the fix-ssa-nesting branch January 27, 2026 20:31
landonxjames added a commit to landonxjames/smithy that referenced this pull request Jan 27, 2026
Note the split model currently won't compile due to the bug fixed in
smithy-lang#2946

Commiting so I can pull that change in and regenerate
landonxjames added a commit to landonxjames/smithy that referenced this pull request Jan 27, 2026
sugmanue added a commit that referenced this pull request Jan 29, 2026
…ased tests (#2945)

* Add tree versions of coalesce, ite, and split tests

* Add bdd based rule set std lib function tests

Also split tests into separate bdd-tests and tree-tests folders

* Add cahngelog entry

* Centralize both tree rules and BDD rules in single test models

Note the split model currently won't compile due to the bug fixed in
#2946

Commiting so I can pull that change in and regenerate

* Recompiled split test BDD with changes from #2946

* Remove endpointBDD traits from smithy-rules-engine-tests

Automating adding them back is tracked in #2949

* Remove use statements for endpointBdd trait

* Format tests

---------

Co-authored-by: Manuel Sugawara (∩`-´)⊃━炎炎炎炎炎 <sugmanue@amazon.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants