1---2name: ue5-performance-packaging3description: UE5.6/UE5.7 performance and packaging readiness workflow. Use when requests involve PIE performance checks, runtime stat review, pre-package validation, build configuration sanity, and release readiness checklists.4---56# Quick Start7- Confirm target platform and build configuration.8- Collect current performance symptoms and packaging goal.9- Output a pre-package checklist plus measurement plan.1011# UE5.7 API Anchors12- Runtime quality and frame-budget anchors:13 - `UGameUserSettings::SetOverallScalabilityLevel(...)`14 - `UGameUserSettings::SetFrameRateLimit(...)`15 - `UGameUserSettings::ApplySettings(...)`16- Packaging settings anchors:17 - `UProjectPackagingSettings`18 - `BuildConfiguration`, `MapsToCook`, `DirectoriesToAlwaysCook`19 - `UsePakFile`, `bUseIoStore`, `bGenerateChunks`20- Asset dependency validation anchors:21 - `FAssetRegistryModule`, `IAssetRegistry`22 - `GetAssetsByPath(...)`23 - `GetDependencies(...)`, `GetReferencers(...)`24- Profiling instrumentation anchors:25 - `TRACE_CPUPROFILER_EVENT_SCOPE(...)`26 - `DECLARE_CYCLE_STAT(...)`27- Practical runtime stat commands:28 - `stat unit`, `stat gpu`, `stat scenerendering`, `memreport -full`2930# Performance and Packaging Contract31- Every performance/packaging task must define:32 - target platform + build config + test map33 - reproducible capture scenario (camera path, duration, net mode)34 - baseline metrics and acceptance thresholds35 - packaging configuration set and dependency scan scope36 - go/no-go output with explicit blockers37- If any item is missing, readiness evaluation is incomplete.3839# Workflow40## 1) Reproducible Baseline Capture41- Freeze test map, camera path, scalability, and net mode.42- Capture `stat unit` and `stat gpu` under same scenario repeatedly.43- Use median or percentile metrics, not single-frame spikes.4445## 2) Hotspot Isolation46- Identify top-cost gameplay/render systems in the capture window.47- Correlate high-cost actors/assets with scene context.48- Add scoped CPU markers for custom systems when attribution is unclear.4950## 3) Asset and Dependency Validation51- Scan target paths for missing or broken asset references.52- Query dependencies and referencers for problematic assets.53- Validate required map/game mode assets are included in package scope.5455## 4) Packaging Configuration Validation56- Check `UProjectPackagingSettings` fields for target release policy.57- Validate maps-to-cook, always-cook directories, and build configuration.58- Validate Pak/IoStore/chunk strategy against distribution requirements.5960## 5) Package Readiness Trial61- Run pre-package checklist and dry-run style verification.62- Isolate first blocking packaging error and dependency chain.63- Record unresolved blockers with owner and risk.6465## 6) Go/No-Go Decision66- Approve only when metrics and packaging checks meet thresholds.67- Report remaining risks and recommended mitigation actions.68- Lock scenario and settings used for sign-off evidence.6970# Constraints71- Do not claim optimization wins without measurable before/after data.72- Keep profiling scenario reproducible (map, camera path, net mode).73- Distinguish editor overhead from packaged runtime behavior.74- Avoid changing quality scalability settings without reporting it.75- Keep packaging checks deterministic; avoid ad-hoc config toggles during sign-off.76- Always report metric units (ms, fps, memory) and capture duration.7778# Failure Handling79- Symptom: performance data is noisy across runs.80 - Locate: non-deterministic scenario setup and background variance.81 - Fix: lock scenario, warm up run, and compare median/percentile values.82- Symptom: optimization claims do not reproduce.83 - Locate: mismatched quality settings, map, or runtime mode.84 - Fix: publish exact capture config and rerun before/after under same conditions.85- Symptom: package build fails with long error cascade.86 - Locate: first blocking error and its direct dependency chain.87 - Fix: resolve earliest blocker first; rerun to reveal next blockers.88- Symptom: packaged build launches with missing assets.89 - Locate: cook list coverage and dependency graph gaps.90 - Fix: include missing maps/directories and resolve broken references.91- Symptom: packaged build perf is worse than PIE baseline.92 - Locate: packaged-only config differences and runtime content path.93 - Fix: compare packaged config to baseline and align scalability/device settings.94- Symptom: memory usage regresses near content-heavy scenes.95 - Locate: high-memory assets and streaming policy behavior.96 - Fix: reduce resident asset pressure and adjust streaming/cook strategy.9798# Packaging Ops99- Prefer explicit map/cook lists over implicit discovery for release builds.100- Use AssetRegistry queries to validate dependencies before packaging.101- Keep one source of truth for release packaging settings per target profile.102- Re-run readiness checks after any packaging setting change.103104# UE5.6 / UE5.7 Compatibility Notes105- `UGameUserSettings`, `UProjectPackagingSettings`, and AssetRegistry APIs above are stable in UE5.6/UE5.7.106- `ProjectPackagingSettings.h` lives under `Developer/DeveloperToolSettings` in both versions.107108# Escalation109- Escalate when performance bottleneck requires engine-level profiling or renderer changes.110- Escalate when packaging issues stem from third-party plugin build failures.