Skip to content

fix: division operator resolution #1446

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 25 commits into
base: main
Choose a base branch
from
Open

fix: division operator resolution #1446

wants to merge 25 commits into from

Conversation

lursz
Copy link
Contributor

@lursz lursz commented Jul 2, 2025

No description provided.

Copy link

github-actions bot commented Jul 2, 2025

pkg.pr.new

packages
Ready to be installed by your favorite package manager ⬇️

https://pkg.pr.new/software-mansion/TypeGPU/typegpu@94a5f9c779a05bd13ed91443b97051ca2c29fa0c
https://pkg.pr.new/software-mansion/TypeGPU/@typegpu/noise@94a5f9c779a05bd13ed91443b97051ca2c29fa0c
https://pkg.pr.new/software-mansion/TypeGPU/unplugin-typegpu@94a5f9c779a05bd13ed91443b97051ca2c29fa0c

benchmark
view benchmark

commit
view commit

@lursz lursz linked an issue Jul 2, 2025 that may be closed by this pull request
@lursz lursz requested review from reczkok and iwoplaza July 3, 2025 07:49
Copy link
Contributor

@aleksanderkatan aleksanderkatan left a comment

Choose a reason for hiding this comment

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

///


if (!lhsIsFloat && !rhsIsFloat) {
console.warn(
'In division we cast both sides to the f32. This may not be the expected behaviour. Consider using explicit conversions instead.',
Copy link
Contributor

Choose a reason for hiding this comment

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

Do we use GB English (behaviour)?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

We might have to decide upon that in the future. This does not matter here, as those warnings are deemed unnecessary (we aim to mimic JS) and will be removed.

Copy link
Contributor

@reczkok reczkok left a comment

Choose a reason for hiding this comment

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

It breaks Matrix Multiplication (next) (we should also minimize the implicit conversions that were created)

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.

bug: Standardize the behavior of integer division between TGSL and WGSL
4 participants