Skip to content

CI: stage WebView2 Core DLL so the /perf Rust column runs (fix #674) - #689

Merged
Alexandre Zollinger Chohfi (azchohfi) merged 4 commits into
mainfrom
perf-rust-webview2-staging
Jun 26, 2026
Merged

Alexandre Zollinger Chohfi (azchohfi) merged 4 commits into
mainfrom
perf-rust-webview2-staging

Conversation

@azchohfi

Copy link
Copy Markdown
Collaborator

Problem

The /perf Rust cross-framework column reads n/a even though the crate builds fine. On the live re-run that validated the merged gate fix (#677), the C# legs all computed but the Rust column was still empty:

  • Live comment: /perf on PR #656 — Rust column = n/a.
  • Run 28211304020: test_reactor_perf reports Finished release, then every run exits 0xC0000135 (STATUS_DLL_NOT_FOUND) instantly with 0-byte stdout/stderr.

This is issue #674.

Root cause

The workflow patches the harness build.rs to windows_reactor_setup::as_self_contained(), which embeds an app.manifest declaring 17 load-time side-by-side <asmv3:file> dependencies. The Windows loader resolves every manifest <file> from the activation context at process start — a single missing one faults with 0xC0000135 before any app code runs (hence the instant exit + empty output).

Stage-RustRuntime already copies the WinAppSDK runtime DLLs from the runtime MSIX, which covers 16 of the 17. The 17th — Microsoft.Web.WebView2.Core.dll — does not ship in the WinAppSDK runtime MSIX; it lives in the separate Microsoft.Web.WebView2 NuGet package. Upstream stages it via deploy_webview2(); our PowerShell backstop never fetched it.

Proven offline against the pinned RUST_REF (ef02ee6f…): diffing the 17 manifest <file> names against the staged set leaves exactly one gap — Microsoft.Web.WebView2.Core.dll.

Fix

Port upstream windows_reactor_setup::deploy_webview2 (crates/libs/reactor-setup/src/lib.rs @ the pinned RUST_REF) into Stage-RustRuntime:

  • Download Microsoft.Web.WebView2 1.0.4022.49 (upstream's pinned WEBVIEW2_VER) into the shared windows-reactor-setup cache.
  • Extract (--strip-components=1, matching upstream stage_pkg) and copy win-<arch>/native_uap/Microsoft.Web.WebView2.Core.dll next to test_reactor_perf.exe.
  • Reuse the same evict-on-truncated / clear-partial-extract self-healing as the runtime staging.
  • Add the WebView2 Core DLL to the $required set, so the completion marker is only written (and only trusted on the idempotent early-return) once it is present — a pre-fix warm cache is detected as stale and re-staged.

Why it's safe

Validation

  • RunPerfBenchmark.Tests.ps1: 21/21 (added a test asserting a missing WebView2 Core DLL invalidates the completion marker), under both -File and dot-source.
  • PerfLib.Tests.ps1: 61/61, both invocations.
  • Offline download/extract/copy repro: Microsoft.Web.WebView2.Core.dll (855,944 bytes, x64) lands next to the exe; warm-cache re-run does not re-download.

Final acceptance is a live /perf re-run on a PR (e.g. comment /perf on #656) by a maintainer — confirm the Rust column populates instead of n/a.

Refs #661, #662, #674; follows up merged #677.

Co-authored-by: Copilot [email protected]

…00135)

The /perf Rust cross-framework column built fine but every test_reactor_perf.exe
run exited 0xC0000135 (STATUS_DLL_NOT_FOUND) at process start with 0-byte
stdout/stderr, so the column read n/a (issue #674; observed live on run
28211304020 against PR #656).

Root cause: the harness build.rs is patched to
windows_reactor_setup::as_self_contained(), which embeds an app.manifest
declaring 17 load-time side-by-side <file> dependencies. 16 are WinAppSDK
runtime DLLs that Stage-RustRuntime already copies from the runtime MSIX, but
the 17th -- Microsoft.Web.WebView2.Core.dll -- ships in the SEPARATE
Microsoft.Web.WebView2 NuGet package, not the runtime MSIX. Stage-RustRuntime
never fetched it, so the loader faulted on a missing activation-context file
before any app code ran.

Fix: port upstream windows_reactor_setup::deploy_webview2
(crates/libs/reactor-setup/src/lib.rs at the pinned RUST_REF) into
Stage-RustRuntime -- stage Microsoft.Web.WebView2 1.0.4022.49 and copy
win-<arch>/native_uap/Microsoft.Web.WebView2.Core.dll next to the exe, reusing
the shared windows-reactor-setup cache and the same evict / self-heal logic as
the runtime staging. Add the WebView2 Core DLL to the required-set so the
completion marker is only written (and only trusted on early-return) once it is
present next to the exe.

Validated: 21/21 RunPerfBenchmark gate tests (incl. a new WebView2-required
test) and 61/61 PerfLib tests pass under both -File and dot-source; an offline
download/extract/copy repro confirms the DLL lands next to the exe with
warm-cache reuse. Final acceptance is a live /perf re-run on a PR (e.g. #656)
by a maintainer.

Refs #661, #662, #674; follows up merged #677.

Co-authored-by: Copilot <[email protected]>

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 the /perf CI orchestrator to stage the missing WebView2 Core DLL required by the Rust harness’s embedded side-by-side manifest, so the Rust cross-framework column can run instead of exiting immediately with 0xC0000135 (issue #674).

Changes:

  • Extend Stage-RustRuntime to download/extract Microsoft.Web.WebView2 and copy Microsoft.Web.WebView2.Core.dll next to test_reactor_perf.exe, and include it in the required-set marker gate.
  • Add a unit test asserting that a pre-existing completion marker is treated as stale if the WebView2 Core DLL is missing.
  • Update the CI perf README to document that WebView2 Core is staged from a separate NuGet package.

Reviewed changes

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

File Description
tests/stress_perf/ci/Run-PerfBenchmark.ps1 Stages WebView2 Core DLL alongside WinAppSDK runtime files and tightens idempotency requirements for Rust harness staging.
tests/stress_perf/ci/RunPerfBenchmark.Tests.ps1 Adds coverage for the “marker present but WebView2 Core missing” stale-marker case.
tests/stress_perf/ci/README.md Documents the additional WebView2 Core staging requirement for the Rust column.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Mirror the sibling runtime-MSIX block's $LASTEXITCODE check in the new
WebView2 staging path: a truncated-but->1MB nupkg that tar only partially
unpacks could otherwise stage a corrupt Core.dll, write the completion
marker, and sticky-poison a persistent windows-reactor-setup cache. On a
nonzero tar exit, drop the partial extract and evict the nupkg so the next
run re-downloads instead of trusting Test-Path on a broken DLL.

Addresses a pr-review correctness finding on #689.

Co-authored-by: Copilot <[email protected]>
Address Copilot review on #689:
- distinguish a tar extract failure from a genuinely-absent DLL in the
  not-staged log (the $LASTEXITCODE guard already separates the cases).
- success log no longer claims all staged files are "WinAppSDK runtime"
  files now that $staged also counts the WebView2 Core DLL.

Co-authored-by: Copilot <[email protected]>

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 3 out of 3 changed files in this pull request and generated 1 comment.

Address Copilot review on #689: project $notCopied filenames with
ForEach-Object { $_.Name } instead of the bare member-name form, so the
incomplete-staging diagnostic is unambiguous to readers (behavior is
identical; the bare form already bound -MemberName).

Co-authored-by: Copilot <[email protected]>

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 3 out of 3 changed files in this pull request and generated no new comments.

@azchohfi
Alexandre Zollinger Chohfi (azchohfi) merged commit f7b1d02 into main Jun 26, 2026
21 checks passed
@azchohfi
Alexandre Zollinger Chohfi (azchohfi) deleted the perf-rust-webview2-staging branch June 26, 2026 02:24
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.

2 participants