Skip to content

BUG: Preserve object common-dtype promotion in Quad ufuncs - #118

Open
SwayamInSync wants to merge 1 commit into
numpy:mainfrom
SwayamInSync:fix-object-promotion-114
Open

BUG: Preserve object common-dtype promotion in Quad ufuncs#118
SwayamInSync wants to merge 1 commit into
numpy:mainfrom
SwayamInSync:fix-object-promotion-114

Conversation

@SwayamInSync

@SwayamInSync SwayamInSync commented Jul 29, 2026

Copy link
Copy Markdown
Member

Closes #114

The promoters now preserve NumPy's ObjectDType precedence. When a Quad ufunc receives an object-array input, it selects NumPy's existing object loop rather than forcing the object operand to Quad.

This applies in both operand orders and covers:

  • Arithmetic ufuncs such as add and multiply
  • Comparisons with Boolean output
  • Logical operations with the object output used by NumPy's object loops
  • matmul
  • Broadcasting and masked out= operations
  • Both SLEEF and long-double backends

Operations without an applicable object loop continue to raise normally. Unsupported Quad/complex and Quad/string promotion is unchanged, and importing quaddtype does not affect built-in-only NumPy dispatch.

The change also makes matmul promoter registration failures propagate instead of being silently cleared.

@SwayamInSync
SwayamInSync requested a review from ngoldbaum July 29, 2026 13:05
@SwayamInSync

Copy link
Copy Markdown
Member Author

This is small addition but important to ensure we do not override NumPy's default

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: Quad ufunc promoters override valid object common-dtype promotion

1 participant