feat(tools): emit sanitizer triage as JSON #12872

Merged
StoneDC merged 3 commits from upstream-pr/12872 into main 2026-11-02 16:15:01 +00:00
StoneDC commented 2026-10-29 13:24:43 +00:00 (Migrated from github.com)

Imported from boykopovar/AnyPS5. Originally posted by StoneDC on 2026-10-29T13:24:43Z.


What

Add sanitizer_report.py --json with sorted per-test names, original outcomes, known-failure reasons, captured sanitizer reports, unexpected flags and known tests that were not run. Preserve the existing failure policy and Markdown summary append behavior.

Addresses the contract coverage review in the existing fixture: pin passed/skipped/failed outcomes and every per-test unexpected flag, both before and after the failing test is recognized by the known-failure policy. The review follow-up changes only tests; it does not alter the correct production mapping.

Tested

Exact tested head 4d3e4e578f04ed74e3330f85d9bd37e77c670607 on current main bb04a4f1ea0175e9e4f149f0359a764d62ff3296. Windows / MinGW GCC 15.2, CMake 4.3.1, Python 3.14.3; Ubuntu/WSL / GCC 15.2, CMake 4.2.3, Python 3.14.4. Python-only checks do not claim a C++ build.

ctest --test-dir <build> -R "^(sanitizer_report|tools_sanitizer_json)$" --parallel 2 -V: both groups pass on each platform, executing 2 JSON tests and 27 existing sanitizer tests. Windows has two existing platform skips in the old suite; Linux has none. No CTest groups skip.

On each OS, separately mutate the real production tool to report every outcome as passed or every unexpected flag as false, retaining these current tests. Both mutants fail value assertions; neither survives the strengthened fixture. The production source is unchanged by these temporary controls. No product build, title execution, sanitizer-instrumented product run or GPU test was performed.

