Skip to content

vulkan: apply atan2 zero workaround to packed shaders - #6930

Merged
nihui merged 3 commits into
Tencent:masterfrom
LEKKO2310:fix-vulkan-atan2-zero
Sep 16, 2026
Merged

nihui merged 3 commits into
Tencent:masterfrom
LEKKO2310:fix-vulkan-atan2-zero

Conversation

@LEKKO2310

Copy link
Copy Markdown
Contributor

Summary

Apply the existing packed-vector atan(0, 0) workaround to all non-MoltenVK drivers. Mesa v3dv exhibits the same incorrect vectorized result as llvmpipe, so restricting the workaround to driver ID 13 leaves packed BinaryOp atan2/ratan2 broken on v3dv.

The change covers:

  • binaryop_pack4.comp
  • binaryop_broadcast_pack4.comp
  • binaryop_broadcast_pack1to4.comp

Verification

Built with Vulkan and system glslang on Ubuntu 24.04, then ran test_binaryop_3 with Mesa llvmpipe 25.2.8:

100% tests passed, 0 tests failed out of 1

Fixes #6884.

Mesa v3dv has the same broken vector atan(0, 0) behavior as llvmpipe. Apply the existing zero-input workaround for all non-MoltenVK drivers so packed BinaryOp atan2 and ratan2 match the CPU result.

Fixes Tencent#6884.
@tencent-adm

tencent-adm commented Aug 25, 2026

Copy link
Copy Markdown
Member

CLA assistant check
Thank you for your submission, we really appreciate it. Like many open source projects, we ask that you all sign our Contributor License Agreement before we can accept your contribution.
1 out of 2 committers have signed the CLA.

✅ LEKKO2310
❌ nihui
You have signed the CLA already but the status is still pending? Let us recheck it.

@LEKKO2310
LEKKO2310 marked this pull request as ready for review August 25, 2026 06:26
@codecov-commenter

codecov-commenter commented Sep 15, 2026

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 94.88%. Comparing base (5ea9830) to head (c7253b9).
⚠️ Report is 2 commits behind head on master.

Additional details and impacted files
@@            Coverage Diff             @@
##           master    #6930      +/-   ##
==========================================
- Coverage   94.94%   94.88%   -0.06%     
==========================================
  Files        1151     1151              
  Lines      473093   472714     -379     
==========================================
- Hits       449159   448558     -601     
- Misses      23934    24156     +222     

☔ View full report in Codecov by Harness.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@chatgpt-codex-connector

chatgpt-codex-connector Bot commented Sep 15, 2026

Copy link
Copy Markdown

Codex Review Summary

This comment shows the latest Codex review activity on this pull request.

Review Status Commit Review trigger
📝 Code Review Completed 2026-09-16T02:31:21.949622Z c7253b9 New commits
ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review" or "@codex security review".

Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings.

@nihui
nihui merged commit 2c43fc4 into Tencent:master Sep 16, 2026
63 of 68 checks passed
@nihui

nihui commented Sep 16, 2026

Copy link
Copy Markdown
Member

Thanks for your contribution !

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

atan2-vec4: any test exercising BinaryOp op_type 10/11 with pack=1 on a device using Mesa v3dv fail

4 participants