Skip to content

Conversation

jwnimmer-tri
Copy link
Collaborator

@jwnimmer-tri jwnimmer-tri commented Oct 3, 2025

Towards #23477. (Eigen 5's updated linear solvers cause Drake a bit of trouble; having that isolated into a few files instead of spammed into everything downstream of these headers improves developer iteration speed.)


This change is Reviewable

@jwnimmer-tri jwnimmer-tri added priority: low status: single reviewer ok https://drake.mit.edu/reviewable.html release notes: none This pull request should not be mentioned in the release notes labels Oct 3, 2025
@jwnimmer-tri jwnimmer-tri force-pushed the proximity-no-qr-solving-inline-omg branch 3 times, most recently from 7e69918 to 470f6dc Compare October 3, 2025 15:06
@jwnimmer-tri
Copy link
Collaborator Author

+assignee:@SeanCurtis-TRI for both reviews, please.

@jwnimmer-tri jwnimmer-tri force-pushed the proximity-no-qr-solving-inline-omg branch from 470f6dc to d34ad70 Compare October 3, 2025 22:57
Copy link
Contributor

@SeanCurtis-TRI SeanCurtis-TRI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

:LGTM: With two editorial bits.

@SeanCurtis-TRI reviewed 6 of 8 files at r1, 2 of 2 files at r2, all commit messages.
Reviewable status: 2 unresolved discussions


geometry/proximity/mesh_field_linear.h line 333 at r2 (raw file):

   @throws std::exception if the field does not have gradients defined _and_ the
           MeshType doesn't support Barycentric coordinates.
   @tparam C must be either `double` or `AutoDiffXd`. */

BTW This seems to be the only function that picked up template documentation that didn't pick up the corresponding requires clause. Any reason to omit it?


