ZionGames Docs

Home / Zion Tools / Zion Dependency Graph

πŸ•ΈοΈ Zion Dependency Graph

See every reference. Trust every delete.

Addressables Audit

New in v1.3, and shown only when the Addressables package (1.21 through 2.x) is installed. Every Addressables project eventually asks the same question: what is this bundle layout actually costing me, and can I trust the answer? This tab answers it off the static asset index, in seconds, with no build required.

Running an audit

Open the Addressables tab in the side panel and click Run Addressables Audit. The tool reads each group's BundledAssetGroupSchema packing mode to project the bundle layout a build would produce, then walks every explicit entry's dependency tree. Anything reachable from two or more distinct bundles is a candidate finding.

Audits are opt-in per session, the same reasoning as Find Duplicates in v1.2 - the walk is fast, but there is no reason to pay for it before you ask.

Object-level duplicate detection

This is the part that differs from Unity's own Analyze > Check Duplicate Bundle Dependencies rule, and it is the reason the tab exists.

Unity's rule compares whole files. Two prefabs that reference completely disjoint sub-objects of one sprite sheet or one FBX are reported as duplicated, even though nothing is actually shared. Worse, its one-click Fix acts on that same wrong unit: it yanks the whole file out into its own group, manufacturing an extra bundle and an extra load dependency for an asset that never needed isolating.

Zion Dependency Graph resolves duplication at the object level instead. For text-serialised assets it reads the actual {fileID, guid} pairs each referrer points at and intersects them per bundle:

  • Overlapping object sets - a genuine duplicate. Reported with wasted bytes and a suggested fix.
  • Disjoint object sets - nothing is duplicated. Reported as Partial, zero wasted bytes, no action suggested, with a note such as "3 sub-objects, none common".
This was verified directly against Unity's own Analyze tool. A texture sliced into two non-overlapping sprites, referenced by two prefabs in different groups, is correctly cleared here - while Unity's rule flags it and its Fix action isolates it into an unnecessary extra bundle.

Fix guidance, not auto-fix

Every real duplicate gets one of four calls. Nothing is ever restructured automatically - moving entries between groups is a decision about your bundle layout, so the tool makes the recommendation and you make the change.

VerdictWhat it means
No actionNothing is genuinely shared - typically a Partial finding where the referrers point at different sub-objects
Accept duplicationThe asset is small enough (under the 16 KB ceiling) that isolating it costs more in bundle overhead and load dependencies than the duplicated bytes save
Promote to a shared groupMove the asset into a shared group so both bundles reference it once instead of embedding it twice
Merge groupsThe two groups overlap enough that keeping them separate is the actual problem - offered while both stay under the 25-entry ceiling

Both thresholds are shown in the tab rather than hidden, so you can judge whether they match your project.

Resources / Addressables overlap

An asset living under a Resources/ folder that is also reachable from a bundle gets duplicated twice over - once into the Resources blob that ships in every build, once into the bundle. Unity's own tooling flags this class of waste but cannot fix it. Overlaps are listed alongside the duplicate-bundle findings.

Bundle membership everywhere

Once an audit has run, selecting any asset anywhere in the tool adds an Addressables section to the detail panel showing its bundle(s), whether it is an explicit entry or an implicit pull-in, and the reference chain responsible. See Detail Panel.

Package assets are excluded

Anything under Packages/ is left out of findings - including the default materials and shaders Unity auto-assigns, which are technically shared across every bundle in almost every project. You cannot promote or merge a package's own asset into one of your groups, so surfacing it would be noise on every real project. This mirrors the Assets/-only philosophy of orphan detection.

Export

Once a successful audit exists, Export JSON and Export CSV buttons appear on the tab.

  • CSV - one row per duplicate finding, sorted by wasted bytes descending, ready to triage in a spreadsheet
  • JSON - the complete duplicate, overlap and membership data

Both exports are generated from the same report the tab displays, so they can never disagree with what you are looking at.

Headless / CI gate

The audit can gate a build from the command line, failing a pipeline the same way a broken test does:

Unity -batchmode -quit -projectPath <path> ^
      -executeMethod ZionDependencyGraph.Editor.Addressables.AddressablesAuditCI.RunAndFailIfOverThreshold ^
      -zionWastedBytesThreshold 1048576 ^
      -zionAuditExportPath report.json

Line continuations above are Windows shell form - use \ instead on macOS and Linux, or put it all on one line.

  • -zionWastedBytesThreshold - exits non-zero when total wasted bytes exceed this figure (bytes; the example is 1 MB)
  • -zionAuditExportPath - optional. End the path in .csv for a CSV report, anything else for JSON

The method deliberately has no menu item, because it can quit the Editor, and it only ever calls EditorApplication.Exit when actually running in batch mode - run it interactively and it just logs the result to the Console.

Honest limit - the wasted-bytes figures are uncompressed serialised bytes, derived from source file length, not the compressed size a real build produces. Treat them as a reliable relative measure of what is duplicated and what it is worth fixing first, not as an exact install-size promise. A build-accurate number would require reconciling against that build's own buildlayout.json, which this version does not do.
Continue to Safe Delete.