Repository navigation
Main gets work time without the audio thread wait, benchmark tools that skip diagnostic files and the real menu names in the docs - #38
Merged
Conversation
With frameskip set to manual or none, synchronize_sound sleeps until the audio thread takes a block, and nothing recorded that sleep, so a paced capture counted it in work-time, frames-work-over-budget and phase-main-update-gba-us. The sleep now goes into the frame's waits as its own site, which no VBlank wait counter shows.
Every diagnostic build writes perf-<time>-alloc.txt beside each report, so --baseline-dir and --candidate-dir on a diagnostic build's folder, as the padding experiment asks, stopped on that file as a report that is not stopped. The files that are no report are now one list.
A -core.txt or -alloc.txt beside an archived report passed check-tree and compare-benchmarks but stopped perf-table.py --update as a report that is not stopped. perf-table now reads the same list of files that are no report.
The measurement steps sent testers to Diagnostics > Start measurement, a row that does not exist: it is Start recording, then Stop recording and Save report. The changelog's restore item is under Link Cable.
PRF-4.1 and the F-120 hash code are in main, so PRF-1.5 waits only on CMP-1.4. PRF-3.2 and PRF-3.3 are partial, not code complete: the bench hashes nothing, so their same-state acceptance waits for the end of bench hash of the replay-oracle review fix. PRF-3.1's hardware run also checks that the bench does not switch the Media Engine off, and the notes of PRF-2.1 and PRF-10.1 name this round's fixes.
The PRF-3.2 and PRF-3.3 notes now say that only F-120's hash code is in main, with ENG-3.3 still waiting for the PSP, and that the end-of-bench hash is written in wip/replay-oracle. The PRF-3.1 note says to start the benchmark right after the EBOOT starts, since the quit counters count from there, and the PRF-2.1 note names the clock read sound.c now takes.
CONTRIBUTING.md: both sides listed the two Unbound benchmark rows of the diagnostic profile. Keep this branch's wording, which follows the real row names, and main's pointer to docs/PERFORMANCE.md.
redcode9
merged commit Nov 16, 2026
247c8f2
into
features/state-of-the-art-development/main
8 checks passed
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.
Review-fix round for
wip/perf-method. The branch was fast-forwarded to main 391f5e9 first, so this PR holds nine commits after it: one PSP code change insource/src/sound.cwith itsperf_metricschange and host test, two script fixes with their tests, and six docs commits. The report format does not change: no key is added or removed.What was wrong and what changed:
synchronize_sound()sleeps in 100 us steps until the audio thread takes a block. That sleep falls inside the frame time, but only recorded waits are taken out of it, and this one was never recorded. So in paced captures with manual or no frameskip, work-time p50/p95/p99, frames-work-over-budget andphase-main-update-gba-usheld the audio wait, and an audio pacing difference could look like a CPU regression incompare-benchmarks' work-p95 gate. Captures with auto frameskip and the unbound benchmark were not affected.perf_metrics.hgets a last wait site,PERF_METRICS_WAIT_AUDIO_DRAIN.perf_metrics_record_waitadds it only to the frame's waits: no VBlank count or total, and the backpressure flag is untouched, so late frames do not change.synchronize_sound()sets a flag before each sleep. After the loop, while a capture runs, it records the time sincestartedunder the new site.startedis taken after the auto frameskip's VBlank wait, so nothing is counted twice, and a drain right after that wait is covered too.sceKernelGetSystemTimeWideread insound.c, only during a capture and only on frames where the loop slept. With no capture running, the game pays only one extra check, on frames where the loop slept.docs/PERFORMANCE.mdnow lists the sound sync's wait for the audio thread among the waits thatphase-main-update-gba-usleaves out.tests/test_perf_metrics.cgetstest_audio_drain_leaves_work_only: work is the frame minus the audio VBlank wait, the drain and the GE wait; only the VBlank wait is counted at its site; backpressure and present counts stay 0; the frame still counts as late.compare-benchmarksfailed on the-alloc.txtfiles every diagnostic build writes beside its reports (e421190).main_perf_write_alloc_tracewrites one next to every report in a diagnostic build, and the padding experiment (PRF-10.1) needs that profile.collect_groupsskipped only.mdand-core.txt, so--baseline-dir/--candidate-diron a copied diagnosticbenchmarks/folder stopped with "benchmark is not stopped", and the experiment could give no verdict. A newNOT_REPORTSconstant (.md,-core.txt,-alloc.txt) is whatcollect_groupsnow skips.release_gate.pyreads groups throughcollect_groups, so it gets the same fix.tests/test_compare_benchmarks.pywrites arun-0-alloc.txtin the real format beside the-core.txtcase and checks the group still has 3 reports.perf-table.pydid not skip whatcompare-benchmarksskips (692c272).perf-table.collectskipped only.md, so a-core.txtor-alloc.txtbeside an archived report madeperf-table.py --updatefail with "invalid report line", whilecheck-tree.shandcompare-benchmarksaccepted the same archive. It now skipscompare_benchmarks.NOT_REPORTS.test_empty_archiveintests/test_perf_table.pyalso writesrun-1-core.txtandrun-1-alloc.txtand still gets "No reports archived yet.".message_eng.h:1160-1164).benchmarks/README.md,docs/PERFORMANCE.md,README.md, theperf-baseline-5steps indocs/hardware-tests.mdand a comment intests/test_perf_video_sentinel.cnow use those names.perf-baseline-5gives the steps for the reports the stable release gate compares. TheREADME.mdanddocs/hardware-tests.mdlines were older than this branch. No tracked file says "Start measurement" any more.MSG_CATEGORY_LINK_CABLE). "Link > Restore pre-link save" and "the Link menu says why", both in the Unreleased save-store items, now say Link Cable, rewrapped to 76 columns.CONTRIBUTING.md's list of what the diagnostic profile adds left out the two Unbound benchmark rows (bc79c4f).build_profile.hswitches them on withENABLE_DIAGNOSTIC_BENCH_ARMS, and they also shift the Diagnostics row numbers. The list now names the rows with rendering off and with audio off.input_diagnostic_trace_begin_benchininput.cfrees the replay hashes, the perf report has no hash key, and the game goes back to paced play when the bench ends, so the end state cannot be captured afterwards. A hardware session on these tickets would have wasted console time. Both notes now read «in parte» and say:bench-state-hash) is commit bcf3657 onwip/replay-oracleand reaches main with that branch's review-fix PR;Round 1 wrote that F-120 was in main and that the hash would come with the replay-oracle PR before any branch had the code. c092e2a corrects the F-120 wording, and bcf3657 now exists.
wip/platform), in main since cf5ef4f. PRF-1.5 now waits only for CMP-1.4, with «PRF-4.1 è in main (cf5ef4f)». ENG-3.2 for PRF-1.7, in the header and on PRF-1.7's line, now says it is in main since 2ff83ab but not yet proven on PSP. A second finding reported the same PRF-4.1 wait, and cfc59fe fixes it too.video_me.c), Exact moves to the main CPU until the EBOOT restarts, and the report writes onlyrenderer. Whether this ever happens depends on PSP timing nobody has measured, so the code is unchanged.python3 tools/decode_runtime_log.py. Look forexact-renderer=cpu-too-slowinstead ofmedia-engine, and for late frames in the second value ofme-frames/frames-late/me-busy-us-per-frame(LINK_COUNTERS groups 11 and 9, written at quit and counted from the EBOOT start, so group 9 then holds almost only the bench's frames).docs/PERFORMANCE.md's "every frame is drawn" now adds that with Exact on the Media Engine, a frame the Media Engine has not finished in time shows the previous one again and counts as late.Tickets whose status changed:
bench-state-hashin main, then their PSP run. Checkboxes stay empty.wip/open-bios). It also still waits for PRF-2.3 (decision (m)) and a hardware session. Checkbox stays empty.sound.cshows in this PR's CI. Its acceptance limits clock reads only inmain.candpsp_video.c, andcheck-performance.shstill passes.-alloc.txtfiles since e421190.docs/BACKLOG.mddoes not change.Tests on this host (clang with the freestanding host shim, UBSan in trap mode):
test_perf_metrics,test_perf_monitorandtest_perf_report, built with-std=c99 -Wall -Wextra -Werror: pass, plain and with UBSan. The fixer ran them after 25cd5a1 and at cfc59fe, and rerantest_perf_metricsat db52e1a. The reviewer ran all three from agit archivecopy in both rounds.perf_metrics.ccase: dropping the case, counting the drain as a VBlank audio wait, setting the backpressure flag and adding nothing.test_audio_drain_leaves_work_onlycatches all four, plain and with UBSan. Before this PR no test covered the drain.python -m unittestoftest_compare_benchmarks.py,test_perf_table.py,test_release_gate.pyandtest_hardware_session.pyat cfc59fe: 102 tests OK. One test was skipped because it needs zip and unzip. At db52e1a,test_compare_benchmarks.pyandtest_perf_table.py: 49 tests OK.compare-benchmarkswithout-alloc.txtand without-core.txt, andperf-tableback to.mdonly, without-core.txtand without-alloc.txt. The tests catch all five.python scripts/hardware-session.py --check: passes, with 29 tests in the catalogue and 18 valid result rows.PYTHON=python:check-tree.shpasses. It covers messages, menu layout, lifecycle, video, performance, script syntax, forbidden names, module tests and the source tree.check-performance.sh,check-scripts.sh,check-messages.sh,check-menu-layout.sh,check-lifecycle.shandcheck-video.shpass on their own too.synchronize_sound()out and compiled it against stubs with the PSP warning flags plus-Wextra -Wmissing-prototypes -Werror. It compiles cleanly. This is not a psp-gcc build.git diff --check 391f5e9..HEADis clean. Every changed file is LF, no message table changed, the forbidden-name check passes, and the commit messages carry no attribution lines.git merge-treeof HEAD with everywip/branch based on 391f5e9 merges cleanly, exceptwip/release-and-ci(see below).test_perf_metrics.c, which is already inHOST_TESTSandHOST_SANITIZE_TESTS. The Python files are already on the unittest line ofmake check.make check,make test-sanitize,make check-cbmcand both PSP builds on this PR.Not verified here:
sound.c, which is built with-Werror. This machine has no PSPDev. Fixer and reviewer each read the change: the flag is declared and used, the enum comes in throughperf_monitor.h, and the u64 difference is cast to u32 as in the code around it. CI has to confirm it.make check,make test-sanitizewith gcc and ASan, andmake check-cbmc: this machine has no make or gcc.tests/test_perf_video_sentinel.cwas not rebuilt, because it needs the PSP SDK headers. Only a comment changed there.wip/replay-oraclebranch. This round did not build it or run its tests. The PRF-3.2 and PRF-3.3 notes assume it reaches main with that branch's review-fix PR.Files of other branches touched (rule 5):
source/src/sound.c(wip/audio): insynchronize_sound(), one local flag and one guardedperf_monitor_record_waitafter the drain loop.docs/hardware-tests.md, the shared hardware test catalogue thatwip/release-and-cistarted: one word in theperf-baseline-5steps.CHANGELOG.md(shared): the two save-store Unreleased lines about the pre-link copy, rewrapped.wip/save-store's review-fix PR (a59a3e4) makes the same change with the same text, so the two merge cleanly in either order.CONTRIBUTING.md(shared): the diagnostic profile list.wip/release-and-ci's review-fix branch (0c1440e) adds the same two benchmark rows to the same sentence, in other words, andgit merge-treereports a conflict there. Whichever PR merges second keeps one mention of the rows.README.md(wip/docs): the Performance comparison steps.docs/PERFORMANCE.md,benchmarks/README.mdandtests/test_perf_video_sentinel.care this branch's own.wip/replay-oracleandwip/ui-foundationalso changedocs/PERFORMANCE.mdin their review-fix branches, and both merge cleanly with this one.Skipped, with the reason:
wip/replay-oracle(bcf3657).sound.chas never been built for the PSP. If either profile fails onsound.c, untick PRF-2.1 and mark it «in parte» until it is fixed.bench-state-hashwithout «senza la regione audio», which PRF-3.2's note gives. The hash leaves out the audio samples, so it is weaker than a full F-120 hash, and whoever ticks PRF-3.3 should know. The fix is to add those words to PRF-3.3's parenthetical.docs/PERFORMANCE.mdonly as far as "waits for audio. The game gets no input. The capture then", which leaves a 57-column line before the old lines. It renders the same in Markdown.CHANGELOG.mdentry for the work-time fix: work time is new since 1.4.3, and its Unreleased entry already says "work time without the waits".The branch stays open, so
docs/wip/perf-method.mdstays.