Skip to content

Slai Agent Runtime: Support ARM architectures in package name normalization - #6585

Open
Slai.life (huong8373tt-beep) wants to merge 4 commits into
microsoft:masterfrom
huong8373tt-beep:fix/normalize-arm-architecture
Open

Slai.life (huong8373tt-beep) wants to merge 4 commits into
microsoft:masterfrom
huong8373tt-beep:fix/normalize-arm-architecture

Conversation

@huong8373tt-beep

@huong8373tt-beep Slai.life (huong8373tt-beep) commented Oct 8, 2026 •

Copy link
Copy Markdown
Contributor

Description of the change

Adds ARM, ARM64, and AARCH64 architecture suffix recognition to package-name normalization. This lets installed ARP entries such as PowerToys (Preview) arm64 correlate with manifests whose names omit the architecture suffix.

Closes #6490

Validation

  • Built AppInstallerCLITests (Release|x64) on Windows.
  • Ran AppInstallerCLITests.exe NameNorm_Architecture: 1 test case, 9 assertions passed.

Attribution

This issue was discovered while Slai Agent Runtime was operating in a Windows environment. The developer authorized this contribution after the issue was reproduced and the fix was validated.

Microsoft Reviewers: Open in CodeFlow

@huong8373tt-beep
Slai.life (huong8373tt-beep) requested a review from a team as a code owner October 8, 2026 07:45
@azure-pipelines

Copy link
Copy Markdown
Azure Pipelines:
There may be pipelines that require an authorized user to comment /azp run to run.

Regex::Expression ArchitectureX32{ R"((?<=^|[^\p{L}\p{Nd}])(X32|X86)(?=\P{Nd}|$)(?:\sEDITION)?)", reOptions };
Regex::Expression ArchitectureX64{ R"((?<=^|[^\p{L}\p{Nd}])(X64|AMD64|X86([\p{Pd}\p{Pc}]64))(?=\P{Nd}|$)(?:\sEDITION)?)", reOptions };
Regex::Expression ArchitectureArm64{ R"((?<=^|[^\p{L}\p{Nd}])(ARM64|AARCH64)(?=\P{Nd}|$)(?:\sEDITION)?)", reOptions };
Regex::Expression ArchitectureArm{ R"((?<=^|[^\p{L}\p{Nd}])(ARM)(?=\P{Nd}|$)(?:\sEDITION)?)", reOptions };

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.

As ARM does not end in a number, the trailing \P{Nd} ends up matching other letters (I think). Needs a negative test case like "Name armadillo" that does not replace anything or detect the architecture. Fixing it requires a bit more regex knowledge than is currently in my head. But regardless of the fix, a lot more test cases are likely needed.

Additionally, it makes sense to include ARM32 as a variant that might appear. That one should be able to use the existing pattern as it does end in a number.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Implemented in 79514f1. ARM now requires a non-letter/non-digit boundary, so names such as Name armadillo remain unchanged and report Unknown. Added coverage for that negative case and for the ARM32 variant; ARM64 and AARCH64 continue to use the existing digit-terminated pattern.

I also checked the boundary cases (ARMfoo, ARM Edition, and ARM-foo) against the revised expression.

@microsoft-github-policy-service microsoft-github-policy-service Bot added Needs-Attention Issue needs attention from Microsoft and removed Needs-Author-Feedback Issue needs attention from issue or PR author labels Oct 8, 2026

@JohnMcPMS JohnMcPMS 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.

Note that there is a test that covers a lot of other inputs (NameNorm_Database_Initial) that might need to be updated.

REQUIRE(normer.Normalize("Name arm64", {}).Architecture() == Architecture::Arm64);
REQUIRE(normer.Normalize("Name aarch64", {}).Architecture() == Architecture::Arm64);
REQUIRE(normer.Normalize("Name armadillo", {}).Architecture() == Architecture::Unknown);
REQUIRE(normer.Normalize("Name armadillo", {}).Name() == "Name armadillo");

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.

Normalization removes spaces. At some point the case is folded as well, but I don't remember if that is part of the normalization or the index storage.

Regex::Expression ArchitectureX32{ R"((?<=^|[^\p{L}\p{Nd}])(X32|X86)(?=\P{Nd}|$)(?:\sEDITION)?)", reOptions };
Regex::Expression ArchitectureX64{ R"((?<=^|[^\p{L}\p{Nd}])(X64|AMD64|X86([\p{Pd}\p{Pc}]64))(?=\P{Nd}|$)(?:\sEDITION)?)", reOptions };
Regex::Expression ArchitectureArm64{ R"((?<=^|[^\p{L}\p{Nd}])(ARM64|AARCH64)(?=\P{Nd}|$)(?:\sEDITION)?)", reOptions };
Regex::Expression ArchitectureArm{ R"((?<=^|[^\p{L}\p{Nd}])(ARM32(?=\P{Nd}|$)|ARM(?=[^\p{L}\p{Nd}]|$))(?:\sEDITION)?)", reOptions };

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.

There is still an issue with "ARM" being detected as a standalone word. Since it is itself both a word (🦾) and a company, we could be detecting one of those semantics rather than the architecture one. The name could be "ARM Compiler (x64)" from "ARM Corporation" and we would end up with "compiler" from "arm" (I don't think we apply the arch removal to publisher).

I think we might be far enough past ARM32 to completely ignore "ARM" due to its difficulties (we can keep the "ARM32" one as it matches the existing expression better).

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Updated in 211a8b4. The current ArchitectureArm pattern recognizes only ARM32; bare ARM is no longer matched or removed.

I also ran NameNorm_Database_Initial: the earlier bare-ARM variant changed the existing GNU Arm Embedded Toolchain ... fixture, while the current ARM32-only version preserves it. The ARM Compiler (x64) regression asserts the normalizer's canonical output (ARMCompiler) and confirms that x64, not the company name, is removed.

@microsoft-github-policy-service microsoft-github-policy-service Bot added the Needs-Author-Feedback Issue needs attention from issue or PR author label Oct 8, 2026
Signed-off-by: wangluoye <294879785+huong8373tt-beep@users.noreply.github.com>
@microsoft-github-policy-service microsoft-github-policy-service Bot removed the Needs-Author-Feedback Issue needs attention from issue or PR author label Oct 9, 2026
@huong8373tt-beep

Copy link
Copy Markdown
Contributor Author

Addressed in 211a8b4. I ran AppInstallerCLITests.exe NameNorm_Database_Initial while refining this change. The earlier bare-ARM variant exposed a mismatch for the existing GNU Arm Embedded Toolchain ... fixture; after limiting recognition to ARM32, the database test preserves that fixture and does not require fixture updates. I also added the ARM Compiler (x64) regression to ensure bare ARM is retained while x64 is normalized.

Signed-off-by: wangluoye <294879785+huong8373tt-beep@users.noreply.github.com>
@JohnMcPMS

Copy link
Copy Markdown
Member

/azp run

@azure-pipelines

Copy link
Copy Markdown
Azure Pipelines:
Successfully started running 1 pipeline(s).

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

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Package name normalization does not support ARM(64)

2 participants