geometry/proximity/polygon_surface_mesh.cc line 61 at r2 (raw file):

  requires scalar_predicate<C>::is_bool
{
  unused(p_MQ, p);

BTW Why not eschew the parameter names and unused as long as we're in the .cc file? Simply in the name of minimizing the churn? That churn seems worthwhile.

@jwnimmer-tri jwnimmer-tri force-pushed the proximity-no-qr-solving-inline-omg branch from d34ad70 to 63109b1 Compare October 6, 2025 19:34
Copy link
Collaborator Author

@jwnimmer-tri jwnimmer-tri left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Reviewable status: 1 unresolved discussion


geometry/proximity/mesh_field_linear.h line 333 at r2 (raw file):

Previously, SeanCurtis-TRI (Sean Curtis) wrote…

BTW This seems to be the only function that picked up template documentation that didn't pick up the corresponding requires clause. Any reason to omit it?

This one is less important since its not out-of-line, but in any case I'm OK to add it.


geometry/proximity/polygon_surface_mesh.cc line 61 at r2 (raw file):

Previously, SeanCurtis-TRI (Sean Curtis) wrote…

BTW Why not eschew the parameter names and unused as long as we're in the .cc file? Simply in the name of minimizing the churn? That churn seems worthwhile.

The style guide rule is to keep the names unless they are obvious: https://drake.mit.edu/styleguide/cppguide.html#Function_Declarations_and_Definitions

For now, I'm happy to err on the side of "might not be obvious".

Copy link
Contributor

@SeanCurtis-TRI SeanCurtis-TRI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@SeanCurtis-TRI reviewed 1 of 1 files at r3, all commit messages.
Reviewable status: :shipit: complete! all discussions resolved, LGTM from assignee SeanCurtis-TRI(platform)


geometry/proximity/polygon_surface_mesh.cc line 61 at r2 (raw file):
Hmmm... I interpret that differently. The examples of "you may omit if obvious" seem all to show declarations as the example.

But for the nonobvious, it seems to specifically advocate for simply commenting out the name (in place).

Unused parameters that might not be obvious should comment out the variable name in the function definition (emphasis mine).

That still seems superior to the use of unused.

@jwnimmer-tri jwnimmer-tri force-pushed the proximity-no-qr-solving-inline-omg branch from 63109b1 to 67c7b8b Compare October 6, 2025 20:12
Copy link
Collaborator Author

@jwnimmer-tri jwnimmer-tri left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Reviewable status: :shipit: complete! all discussions resolved, LGTM from assignee SeanCurtis-TRI(platform)


geometry/proximity/polygon_surface_mesh.cc line 61 at r2 (raw file):

Previously, SeanCurtis-TRI (Sean Curtis) wrote…

Hmmm... I interpret that differently. The examples of "you may omit if obvious" seem all to show declarations as the example.

But for the nonobvious, it seems to specifically advocate for simply commenting out the name (in place).

Unused parameters that might not be obvious should comment out the variable name in the function definition (emphasis mine).

That still seems superior to the use of unused.

Switched to comments.

Copy link
Contributor

@SeanCurtis-TRI SeanCurtis-TRI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@SeanCurtis-TRI reviewed 2 of 2 files at r4, all commit messages.
Reviewable status: 1 unresolved discussion


geometry/proximity/polygon_surface_mesh.h line 270 at r1 (raw file):

  Vector3<FieldValue> CalcGradientVectorOfLinearField(
      const std::array<FieldValue, 3>& field_value, int p) const {
    unused(field_value, p);

BTW I'm not sure this is appropriate. In the current documentation, the parameter names get called out. With this change, the new documentation drops the names:

image.png

The method is described as "stub" so it might be appropriate to omit the parameter names, but it certainly leaves the doxygen with non-obvious place holders which seems to go against the spirit of the styleguide.

@jwnimmer-tri jwnimmer-tri force-pushed the proximity-no-qr-solving-inline-omg branch from 67c7b8b to d426572 Compare October 6, 2025 20:28
Copy link
Collaborator Author

@jwnimmer-tri jwnimmer-tri left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Reviewable status: :shipit: complete! all discussions resolved, LGTM from assignee SeanCurtis-TRI(platform)


geometry/proximity/polygon_surface_mesh.h line 270 at r1 (raw file):

Previously, SeanCurtis-TRI (Sean Curtis) wrote…

BTW I'm not sure this is appropriate. In the current documentation, the parameter names get called out. With this change, the new documentation drops the names:

image.png

The method is described as "stub" so it might be appropriate to omit the parameter names, but it certainly leaves the doxygen with non-obvious place holders which seems to go against the spirit of the styleguide.

In that case, going back to r2 is the winner.


geometry/proximity/polygon_surface_mesh.cc line 61 at r2 (raw file):

Why not eschew the parameter names and unused as long as we're in the .cc file? Simply in the name of minimizing the churn?

Yes. And also for consistency with the header which still uses unused.

Copy link
Contributor

@SeanCurtis-TRI SeanCurtis-TRI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@SeanCurtis-TRI reviewed 3 of 3 files at r5, all commit messages.
Reviewable status: 1 unresolved discussion


geometry/proximity/polygon_surface_mesh.h line 270 at r1 (raw file):

Previously, jwnimmer-tri (Jeremy Nimmer) wrote…

In that case, going back to r2 is the winner.

I don't agree, but I'm not going to fight it.

In the name of completeness, I'm stating the basis of my disagreement in a completely unbinding way. I think the .cc file avoiding use of unused where the header uses it is perfectly reasonable. It certainly makes the .cc file hew to the styleguide more accurately. (Which, of course, makes no mention of .h vs .cc in this regard.)


geometry/proximity/mesh_field_linear.h line 337 at r3 (raw file):

  promoted_numerical_t<C, T> EvaluateCartesian(int e,
                                               const Vector3<C>& p_MQ) const
    requires scalar_predicate<C>::is_bool

btw Did you mean to revert this as well?

@jwnimmer-tri jwnimmer-tri force-pushed the proximity-no-qr-solving-inline-omg branch from d426572 to 4eab8bb Compare October 6, 2025 20:51
Copy link
Contributor

@SeanCurtis-TRI SeanCurtis-TRI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@SeanCurtis-TRI reviewed 1 of 1 files at r6, all commit messages.
Reviewable status: :shipit: complete! all discussions resolved, LGTM from assignee SeanCurtis-TRI(platform)

@jwnimmer-tri jwnimmer-tri merged commit 40373a8 into RobotLocomotion:master Oct 6, 2025
8 of 10 checks passed
@jwnimmer-tri jwnimmer-tri deleted the proximity-no-qr-solving-inline-omg branch October 6, 2025 22:48
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
priority: low release notes: none This pull request should not be mentioned in the release notes status: single reviewer ok https://drake.mit.edu/reviewable.html
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants