Skip to content

Add regression tests for ilc --help instruction set help text#125735

Closed
Copilot wants to merge 3 commits intomainfrom
copilot/fix-ilc-help-output-duplicates
Closed

Add regression tests for ilc --help instruction set help text#125735
Copilot wants to merge 3 commits intomainfrom
copilot/fix-ilc-help-output-duplicates

Conversation

Copy link
Copy Markdown
Contributor

Copilot AI commented Mar 18, 2026

Description

ilc --help output for --instruction-set had two issues: massive duplicates in per-architecture instruction set lists (e.g., base, base, base, avx2, avx2, avx2, ...) and listing the removed x86-64 predefined CPU group that produces "Unrecognized instruction set" errors when used.

Both issues are already fixed in main — duplicates by DistinctBy (PR #119368), and x86-64 removal from InstructionSetDesc.txt. This PR adds regression tests to prevent recurrence:

  • HelpTextShowsNoDuplicateInstructionSetNames — simulates the exact DistinctBy + Specifiable logic from PrintExtendedHelp and asserts uniqueness per architecture
  • AllSpecifiableNamesAppearInHelpText — verifies DistinctBy ordering doesn't shadow specifiable names behind non-specifiable entries with the same key
  • AllCpuGroupNamesResolveToValidInstructionSets — exercises InstructionSetSupportBuilder.AddSupportedInstructionSet for every predefined CPU group to catch stale/broken group definitions
  • AllCpuGroupNamesAreUnique / NoPredefinedGroupNamedX86Dash64WithoutVersion — guards against re-introducing removed or duplicate group names
Original prompt

This section details on the original issue you should resolve

<issue_title>ilc --help for --instruction-set contains many duplicates and lists removed/outdated predefined CPU groups</issue_title>
<issue_description>### Description

Hello,

Description

When running ilc --help (from package runtime.win-x64.Microsoft.DotNet.ILCompiler 10.0.5, the latest stable at the moment), the output for the --instruction-set option is malformed.

1. Massive duplicates in the per-architecture lists

Current output (x64 section excerpt):
x64: base, base, base, sse4.2, sse4.2, sse4.2, sse4.2, sse4.2, avx, avx2, avx2, avx2, avx2, avx2, avx2, avx2, avx512, avx512, ...
(and many more repeated values for avx2, avx512*, aes, gfni, avxvnniint, etc.)

The same problem exists in the x86 section.

This looks like the help text is generated by concatenating several internal arrays/lists without proper deduplication or formatting.

2. Predefined CPU groups that are no longer supported are still listed

The help still mentions:
The following CPU names are predefined groups of instruction sets and can be used in --instruction-set too:
x86-64, x86-64-v2, x86-64-v3, x86-64-v4, armv8-a, armv8.1-a, ...

According to recent changes in .NET 10 / NativeAOT, the old x86-64* / x86-64-v* aliases have been removed or renamed .

Users who copy-paste from --help will get compile "Unrecognized instruction set" errors

Image

Reproduction Steps

  1. Download runtime.win-x64.Microsoft.DotNet.ILCompiler 10.0.5
  2. Run: ilc --help
  3. Scroll to the --instruction-set section

Expected behavior

  • Clean, deduplicated list of supported instruction sets per architecture.
  • Only currently supported predefined CPU groups should be listed.
  • The help text should be readable and accurate.

Actual behavior

Noisy output with dozens of repeated values + outdated predefined groups.

Regression?

No response

Known Workarounds

No response

Configuration

No response

Other information

Thank you for improving the developer experience of NativeAOT!</issue_description>

Comments on the Issue (you are @copilot in this section)


📍 Connect Copilot coding agent with Jira, Azure Boards or Linear to delegate work to Copilot in one click without leaving your project management tool.

@dotnet-policy-service
Copy link
Copy Markdown
Contributor

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

Copilot AI and others added 2 commits March 18, 2026 17:21
…lid CPU groups)

Co-authored-by: jtschuster <36744439+jtschuster@users.noreply.github.com>
…tive comparison

Co-authored-by: jtschuster <36744439+jtschuster@users.noreply.github.com>
Copilot AI changed the title [WIP] Fix duplicate entries in ilc --help instruction set output Add regression tests for ilc --help instruction set help text Mar 18, 2026
Copilot AI requested a review from jtschuster March 18, 2026 17:29
@jtschuster
Copy link
Copy Markdown
Member

Not sure this warrants additional tests if it's already fixed main.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

Status: No status
Status: Done

Development

Successfully merging this pull request may close these issues.

ilc --help for --instruction-set contains many duplicates and lists removed/outdated predefined CPU groups

2 participants