Current-main conventions with this complete description, whitespace, script registration and Python 3.9 grammar checks pass. Actual unittest discovery retains every test from the previously published head, with no duplicate classes or methods in changed files. Linux source archives are initialized as local Git snapshots for checks that require a file index/current revision. No test timeout was raised. New hosted CI starts after publication; previous-head passes are not substituted for the updated head.

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:5068828344 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/pull/12872). Originally posted by [StoneDC](https://github.com/StoneDC) on 2026-10-29T13:24:43Z. --- ### What Add `sanitizer_report.py --json` with sorted per-test names, original outcomes, known-failure reasons, captured sanitizer reports, unexpected flags and known tests that were not run. Preserve the existing failure policy and Markdown summary append behavior. Addresses the [contract coverage review](https://github.com/boykopovar/AnyPS5/pull/12872#pullrequestreview-5699512394) in the existing fixture: pin passed/skipped/failed outcomes and every per-test unexpected flag, both before and after the failing test is recognized by the known-failure policy. The review follow-up changes only tests; it does not alter the correct production mapping. ### Tested <!-- OS, title or homebrew, what was checked. "Not tested" is a valid answer. A performance change: the summary lines of main and of this PR from the same machine and scene, with the traces attached, captured as the Performance report issue form describes. --> Exact tested head `4d3e4e578f04ed74e3330f85d9bd37e77c670607` on current main `bb04a4f1ea0175e9e4f149f0359a764d62ff3296`. Windows / MinGW GCC 15.2, CMake 4.3.1, Python 3.14.3; Ubuntu/WSL / GCC 15.2, CMake 4.2.3, Python 3.14.4. Python-only checks do not claim a C++ build. `ctest --test-dir <build> -R "^(sanitizer_report|tools_sanitizer_json)$" --parallel 2 -V`: both groups pass on each platform, executing 2 JSON tests and 27 existing sanitizer tests. Windows has two existing platform skips in the old suite; Linux has none. No CTest groups skip. On each OS, separately mutate the real production tool to report every outcome as passed or every unexpected flag as false, retaining these current tests. Both mutants fail value assertions; neither survives the strengthened fixture. The production source is unchanged by these temporary controls. No product build, title execution, sanitizer-instrumented product run or GPU test was performed. Current-main conventions with this complete description, whitespace, script registration and Python 3.9 grammar checks pass. Actual unittest discovery retains every test from the previously published head, with no duplicate classes or methods in changed files. Linux source archives are initialized as local Git snapshots for checks that require a file index/current revision. No test timeout was raised. New hosted CI starts after publication; previous-head passes are not substituted for the updated head. ### 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: none <!-- #PR, or none --> - [x] Fixes: none <!-- issue it closes as Fixes #N, or none --> - [x] Unblocks: none <!-- title ID and Game bring-up discussion, e.g. PPSA01325 #3232, or none --> - [x] GPUs tested: n/a <!-- for AGC, shader recompiler or VideoOut changes: vendor, model, driver and OS of each GPU the GPU tests ran on; otherwise n/a --> - [x] AI-assisted: yes <!-- yes / no -->
malekaifa commented 2026-10-29 14:35:41 +00:00 (Migrated from github.com)

Imported from boykopovar/AnyPS5. Originally posted by malekaifa on 2026-10-29T14:35:41Z.

Review: COMMENTED


Reviewed exact head 0237a2273ae961d9daa3744f9bb3339846ed4347. The production JSON mapping looks consistent with the existing sanitizer policy, and it composes cleanly with live #12437: an exact merge-tree preserves both --json and RuntimeError handling for summary-path symlink loops.

Local validation is green: on Windows Python 3.12 the new JSON suite passes 2/2 and the existing sanitizer suite passes 27 tests with 2 platform skips; WSL Python 3.12 passes 2/2 + 27/27.

I did find a focused contract-test gap before approval. The PR advertises each test's original outcome and per-test unexpected flag, but neither field is asserted by test_sanitizer_json.py. I mutation-checked the exact head:

  • replacing "outcome": found[name] with "outcome": "passed" -> both JSON tests still pass;
  • replacing "unexpected": found[name] == "failed" and name not in known with "unexpected": False -> both JSON tests still pass.

The implementation itself is correct; this is test coverage for two public machine-readable fields. Please pin them in the existing fixture (for example, assert okay=passed, skip=skipped, 界=failed, and 界.unexpected true before the known-failure run / false in the known-failure run). That should kill both mutants without expanding the production diff.

<!-- greyfinch-sync:boykopovar/AnyPS5:review:5699512394 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/pull/12872#pullrequestreview-5699512394). Originally posted by [malekaifa](https://github.com/malekaifa) on 2026-10-29T14:35:41Z. **Review:** COMMENTED --- Reviewed exact head `0237a2273ae961d9daa3744f9bb3339846ed4347`. The production JSON mapping looks consistent with the existing sanitizer policy, and it composes cleanly with live #12437: an exact merge-tree preserves both `--json` and `RuntimeError` handling for summary-path symlink loops. Local validation is green: on Windows Python 3.12 the new JSON suite passes 2/2 and the existing sanitizer suite passes 27 tests with 2 platform skips; WSL Python 3.12 passes 2/2 + 27/27. I did find a focused contract-test gap before approval. The PR advertises each test's original `outcome` and per-test `unexpected` flag, but neither field is asserted by `test_sanitizer_json.py`. I mutation-checked the exact head: - replacing `"outcome": found[name]` with `"outcome": "passed"` -> both JSON tests still pass; - replacing `"unexpected": found[name] == "failed" and name not in known` with `"unexpected": False` -> both JSON tests still pass. The implementation itself is correct; this is test coverage for two public machine-readable fields. Please pin them in the existing fixture (for example, assert `okay=passed`, `skip=skipped`, `界=failed`, and `界.unexpected` true before the known-failure run / false in the known-failure run). That should kill both mutants without expanding the production diff.
malekaifa commented 2026-10-30 00:54:29 +00:00 (Migrated from github.com)

Imported from boykopovar/AnyPS5. Originally posted by malekaifa on 2026-10-30T00:54:29Z.

Review: APPROVED


Re-reviewed exact head 4d3e4e578f after the contract-test follow-up. Production sanitizer_report.py is byte-identical to the head I reviewed previously; only test_sanitizer_json.py changed. The updated JSON suite passes on Windows Python 3.12 (2/2) and WSL Python 3.12.3 (2/2). The two mutants from my prior review are now killed: forcing every outcome to passed fails the outcome assertions, and forcing every unexpected flag to false fails the unexpected assertion. Current-main merge-tree is clean, the live #12437 symlink-loop RuntimeError follow-up composes cleanly with this head, git diff --check is clean, and the hosted Build on this exact head is fully green across Windows, Ubuntu, both macOS relinker lanes and ASan. The requested coverage gap is resolved; no blocking issue found.

<!-- greyfinch-sync:boykopovar/AnyPS5:review:5706853677 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/pull/12872#pullrequestreview-5706853677). Originally posted by [malekaifa](https://github.com/malekaifa) on 2026-10-30T00:54:29Z. **Review:** APPROVED --- Re-reviewed exact head 4d3e4e578f04ed74e3330f85d9bd37e77c670607 after the contract-test follow-up. Production sanitizer_report.py is byte-identical to the head I reviewed previously; only test_sanitizer_json.py changed. The updated JSON suite passes on Windows Python 3.12 (2/2) and WSL Python 3.12.3 (2/2). The two mutants from my prior review are now killed: forcing every outcome to passed fails the outcome assertions, and forcing every unexpected flag to false fails the unexpected assertion. Current-main merge-tree is clean, the live #12437 symlink-loop RuntimeError follow-up composes cleanly with this head, git diff --check is clean, and the hosted Build on this exact head is fully green across Windows, Ubuntu, both macOS relinker lanes and ASan. The requested coverage gap is resolved; no blocking issue found.
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!12872
No description provided.