Skip to content

Fix recursion limits with next solver - #9953

Open
nazar-pc wants to merge 2 commits into
gfx-rs:trunkfrom
nazar-pc:fix-recursion-limits-next-solver
Open

Fix recursion limits with next solver#9953
nazar-pc wants to merge 2 commits into
gfx-rs:trunkfrom
nazar-pc:fix-recursion-limits-next-solver

Conversation

@nazar-pc

Copy link
Copy Markdown
Contributor

Connections

#9608, #9609

Description

This is a much better alternative to #9609 that solves the same underlying issue. The root cause is that next solver has a really hard time figuring out auto traits and ultimately fails with default recursion limit.

I later discovered that this is infectious, meaning not only wgpu needs to raise limits, but any crate that uses a lot of its types. The solution is to help solver a little bit and implement the traits manually. The code is more or less a macro expansion from https://crates.io/crates/non_structural_derive applied to the core type that is used basically everywhere.

This small change removes the need to increase recursion limits both here and for downstream users and I believe should help with compilation time as well.

Testing

Checked whether workspace compiles with cargo clippy.

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.

@nazar-pc
nazar-pc force-pushed the fix-recursion-limits-next-solver branch 2 times, most recently from e1928b5 to d7c5a2c Compare July 28, 2026 15:01
@nazar-pc

Copy link
Copy Markdown
Contributor Author

Changelog fails because I replaced one non-break space character with a normal whitespace. It likely was a typo originally and my IDE warns about all kinds of invisible or strange characters like that. I can roll it back if you'd really want me to.

@nazar-pc
nazar-pc force-pushed the fix-recursion-limits-next-solver branch from d7c5a2c to 38dc8c9 Compare July 28, 2026 15:02
Comment thread wgpu-core/src/global.rs Outdated
Comment thread wgpu-core/src/global.rs Outdated

@jimblandy jimblandy left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Thank you very much!

@jimblandy jimblandy left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Actually, please make the change Andy suggested.

@nazar-pc
nazar-pc force-pushed the fix-recursion-limits-next-solver branch from caf0552 to ab22123 Compare July 29, 2026 15:57
@nazar-pc
nazar-pc requested a review from jimblandy July 29, 2026 15:57
Comment thread wgpu-core/src/global.rs Outdated
@nazar-pc
nazar-pc requested a review from kpreid July 31, 2026 04:29
@kpreid
kpreid force-pushed the fix-recursion-limits-next-solver branch from 3207e16 to acc16f5 Compare July 31, 2026 16:26
@kpreid

kpreid commented Jul 31, 2026

Copy link
Copy Markdown
Collaborator

I resolved the changelog conflict, and while I was there, broke out the whitespace fix to a separate commit and rewrote the changelog message to clarify its user-facing implications.

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