Commit d1b3c86
committed
Simplify promoter logic: remove dead code and fix comparison reduction
- quad_ufunc_promoter: Remove dead has_quad/common/PyArray_PromoteDTypeSequence
machinery. Since this promoter is only registered for patterns where at
least one input is QuadPrecDType, we always promote to QuadPrecDType
directly. The old fallback paths were unreachable and had a refcount bug
(Py_XDECREF on a borrowed pointer when has_quad was true).
- comparison_ufunc_promoter: Rewrite with self-contained logic instead of
delegating to quad_ufunc_promoter. Fixes reduction path which incorrectly
set accumulator to QuadPrecDType instead of BoolDType (the registered
reduce loop expects Bool, Quad, Bool).1 parent 3549bb9 commit d1b3c86
2 files changed
Lines changed: 28 additions & 55 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
260 | 260 | | |
261 | 261 | | |
262 | 262 | | |
263 | | - | |
264 | | - | |
265 | | - | |
266 | | - | |
267 | | - | |
268 | | - | |
| 263 | + | |
| 264 | + | |
| 265 | + | |
| 266 | + | |
| 267 | + | |
| 268 | + | |
| 269 | + | |
| 270 | + | |
| 271 | + | |
| 272 | + | |
| 273 | + | |
| 274 | + | |
| 275 | + | |
| 276 | + | |
| 277 | + | |
| 278 | + | |
| 279 | + | |
| 280 | + | |
| 281 | + | |
| 282 | + | |
| 283 | + | |
269 | 284 | | |
| 285 | + | |
270 | 286 | | |
271 | | - | |
| 287 | + | |
272 | 288 | | |
273 | 289 | | |
274 | 290 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
16 | 16 | | |
17 | 17 | | |
18 | 18 | | |
19 | | - | |
20 | 19 | | |
21 | | - | |
22 | | - | |
23 | 20 | | |
24 | 21 | | |
25 | 22 | | |
26 | | - | |
| 23 | + | |
27 | 24 | | |
28 | 25 | | |
29 | 26 | | |
30 | 27 | | |
31 | 28 | | |
32 | 29 | | |
33 | 30 | | |
34 | | - | |
35 | | - | |
36 | | - | |
37 | | - | |
38 | | - | |
39 | | - | |
40 | | - | |
41 | | - | |
42 | | - | |
43 | | - | |
44 | | - | |
45 | | - | |
46 | | - | |
47 | | - | |
48 | | - | |
49 | | - | |
50 | | - | |
51 | | - | |
52 | | - | |
53 | | - | |
54 | | - | |
55 | | - | |
56 | | - | |
57 | | - | |
58 | | - | |
59 | | - | |
60 | | - | |
61 | | - | |
62 | | - | |
63 | | - | |
64 | | - | |
65 | | - | |
66 | | - | |
67 | | - | |
68 | | - | |
69 | | - | |
70 | | - | |
| 31 | + | |
| 32 | + | |
71 | 33 | | |
72 | 34 | | |
73 | | - | |
74 | 35 | | |
75 | 36 | | |
76 | 37 | | |
77 | 38 | | |
78 | | - | |
79 | | - | |
80 | | - | |
81 | | - | |
| 39 | + | |
| 40 | + | |
82 | 41 | | |
83 | 42 | | |
84 | 43 | | |
85 | | - | |
86 | | - | |
87 | 44 | | |
88 | 45 | | |
89 | 46 | | |
| |||
0 commit comments