Skip to content
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

Fix assignment of AInt to u32 in the expression generator #3379

Merged
merged 1 commit into from
Feb 8, 2024

Conversation

amaiorano
Copy link
Member

@amaiorano amaiorano commented Feb 8, 2024

Apply the same fix that was made for AFloat to AInt when emitting the value assignment WGSL. Otherwise, if
globalTestConfig.unrollConstEvalLoops is true, as it is on Windows, then we emit invalid WGSL because we index an array of AInts with a runtime index, forcing concretization, which results in an assignment of i32 to u32. The fix is to do as was done with AFloat: we emit direct assignments of the literal values into the output array. Also made sure we don't emit the array of values in this case, as it's unused.

This fixes 'webgpu:shader,execution,expression,unary,ai_assignment:*' tests that were failing on Windows.

Issue: #1644


Requirements for PR author:

  • All missing test coverage is tracked with "TODO" or .unimplemented().
  • New helpers are /** documented */ and new helper files are found in helper_index.txt.
  • Test behaves as expected in a WebGPU implementation. (If not passing, explain above.)

Requirements for reviewer sign-off:

  • Tests are properly located in the test tree.
  • Test descriptions allow a reader to "read only the test plans and evaluate coverage completeness", and accurately reflect the test code.
  • Tests provide complete coverage (including validation control cases). Missing coverage MUST be covered by TODOs.
  • Helpers and types promote readability and maintainability.

When landing this PR, be sure to make any necessary issue status updates.

@amaiorano amaiorano requested review from zoddicus and ben-clayton and removed request for zoddicus February 8, 2024 20:09
Apply the same fix that was made for AFloat to AInt when emitting the
value assignment WGSL. Otherwise, if
globalTestConfig.unrollConstEvalLoops is true, as it is on Windows, then
we emit invalid WGSL because we index an array of AInts with a runtime
index, forcing concretization, which results in an assignment of i32 to
u32. The fix is to do as was done with AFloat: we emit direct
assignments of the literal values into the output array. Also made sure
we don't emit the array of values in this case, as it's unused.
@amaiorano amaiorano force-pushed the fix-abstract-to-u32-assignment branch from 23e2707 to ef33557 Compare February 8, 2024 20:25
Copy link
Contributor

@ben-clayton ben-clayton left a comment

Choose a reason for hiding this comment

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

Thanks!

@amaiorano
Copy link
Member Author

Thanks!

I'm still not used to GitHub. I had replied "Thanks!" to your suggetions, but those got lost when I resolved them...

@amaiorano amaiorano merged commit d759c05 into gpuweb:main Feb 8, 2024
1 check passed
ben-clayton added a commit to ben-clayton/cts that referenced this pull request Mar 12, 2024
Extends the fix of gpuweb#3379 to cover composite types.
ben-clayton added a commit to ben-clayton/cts that referenced this pull request Mar 12, 2024
Extends the fix of gpuweb#3379 to cover composite types.
ben-clayton added a commit to ben-clayton/cts that referenced this pull request Mar 12, 2024
Extends the fix of gpuweb#3379 to cover composite types.
ben-clayton added a commit that referenced this pull request Mar 12, 2024
Extends the fix of #3379 to cover composite types.
ben-clayton added a commit to ben-clayton/cts that referenced this pull request Mar 18, 2024
Extends the fix of gpuweb#3379 to cover composite types.
ben-clayton added a commit to ben-clayton/cts that referenced this pull request Mar 18, 2024
Extends the fix of gpuweb#3379 to cover composite types.
ben-clayton added a commit to ben-clayton/cts that referenced this pull request Mar 19, 2024
Extends the fix of gpuweb#3379 to cover composite types.
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