Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
35 commits
Select commit Hold shift + click to select a range
efa6c5e
fix(tools): preserve native provenance in title runs
Nov 17, 2026
80040dc
test(tools): place provenance cases beside related coverage
Nov 17, 2026
9d3a0f5
fix(tools): retain malformed native summary evidence
Nov 17, 2026
af1ed24
fix(tools): qualify title comparisons with recorded context
Nov 17, 2026
20028d4
chore(tools): refresh native provenance tests onto main
Nov 17, 2026
bf93dd3
chore(tools): retain refreshed provenance history in context comparisons
Nov 17, 2026
c841798
test(tools): integrate current title and recipe coverage
Nov 19, 2026
d775fe7
test(tools): integrate current title and recipe coverage
Nov 19, 2026
ac2e5ba
test(tools): retain updated prerequisite history
Nov 19, 2026
cc28a49
test(tools): provide runtime identity in end-to-end bisect fixture
Nov 19, 2026
dcd0b21
test(tools): retain prerequisite bisect fixture coverage
Nov 19, 2026
606307b
chore(tools): integrate current main
Nov 21, 2026
ce85a04
chore(tools): integrate updated title-run prerequisite
Nov 21, 2026
a173fd1
chore(tools): integrate current main
Nov 22, 2026
94c82b0
chore(tools): integrate updated title-run prerequisite
Nov 22, 2026
f286619
chore(tools): integrate current main without losing run evidence
Nov 22, 2026
78d37c4
chore(tools): integrate current main without losing run evidence
Nov 22, 2026
2d180c4
fix(tools): distinguish damaged summaries from unrelated logs
Nov 22, 2026
daa6cc9
chore(tools): compose refreshed title-run prerequisite
Nov 22, 2026
45ba2ff
fix(tools): scan malformed summary prefixes with a cursor
Nov 22, 2026
34216e7
chore(tools): compose refreshed title-run prerequisite
Nov 22, 2026
ff7f64c
fix(tools): identify summary evidence after bracketed log prefixes
Nov 22, 2026
9c22395
chore(tools): compose refreshed title-run prerequisite
Nov 22, 2026
ee2de2a
test(tools): cover strict summary and provenance integration
Nov 23, 2026
8b80fb0
fix(tools): retain native evidence with strict summary validation
Nov 23, 2026
b363016
fix(tools): retain native evidence with strict summary validation
Nov 23, 2026
f25330b
chore(tools): compose refreshed title-run prerequisite
Nov 23, 2026
cbd0b22
test(tools): preserve telemetry checks with provenance metadata
Nov 23, 2026
36aa069
chore(tools): compose refreshed title-run prerequisite
Nov 23, 2026
8058308
test(tools): isolate summary provenance integration checks
Nov 23, 2026
1aaacce
chore(tools): compose refreshed title-run prerequisite
Nov 23, 2026
da569b3
fix(tools): attribute non-object title summary rows
Nov 23, 2026
200ee3f
test(tools): pin type-aware native trace identities
Nov 27, 2026
3427cec
chore(tools): integrate prerequisite #22260
Nov 29, 2026
5003dc5
chore(tools): merge current main into title comparison context
Nov 29, 2026
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -1040,6 +1040,9 @@ if(BUILD_TESTING)
add_test(NAME title_run_identity COMMAND ${Python3_EXECUTABLE}
${CMAKE_CURRENT_SOURCE_DIR}/tools/tests/test_title_run_identity.py)
set_tests_properties(title_run_identity PROPERTIES TIMEOUT 30)
add_test(NAME title_run_summary_provenance COMMAND ${Python3_EXECUTABLE}
${CMAKE_CURRENT_SOURCE_DIR}/tools/tests/test_title_run_summary_provenance.py)
set_tests_properties(title_run_summary_provenance PROPERTIES TIMEOUT 30)
add_test(NAME performance_compare COMMAND ${Python3_EXECUTABLE}
${CMAKE_CURRENT_SOURCE_DIR}/tools/tests/test_performance_compare.py)
set_tests_properties(performance_compare PROPERTIES TIMEOUT 20)
Expand Down
2 changes: 2 additions & 0 deletions docs/dev/PERFORMANCE_BISECT.md
Original file line number Diff line number Diff line change
Expand Up @@ -53,6 +53,8 @@ The known-good revision must be an earlier commit on the known-bad revision's fi

