Repository navigation
Structure RAR conflict diagnostics in binary logs - #14601
Conversation
6727ccc to
6cc908b
Compare
There was a problem hiding this comment.
Pull request overview
This PR reduces .binlog size and improves replay fidelity by replacing large, preformatted ResolveAssemblyReference (RAR) conflict diagnostics with new structured BuildEventArgs types that are serialized into the binary log (format bump to 29) and transported across nodes/out-of-proc RAR.
Changes:
- Introduces structured conflict events (
AssemblyConflictDependencyDetailsMessageEventArgs,AssemblyConflictWarningEventArgs) and uses them in RAR behind ChangeWave 18.11, preserving legacy text via lazy formatting. - Extends binary logger serialization/deserialization and node packet plumbing to support the new event record kinds and transport paths (task host + out-of-proc RAR).
- Adds unit tests covering roundtrip serialization, lazy formatting behavior, task host forwarding, out-of-proc dispatch, and ChangeWave opt-out/legacy text equivalence.
Reviewed changes
Copilot reviewed 17 out of 17 changed files in this pull request and generated 4 comments.
Show a summary per file
| File | Description |
|---|---|
| src/UnitTests.Shared/MockEngine.cs | Adds warnings-as-errors support for tests via IBuildEngine8.ShouldTreatWarningAsError. |
| src/Tasks/AssemblyDependency/ResolveAssemblyReference.cs | Emits new structured conflict events (and warning aggregation/promotion behavior) behind ChangeWave 18.11. |
| src/Tasks/AssemblyDependency/Node/OutOfProcRarClient.cs | Dispatches out-of-proc RAR logged events by runtime type (supports new structured events). |
| src/Tasks.UnitTests/AssemblyDependency/Node/OutOfProcRarNode_Tests.cs | Adds a regression test ensuring structured conflict events are dispatched correctly. |
| src/Tasks.UnitTests/AssemblyDependency/AssemblyConflictLogging_Tests.cs | New tests validating legacy-text equivalence, filters, metadata, escaping, and warning promotion behavior under the ChangeWave. |
| src/Shared/LogMessagePacketBase.cs | Adds new LoggingEventType IDs and instantiation mapping for the structured conflict events. |
| src/Framework/AssemblyReferenceConflictEventArgs.cs | Adds new public conflict event args + supporting structured data types and lazy message formatting. |
| src/Build/Logging/BinaryLogger/BuildEventArgsWriter.cs | Serializes the new structured conflict record kinds into binlog format 29. |
| src/Build/Logging/BinaryLogger/BuildEventArgsReader.cs | Deserializes the new structured conflict record kinds and preserves ProjectFile on replay. |
| src/Build/Logging/BinaryLogger/BinaryLogRecordKind.cs | Adds record kinds for structured conflict dependency details and warnings. |
| src/Build/Logging/BinaryLogger/BinaryLogger.cs | Bumps binlog format version to 29 and documents the new record kinds. |
| src/Build/Instance/TaskFactories/TaskHostTask.cs | Refactors task-host log forwarding to dispatch by event runtime type (including telemetry/custom events). |
| src/Build.UnitTests/BuildEventArgsSerialization_Tests.cs | Adds roundtrip + lazy-materialization tests for new structured conflict event args. |
| src/Build.UnitTests/BackEnd/TaskHost_Tests.cs | Adds multi-node forwarding tests for the new structured conflict events. |
| src/Build.UnitTests/BackEnd/NodePackets_Tests.cs | Validates node packet typing/translation for the new structured conflict events. |
| src/Build.UnitTests/AssemblyConflictTestData.cs | Provides shared message-format test data for structured conflict tests. |
| documentation/wiki/ChangeWaves.md | Documents the new ChangeWave 18.11 RAR structured conflict diagnostics and binlog format impact. |
💡 Add a code-review agent skill for context-aware, tailored reviews. Learn more in the docs.
|
Measured with separate PerfStar conflict-detail and MSB3277 stress scenarios: eight conflicts × 768 dependees, three measured iterations, Windows/Linux, normal and Comparing the serialization-only run 15290127 with #14599+#14601 15290128:
Replay preserved the rendered payloads and replaced each set of eight legacy messages/warnings with eight structured events. |
6cc908b to
39d473d
Compare
39d473d to
c4dd9c5
Compare
|
@AlesProkop ok, rebased and good to go! |
## Learning atom - **What:** Refined the existing "Adding New Build Event Types" guidance in `.github/skills/maintaining-binary-log-compatibility/SKILL.md` to require tracing new events through every dispatcher and transport, including task-host forwarding, while preserving non-fatal handling for unknown event types. - **Why:** Review of #14599 found a newly serialized event missing from `TaskHostTask.HandleLoggedMessage`; review of #14601 found unsupported logging events could become fatal in a forwarding path. Both are instances of serialization being updated without validating the complete event route. - **Deduplication:** Existing atoms cover serialization/replay round trips and forwarding completeness separately, but none connects new event types to every forwarding/dispatch path or calls out preserving unknown-event behavior. ## Reviewers (core MSBuild team) Suggested reviewers — core-team members who discussed this pattern (please assign): ``@dotnet/kitten`` > [!WARNING] > <details> > <summary>Firewall blocked 1 domain</summary> > > The following domain was blocked by the firewall during workflow execution: > > - `github.com` > > To allow these domains, add them to the `network.allowed` list in your workflow frontmatter: > > ```yaml > network: > allowed: > - defaults > - "github.com" > ``` > > See [Network Configuration](https://github.github.com/gh-aw/reference/network/) for more information. > > </details> > Generated by [Dreaming (learning atoms curation)](https://github.com/dotnet/msbuild/actions/runs/34888369620) · copilot · gpt56 · 85.9 AIC · ⌖ 9.11 AIC · ⊞ 24.2K · [◷](https://github.com/search?q=repo%3Adotnet%2Fmsbuild+%22gh-aw-workflow-id%3A+dreaming.agent%22&type=pullrequests) <!-- gh-aw-agentic-workflow: Dreaming (learning atoms curation), engine: copilot, model: gpt-5.6-sol, id: 34888369620, workflow_id: dreaming.agent, run: https://github.com/dotnet/msbuild/actions/runs/34888369620 --> <!-- gh-aw-workflow-id: dreaming.agent --> <!-- gh-aw-workflow-call-id: dotnet/msbuild/dreaming.agent --> Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com> Co-authored-by: Copilot <[email protected]>
e797d42 to
78db700
Compare
78db700 to
a054305
Compare
Replace enormous conflict dependency-list strings with lazy structured events whose repeated identities, paths, dependees, and item specs use the binary log string table. Preserve legacy rendering and warning behavior behind ChangeWave 18.11, and advance the binlog format to v29. Co-authored-by: Copilot App <[email protected]> Copilot-Session: aa22c3ca-3e39-4cf7-9fd7-666cc172d93d
Co-authored-by: Copilot App <[email protected]> Copilot-Session: aa22c3ca-3e39-4cf7-9fd7-666cc172d93d
Rewrite the ChangeWave entry, public XML documentation, implementation comments, and test descriptions with concise technical language. Clarify reader compatibility and lazy message behavior without changing product behavior. Co-authored-by: Copilot App <[email protected]> Copilot-Session: aa22c3ca-3e39-4cf7-9fd7-666cc172d93d
Co-authored-by: Copilot App <[email protected]>
Co-authored-by: Copilot App <[email protected]> Copilot-Session: 555d1cfc-988c-49d3-b17f-81c8593ece36
Remove conflict format strings from IPC and binary-log payloads. Render structured messages invariantly by default, while built-in console and terminal loggers relocalize accepted events in the active UI culture. Co-authored-by: Copilot App <[email protected]> Copilot-Session: 555d1cfc-988c-49d3-b17f-81c8593ece36
Use the generalized static forwarding helper introduced by the structured conflict event handling. Co-authored-by: Copilot App <[email protected]> Copilot-Session: 555d1cfc-988c-49d3-b17f-81c8593ece36
Cache conflict message formats per culture and expose culture-aware event formatting so multiple user-facing loggers reuse localized output without materializing the invariant message. Co-authored-by: Copilot App <[email protected]> Copilot-Session: 555d1cfc-988c-49d3-b17f-81c8593ece36
Preserve the Wave 18.12 compatibility guard before dispatching TaskHost events by their runtime type. This keeps structured event forwarding while restoring legacy event filtering when the wave is disabled. Co-authored-by: Copilot App <[email protected]> Copilot-Session: aa22c3ca-3e39-4cf7-9fd7-666cc172d93d
a054305 to
5502297
Compare
Stack dependency
This draft PR depends on #14599 and targets its
baronfel-analyze-binlog-sizebranch. PR #14599 introduces structured RAR search-trace events and binary-log format 28. Review and merge #14599 first.This PR also uses format 28 because both record types are unshipped and their length-prefixed records remain forward-skippable.
Motivation
RAR emitted 2,126 conflict dependency-list messages in the analyzed 823.6 MiB binary log. Those messages contained 992,063,604 characters (about 946 MiB of uncompressed text).
The structured model contains 1,949 unique strings and 13,560,767 wire bytes. In the category-specific measurement, gzip size decreased from 49,133,718 bytes to 1,281,821 bytes: a 45.6 MiB (97.4%) reduction for this category. Whole-log savings remain workload-dependent.
Changes
BuildEventArgs.Messagein invariant English for stable IPC and binary-log replay.FormatMessage(CultureInfo)on each structured conflict event so consumers can render another culture when needed.CurrentUICulture. Importance filtering still occurs before rendering.ProjectFile, task-node locations, help keywords, andOutputUnresolvedAssemblyConflictsmetadata.Compatibility and incremental payload impact
Removing the nine conflict format strings saves 549 bytes per warning event and 221 bytes per dependency-detail event on IPC. At 1,000 / 100,000 / 100,000,000 events, that is:
In raw binlogs, string-table deduplication makes the incremental savings smaller: approximately 8 bytes per detail event and 18 bytes per warning event, plus about 225 or 558 one-time bytes for the corresponding format strings. Repeated-reference savings are therefore approximately 8 KB / 0.8 MB / 0.8 GB for detail events and 18 KB / 1.8 MB / 1.8 GB for warnings at the same scales. Compressed-binlog savings are smaller because repeated indices compress well.
Filtered events perform no rendering work. Invariant output renders once and caches in
Message; non-invariant output performs one resource-based render per accepted event/culture and caches the result.Validation
60.binlog).net11.0andnet472, with 0 failures and 0 skips.src\Samples\Dependency\Dependency.csprojcompleted with 0 warnings and 0 errors (61.binlog).