Skip to content

[Experiment] Measure x64 PR test compilation - #1948

Draft
Huzaifa Danish (huzaifa-d) wants to merge 3 commits into
mainfrom
user/modanish/pr-ci-performance
Draft

Huzaifa Danish (huzaifa-d) wants to merge 3 commits into
mainfrom
user/modanish/pr-ci-performance

Conversation

@huzaifa-d

@huzaifa-d Huzaifa Danish (huzaifa-d) commented Dec 5, 2026 •

Copy link
Copy Markdown
Contributor

📖 Description

Temporary diagnostic draft; do not merge. Compare x64 PR test compilation with separate workspace-cache, content-aware snapshot, Cargo concurrency, local sccache, filesystem-probe feature and isolated NVX-target experiments. Existing required checks and scheduled validation remain unchanged. The experimental cache keys include the exact PR commit; warm-cache measurements require a same-commit rerun. Signature verification and tamper rejection run before the experimental test builds.

🔗 References

N/A — temporary performance investigation.

🔍 Validation

  • node --test scripts\tests\x64-ci-snapshot-experiment.test.js scripts\tests\x64-ci-experiment-workflow.test.js scripts\tests\cargo-build-snapshot.test.js scripts\tests\w365-fixtures.test.js — passed, 42 tests.
  • node --test scripts\tests\microvm-validation.test.js — passed, 76 tests.
  • go run github.com/rhysd/actionlint/cmd/actionlint@v1.7.12 .github\workflows\Build.yml .github\workflows\Experimental.Windows.X64.Job.yml — passed.
  • cargo --config ..\.azure-pipelines\.cargo\config.public.toml test --locked --offline --release --target x86_64-pc-windows-msvc -p mxc-sdk --no-default-features --features microvm --test nvx_bundle_integrity --color never -- --exact crate_staged_bundle_opens_and_rejects_an_unverified_library --nocapture — passed locally with an isolated target.
  • cargo --config ..\.azure-pipelines\.cargo\config.public.toml test --locked --offline --release --target x86_64-pc-windows-msvc -p mxc-sdk --no-default-features --features microvm --test nvx_bundle_integrity --color never -- --exact signatures_reject_unsigned_tampered_and_other_publishers --nocapture — passed locally with an isolated target.
  • Actual signed runtime accepted and identical tampered runtime trees rejected by the independent signature gate in a local fixture.
  • gh run view 47457162720 --repo microsoft/mxc --attempt 1 — passed; all eight x64 experiment variants passed.
  • gh run view 47467439794 --repo microsoft/mxc --attempt 1 — passed after a no-source-change PR push; all eight variants passed.
  • gh run view 47467439794 --repo microsoft/mxc --attempt 2 — passed on the same commit; all eight variants passed. The required and experimental workspace suites each reported 5,280 passed and 76 ignored results.

The local-only sccache variant restored its cache on the same-commit rerun (100 hits, three misses); its minimal-feature NVX step fell from 291s to 45s. Its full experimental job fell from 1,695s to 1,322s, including its independent signature verifier. These are single runs on different VMs; the cache key changes on a new commit, so this is not evidence of faster new PR pushes. The normal and content-aware workspace-cache variants missed their caches on the rerun and preserved zero bundles, leaving their warm-cache comparison incomplete. Four-versus-eight Cargo jobs and probe feature variants had variable results; the probe feature sets are not equivalent. No production optimisation is established by this draft.

A separate local-only check built the same source tree at two different Git commits using fresh target directories and a shared local sccache. The second build had 178 Rust cache hits and no misses, and fell from 188s to 30s. The resulting Windows daemon carried the correct new commit in its version resource, and the minimal-feature NVX regression passed using the full-feature fixture and isolated local state. This is one local pair, not a hosted cross-commit PR-push result; source changes, procedural macro inputs and cache trust remain to be tested.

✅ Checklist

  • Signed the Contributor License Agreement
  • Linked to an issue
  • For features or changes requiring a spec: linked the issue with maintainer-applied feature-accepted
  • Before merging implementation: linked the required maintainer-approved design/API spec, or explained why no spec is required
  • Feature issue remains open unless this PR completes all agreed implementation, validation, and documentation
  • Updated documentation (if applicable)
  • Updated Copilot instructions (if build, architecture, or conventions changed)
  • If this PR changes Cargo.lock, the dependency-feed-check check passes (see pull request builds)

📋 Issue Type

  • Bug fix
  • Feature
  • Task
Microsoft Reviewers: Open in CodeFlow

Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
Copilot AI max review requested due to automatic review settings December 5, 2026 00:31
@azure-pipelines

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

Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>

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.

🟡 Changes recommended

The expected tampered-bundle rejection leaves $LASTEXITCODE nonzero, failing the CI job and preventing compilation measurements and cache saving.

2 open issues
What changed in this PR

Temporary, do-not-merge diagnostics for MXC’s Windows x64 PR test compilation. Existing required checks and scheduled validation remain unchanged.

Changes:

  • Compare eight variants covering caches, snapshots, parallelism, sccache, probe features, and isolated NVX builds.
  • Verify runtime signatures before measuring test compilation.
  • Add content-aware restoration, regression tests, and experiment guidance.
File Description
scripts/​tests/​x64-ci-snapshot-experiment.test.js Tests timestamp preservation and restore safety.
scripts/​tests/​x64-ci-experiment-workflow.test.js Checks experiment wiring and verification order.
scripts/​ci/​x64-ci-snapshot-experiment.ps1 Preserves timestamps for unchanged runtime bundles.
docs/​development/​build-and-test/​ci-validation-infrastructure.md Documents experiment isolation and warm-cache measurements.
.github/​workflows/​Experimental.Windows.X64.Job.yml Runs compilation variants and uploads timings.
.github/​workflows/​Build.yml Calls the PR-only experiment after the Windows build.

Review effort: Max

$exitCode = $LASTEXITCODE
$watch.Stop()
Write-Host "MXC_EXPERIMENT_WORKSPACE_COMPILE_SECONDS=$($watch.Elapsed.TotalSeconds)"
if ($exitCode -ne 0) { throw 'Compiling workspace tests failed.' }
Copilot AI max review requested due to automatic review settings December 5, 2026 00:52

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.

🟡 Changes recommended

The pinned rust-cache prevents reuse of Windows release builds, and sccache’s idle timeout can discard workspace compilation statistics before the final report.

3 open issues
1 resolved since last review

Review effort: Max

Comment on lines +60 to +61
SCCACHE_GHA_ENABLED: "off"
SCCACHE_CACHE_SIZE: 512M
- name: Point cargo at the MxcDependencies feed
uses: ./.github/actions/setup-cargo-feed

- uses: Swatinem/rust-cache@e18b497796c12c097a38f9edb9d0641fb99eee32 # v2
Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>

This branch has not been deployed

No deployments
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.

3 participants