feat(run-report): add the run report schema, fixtures and schema tests #14165

Merged
oneandonlydean merged 1 commit from upstream-pr/14165 into main 2026-10-31 22:59:02 +00:00
oneandonlydean commented 2026-10-31 21:48:29 +00:00 (Migrated from github.com)

Imported from boykopovar/AnyPS5. Originally posted by oneandonlydean on 2026-10-31T21:48:29Z.


What

Adds the run report format: a JSON schema (docs/run-report.schema.json, version 1), example reports (one per stop reason: none, assert, crash, missing function, unsupported shader, unsupported format, other; plus a run with no presented frame, one without GPU metadata and one recovered after the process was killed), and a test that checks every example against the schema and that malformed or contradictory reports are rejected. A small workflow runs that test when the schema, the examples or the test change.

This is the first of four PRs. It holds only the format, so the format can be reviewed on its own before any code writes it. The follow-ups are:

  1. The writer and the --aps5-report / APS5_REPORT switch, with tests that validate their output against this schema.
  2. GPU and shader counters.
  3. Recovery of a report after an unclean exit.

The largest example (a report cut at its size limit) is generated by the test instead of being committed. It is about 3,000 lines of repeated entries, and the test also checks that the generated report validates and stays under 64 KiB.

*.json is ignored on main, so .gitignore un-ignores only the schema and the example folder.

Tested

Linux, in a venv with tools/requirements-run-report.txt (jsonschema 4.23.0): python tools/tests/test_run_report_schema.py -> 27 tests OK. As a negative check, changing a limit or the version constant in the schema makes the test fail. Restored, it passes again. python3 tools/check_conventions.py passes. No C++ is changed.

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: none
  • Fixes: none
  • Unblocks: none
  • GPUs tested: n/a
  • AI-assisted: yes
