Skip to content

Clarify ArrayRecord handling of Multiple Null Records - #132479

Merged
adamsitnik merged 2 commits into
mainfrom
copilot/replace-comment-arrayrecord
Sep 9, 2026
Merged

adamsitnik merged 2 commits into
mainfrom
copilot/replace-comment-arrayrecord

Conversation

Copilot AI commented Aug 18, 2026 •

Copy link
Copy Markdown
Contributor

No description provided.

@azure-pipelines

Copy link
Copy Markdown
Azure Pipelines:
Successfully started running 3 pipeline(s).
13 pipeline(s) were filtered out due to trigger conditions.
There may be pipelines that require an authorized user to comment /azp run to run.

@GrabYourPitchforks

GrabYourPitchforks commented Aug 18, 2026 •

Copy link
Copy Markdown
Member

@adamsitnik I think the pertinent question is "why does this check exist?" It's purely a performance optimization, but it comes across as a correctness check.

That's also why, in the conversation I had with you, I pushed back a bit against the unit test. Unit tests typically check correctness, and I think most readers and maintainers of the code base would not expect the presence of a performance-check-only unit test. (That deserves a comment in the unit test!)

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

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 updates the inline documentation above ArrayRecord.CheckExpectedRecordCount to clarify how NRBF array record counting behaves when “multiple null” records are present, especially when allowNulls is enabled.

Changes:

  • Replaced the existing XML doc/remarks block with a shorter two-line comment describing the record-count vs element-count invariant.
  • Focused the comment specifically on the special-case behavior of multiple-null records when nulls are allowed.

@adamsitnik adamsitnik left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

That's also why, in the conversation I had with you, I pushed back a bit against the unit test. Unit tests typically check correctness, and I think most readers and maintainers of the code base would not expect the presence of a performance-check-only unit test. (That deserves a comment in the unit test!)

I add test any time I want to make sure that given behavior/characteristic does not change over the time. We usually don't provide performance-oriented tests not because we don't want the performance to regress, but because it's really hard to implement such a test in a reliable way. That is why most of our performance tests live in the https://github.com/dotnet/performance repo.

In this case providing a test was straightforward: we don't care about CPU time, we just want to make sure it does not allocate a LOT of memory. Just so the check is not deleted in a few years from. Since that is unlikely to happen in dotnet/runtime I am OK with removing the test if this is very important to you @GrabYourPitchforks .

@copilot delete this test as well.

Copilot AI commented Aug 24, 2026

Copy link
Copy Markdown
Contributor Author

That's also why, in the conversation I had with you, I pushed back a bit against the unit test. Unit tests typically check correctness, and I think most readers and maintainers of the code base wo...

Removed the allocation-focused test in 3388e3e.

Copilot AI requested a review from adamsitnik August 24, 2026 11:54
@adamsitnik adamsitnik added this to the 12.0.0 milestone Aug 24, 2026
@adamsitnik
adamsitnik marked this pull request as ready for review August 24, 2026 12:44
Copilot AI review requested due to automatic review settings August 24, 2026 12:44
@azure-pipelines

Copy link
Copy Markdown
Azure Pipelines:
Successfully started running 3 pipeline(s).
13 pipeline(s) were filtered out due to trigger conditions.
There may be pipelines that require an authorized user to comment /azp run to run.

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Pull request overview

Copilot reviewed 2 out of 2 changed files in this pull request and generated 2 comments.

@adamsitnik
adamsitnik enabled auto-merge (squash) August 24, 2026 13:35
@adamsitnik
adamsitnik disabled auto-merge September 9, 2026 13:41
@adamsitnik
adamsitnik merged commit d975570 into main Sep 9, 2026
80 checks passed
@adamsitnik
adamsitnik deleted the copilot/replace-comment-arrayrecord branch September 9, 2026 13:41
@github-actions github-actions Bot locked and limited conversation to collaborators Oct 10, 2026
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants