-
-
Notifications
You must be signed in to change notification settings - Fork 5.6k
counting and summing Bools with a small integer init
promote to Int
#58374
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
base: master
Are you sure you want to change the base?
Conversation
for accumulate inference
OK, so upon reflection here, I think we should just always promote all small integers to |
init
promote to [U]Int
init
promote to Int
@nanosoldier |
The package evaluation job you requested has completed - possible new issues were detected. Report summary❗ Packages that crashed2 packages crashed on the previous version too. ✖ Packages that failed14 packages failed only on the current version.
1240 packages failed on the previous version too. ✔ Packages that passed tests25 packages passed tests only on the current version.
5370 packages passed tests on the previous version too. ~ Packages that at least loaded11 packages successfully loaded only on the current version.
2975 packages successfully loaded on the previous version too. ➖ Packages that were skipped altogether920 packages were skipped on the previous version too. |
This is a small but concrete and independent change that can easily be split out from #58241 and is required for more pairwise reassociations (like #52397).
Specifically, it's required because
count
andsum
useBase.add_sum
, which very intentionally promotes small integers toInt
orUint
. And if you add twoBool
s together, they also promote toInt
. But if aninit=0x00
is provided, then we get into a strange situation. This is the status quo on master right now:In other words, if we happen to choose to re-associate the branches here, we end up with a
0x02 +ₛ 0x02
, which promotes toUint
.This change here adds
Bool
into the extra promotion behaviors foradd_sum
. So with this commit, the above session becomes: