Skip to content

Conversation

@orizi
Copy link
Collaborator

@orizi orizi commented Jan 17, 2026

Summary

Refactored the DeferredVariableKind enum by replacing it with the existing DeferredOutputKind from the Sierra library. This simplifies the codebase by eliminating duplicate enum definitions and standardizing on a single representation for deferred output types.


Type of change

Please check one:

  • Bug fix (fixes incorrect behavior)
  • New feature
  • Performance improvement
  • Documentation change with concrete technical impact
  • Style, wording, formatting, or typo-only change

Why is this change needed?

The codebase had two separate enums (DeferredVariableKind and DeferredOutputKind) representing the same concept. This duplication required mapping between the two types and maintaining parallel implementations. By using the existing DeferredOutputKind enum directly, we eliminate this redundancy and simplify the code.

Additionally, the AddConst variant in DeferredOutputKind previously contained a param_idx field that wasn't actually being used in a meaningful way, so it was removed to further simplify the implementation.


What was the behavior or documentation before?

Before this change, the code maintained two parallel enum types:

  1. DeferredVariableKind in the store_variables module
  2. DeferredOutputKind in the sierra library

The code had to map between these types, and the AddConst variant in DeferredOutputKind contained an unused param_idx field.


What is the behavior or documentation after?

After this change:

  • DeferredVariableKind has been removed entirely
  • All code now uses DeferredOutputKind directly
  • The param_idx field has been removed from the AddConst variant in DeferredOutputKind
  • The code is simpler and more maintainable with fewer type conversions

Additional context

This refactoring doesn't change any functionality but makes the code more consistent and easier to maintain by eliminating duplicate type definitions and unnecessary fields.

Was unused before - thiis now changes the meaning in sierra crate to
the existing meaning in sierra-generator crate.

SIERRA_UPDATE_PATCH_CHANGE_TAG=No result effect.
@reviewable-StarkWare
Copy link

This change is Reviewable

Copy link
Collaborator Author

orizi commented Jan 17, 2026

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

@orizi orizi marked this pull request as ready for review January 17, 2026 08:08
Copy link
Contributor

@eytan-starkware eytan-starkware left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

:lgtm:

@eytan-starkware reviewed 26 files and all commit messages, and made 1 comment.
Reviewable status: :shipit: complete! all files reviewed, all discussions resolved (waiting on @ilyalesokhin-starkware, @liorgold2, and @TomerStarkware).

Copy link
Collaborator

@TomerStarkware TomerStarkware left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

:lgtm:

@TomerStarkware reviewed all commit messages and made 1 comment.
Reviewable status: :shipit: complete! all files reviewed, all discussions resolved (waiting on @ilyalesokhin-starkware and @liorgold2).

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.

5 participants