<!-- greyfinch-sync:boykopovar/AnyPS5:issue:5101832055 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/pull/14165). Originally posted by [oneandonlydean](https://github.com/oneandonlydean) on 2026-10-31T21:48:29Z. --- ### What Adds the run report format: a JSON schema (`docs/run-report.schema.json`, version 1), example reports (one per stop reason: none, assert, crash, missing function, unsupported shader, unsupported format, other; plus a run with no presented frame, one without GPU metadata and one recovered after the process was killed), and a test that checks every example against the schema and that malformed or contradictory reports are rejected. A small workflow runs that test when the schema, the examples or the test change. This is the first of four PRs. It holds only the format, so the format can be reviewed on its own before any code writes it. The follow-ups are: 1. The writer and the `--aps5-report` / `APS5_REPORT` switch, with tests that validate their output against this schema. 2. GPU and shader counters. 3. Recovery of a report after an unclean exit. The largest example (a report cut at its size limit) is generated by the test instead of being committed. It is about 3,000 lines of repeated entries, and the test also checks that the generated report validates and stays under 64 KiB. `*.json` is ignored on `main`, so `.gitignore` un-ignores only the schema and the example folder. ### Tested Linux, in a venv with `tools/requirements-run-report.txt` (jsonschema 4.23.0): `python tools/tests/test_run_report_schema.py` -> 27 tests OK. As a negative check, changing a limit or the version constant in the schema makes the test fail. Restored, it passes again. `python3 tools/check_conventions.py` passes. No C++ is changed. ### Checklist - [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: none - [x] Fixes: none - [x] Unblocks: none - [x] GPUs tested: n/a - [x] AI-assisted: yes
MarcZX10 commented 2026-10-31 22:23:51 +00:00 (Migrated from github.com)

Imported from boykopovar/AnyPS5. Originally posted by MarcZX10 on 2026-10-31T22:23:51Z.

Review: APPROVED


Reviewed — looks good

The exact head passes its pinned schema suite and hosted schema check; I found no blocking defect, with one non-blocking timestamp-validation limitation noted below.

What I ran

Reviewed head 63299d50788b927b5b18988251f35b9f220f8d9f against PR base 3c8e5d9d428df7306f760df8e165410b68fe68f2. A local merge preview against current main 1bc97b9527eaf6b56681cd3465bca67b75329161 was clean. Environment: Debian Linux x86_64, Python 3.11.2; no C/C++ compiler was needed for this schema-only change.

python3 /marc/AnyPS5/tools/pr_precheck.py --repo boykopovar/AnyPS5 --pr 14165
/tmp/review-14165-venv/bin/python tools/tests/test_run_report_schema.py

The test command ran from an isolated checkout of the exact head, with dependencies installed from tools/requirements-run-report.txt (including jsonschema==4.23.0). I also tested the cap assertion by changing only missing.functions.maxItems from 200 to 201 in a disposable copy and rerunning the suite.

Results

Check Result
Diff whitespace Passed (git diff --check for the PR base and head).
Repository conventions and PR template Passed.
Run-report schema suite Passed: 27 tests using the pinned requirements.
Negative control for list cap Failed as expected after changing the schema cap from 200 to 201; the cap test detected acceptance of the oversized list.
Python test registration Passed: 233 scripts are registered by CMake or a workflow.
Hosted schema workflow Passed on this head.
Hosted conventions, intake, eligibility, labels, and relinker/relinker-asan jobs Passed on this head.
Hosted Linux, Windows, register-context, and write-watch jobs Skipped by workflow selection.
Precheck's system-Python test invocation Its one failure was the environment-version assertion: system jsonschema was 4.10.3 while the PR pins 4.23.0. The pinned-environment rerun above passes. The precheck's negative-control harness could not run this new-schema test against base because the schema/fixtures do not exist on base; its test-quality helper was also unavailable in the extracted PR checkout. The separate head-copy negative control above did run.
Unedited output — pinned suite
...........................
----------------------------------------------------------------------
Ran 27 tests in 0.860s

OK
Unedited output — negative control
................F..........
======================================================================
FAIL: test_lists_over_the_caps_are_rejected (__main__.RejectionTests.test_lists_over_the_caps_are_rejected)
----------------------------------------------------------------------
Traceback (most recent call last):
  File "/tmp/review-14165-mutant.gET64A/tools/tests/test_run_report_schema.py", line 282, in test_lists_over_the_caps_are_rejected
    self.assertRejected(document)
  File "/tmp/review-14165-mutant.gET64A/tools/tests/test_run_report_schema.py", line 166, in assertRejected
    self.assertTrue(self.errors(document), "the document was accepted")
AssertionError: [] is not true : the document was accepted

----------------------------------------------------------------------
Ran 27 tests in 0.757s

FAILED (failures=1)
mutant_exit=1
mutant_dir=/tmp/review-14165-mutant.gET64A
Unedited output — precheck environment mismatch
...........F...............
======================================================================
FAIL: test_validator_matches_the_pinned_requirement (tools.tests.test_run_report_schema.PinnedValidatorTests.test_validator_matches_the_pinned_requirement)
----------------------------------------------------------------------
Traceback (most recent call last):
  File "/tmp/anyps5-pr-precheck/boykopovar-AnyPS5-pr-14165-63299d50788b/head-63299d50788b-f777d49e/tools/tests/test_run_report_schema.py", line 146, in test_validator_matches_the_pinned_requirement
    self.assertEqual(metadata.version("jsonschema"), pinned["jsonschema"])
AssertionError: '4.10.3' != '4.23.0'
- 4.10.3
+ 4.23.0

----------------------------------------------------------------------
Ran 27 tests in 0.584s

FAILED (failures=1)

Negative control

Assertion Change made in disposable copy Did the new test fail?
test_lists_over_the_caps_are_rejected Raised missing.functions.maxItems from 200 to 201, allowing the over-cap fixture through the mutated schema. Yes. It failed because the oversized document was accepted.

Findings

Blocking

None.

Non-blocking

  • generated checks the timestamp's digit layout but not whether its date/time components are valid; for example, 2026-99-99T88:88:88Z passes schema validation. If the schema is intended to guarantee a real UTC timestamp, consider tightening validation and adding an invalid-calendar-value test. This does not block the report schema's current fixture and bounds coverage.

Sources

Not verified

  • No product build or C/C++ tests were run; this PR changes schema, fixture, workflow, and Python-test files only.
  • Hosted Linux, Windows, register-context, and write-watch jobs were skipped; no console, GPU, or firmware behavior is implicated or verified by this change.
  • The timestamp constraint's intended semantic strength is not stated beyond the schema pattern and tests, so the calendar-validity observation is non-blocking.
<!-- greyfinch-sync:boykopovar/AnyPS5:review:5725246240 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/pull/14165#pullrequestreview-5725246240). Originally posted by [MarcZX10](https://github.com/MarcZX10) on 2026-10-31T22:23:51Z. **Review:** APPROVED --- # Reviewed — looks good The exact head passes its pinned schema suite and hosted schema check; I found no blocking defect, with one non-blocking timestamp-validation limitation noted below. ## What I ran Reviewed head `63299d50788b927b5b18988251f35b9f220f8d9f` against PR base `3c8e5d9d428df7306f760df8e165410b68fe68f2`. A local merge preview against current `main` `1bc97b9527eaf6b56681cd3465bca67b75329161` was clean. Environment: Debian Linux x86_64, Python 3.11.2; no C/C++ compiler was needed for this schema-only change. ```sh python3 /marc/AnyPS5/tools/pr_precheck.py --repo boykopovar/AnyPS5 --pr 14165 /tmp/review-14165-venv/bin/python tools/tests/test_run_report_schema.py ``` The test command ran from an isolated checkout of the exact head, with dependencies installed from `tools/requirements-run-report.txt` (including `jsonschema==4.23.0`). I also tested the cap assertion by changing only `missing.functions.maxItems` from 200 to 201 in a disposable copy and rerunning the suite. ## Results | Check | Result | |---|---| | Diff whitespace | Passed (`git diff --check` for the PR base and head). | | Repository conventions and PR template | Passed. | | Run-report schema suite | Passed: 27 tests using the pinned requirements. | | Negative control for list cap | Failed as expected after changing the schema cap from 200 to 201; the cap test detected acceptance of the oversized list. | | Python test registration | Passed: 233 scripts are registered by CMake or a workflow. | | Hosted schema workflow | Passed on this head. | | Hosted conventions, intake, eligibility, labels, and relinker/relinker-asan jobs | Passed on this head. | | Hosted Linux, Windows, register-context, and write-watch jobs | Skipped by workflow selection. | | Precheck's system-Python test invocation | Its one failure was the environment-version assertion: system `jsonschema` was 4.10.3 while the PR pins 4.23.0. The pinned-environment rerun above passes. The precheck's negative-control harness could not run this new-schema test against base because the schema/fixtures do not exist on base; its test-quality helper was also unavailable in the extracted PR checkout. The separate head-copy negative control above did run. | <details><summary>Unedited output — pinned suite</summary> ```text ........................... ---------------------------------------------------------------------- Ran 27 tests in 0.860s OK ``` </details> <details><summary>Unedited output — negative control</summary> ```text ................F.......... ====================================================================== FAIL: test_lists_over_the_caps_are_rejected (__main__.RejectionTests.test_lists_over_the_caps_are_rejected) ---------------------------------------------------------------------- Traceback (most recent call last): File "/tmp/review-14165-mutant.gET64A/tools/tests/test_run_report_schema.py", line 282, in test_lists_over_the_caps_are_rejected self.assertRejected(document) File "/tmp/review-14165-mutant.gET64A/tools/tests/test_run_report_schema.py", line 166, in assertRejected self.assertTrue(self.errors(document), "the document was accepted") AssertionError: [] is not true : the document was accepted ---------------------------------------------------------------------- Ran 27 tests in 0.757s FAILED (failures=1) mutant_exit=1 mutant_dir=/tmp/review-14165-mutant.gET64A ``` </details> <details><summary>Unedited output — precheck environment mismatch</summary> ```text ...........F............... ====================================================================== FAIL: test_validator_matches_the_pinned_requirement (tools.tests.test_run_report_schema.PinnedValidatorTests.test_validator_matches_the_pinned_requirement) ---------------------------------------------------------------------- Traceback (most recent call last): File "/tmp/anyps5-pr-precheck/boykopovar-AnyPS5-pr-14165-63299d50788b/head-63299d50788b-f777d49e/tools/tests/test_run_report_schema.py", line 146, in test_validator_matches_the_pinned_requirement self.assertEqual(metadata.version("jsonschema"), pinned["jsonschema"]) AssertionError: '4.10.3' != '4.23.0' - 4.10.3 + 4.23.0 ---------------------------------------------------------------------- Ran 27 tests in 0.584s FAILED (failures=1) ``` </details> ## Negative control | Assertion | Change made in disposable copy | Did the new test fail? | |---|---|---| | `test_lists_over_the_caps_are_rejected` | Raised `missing.functions.maxItems` from 200 to 201, allowing the over-cap fixture through the mutated schema. | Yes. It failed because the oversized document was accepted. | ## Findings ### Blocking None. ### Non-blocking - `generated` checks the timestamp's digit layout but not whether its date/time components are valid; for example, `2026-99-99T88:88:88Z` passes schema validation. If the schema is intended to guarantee a real UTC timestamp, consider tightening validation and adding an invalid-calendar-value test. This does not block the report schema's current fixture and bounds coverage. ## Sources - [Schema timestamp constraint at the reviewed head](https://github.com/boykopovar/AnyPS5/blob/63299d50788b927b5b18988251f35b9f220f8d9f/docs/run-report.schema.json#L11) - [Schema tests at the reviewed head](https://github.com/boykopovar/AnyPS5/blob/63299d50788b927b5b18988251f35b9f220f8d9f/tools/tests/test_run_report_schema.py#L141) - [Hosted schema check for this head](https://github.com/boykopovar/AnyPS5/actions/runs/41245298581/job/124667364419) ## Not verified - No product build or C/C++ tests were run; this PR changes schema, fixture, workflow, and Python-test files only. - Hosted Linux, Windows, register-context, and write-watch jobs were skipped; no console, GPU, or firmware behavior is implicated or verified by this change. - The timestamp constraint's intended semantic strength is not stated beyond the schema pattern and tests, so the calendar-validity observation is non-blocking.
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!14165
No description provided.