Each tested revision runs `title_run.py` repeatedly with one measured run per invocation. The median FPS is compared with the good endpoint. A search stops instead of guessing if the bad endpoint is not slow enough, a run fails to render, the machine/title/content identity changes, or sample spread exceeds `max_spread_pct`.

Each sample requires clean native runtime provenance matching the requested commit as well as the clean source checkout. Native trace `commit`/`dirty` and run-report `anyps5.commit`/`modified` are checked together, including all recorded intervals. A missing, unknown, modified or conflicting identity stops the search. Historical title runners that omit native identity cannot provide a qualified sample; their saved metrics remain readable by the title-run comparison.

## Read the report

The command prints the first measured regression and its previous good commit. The optional JSON report records those commits, the supplied endpoints, the percentage threshold, the sample spread limit, the first-parent method, its monotonicity assumption, and every commit actually measured. `tested_commits` can be much smaller than `commits_between` because the search is logarithmic; it is not a claim that every commit was benchmarked.
Expand Down
2 changes: 2 additions & 0 deletions docs/dev/TRACING.md
Original file line number Diff line number Diff line change
Expand Up @@ -107,6 +107,8 @@ Use the interval digest without a thread filter for `aps5-summary.jsonl`.

`python tools/title_run.py --games <directory> [ID ...]` relinks and runs extracted title packages found under `--games` (a directory holding `eboot.bin` and `sce_sys/param.json`) and writes `summary.json` and a fixed-format `summary.md` under `--out` (default `build/title-runs/<commit>-<time>-<unique>/`). Each title runs `--runs` times (default 2): the first with empty AnyPS5 and Mesa or NVIDIA shader caches, the next ones keeping them. AMD's Windows `VkCache` is not isolated. On Windows the title's windows open behind every other window, without focus and without being minimized, and can be brought forward from the taskbar; elsewhere run it under a virtual display if that matters. A run ends as `relink-failed`, `crashed`, `exited`, `stalled` (no present in the last 20 s, or too few presents for a frame to be dumped), `frame-unreadable` (the last dumped frame is truncated or not a 24- or 32-bit BMP), `blank` (the last frame is one colour) or `rendering`; the first, middle and last dumped frames are kept. A screen that presents only when its view changes stops after a few presents and is reported `stalled` although the title still answers input; pressing a button through `tools/pad_input.py` with `APS5_PAD_INPUT_FILE` set tells it apart from a stuck title. `--compare <summary.json>` lists regressions, improvements and missing titles against an earlier run, limited to the IDs given when there are any. Titles are prepared in `<out>/work/<ID>/`, the same path on every run, so a firewall prompt for a title that opens a port appears once; answering Cancel does not affect the run. An invocation locks `<out>/work/<ID>.lock` for each title it runs before touching anything, and refuses to start while another invocation with the same `--out` holds one of them. Per-title relink flags, run length and environment live in `tools/titles.json`. It also compares the last run of each title that both summaries hold by numbers: the FPS of the trace summary, the `averageFps` and `frameMs` percentiles (p50, p90 and p99) of `anyps5-report.json`, the `compiled`, `failed` and `cacheHits` shader counts, and the functions in `missing.functions` and the instructions in `shaders.unsupported`, each split into only before, only now and in both. A value the report does not hold reads `not recorded` on that side; the lists are partial when `truncated` is above zero. `--json` prints that comparison as JSON instead of the table. `--smoke` runs the titles marked `"smoke": true` in `tools/titles.json` instead of named IDs: a start-up check for changes to the relinker, the module loader or libc start-up, which can break every title at second 0 (#7665). The set is DriftCheck (PPSA98766, the smallest import table), DOOM (PPSA99666), Jelly5 (PPSA99505), SymphonyStation5 (PPSA17641), PS5SX2 (PPSA99203, `--trap-sdk-syscall-stubs` and the most libc imports) and VLC (PPSA85300, `--registry`). A `--module-dir` directory among a title's relink flags is staged for the relinker like `sce_module/`, so a Unity title lists `--module-dir Media/Modules --module-dir Media/Plugins` as [GAME_TESTING.md](GAME_TESTING.md) describes. A title's `pad` entry holds a controller timeline in the [`tools/pad_timeline.py` format](../user/INPUT_MAPPING.md#controller-timelines) (`events`, and optionally `repeat` and `gap_ms`); each run sets `APS5_PAD_INPUT_FILE` to `pad-input.txt` in the work directory and queues the timeline after both the minimum `after_s` delay (default 5 seconds) and a fresh complete port-0 controller recording sample, since commands already present on the first controller read are ignored. Each run reports `pad_queued_s`, or `null` when no timeline was queued; the log distinguishes an unmet delay from a missing fresh sample. The timeline follows wall time, not frames, so the title's path differs between runs.

The summary's `build` records the source checkout. Each run's `native` keeps trace `commit`/`dirty` identities and run-report `anyps5.commit`/`modified` separately. The trace summary lists each distinct `commit`/`dirty` pair once, in first-seen order. JSON types are preserved, so `false` and `0` are distinct. Repeated identities still contribute their interval metrics. Comparisons report whether this native evidence matches the clean source checkout, differs, is modified, conflicts or is unknown. Malformed and non-object summary protocol rows retain counts in `native.summary_errors` and cannot qualify as matched; valid metrics remain readable. A valid JSON scalar or array counts as a non-object protocol row when it is the exact string `aps5-bench/1`, an array beginning with that tag, or an array directly containing an object that declares that format. Other JSON scalars and arrays are ignored. Ordinary log records outside the summary protocol are ignored, including truncated records whose available top-level prefix identifies only log fields or another format. A damaged prefix still taints provenance when a complete `aps5-bench/1` format value or a legacy top-level summary field is readable; nested fields are not treated as protocol declarations. Fragments without a recognizable protocol declaration cannot be attributed to the summary protocol. Prefix inspection records an error count, never a recovered native identity. Missing identity in an older summary remains unknown while its metrics stay readable. Matching describes the runtime's compiled identity metadata; it does not attest the bytes of every loaded library.

Keep `--out` outside extracted packages and inputs, including configured `--content` source files, outside `<out>/work/`; the runner checks for overlapping paths and aliases before clearing work. Title selection does not exclude other discovered packages from these checks. Module directories must be relative paths inside the package (`.` is allowed). On Linux, `/proc/self/fdinfo/` must be readable, and work directories cannot cross mount boundaries.

A title's `files` in `tools/titles.json` adds files to its prepared folders before each run. Each key is a path under `app0/`, `data/` or `download0/`, and each value is either `{"text": ...}`, written as given, or `{"content": <path>}`, copied from the directory passed with `--content`. Content is data that cannot be committed, such as a game's own data files. A title whose content is missing still runs, and `summary.md` lists it under `Ran without content`. vkQuake (PPSA99010) reads `quake/pak0.pak`, which is `id1/pak0.pak` from id Software's shareware `quake106.zip` (MD5 `5906e5998fc3d896ddaf5e6a62e03abb`). Its entry also turns off ray-traced shadows: their first compute pipelines take longer to build than the title waits for the GPU (#6118). Afterglow (PPSA47770) runs with `APS5_ASYNC_PIPELINE_WORDS=1000000`: the pipeline of a 95,468-byte pixel shader, about 2.5 million SPIR-V words, takes longer to build on the draw than the title waits for the submission to retire, and the title then exits with `submission retirement failed` on every start. SudokuZen (PPSA50001) and Surround Sound Studio (PPSA99051) run with `APS5_ASYNC_PIPELINE_WORDS=100000` for the same reason: on the cold run the pipeline of their 21,652-byte pixel shader, about 337,000 SPIR-V words, is built on the draw, and both exit with `submission retirement failed` before their first present. VLC (PPSA85300) reads `vlc/testsrc2-720p.mp4`, made with `ffmpeg -f lavfi -i testsrc2=size=1280x720:rate=30 -f lavfi -i sine=frequency=440:sample_rate=48000 -t 20 -c:v libx264 -profile:v high -pix_fmt yuv420p -c:a aac -b:a 128k -movflags +faststart testsrc2-720p.mp4`, skips its first-run setup through `prefs.txt`, and plays the clip from its library with one Cross press. Ruffle Flash (PPSA68091) reads `ruffle/testsrc2.swf`, made with `ffmpeg -f lavfi -i testsrc2=size=640x360:rate=24 -t 20 -c:v flv1 -q:v 5 -an testsrc2.swf` (Sorenson H.263 frames; ffmpeg's JPEG-frame SWF stays on its first frame in Ruffle), and plays it from its library with one Cross press; its built-in demo is an empty 18-byte SWF.
Expand Down
4 changes: 4 additions & 0 deletions tools/performance_bisect.py
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@
from fractions import Fraction
from pathlib import Path

