Skip to content
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

Removing unnecessary comments #114190

Merged
merged 10 commits into from
Apr 5, 2025

Conversation

thaystg
Copy link
Member

@thaystg thaystg commented Apr 3, 2025

Addressing @jkotas comment in this other PR: #113995

@thaystg thaystg requested review from jkotas and Copilot April 3, 2025 00:44
@dotnet-issue-labeler dotnet-issue-labeler bot added the needs-area-label An area label is needed to ensure this gets routed to the appropriate area owners label Apr 3, 2025
Copy link
Contributor

@Copilot Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull Request Overview

This PR removes extraneous commentary from method implementations in the IncreaseMetadataRowSize test file based on previous feedback.

  • Removed placeholder comments from Method2, Method3, Method4, and Method5
  • Simplified each method to an empty implementation

@thaystg thaystg requested a review from a team April 3, 2025 00:46
@jkotas
Copy link
Member

jkotas commented Apr 3, 2025

Looks like this has another whitespace conflict?

{
return 0;
}
public static void Method2(int x2) {}
Copy link
Member

Choose a reason for hiding this comment

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

Suggested change
public static void Method2(int x2) {}
public static void Method2() {}

Do these methods even need the arguments?

Copy link
Member Author

@thaystg thaystg Apr 3, 2025

Choose a reason for hiding this comment

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

Yes, to increase the string heap on metadata I preferred to add a parameter on each method than adding the double number of the methods.

Copy link
Member

@jkotas jkotas Apr 4, 2025

Choose a reason for hiding this comment

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

Ah, ok. I thought that the test is trying to go over some threshold limit related to number of methods (ie methoddef tokens) given that it has very large number of methods.

It sounds like the test is actually trying to get over the 64k limit for the string blob size. Is that right? It would be useful to mention in a comment somewhere. It is not obvious from the test code.

Also, I assume that the number of methods can be much smaller if we just gave them longer names, like void VeryLooooooooooooooooooooooooooooooooongMethodNameToPushTheStringBlobOver64k_1() { }, void VeryLooooooooooooooooooooooooooooooooongMethodNameToPushTheStringBlobOver64k_2() { }, ... - we would only need less than 1000 of those. Is that right?

Copy link
Member Author

Choose a reason for hiding this comment

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

Right, I did that now. Thanks!

@thaystg
Copy link
Member Author

thaystg commented Apr 3, 2025

Looks like this has another whitespace conflict?

Fixed.

@am11
Copy link
Member

am11 commented Apr 3, 2025

Fixed.

_v1 still has the incorrect line endings. You probably want to set core.autocrlf to true on your machine: https://git-scm.com/book/en/v2/Customizing-Git-Git-Configuration#_core_autocrlf. On my windows box (standard install VS and git-for-windows):

# global autocrlf
$ git config --global core.autocrlf
# is empty

# system autocrlf
$ git config --system core.autocrlf
# is true

If you want to match this config, then from admin shell: git config --system core.autocrlf true. Otherwise, you can set it globally for your user profile git config --global core.autocrlf true without admin command prompt or powershell.

@thaystg
Copy link
Member Author

thaystg commented Apr 3, 2025

Fixed.

_v1 still has the incorrect line endings. You probably want to set core.autocrlf to true on your machine: https://git-scm.com/book/en/v2/Customizing-Git-Git-Configuration#_core_autocrlf. On my windows box (standard install VS and git-for-windows):

# global autocrlf
$ git config --global core.autocrlf
# is empty

# system autocrlf
$ git config --system core.autocrlf
# is true

If you want to match this config, then from admin shell: git config --system core.autocrlf true. Otherwise, you can set it globally for your user profile git config --global core.autocrlf true without admin command prompt or powershell.

I have already done it, but how did you see that it's wrong yet, for me I see this output when I call:
git ls-files --eol

i/lf    w/crlf  attr/text             	src/libraries/System.Runtime.Loader/tests/ApplyUpdate/System.Reflection.Metadata.ApplyUpdate.Test.IncreaseMetadataRowSize/IncreaseMetadataRowSize.cs
i/lf    w/crlf  attr/text             	src/libraries/System.Runtime.Loader/tests/ApplyUpdate/System.Reflection.Metadata.ApplyUpdate.Test.IncreaseMetadataRowSize/IncreaseMetadataRowSize_v1.cs
i/lf    w/crlf  attr/text             	src/libraries/System.Runtime.Loader/tests/ApplyUpdate/System.Reflection.Metadata.ApplyUpdate.Test.IncreaseMetadataRowSize/System.Reflection.Metadata.ApplyUpdate.Test.IncreaseMetadataRowSize.csproj
i/lf    w/crlf  attr/text=auto        	src/libraries/System.Runtime.Loader/tests/ApplyUpdate/System.Reflection.Metadata.ApplyUpdate.Test.IncreaseMetadataRowSize/deltascript.json

Also looked at the file and I see:
image

@am11
Copy link
Member

am11 commented Apr 3, 2025

Ah, I was actually inspecting the patch link https://patch-diff.githubusercontent.com/raw/dotnet/runtime/pull/114190.patch, it shows diffs commit-wise rather than composite diff. Your latest commit indeed fixed the issue. 👍

@tommcdon tommcdon added area-System.Reflection.Metadata and removed needs-area-label An area label is needed to ensure this gets routed to the appropriate area owners labels Apr 3, 2025
@tommcdon tommcdon added this to the 10.0.0 milestone Apr 3, 2025
Copy link
Contributor

Tagging subscribers to this area: @dotnet/area-system-reflection-metadata
See info in area-owners.md if you want to be subscribed.

@noahfalk
Copy link
Member

noahfalk commented Apr 3, 2025 via email

@@ -9,30 +9,10 @@ public static int Method1()
{
Copy link
Member

Choose a reason for hiding this comment

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

Could you please add license headers?

Also, "This file was autogenerated by copilot." is not useful and it should be deleted. If we were adding a comment like that to all pieces of code that AI helped with, we would have them all over the place.

Copy link
Member Author

Choose a reason for hiding this comment

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

done.

Copy link
Member

@jkotas jkotas left a comment

Choose a reason for hiding this comment

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

Thank you!

@jkotas jkotas merged commit e2ec536 into dotnet:main Apr 5, 2025
81 of 87 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants