dotnet / dotnet/msbuild

Prototype safe ProjectInstance snapshots for cross-build evaluation caching

Open
#14,684 0 comments 0 reactions 1 assignee Claimed by @AlesProkop View on GitHub
Area: Evaluation
Dominant language
C#
Stars
5.5k
Forks
1.5k
Avg merge
1d 8h
Merged PRs (30d)
141

Description

## Summary

Prototype a safe representation for retaining evaluated project state across MSBuild Server submissions and materializing a fresh `ProjectInstance` on an evaluation-cache hit.

## Motivation

Target execution can mutate a `ProjectInstance`, so a cross-build evaluation cache cannot safely return the same live instance to multiple build requests. Cache hits need to produce isolated project state while remaining substantially cheaper than reevaluation. This is a key feasibility question for #14234.

## Scope

- Create a snapshot from a freshly evaluated `ProjectInstance`, before target execution mutates it.
- Compare possible approaches: in memory or on-disk persistence.
- Materialize independent instances from one snapshot.
- Verify properties, items, item definitions, and targets match normal evaluation.
- Measure snapshot creation, hit materialization time, allocations, and retained memory.
- Confirm target mutations and request-specific state do not leak into later builds.
- Add dotnet benchmarks

Cache keys, input invalidation, server lifetime, and eviction policy are outside this issue.

## Success criteria

- No mutable project or request state is shared between submissions.
- Build is correct.
- The prototype reports memory per snapshot.

Related: #14234, #14538.

Contributor guide

No contributing guide indexed for this repository

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.