feat(tools): split the periodic reports of an APS5_AB run by phase #8161

Merged
Celegans12 merged 2 commits from upstream-pr/8161 into main 2026-10-27 08:34:48 +00:00
Celegans12 commented 2026-10-20 00:57:06 +00:00 (Migrated from github.com)

Imported from boykopovar/AnyPS5. Originally posted by Celegans12 on 2026-10-20T00:57:06Z.


What

Stacked on #8160; please review the last commit only.

An APS5_AB run interleaves phases A and B, and each periodic report on stderr covers the time since the previous report of its kind, so the reports have to be sorted by phase before A and B can be compared. tools/ab_split.py <log> does that.

  • It reads the [ab] lines and counts a [present], [gputime], [draw] pipelined or [syncwait] report for a phase only when the previous report of the same kind came after the phase's settled line, so its whole span lies inside one setting.
  • Per phase it prints presents per 10 s and frame time (settled line to the next phase's begin), GPU busy and idle-gap time per frame, GPU time per present (also per --program key and --class), committer time per commit, room wait per draw, drain time and unlocked hook waits per report.
  • For each metric it prints the A and B means and the noise estimate: each B phase against the mean of its neighbouring A phases, which cancels a linear drift, as mean ± standard error (SD, n). --json prints the phases and metrics as JSON.

The A/B numbers in the Tested section of #8160 are this tool's output.

Tested

  • Windows 11, Python 3.14, based on main 4b1a9a3b2f: the new ab_split test (7 cases) passes in ctest (--repeat until-fail:3). It fails on main, where the tool doesn't exist, and with the first report after a settled line counted (its span includes the settle) 3 of the 7 cases fail.
  • On our Yōtei tree it produced every A/B table we used this week, e.g. the owned-proofs run in #8160: presents per 10 s -0.61 ± 0.06, committer busy +4.0 ± 0.6 points over 9 pairs.
  • Linux (WSL, gcc 13.3), CI's job on the merge with current main: ab_split passes with #8160's tests.
  • Not tested: macOS (the relinker matrix runs the test there).

Checklist

  • Based on current main; no other open PR implements the same functions
  • One topic per PR; follow-ups go in a new PR
  • No comments in code except technical debt
  • Unimplemented paths throw (NotImplemented_nid_no_patch); silent stubs are listed under Silent stubs in their library's technical debt file
  • No notes, investigation .md files or images added to the repository (attach them to this PR)
  • New third-party code is a submodule built from source
  • Generic behaviour, not specific to one title
  • Depends on: #8160
  • Fixes: none
  • Unblocks: PPSA26344 #675
  • GPUs tested: n/a
  • AI-assisted: yes
<!-- greyfinch-sync:boykopovar/AnyPS5:issue:4929458133 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/pull/8161). Originally posted by [Celegans12](https://github.com/Celegans12) on 2026-10-20T00:57:06Z. --- ### What Stacked on #8160; please review the last commit only. An `APS5_AB` run interleaves phases A and B, and each periodic report on stderr covers the time since the previous report of its kind, so the reports have to be sorted by phase before A and B can be compared. `tools/ab_split.py <log>` does that. - It reads the `[ab]` lines and counts a `[present]`, `[gputime]`, `[draw] pipelined` or `[syncwait]` report for a phase only when the previous report of the same kind came after the phase's settled line, so its whole span lies inside one setting. - Per phase it prints presents per 10 s and frame time (settled line to the next phase's begin), GPU busy and idle-gap time per frame, GPU time per present (also per `--program` key and `--class`), committer time per commit, room wait per draw, drain time and unlocked hook waits per report. - For each metric it prints the A and B means and the noise estimate: each B phase against the mean of its neighbouring A phases, which cancels a linear drift, as mean ± standard error (SD, n). `--json` prints the phases and metrics as JSON. The A/B numbers in the Tested section of #8160 are this tool's output. ### Tested - Windows 11, Python 3.14, based on `main` 4b1a9a3b2f: the new `ab_split` test (7 cases) passes in ctest (`--repeat until-fail:3`). It fails on `main`, where the tool doesn't exist, and with the first report after a settled line counted (its span includes the settle) 3 of the 7 cases fail. - On our Yōtei tree it produced every A/B table we used this week, e.g. the owned-proofs run in #8160: presents per 10 s -0.61 ± 0.06, committer busy +4.0 ± 0.6 points over 9 pairs. - Linux (WSL, gcc 13.3), CI's job on the merge with current `main`: `ab_split` passes with #8160's tests. - Not tested: macOS (the relinker matrix runs the test there). ### Checklist <!-- Rules behind each item: https://github.com/boykopovar/AnyPS5/blob/main/CONTRIBUTING.md --> - [x] Based on current `main`; no other open PR implements the same functions - [x] One topic per PR; follow-ups go in a new PR - [x] No comments in code except [technical debt](https://github.com/boykopovar/AnyPS5/blob/main/docs/dev/CONVENTIONS.md) - [x] Unimplemented paths throw (`NotImplemented_nid_no_patch`); silent stubs are listed under Silent stubs in their library's [technical debt](https://github.com/boykopovar/AnyPS5/tree/main/docs/dev/debt) file - [x] No notes, investigation `.md` files or images added to the repository (attach them to this PR) - [x] New third-party code is a submodule built from source - [x] Generic behaviour, not specific to one title - [x] Depends on: #8160 - [x] Fixes: none - [x] Unblocks: PPSA26344 #675 - [x] GPUs tested: n/a - [x] AI-assisted: yes
THEMANnt commented 2026-10-25 12:42:59 +00:00 (Migrated from github.com)

Imported from boykopovar/AnyPS5. Originally posted by THEMANnt on 2026-10-25T12:42:59Z.

Review: APPROVED


Reviewed head c3f43a2a308eb85ef27721984c364eb0a56c7755. No actionable findings in this focused A/B tooling and runtime-switch review.

The scheduler validates its runtime-switch allowlist and timing inputs, starts phase A from captured environment settings, and toggles only the listed switch for phase B. Flip integration takes the GPU mutex while applying a step; Recorder reads the atomic switch alongside the existing barrier-merging constraints. The Python reader excludes periodic-report windows spanning a phase/settling boundary and reports per-phase measurements plus neighboring-A comparisons.

Validation: Windows, MinGW GCC 15.2.0/Python 3.11.9: compiled the exact new RuntimeSwitches.cpp with its exact test source; normal and invalid-switch refusal modes both pass. All seven Python ab_split tests pass. Both changed integration units, Recorder.cpp and PacketExecution.cpp, pass syntax checks using pinned project headers with existing third-party/generated dependency includes. Conventions and whitespace pass; the new native/Python CMake registrations were inspected. This older registration CLI does not support --scripts, so no registration-command pass is claimed. Baseline lacks the new Python module; its grafted-test import failure is not a behavioral regression control. Hosted relinker/ASan and policy checks pass; product jobs are skipped.

Scope: Native scheduling/switch tests, integration syntax/source review and synthetic log analysis. No GPU/title run, full driver link or performance improvement was independently measured.

<!-- greyfinch-sync:boykopovar/AnyPS5:review:5643243206 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/pull/8161#pullrequestreview-5643243206). Originally posted by [THEMANnt](https://github.com/THEMANnt) on 2026-10-25T12:42:59Z. **Review:** APPROVED --- Reviewed head `c3f43a2a308eb85ef27721984c364eb0a56c7755`. No actionable findings in this focused A/B tooling and runtime-switch review. The scheduler validates its runtime-switch allowlist and timing inputs, starts phase A from captured environment settings, and toggles only the listed switch for phase B. Flip integration takes the GPU mutex while applying a step; Recorder reads the atomic switch alongside the existing barrier-merging constraints. The Python reader excludes periodic-report windows spanning a phase/settling boundary and reports per-phase measurements plus neighboring-A comparisons. **Validation:** Windows, MinGW GCC 15.2.0/Python 3.11.9: compiled the exact new RuntimeSwitches.cpp with its exact test source; normal and invalid-switch refusal modes both pass. All seven Python ab_split tests pass. Both changed integration units, Recorder.cpp and PacketExecution.cpp, pass syntax checks using pinned project headers with existing third-party/generated dependency includes. Conventions and whitespace pass; the new native/Python CMake registrations were inspected. This older registration CLI does not support --scripts, so no registration-command pass is claimed. Baseline lacks the new Python module; its grafted-test import failure is not a behavioral regression control. Hosted relinker/ASan and policy checks pass; product jobs are skipped. **Scope:** Native scheduling/switch tests, integration syntax/source review and synthetic log analysis. No GPU/title run, full driver link or performance improvement was independently measured.
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
boykopovar/AnyPS5!8161
No description provided.