Skip to content

[#107] Add Unity 6.6 BuildReport Summary fields and ContentSummary tables#108

Merged
SkowronskiAndrew merged 6 commits into
mainfrom
buildreport-new-content
Jul 23, 2026
Merged

[#107] Add Unity 6.6 BuildReport Summary fields and ContentSummary tables#108
SkowronskiAndrew merged 6 commits into
mainfrom
buildreport-new-content

Conversation

@SkowronskiAndrew

Copy link
Copy Markdown
Collaborator

Summary

Fixes #107.

Unity 6.6 enriches the BuildReport with additional BuildSummary fields and a new ContentSummary object. This PR teaches analyze to capture both. All new data degrades gracefully: analyzing a report from an older Unity version produces no error — the new build_reports columns are left NULL and the ContentSummary tables are simply not created (mirroring the existing on-demand behavior of the PackedAssets tables).

Changes

Part 1 — new build_reports columns

Added seven columns for the Unity 6.6 BuildSummary fields: build_name, build_content_options, build_session_guid, build_manifest_hash, build_profile_path, build_profile_guid, data_path. Each is read only when present in the TypeTree, so older reports leave them NULL. All-zero GUIDs and Hash128 values (e.g. no active build profile, non-ContentDirectory builds) are stored as NULL rather than a string of zeros. A GuidHelper.FormatUnityHash128 helper formats the manifest hash to match Unity's Hash128.ToString().

The intentionally-ignored fields (platformGroupName, crc, multiProcessEnabled) remain ignored.

Part 2 — ContentSummary tables and views

Added an on-demand ContentSummaryHandler (class id 330615474) following the PackedAssets pattern, plus three tables and two views:

  • build_report_content_summary — cross-build totals (sizes and counts)
  • build_report_content_type_stats — per Unity object type: size, object/resource counts
  • build_report_content_asset_stats — per source asset: GUID, path, size, object/resource counts
  • build_report_content_summary_view / build_report_content_type_stats_view — resolve build_report_id (and, for type stats, the type name)

A ContentSummary object does not record which build it belongs to, so — exactly as with PackedAssets — the tables store the ContentSummary object's own id and the views resolve build_report_id via the BuildReport object (type 1125) in the same serialized file. Type names are populated from TypeIdRegistry so the type-stats view is useful even when the build output is not analyzed alongside the report.

Documentation/buildreport.md documents all of the above.

Testing

dotnet test — full suite green (265 UnityDataTool.Tests + 62 Analyzer.Tests + 425 UnityFileSystem.Tests, 0 failures).

Added 6 tests to BuildReportTests.cs covering: the new Summary columns on a ContentDirectory report, the empty build_name case for an AssetBundle report, NULL columns for an older report, ContentSummary table population and spot-checked values, on-demand absence of the tables for an older report, and correct build_report_id resolution when multiple 6.6 reports are analyzed together. These use the existing Unity 6.6 reference reports under TestCommon/Data/LeadingEdgeBuilds.

Also manually verified against the reference reports via analyze + SQL queries, and against older TestCommon/Data/BuildReports reports to confirm backward compatibility.

…bles

Part 1: extend build_reports with the new 6.6 BuildSummary fields
(build_name, build_content_options, build_session_guid, build_manifest_hash,
build_profile_path, build_profile_guid, data_path), left NULL for older reports.

Part 2: add on-demand build_report_content_* tables and views for the new
ContentSummary object (cross-build stats, per-type stats, per-source-asset stats).
@SkowronskiAndrew
SkowronskiAndrew requested a review from Copilot July 22, 2026 21:15
@SkowronskiAndrew
SkowronskiAndrew marked this pull request as ready for review July 22, 2026 21:18

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

This PR updates UnityDataTools’ build report analysis pipeline (Analyzer → SQLite schema/handlers + CLI tests/docs) to support Unity 6.6’s expanded BuildSummary fields and the new ContentSummary object, while remaining compatible with older Unity build reports.

Changes:

  • Added seven new nullable columns to build_reports and populated them when present in Unity 6.6+ BuildReports (including proper NULLing of all-zero GUID/Hash128 values).
  • Introduced an on-demand ContentSummaryHandler plus new build_report_content_* tables and views, following the existing lazy-schema pattern used by PackedAssets.
  • Added test coverage for Unity 6.6 reports and documented the new schema in Documentation/buildreport.md.

Reviewed changes

Copilot reviewed 11 out of 12 changed files in this pull request and generated no comments.

Show a summary per file
File Description
UnityDataTool.Tests/BuildReportTests.cs Adds Unity 6.6-focused tests for new BuildSummary columns and ContentSummary tables/views, plus backwards-compat tests for older reports.
UnityBinaryFormat/GuidHelper.cs Adds FormatUnityHash128 helper to format manifest hashes consistently with Unity’s Hash128.ToString().
Documentation/buildreport.md Documents ContentSummary support, new tables/views, and the new Unity 6.6 build_reports columns + lazy-creation behavior.
Analyzer/SQLite/Writers/SerializedFileSQLiteWriter.cs Registers ContentSummaryHandler so ContentSummary objects are captured during analysis.
Analyzer/SQLite/Handlers/ContentSummaryHandler.cs New handler: lazy-creates schema, inserts ContentSummary totals, type stats, and asset stats; seeds types from TypeIdRegistry for readable views.
Analyzer/SQLite/Handlers/BuildReportHandler.cs Extends build_reports INSERT to include the seven new nullable Unity 6.6 fields.
Analyzer/SerializedObjects/ContentSummary.cs New serialized-object reader for Unity 6.6 ContentSummary (totals, type stats list, asset stats list).
Analyzer/SerializedObjects/BuildReport.cs Reads Unity 6.6 optional Summary fields safely (via HasChild) and normalizes default GUID/Hash128 values to null.
Analyzer/Resources/ContentSummary.sql New on-demand tables and views for ContentSummary and per-type stats, resolving build_report_id via same-serialized-file join (PackedAssets pattern).
Analyzer/Resources/BuildReport.sql Adds the seven new Unity 6.6 columns to the build_reports table schema.
Analyzer/Properties/Resources.resx Embeds ContentSummary.sql as a resource.
Analyzer/Properties/Resources.Designer.cs Exposes the embedded ContentSummary SQL resource to code.
Files not reviewed (1)
  • Analyzer/Properties/Resources.Designer.cs: Generated file

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

Comment thread Documentation/buildreport.md Outdated
Comment thread Documentation/buildreport.md Outdated
Comment thread Documentation/buildreport.md
Comment thread Documentation/buildreport.md Outdated
Comment thread Documentation/buildreport.md Outdated
SkowronskiAndrew and others added 5 commits July 23, 2026 09:25
Manual fixes based on review.

Co-authored-by: Andrew Skowronski <86242170+SkowronskiAndrew@users.noreply.github.com>
Reorganize the page so its focus is what UnityDataTool extracts and how build
reports differ across build types and Unity versions (which the versioned Unity
Manual intentionally does not cover):

- Add a build-type x data-availability matrix and a "Unity version differences"
  section (ContentSummary added in 6.6, PackedAssets scene coverage, content
  directory builds omit PackedAssets, build history location change).
- Note ContentSummary is absent for scripts-only/content-reusing Player builds and
  reflects only rebuilt bundles for incremental AssetBundle builds.
- Document the --build-history option for content directory analysis.
- Consolidate usage, examples, schema, alternatives, and limitations.
- Add the built-in Build Analysis window (6.6+) as an alternative UI.
- Note the BuildReportInspector package's 6.6 status and its overlap with the
  built-in window.
- Restructure the BuildReport API guidance around build history: BuildHistory.
  LoadBuildReport for 6.6+ tracked builds, with the GetLatestReport/AssetDatabase/
  InternalEditorUtility approaches kept for pre-6.6 and AssetBundle reports.
@SkowronskiAndrew
SkowronskiAndrew merged commit 5a1677f into main Jul 23, 2026
5 checks passed
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.

analyze - Update BuildReport support to include new Unity 6.6 content

2 participants