Skip to content

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

Merged
oneandonlydean merged 3 commits into
boykopovar:mainfrom
StoneDC:b41/sanitizer-json
Nov 2, 2026
Merged

oneandonlydean merged 3 commits into
boykopovar:mainfrom
StoneDC:b41/sanitizer-json

Conversation

@StoneDC

@StoneDC StoneDC commented Oct 29, 2026 •

Copy link
Copy Markdown
Contributor

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

@github-actions

github-actions Bot commented Oct 29, 2026 •

Copy link
Copy Markdown

Other open pull requests touch the same code. Merging one will break the other, or both implement the same thing. If this one builds on them, list them in Depends on.

Pull request Conflicting files (lines on main) Same exports Same new files
PR 13189 tools/sanitizer_report.py L1

Some comparisons could not be completed because a pull request conflicts with the base branch. Review these shared files manually before concluding that there is no overlap.

Pull request Shared files not compared
PR 1835 CMakeLists.txt
PR 5021 CMakeLists.txt
PR 7642 CMakeLists.txt
PR 9539 CMakeLists.txt
PR 10193 CMakeLists.txt
PR 10897 CMakeLists.txt
PR 13578 CMakeLists.txt
PR 13928 CMakeLists.txt
PR 13929 CMakeLists.txt
PR 14212 CMakeLists.txt
PR 14264 CMakeLists.txt

@malekaifa malekaifa left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.

@oneandonlydean oneandonlydean self-assigned this Oct 29, 2026
@StoneDC

StoneDC commented Oct 29, 2026

Copy link
Copy Markdown
Contributor Author

Follow-up on the review fixes at head 4d3e4e578f04ed74e3330f85d9bd37e77c670607.

Addressed the JSON contract-test gap without changing the correct production mapping. The existing fixture now pins passed/skipped/failed outcomes and each per-test unexpected flag, both before and after the failed test is recognized by the known-failure policy.

Validation at this exact head: both sanitizer-report CTest groups pass on Windows/Linux (2 JSON + 27 existing tests). Windows has two existing platform skips; Linux has none. Separately mutating every outcome to passed or every unexpected flag to false now fails assertions on both platforms. Conventions/whitespace/registration checks pass. This is tool-output validation, not a sanitizer-instrumented product run.

Hosted-check snapshot checked on 2026-10-30 for this head: 5 passed, 4 pending, 3 skipped; no failures. Current checks. Pending and skipped checks are not counted as passes.

The PR description contains the detailed validation scope and limitations. Please re-review the updated head when convenient.

AI-assisted: yes.

@github-actions github-actions Bot added the build label Oct 29, 2026

@malekaifa malekaifa left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Re-reviewed exact head 4d3e4e5 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.

@oneandonlydean
oneandonlydean merged commit b28bb77 into boykopovar:main Nov 2, 2026
13 of 14 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants