Features/correctness iteration#2
Merged
Merged
Conversation
Extend the snapshot exporter to compute and validate the Unity Memory Profiler "Summary" page numbers, and add supporting snapshot decoding, reporting, and batch tooling. Summary metrics - SummaryMetricsCalculator replicates EntriesMemoryMap (build/sort/post-process), GetPointType classification, and the AllMemory/Managed summary builder heuristics (legacy untracked fallback, graphics estimation, map-resolved VM-root reassignment). - Export the Allocated Memory Distribution and Managed Heap Utilization breakdowns plus totals to a new summary_metrics table (DuckDB + SQLite). Golden validation - GoldenValidationRunner compares an exported DB against golden JSON (AssetBundle/SerializedFile/Remapper plus all summary categories), with committed/resident tolerances and a CLI `validate` command. - Add the com.unity.memory-snapshot-data-tools Unity package, whose editor GoldenValueExtractor reads golden values straight from the Memory Profiler's own summary model builders. - scripts/validate-golden.sh exports + validates in one step for CI. Snapshot decoding fixes/additions - Correct ProfileTarget_Info/_MemoryStats entry IDs (59/60, not 64/65) so TargetMemoryStats decodes; read SystemMemoryRegions_Type as ushort so Mapped/Device regions classify correctly. - Decode managed heap section types, target memory stats, and per-type static field bytes; crawl static-field roots so statically reachable managed objects are discovered. - Add SnapMetadataReader, SnapProfileTargetInfoParser, CaptureMetadata, ResidentMemoryCalculator, and MemoryMapResidentAggregator. Reports, batch export, CLI, docs - Multi-snapshot HTML report (builder, renderer, session grouping). - BatchExportRunner/ExportRunner and batch-export CLI command. - Document the .snap binary format (docs/snap-file-format.md); update the report skill and mkdocs nav. - Tests for golden validation, summary metrics, resident memory, batch export, and session grouping. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Print a MemoryProfiler-style memory summary for a snapshot or an exported database directly to the console, without generating a database.
- `summary <input>` accepts a .snap snapshot or a .duckdb/.db database. Snapshots run the same extraction pipeline as export/validate (SnapshotBridge) and read the computed SummaryMetrics; databases read the snapshot_info and summary_metrics tables via the golden-validation queries.
- SummaryReportFormatter renders capture metadata, Total Allocated/Resident, and the Allocated Memory Distribution + Managed Heap Utilization breakdowns as aligned text ("—" where resident size is unavailable).
- Always reports progress and total duration (not just under --verbose); snapshot decode progress is surfaced via a forcing progress wrapper.
- When a database predates summary_metrics, print a runnable re-export example using the snapshot path recorded in snapshot_info.
- Tests for the formatter (metadata/totals/breakdowns, unavailable resident, missing-summary notice).
Also fill in docs/intro.md with the project description and support contact.
Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Add golden validation and MemoryProfiler summary-page metrics.
Extend the snapshot exporter to compute and validate the Unity Memory Profiler "Summary" page numbers, and add supporting snapshot decoding, reporting, and batch tooling.
Summary metrics
Golden validation
validatecommand.Snapshot decoding fixes/additions
Reports, batch export, CLI, docs
Add summary CLI command for high-level memory reports
Print a MemoryProfiler-style memory summary for a snapshot or an exported database directly to the console, without generating a database.
summary <input>accepts a .snap snapshot or a .duckdb/.db database. Snapshots run the same extraction pipeline as export/validate (SnapshotBridge) and read the computed SummaryMetrics; databases read the snapshot_info and summary_metrics tables via the golden-validation queries.Also fill in docs/intro.md with the project description and support contact.
Co-Authored-By: Claude Opus 4.8 (1M context) noreply@anthropic.com