Skip to content

Conversation

@wingertge
Copy link
Collaborator

Small refactor to constants in the IR, to make code cleaner and allow for more effective inlining of constant lines.

Instead of combining the kind and value into the enum, makes the value typeless and uses the Variable::ty field to carry the type information. This allows using lined and other more complex types, and also simplifies handling since most use cases were ignoring the kind anyways, and when the type is needed it's already available from the ty field on the Variable.
Constants are now converted to the target type on construction, and the now redundant sanitize code is removed.

Also fixes some non-fatal validation errors with Vulkan atomics.

Validate your PR with burn.

It is important that you make sure that you don't introduce any bugs in burn.

Instructions

  • Create a new branch or fork of the burn repo
  • Update the main Cargo.toml with this PR hash.
  • Fix any broken tests or compilation errors in burn.
  •  Submit a PR in burn with your fixes and link it here.

pub scope: Scope,
}

impl If {
Copy link
Member

Choose a reason for hiding this comment

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

Is there a reason we don't need that now?

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

It was from the ancient pre-compiler version of CubeCL, so it hadn't been used for a long time. It was for the old assembly macro.

@nathanielsimard nathanielsimard merged commit d88e80c into tracel-ai:main Jan 4, 2026
5 checks passed
@wingertge wingertge deleted the refactor/constant branch January 4, 2026 20:01
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