Add an optional stage breakdown to the scene timing summary #21

Open
HandshakeHackin wants to merge 81 commits from upstream-pr/21 into main
HandshakeHackin commented 2026-11-25 16:57:27 +00:00 (Migrated from github.com)

Imported from PastiiJay/klbf-lab. Originally posted by HandshakeHackin on 2026-11-25T16:57:27Z.


The Proton report in #19 compares texture preparation, GPU time, copy-back time and dropped draws for individual samples. --breakdown extracts those counters and copy preparation from existing host timing lines over the selected scene. It reports the median of each counter and the number of complete records. Older or partial records still contribute to the top-level host summary.

I checked five captured timing lines from fxceless/victory-fork#26 and fxceless/victory-fork#148. For the RTX 5060 Ti sample, the new line returned 46.7 ms preparing copies, 6.5 ms preparing textures, 121.5 ms on the GPU and 31.9 ms copying back, with 4,030 draws and 443 dropped. Default output matched the original byte-for-byte on both excerpts. I also checked UTF-16 PowerShell output, ANSI colors, inclusive line ranges and a truncated timing line.

python docs/klbf/summarize_log.py run.log --lines 1200 2500 --breakdown

<!-- greyfinch-sync:PastiiJay/klbf-lab:issue:5495563094 --> Imported from [PastiiJay/klbf-lab](https://github.com/PastiiJay/klbf-lab/pull/21). Originally posted by [HandshakeHackin](https://github.com/HandshakeHackin) on 2026-11-25T16:57:27Z. --- The Proton report in #19 compares texture preparation, GPU time, copy-back time and dropped draws for individual samples. `--breakdown` extracts those counters and copy preparation from existing host timing lines over the selected scene. It reports the median of each counter and the number of complete records. Older or partial records still contribute to the top-level host summary. I checked five captured timing lines from fxceless/victory-fork#26 and fxceless/victory-fork#148. For the RTX 5060 Ti sample, the new line returned 46.7 ms preparing copies, 6.5 ms preparing textures, 121.5 ms on the GPU and 31.9 ms copying back, with 4,030 draws and 443 dropped. Default output matched the original byte-for-byte on both excerpts. I also checked UTF-16 PowerShell output, ANSI colors, inclusive line ranges and a truncated timing line. `python docs/klbf/summarize_log.py run.log --lines 1200 2500 --breakdown`
PastiiJay commented 2026-11-25 17:02:42 +00:00 (Migrated from github.com)

Imported from PastiiJay/klbf-lab. Originally posted by PastiiJay on 2026-11-25T17:02:42Z.


Thanks a lot @HandshakeHackin! Noted. I'll test it on the RX 9070 XT in the next test build and report back here.

<!-- greyfinch-sync:PastiiJay/klbf-lab:comment:7168918182 --> Imported from [PastiiJay/klbf-lab](https://github.com/PastiiJay/klbf-lab/pull/21#issuecomment-7168918182). Originally posted by [PastiiJay](https://github.com/PastiiJay) on 2026-11-25T17:02:42Z. --- Thanks a lot @HandshakeHackin! Noted. I'll test it on the RX 9070 XT in the next test build and report back here.
HandshakeHackin commented 2026-11-26 05:07:12 +00:00 (Migrated from github.com)

Imported from PastiiJay/klbf-lab. Originally posted by HandshakeHackin on 2026-11-26T05:07:12Z.


I found a case in #31 where the existing command reported zero timing samples. PowerShell wrapped each timestamped entry between the CPU value and preparing:. At b13635f the tool reconstructs those entries inside the selected physical line range. The attached UTF-16 debug log now yields 37 complete host samples and 37 stage breakdowns. The unwrapped #55 log still gives the same 86 samples and medians.

For a small check on #31, --lines 2767 2769 --breakdown returns one sample at 30.7 FPS, 32.5 ms/frame, and 1.3 ms of CPU preparation. A range ending at line 2767 contains only the incomplete header. Windows and Linux checks passed across 41 single-wrap positions, four encodings, and record/range boundaries. Original #31 log · Windows and Linux checks

<!-- greyfinch-sync:PastiiJay/klbf-lab:comment:7183197464 --> Imported from [PastiiJay/klbf-lab](https://github.com/PastiiJay/klbf-lab/pull/21#issuecomment-7183197464). Originally posted by [HandshakeHackin](https://github.com/HandshakeHackin) on 2026-11-26T05:07:12Z. --- I found a case in #31 where the existing command reported zero timing samples. PowerShell wrapped each timestamped entry between the CPU value and `preparing:`. At `b13635f` the tool reconstructs those entries inside the selected physical line range. The attached UTF-16 debug log now yields 37 complete host samples and 37 stage breakdowns. The unwrapped #55 log still gives the same 86 samples and medians. For a small check on #31, `--lines 2767 2769 --breakdown` returns one sample at 30.7 FPS, 32.5 ms/frame, and 1.3 ms of CPU preparation. A range ending at line 2767 contains only the incomplete header. Windows and Linux checks passed across 41 single-wrap positions, four encodings, and record/range boundaries. [Original #31 log](https://github.com/user-attachments/files/35434357/run.log) · [Windows and Linux checks](https://github.com/HandshakeHackin/klbf-lab/actions/runs/45759334277)
PastiiJay commented 2026-11-26 10:42:41 +00:00 (Migrated from github.com)

Imported from PastiiJay/klbf-lab. Originally posted by PastiiJay on 2026-11-26T10:42:41Z.


Thanks, recovering those wrapped PowerShell lines makes old logs usable again. We'll use it on our next run.

<!-- greyfinch-sync:PastiiJay/klbf-lab:comment:7189730772 --> Imported from [PastiiJay/klbf-lab](https://github.com/PastiiJay/klbf-lab/pull/21#issuecomment-7189730772). Originally posted by [PastiiJay](https://github.com/PastiiJay) on 2026-11-26T10:42:41Z. --- Thanks, recovering those wrapped PowerShell lines makes old logs usable again. We'll use it on our next run.
HandshakeHackin commented 2026-12-01 13:58:48 +00:00 (Migrated from github.com)

Imported from PastiiJay/klbf-lab. Originally posted by HandshakeHackin on 2026-12-01T13:58:48Z.


--breakdown now includes submission refresh time, flushes, spans and the median per-sample cost per span, for the scene comparison in #425. I checked it against two real v26.12.1 logs from #427. In the 60-second windows ending 10 seconds before each log ended, the script parsed 57 and 58 refresh records, plus 12 host timing samples in each.

To reproduce from that issue’s ZIP: use --lines 37927 41811 --breakdown on the 16-03-14 log and --lines 42606 46654 --breakdown on 16-17-46. Their median costs were 0.00210 and 0.00192 ms per logged span. Fixed three-decimal output rounded both to 0.002, so the script now keeps three significant digits. All four parser tests passed. These two windows verify the parser on real logs; they cover different gameplay workloads. Code and regression test

<!-- greyfinch-sync:PastiiJay/klbf-lab:comment:7313497181 --> Imported from [PastiiJay/klbf-lab](https://github.com/PastiiJay/klbf-lab/pull/21#issuecomment-7313497181). Originally posted by [HandshakeHackin](https://github.com/HandshakeHackin) on 2026-12-01T13:58:48Z. --- `--breakdown` now includes submission refresh time, flushes, spans and the median per-sample cost per span, for the scene comparison in #425. I checked it against two real v26.12.1 logs from #427. In the 60-second windows ending 10 seconds before each log ended, the script parsed 57 and 58 refresh records, plus 12 host timing samples in each. To reproduce from that issue’s ZIP: use `--lines 37927 41811 --breakdown` on the `16-03-14` log and `--lines 42606 46654 --breakdown` on `16-17-46`. Their median costs were 0.00210 and 0.00192 ms per logged span. Fixed three-decimal output rounded both to 0.002, so the script now keeps three significant digits. All four parser tests passed. These two windows verify the parser on real logs; they cover different gameplay workloads. [Code and regression test](https://github.com/HandshakeHackin/klbf-lab/commit/2f1d22c0c7f7f08814a445adcb02233b8fce5fd0)
This pull request cannot be merged automatically due to conflicts.
Merge manually to resolve the conflicts.
View command line instructions

Checkout

From your project repository, check out a new branch and test the changes.
git fetch -u origin 'upstream-pr/21:upstream-pr/21'
git switch 'upstream-pr/21'

Merge

Merge the changes and update on Forgejo.

Warning: The "Autodetect manual merge" setting is not enabled for this repository, you will have to mark this pull request as manually merged afterwards.

git switch 'main'
git merge --no-ff 'upstream-pr/21'
git switch 'upstream-pr/21'
git rebase 'main'
git switch 'main'
git merge --ff-only 'upstream-pr/21'
git switch 'upstream-pr/21'
git rebase 'main'
git switch 'main'
git merge --no-ff 'upstream-pr/21'
git switch 'main'
git merge --squash 'upstream-pr/21'
git switch 'main'
git merge --ff-only 'upstream-pr/21'
git switch 'main'
git merge 'upstream-pr/21'
git push origin 'main'
Sign in to join this conversation.
No reviewers
No labels
No milestone
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Reference
PastiiJay/klbf-lab!21
No description provided.