Skip to content

Reconcile vendored files: LLM detector, XxHashShared, NativeMethods, EquatableArray - #9500

Merged
Amaury Levé (Evangelink) merged 2 commits into
mainfrom
dev/amauryleve/ideal-parakeet
Jun 29, 2026
Merged

Amaury Levé (Evangelink) merged 2 commits into
mainfrom
dev/amauryleve/ideal-parakeet

Conversation

@Evangelink

Copy link
Copy Markdown
Member

Reconciles four area-vendored-sync drift reports.

Changes

All baseline SHAs in eng/vendored-files.json bumped. Manifest validates; full Debug build passes.

Closes #9495, #9496, #9497, #9498.

…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>
Copilot AI review requested due to automatic review settings June 29, 2026 11:05

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

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 MultiplyWideningLower SIMD paths into the TRX hashing shared implementation (including WASM PackedSimd).
  • 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

Comment thread eng/vendored-files.json Resolved
@Evangelink

This comment has been minimized.

@Evangelink Amaury Levé (Evangelink) left a comment

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

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:

  1. COPILOT_GITHUB_TOKEN (line 27): common naming for GitHub API credentials in CI could produce false-positive LLM detection (cosmetic impact only; upstream decision).
  2. COPILOT_AGENT alone (line 31): the copilot-vscode rule fires on either AI_AGENT=github_copilot_vscode_agent or any non-empty COPILOT_AGENT independently — slightly more permissive than the comment implies.
  3. 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>
@Evangelink
Amaury Levé (Evangelink) enabled auto-merge (squash) June 29, 2026 11:58
@Evangelink Amaury Levé (Evangelink) added the state/needs-review Awaiting review from the team. label Jun 29, 2026
@Evangelink

This comment has been minimized.

auto-merge was automatically disabled June 29, 2026 13:05

Pull request was closed

@Evangelink
Amaury Levé (Evangelink) enabled auto-merge (squash) June 29, 2026 13:05
auto-merge was automatically disabled June 29, 2026 13:05

Branch protection rule check failed

@Evangelink

Copy link
Copy Markdown
Member Author

🧪 Test quality grade — PR #9500

No new or modified test methods were identified in the changed regions of this PR. Nothing to grade.

Re-run with /grade-tests.

🤖 Automated content 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 Grade Tests on PR (on open / sync) workflow. · 115.4 AIC · ⌖ 13.1 AIC · ⊞ 43.8K · [◷]( · ◷)

@Evangelink
Amaury Levé (Evangelink) merged commit 44d9aa4 into main Jun 29, 2026
83 of 85 checks passed
@Evangelink
Amaury Levé (Evangelink) deleted the dev/amauryleve/ideal-parakeet branch June 29, 2026 14:25
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

state/needs-review Awaiting review from the team.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[vendored-sync] platform-llm-environment-detector: drift detected (#0)

3 participants