-
Notifications
You must be signed in to change notification settings - Fork 467
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
Sometimes we can give the type to MRE::take_safely #30881
base: main
Are you sure you want to change the base?
Conversation
7c29518
to
35e89bf
Compare
Tagging @frankmcsherry because of touching EQProp. |
Also, maybe this eliminates that key derivation which @antiguru found to be a bottleneck in |
35e89bf
to
7bdd425
Compare
Bringing back to draft, because there are test failures. |
7bdd425
to
924528b
Compare
Fixed |
924528b
to
b66c4ef
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Seems fine to me!
One possible change, if we're going golfing: you could have take_safely_with_rel_type
take an Option<RelationType>
, saving us the double call to MRE::typ()
when calling MRE::take_safely()
. Only matters in debug mode, so I'm not sure it's worth it.
More
typ()
call elimination, similar to e.g. #30878This one goes after various
take_safely
calls, where we know the type already, so no need to call.typ()
.Also, this makes
take_safely()
give a better key and nullability to the constant, making use of the fact that we have an empty collection, so we have the keys[[]]
and nothing is nullable.Motivation
This PR fixes a previously unreported bug:
take_safely
was often not giving the best possible key to the constant. Ideally, the keys that are recorded on aMRE::Constant
should be the same as if we were to callkeys_with_input_keys
on it, so that we don't have anomalies such ascreate_fast_path_plan
needing to// For best accuracy, we need to recalculate typ.
. This PR moves one step closer to this.This PR refactors existing code.
Tips for reviewer
Checklist
$T ⇔ Proto$T
mapping (possibly in a backwards-incompatible way), then it is tagged with aT-proto
label.