Skip to content

fix(naga): zero initialize loop-local var declarations in each iteration#9592

Open
ruihe774 wants to merge 1 commit into
gfx-rs:trunkfrom
ruihe774:fix-9489
Open

fix(naga): zero initialize loop-local var declarations in each iteration#9592
ruihe774 wants to merge 1 commit into
gfx-rs:trunkfrom
ruihe774:fix-9489

Conversation

@ruihe774
Copy link
Copy Markdown
Contributor

@ruihe774 ruihe774 commented May 26, 2026

Connections
Fixes #9489.

Description
Loop-local var declarations without explicit initializers are zero-initialized in each iteration.

Testing
A new naga validation test is added to ensure ZeroValue is emitted in each iteration for such variables.

Squash or Rebase?
Only one single commit

Checklist

  • I self-reviewed and fully understand this PR.
  • WebGPU implementations built with wgpu may be affected behaviorally.
  • Validation and feature gates are in place to confine behavioral changes.
  • Tests demonstrate the validation and altered logic works.
  • CHANGELOG.md entries for the user-facing effects of this change are present.
  • The PR is minimal, and doesn't make sense to land as multiple PRs.
  • Commits are logically scoped and individually reviewable.
  • The PR description has enough context to understand the motivation and solution implemented.

@teoxoy teoxoy self-assigned this May 27, 2026
@inner-daemons inner-daemons self-requested a review May 27, 2026 15:51
@inner-daemons inner-daemons self-assigned this May 27, 2026
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.

[naga] var with no explicit initializer inside a loop body is not re-zero-initialized per iteration

3 participants