Keep FPS reports usable for short or idle runs #8

Manually merged
github merged 1 commit from github-bot/gh-8 into main 2026-11-27 12:40:50 +00:00 AGit
Owner

@⁠civilwarinfrance on GitHub · 2026-11-27 01:46 UTC · original
civilwarinfrance:fix/fps-report-short-logs → main · +86 −14 · 2 files · 1 commits · merged 2026-11-27 12:32 UTC

Changes

Short or idle VIctory logs can make tools/fps-report.py exit with a division-by-zero error, leaving only part of the report. Keep the report available when the frame counter stays flat, the wait samples cover no elapsed time, or there are zero memory refreshes. Omit the corresponding derived rates when they cannot be calculated.

The aggregate wait rate now counts only waits from the intervals covered by the reported duration. For example, a log with 99, 10 and 20 waits at 0, 1 and 3 seconds now reports 30 waits over 3 seconds. VIctory resets the counters after each sample.

Verification

  • python3 -m unittest discover -s tests -v passed all five tests using synthetic logs. The original script crashed on the four edge-case inputs and overstated the wait rate in the timed example.
  • git diff --check passed. This changes the report script only. No game or runtime testing was needed.

AI assistance: OpenAI Codex wrote the patch and ran the tests.

**@⁠civilwarinfrance** on GitHub · 2026-11-27 01:46 UTC · [original](https://github.com/paveledits/ScarlettMac/pull/8) `civilwarinfrance:fix/fps-report-short-logs` → `main` · +86 −14 · 2 files · 1 commits · merged 2026-11-27 12:32 UTC ## Changes Short or idle VIctory logs can make `tools/fps-report.py` exit with a division-by-zero error, leaving only part of the report. Keep the report available when the frame counter stays flat, the wait samples cover no elapsed time, or there are zero memory refreshes. Omit the corresponding derived rates when they cannot be calculated. The aggregate wait rate now counts only waits from the intervals covered by the reported duration. For example, a log with 99, 10 and 20 waits at 0, 1 and 3 seconds now reports 30 waits over 3 seconds. VIctory resets the counters [after each sample](https://github.com/pragyaangaur/VIctory-macOS/blob/965b3cf/crates/victory-gpu/src/frame.rs#L210-L215). ## Verification - `python3 -m unittest discover -s tests -v` passed all five tests using synthetic logs. The original script crashed on the four edge-case inputs and overstated the wait rate in the timed example. - `git diff --check` passed. This changes the report script only. No game or runtime testing was needed. AI assistance: OpenAI Codex wrote the patch and ran the tests.
github-bot locked as GitHub sync and limited conversation to collaborators 2026-11-27 02:12:57 +00:00
github manually merged commit 4f29ddd144 into main 2026-11-27 12:40:50 +00:00
This discussion has been locked. Commenting is limited to contributors.
No description provided.