import title_run_provenance

TOOLS_DIR = Path(__file__).resolve().parent
PLACEHOLDER = re.compile(r"\{(worktree|build_dir|result_dir|commit)\}")
Expand Down Expand Up @@ -122,6 +123,9 @@ def sample_summary(path, title_id, commit):
fps = run.get("fps")
if run.get("outcome") != "rendering" or type(fps) not in (int, float) or not 0 < fps <= sys.float_info.max:
raise ValueError(f"{path}: title did not render with a finite positive FPS measurement")
native = title_run_provenance.qualification(run, {"commit": commit, "dirty": False})
if native["status"] != "matched":
raise ValueError(f"{path}: native runtime provenance is {native['status']}; expected clean commit {commit}")
identity = {key: machine.get(key, "") for key in ("os", "gpu", "driver", "cpu")}
identity.update(title_id=title_id, title=title.get("name", ""), content_version=title.get("version", ""))
invalid = [key for key in ("os", "gpu", "driver", "cpu", "title")
Expand Down
31 changes: 27 additions & 4 deletions tools/tests/test_performance_bisect.py
Original file line number Diff line number Diff line change
Expand Up @@ -143,6 +143,25 @@ def test_rejects_duplicate_fields(self):


class SummaryValidationTests(unittest.TestCase):
def test_native_identity_cannot_be_certified_by_source_or_saved_status(self):
with tempfile.TemporaryDirectory() as directory:
path = Path(directory) / "summary.json"
rejected = [None, {}, {"status": "matched"},
{"summary": [{"commit": "2" * 12, "dirty": False}]},
{"summary": [{"commit": GOOD[:12], "dirty": True}]},
{"summary": [{"commit": GOOD[:12], "dirty": 0}]},
{"summary": [{"commit": GOOD[:12], "dirty": False}], "summary_errors": {"malformed_rows": 1}},
{"summary": [{"commit": GOOD[:12], "dirty": False}], "summary_errors": {"malformed_rows": False}},
{"summary": [{"commit": GOOD[:12], "dirty": False}], "report": {"commit": GOOD, "modified": True}},
{"summary": [{"commit": GOOD[:12], "dirty": False}], "report": {"commit": "2" * 40, "modified": False}}]
for native in rejected:
summary = {"build": {"commit": GOOD[:7], "dirty": False}, "machine": IDENTITY,
"titles": {"PPSA00000": {"name": "Example", "version": "01.00", "runs": [
{"outcome": "rendering", "fps": 60, "native": native}]}}}
path.write_text(json.dumps(summary), encoding="utf-8")
with self.subTest(native=native), self.assertRaisesRegex(ValueError, "native"):
performance_bisect.sample_summary(path, "PPSA00000", GOOD)

def test_sample_rejects_a_non_object_title_catalog(self):
with tempfile.TemporaryDirectory() as directory:
path = Path(directory) / "summary.json"
Expand All @@ -158,7 +177,8 @@ def test_sample_requires_clean_expected_commit_and_rendering_result(self):
path = Path(directory) / "summary.json"
summary = {"build": {"commit": GOOD[:7], "dirty": False}, "machine": IDENTITY,
"titles": {"PPSA00000": {"name": "Example", "version": "01.00",
"runs": [{"outcome": "rendering", "fps": 60}]}}}
"runs": [{"outcome": "rendering", "fps": 60,
"native": {"summary": [{"commit": GOOD[:12], "dirty": False}]}}]}}}
path.write_text(json.dumps(summary), encoding="utf-8")
self.assertEqual(performance_bisect.sample_summary(path, "PPSA00000", GOOD)["fps"], 60)
summary["build"]["commit"] = GOOD[:9]
Expand Down Expand Up @@ -286,7 +306,7 @@ def test_title_runner_sample_is_parsed_from_its_output_directory(self):
commit = subprocess.check_output(['git', '-C', str(build.parent), 'rev-parse', '--short', 'HEAD'], text=True).strip()
target = out / 'run' / 'summary.json'
target.parent.mkdir(parents=True)
target.write_text(json.dumps({'build': {'commit': commit, 'dirty': False}, 'machine': {'os': 'Linux', 'gpu': 'GPU', 'driver': 'Driver', 'cpu': 'CPU'}, 'titles': {'PPSA00000': {'name': 'Example', 'version': '01.00', 'runs': [{'outcome': 'rendering', 'fps': 60.0}]}}}))
target.write_text(json.dumps({'build': {'commit': commit, 'dirty': False}, 'machine': {'os': 'Linux', 'gpu': 'GPU', 'driver': 'Driver', 'cpu': 'CPU'}, 'titles': {'PPSA00000': {'name': 'Example', 'version': '01.00', 'runs': [{'outcome': 'rendering', 'fps': 60.0, 'native': {'summary': [{'commit': commit, 'dirty': False}]}}]}}}))
""", encoding="utf-8")
repo = root / "repo"
repo.mkdir()
Expand Down Expand Up @@ -427,7 +447,7 @@ def test_bisects_with_real_measurement_directories_and_build_commands(self):
fps = 54.0 if state in ('step-5', 'step-6', 'step-7') else 60.0
target = out / 'run' / 'summary.json'
target.parent.mkdir(parents=True)
target.write_text(json.dumps({'build': {'commit': commit, 'dirty': False}, 'machine': {'os': 'Linux', 'gpu': 'GPU', 'driver': 'Driver', 'cpu': 'CPU'}, 'titles': {'PPSA00000': {'name': 'Example', 'version': '01.00', 'runs': [{'outcome': 'rendering', 'fps': fps}]}}}), encoding='utf-8')
target.write_text(json.dumps({'build': {'commit': commit, 'dirty': False}, 'machine': {'os': 'Linux', 'gpu': 'GPU', 'driver': 'Driver', 'cpu': 'CPU'}, 'titles': {'PPSA00000': {'name': 'Example', 'version': '01.00', 'runs': [{'outcome': 'rendering', 'fps': fps, 'native': {'summary': [{'commit': commit, 'dirty': False}]}}]}}}), encoding='utf-8')
""", encoding="utf-8")
recipe = {"title_id": "PPSA00000", "games": [], "titles": str(root / "titles.json"),
"seconds": 20, "content": None, "build_dir": "build", "repetitions": 3,
Expand Down Expand Up @@ -760,7 +780,8 @@ def sample_fixture(self):
return {"build": {"commit": GOOD[:12], "dirty": False},
"machine": {"os": "Linux", "gpu": "GPU", "driver": "Driver", "cpu": "CPU"},
"titles": {"PPSA00000": {"name": "Example", "version": "01.00",
"runs": [{"outcome": "rendering", "fps": 60.0}]}}}
"runs": [{"outcome": "rendering", "fps": 60.0,
"native": {"summary": [{"commit": GOOD[:12], "dirty": False}]}}]}}}

def test_sample_rejects_dirty_build_identity(self):
with tempfile.TemporaryDirectory() as directory:
Expand Down Expand Up @@ -1034,6 +1055,8 @@ def test_bisect_refuses_existing_output_before_history_or_worktree_access(self):
self.assertEqual(output.read_text(encoding="utf-8"), "owned")




class GitFailureAndExitTests(unittest.TestCase):
def test_git_failure_raises_with_stderr_or_command_fallback(self):
with tempfile.TemporaryDirectory() as directory, patch.dict("os.environ", {"LC_ALL": "C", "GIT_CEILING_DIRECTORIES": str(Path(directory).parent)}):
Expand Down
Loading
Loading