Repository navigation
profile: print the per-frame decomposition in the profile report - #5045
Merged
Merged
Conversation
A profile report held per-system CPU totals, the GPU frame timing and the frame-time line in separate sections, so every reader summed them by hand and an unsummed term stayed invisible. The new "Frame decomposition" section splits the mean recorded frame into INPUT/UPDATE/RENDER system CPU, GPU (the command-buffer spans mean, not the envelope, which also counts inter-submission gaps), offscreen pacing and a remainder, each in ms per frame and as a share of the mean. Rows are computed in whole thousandths so they add up to the printed frame mean exactly; a negative remainder prints as it is, and an unavailable GPU timing is marked with the remainder labelled as including GPU time. The pacer's sample name moves into profile_report.hpp so the report and the Metal pacer share one constant. compare_perf_runs.py parses the section (absent reads None, never zeros) and repeat_profile.py lists each row in summary.md. Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
jakildev
commented
Nov 12, 2026
jakildev
left a comment
Owner
Author
There was a problem hiding this comment.
Review — profile: print the per-frame decomposition in the profile report
Verdict: approve
The decomposition is derived from the same recorded-frame window as the report's frame mean and per-system totals. It uses commandBufferSpans rather than the envelope, preserves unavailable-GPU and negative-remainder semantics, and closes the printed rows at millisecond precision. The parser keeps old reports distinguishable from zero-valued splits, and the summary omits unavailable terms without inventing values.
Acceptance (issue #4951)
| Criterion | Grade | Evidence |
|---|---|---|
| 1. Profile-report unit tests | Met | Seven focused decomposition cases cover expected values, printed-precision closure, unavailable/invalid GPU timing, missing pacing, and negative remainder. |
| 2. Parser compatibility | Met | Old reports remain None; new rows, unavailable GPU semantics, and writer-string pins are covered. |
| 3. Native positive-fire | Met | The submitted Metal Release runs both report RESULT=CLEAN; the million-control values agree with their source sections and the 16-cubed scene records pacing above the required threshold. |
| 4. Cross-run summary | Met | Tests cover each split term's mean/range, old-report omission, and unavailable-GPU labeling. |
| 5. Lint and formatting | Met | Local focused Python lint passes; GitHub's Python lint and format checks are green. |
| 6. Documentation | Met | The README documents the denominator, terms, spans choice, remainder, unavailable GPU behavior, and summary rows. |
Validation
fleet-build --target IrredenEngineTest— passed (terminal detached job exit 0).fleet-run IrredenEngineTest --gtest_filter='ProfileReport*'— 17/17 passed.python3 scripts/perf/test_profile_parser.py— 29/29 passed.python3 scripts/perf/test_repeat_profile.py— 61/61 passed.ruff checkon the four changed Python files — passed.- GitHub's fleet, Linux build, perf-gate, and render-harness jobs were still pending at review time; they are not reported as green here.
Praise
- Converting every contribution to printed thousandths before calculating the remainder makes the report's closure claim mechanically true instead of merely approximate.
- Moving the pacer phase name into the low-level profile module preserves the dependency direction while eliminating a duplicated protocol string.
🤖 Reviewed by Codex GPT-5 (review-pr skill)
Opus recheck not required (reviewed at opus class).
This was referenced Nov 12, 2026
This was referenced Nov 12, 2026
Open
6 tasks done
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.
Summary
writeProfileReportwrites a--- Frame decomposition ---section: the mean recorded frame split intoINPUT/UPDATE/RENDERsystem CPU,GPU(command-buffer spans mean),Pacing(offscreen pacer sleep) andRemainder, each in ms per frame and as a share of theFrame timemean, closing with aFramerow. Rows are computed in whole thousandths, so the printed rows add up to the printed frame mean exactly.supported=0, or no valid frame) prints theGPUrow asunavailableand marks the remainderincludes GPU time; a missing pacing sample reads 0; a negative remainder prints as it is.IRProfile::kOffscreenPacingPhaseinprofile_report.hpp; the Metal pacer and the report share it (engine/profile/does not depend onengine/render/).compare_perf_runs.pyparses the section intoCellReport.frame_split(Nonefor an older report, never zeros);repeat_profile.pyadds aframe split <term>row per term tosummary.md;scripts/perf/README.mddescribes the section and what the remainder contains.Test plan
fleet-run IrredenEngineTest --gtest_filter='ProfileReport*': 17/17 pass (7 newProfileReportDecompositioncases).python3 scripts/perf/test_profile_parser.py: 29 tests OK;python3 scripts/perf/test_repeat_profile.py: 61 tests OK.ruff check scripts/clean;fleet-build --target format-changedclean;python3 scripts/lint_comment_refs.pyok.IRPerfGridbuilt; both positive-fire runs below exitedRESULT=CLEAN,QUIET=guarded.Acceptance evidence
fleet-run IrredenEngineTest --gtest_filter='ProfileReport*'[ PASSED ] 17 tests.;RowsCarryTheExpectedPerFrameFigures,RowsAddUpToTheFrameMeanAtThePrintedPrecision,UnsupportedGpuTimingMarksTheRowUnavailable,AGpuTimingWithNoValidFrameMarksTheRowUnavailable,AMissingPacingSampleReadsZeroall OKpython3 scripts/perf/test_profile_parser.pyRan 29 tests ... OK;FrameSplitParserTestcovers read, absence (frame_split is None), unavailable GPU and the writer pinpython3 scripts/perf/repeat_profile.py --release --repeats 1 --output <dir>/million-yaw0 -- --wave-freeze --no-overlay --pivot-origin --auto-profile 300 --config-preset configs/perf/million-profiling-off.lua --yaw 0RESULT=CLEAN. Section: UPDATE 11.352, RENDER 7.346, GPU 28.365, Pacing 0.000, Remainder 1.519, Frame 48.592. Per-systemTotal(ms)rows: UPDATE 3405.49/300 = 11.352, RENDER 2203.94/300 = 7.346;commandBufferSpansavg 28.365python3 scripts/perf/repeat_profile.py --release --repeats 1 --output <dir>/grid16 -- --auto-profile 300 --grid-size 16 --zoom 1 --yaw 0 --wave-freeze --no-overlay --pivot-originRESULT=CLEAN.Pacing 2.984 35.44%of an 8.419 ms framepython3 scripts/perf/test_repeat_profile.pyRan 61 tests ... OK;SummaryFrameSplitTest. Real summary.md:| frame split UPDATE | 11.352 | 11.352–11.352 | n/a |for each of six rowsruff check scripts/;fleet-build --target format-changedAll checks passed!; format-changed built with no residual changesscripts/perf/README.md§ "Read where a frame's time went"Plan departures
QUIET=guarded). The criteria are relations between the report's own sections and bounds, which hold.Notes for reviewer
fleet-pr-overlapreportsVERDICT: overlapagainst #5042 (lighting,fleet:wip) onengine/profile/include/irreden/profile/profile_report.hppandengine/profile/src/profile_report.cpp; both trial merges are clean.Closes #4951
🤖 Generated with Claude Code