Repository navigation
Reconcile vendored files: LLM detector, XxHashShared, NativeMethods, EquatableArray - #9500
Conversation
…EquatableArray - LLMEnvironmentDetector: port new agent rules (cowork, copilot-cli/vscode, replit, augment, antigravity, new vars) and switch boolean rules to presence-based; sync WellKnownEnvironmentVariables (#9495) - XxHashShared: port Sse2/PackedSimd MultiplyWideningLower paths (#9497) - NativeMethods: no port needed (server override is MSBuild-specific), bump baseline (#9496) - EquatableArray: fix double-encoded upstream path; baselines already current (#9498) Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
There was a problem hiding this comment.
Pull request overview
Updates several vendored files and their manifest baselines to address area-vendored-sync drift reports across Microsoft.Testing.Platform and related extensions.
Changes:
- Updated LLM/agent environment-variable detection rules and synchronized the test infrastructure’s variable allowlist.
- Ported newer
MultiplyWideningLowerSIMD paths into the TRX hashing shared implementation (including WASMPackedSimd). - Bumped vendored baseline SHAs / corrected the ComputeSharp upstream path encoding for
EquatableArray{T}.cs.
Show a summary per file
| File | Description |
|---|---|
| test/Utilities/Microsoft.Testing.TestInfrastructure/WellKnownEnvironmentVariables.cs | Expanded the LLM detector environment-variable list used to isolate acceptance test child processes. |
| src/Platform/Microsoft.Testing.Platform/Helpers/LLMEnvironmentDetector.cs | Updated agent detection rules (new tools/vars) and removed boolean-parsing rule types in favor of presence-based matching. |
| src/Platform/Microsoft.Testing.Extensions.TrxReport/Hashing/XxHashShared.cs | Added additional SIMD implementations for widening multiply (SSE2 and WASM PackedSimd) and updated intrinsics imports. |
| eng/vendored-files.json | Updated vendored baselines and corrected the upstream path for EquatableArray{T}.cs. |
Review details
- Files reviewed: 4/4 changed files
- Comments generated: 1
- Review effort level: Low
This comment has been minimized.
This comment has been minimized.
Amaury Levé (Evangelink)
left a comment
There was a problem hiding this comment.
Note
🤖 Automated review by GitHub Copilot. Posted via a maintainer's GitHub token, so it appears under their account — the account owner did not write or approve this content personally. Generated by the Expert Code Review workflow. To request a follow-up action, reply by tagging @copilot directly.
Review Summary — PR #9500
Reviewed 22 dimensions; skipped: Threading/Concurrency (no concurrency code), Public API (all changes are internal), IDisposable/Resource (none acquired), Localization (no .resx), Analyzer & Code Fix (no src/Analyzers/ changes), IPC Wire (no serialization), PowerShell (no .ps1 files).
✅ Algorithmic Correctness — LGTM
All four paths in MultiplyWideningLower produce the same result ([source[0]×source[1], source[2]×source[3]] as Vector128<ulong>):
| Path | Proof |
|---|---|
| AdvSimd | Shuffles even/odd lanes into Vector64 → UMULL widens ✓ |
| Sse2 | Shuffle([1,0,3,0]) → _mm_mul_epu32 multiplies positions 0 and 2 ✓ |
| PackedSimd | Even → [0,2,_,_], Odd → [1,3,_,_] → i64x2.extmul_low ✓ |
| Scalar | Mask-then-cast trick extracts lower 32-bit halves before widening multiply ✓ |
AdvSimd ∩ Sse2 = ∅ (ARM vs x86), Sse2 ∩ PackedSimd = ∅ (x86 vs WASM) — the if/else if chain is architecturally sound.
✅ Cross-TFM Compatibility — LGTM
System.Runtime.Intrinsics.Wasm.PackedSimd is available since .NET 7; TrxReport targets net8.0;net9.0 (both ≥ 7). The entire block is under #if NET, excluding netstandard2.0. At runtime on non-WASM platforms PackedSimd.IsSupported returns false and the JIT dead-strips the branch.
✅ LLMEnvironmentDetector consumers — LGTM
Downstream code calls only IsLLMEnvironment() (bool). The string labels "copilot", "copilot-cli", "copilot-vscode" are used only internally in the detection-rule array. The copilot → copilot-cli/copilot-vscode split has zero impact on callers.
✅ WellKnownEnvironmentVariables sync — LGTM
Cross-checked all 38 environment variables referenced in DetectionRules against LLMEnvironmentVariables. The lists are in exact agreement; AMP_HOME (pre-existing, unlisted in the diff) is correctly present in both.
✅ BooleanEnvironmentRule removal — informational
GEMINI_CLI, DROID_CLI, KIMI_CLI, and AGENT_CLI previously required a truthy value ("1", "true", "yes", "on"). They now match any non-empty value. This is a deliberate upstream sync (dotnet/sdk) — =false or =0 would now trigger detection. Impact is cosmetic (banner suppression) and consistent with upstream intent.
✅ Vendored-file manifest — LGTM
- LLM detector, XxHash, NativeMethods: SHA pairs updated correctly.
- EquatableArray URL fix (
%7B%7D→{T}) is correct — the double-encoded path would have caused the drift-bot to search the wrong URL.
Inline NITs
Three low-severity notes posted inline:
COPILOT_GITHUB_TOKEN(line 27): common naming for GitHub API credentials in CI could produce false-positive LLM detection (cosmetic impact only; upstream decision).COPILOT_AGENTalone (line 31): thecopilot-vscoderule fires on eitherAI_AGENT=github_copilot_vscode_agentor any non-emptyCOPILOT_AGENTindependently — slightly more permissive than the comment implies.REPL_ID(line 61): generic enough that replica-ID patterns in distributed systems could collide (cosmetic only; upstream decision).
No blocking issues found.
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
This comment has been minimized.
This comment has been minimized.
Pull request was closed
Branch protection rule check failed
🧪 Test quality grade — PR #9500No new or modified test methods were identified in the changed regions of this PR. Nothing to grade. Re-run with
|
Reconciles four
area-vendored-syncdrift reports.Changes
LLMEnvironmentDetector.cs: ported new upstream agent rules (cowork, splitcopilot→copilot-cli/copilot-vscode,replit,augment,antigravity, plus new vars for claude/cursor/codex/goose). Switched boolean rules to presence-based matching and removed the now-unusedBooleanEnvironmentRule/EnvironmentVariableParser. SyncedWellKnownEnvironmentVariables.cs.XxHashShared.cs: ported theSse2/PackedSimd(WASM)MultiplyWideningLowerpaths.NativeMethods.cs: no port needed — the newConsoleConfigurationOverrideis MSBuild-Server-specific and outside the copied region. Baseline bumped to silence the bot.EquatableArray.cs: false "missing" caused by a double-URL-encoded upstream path in the manifest; fixed to literalEquatableArray{T}.cs. Blob/ref already current.All baseline SHAs in
eng/vendored-files.jsonbumped. Manifest validates; full Debug build passes.Closes #9495, #9496, #9497, #9498.