fix(tools): reject thread filters on collapsed samples #13812

Merged
dr-hoseyn merged 3 commits from upstream-pr/13812 into main 2026-11-01 01:09:58 +00:00
dr-hoseyn commented 2026-10-31 07:40:30 +00:00 (Migrated from github.com)

Imported from boykopovar/AnyPS5. Originally posted by dr-hoseyn on 2026-10-31T07:40:30Z.


What

Reject --thread on collapsed-stack records, which contain no thread IDs. Previously the filter was silently ignored and --out could overwrite an existing output with unfiltered samples. Reject during parsing before report/output generation; preserve ordinary address-capture filtering.

Tested

38 symbolizer tests run on Windows: 37 pass, one existing filesystem test skips. The new subprocess regression reproduces ignored filtering on main and passes after the fix with exit 2, empty stdout and unchanged existing output. The existing address-thread test remains green. Conventions and whitespace checks pass. No C++ build, title/GPU, Linux or macOS run.

Overlap review: the initial scan reported test-class insertion conflicts with #12498 and #12499. Moved the regression to a separate test class and preserved existing class whitespace. git merge-tree --write-tree now merges this head cleanly with both PR heads and with the independent output-preflight branch. Neither open PR implements this input-format rejection.

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:5095640304 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/pull/13812). Originally posted by [dr-hoseyn](https://github.com/dr-hoseyn) on 2026-10-31T07:40:30Z. --- ### What Reject --thread on collapsed-stack records, which contain no thread IDs. Previously the filter was silently ignored and --out could overwrite an existing output with unfiltered samples. Reject during parsing before report/output generation; preserve ordinary address-capture filtering. ### Tested 38 symbolizer tests run on Windows: 37 pass, one existing filesystem test skips. The new subprocess regression reproduces ignored filtering on main and passes after the fix with exit 2, empty stdout and unchanged existing output. The existing address-thread test remains green. Conventions and whitespace checks pass. No C++ build, title/GPU, Linux or macOS run. <!-- 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. --> Overlap review: the initial scan reported test-class insertion conflicts with #12498 and #12499. Moved the regression to a separate test class and preserved existing class whitespace. `git merge-tree --write-tree` now merges this head cleanly with both PR heads and with the independent output-preflight branch. Neither open PR implements this input-format rejection. ### 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 - [x] Fixes: none - [x] Unblocks: none - [x] GPUs tested: n/a - [x] AI-assisted: yes
MarcZX10 commented 2026-10-31 07:52:18 +00:00 (Migrated from github.com)

Imported from boykopovar/AnyPS5. Originally posted by MarcZX10 on 2026-10-31T07:52:18Z.

Review: APPROVED


Reviewed — looks good

The CLI now rejects --thread for collapsed stacks, which contain no thread IDs, before emitting a report or writing --out.

What I ran

Reviewed head e6a5d64332e9e80f1a0deadf2aaee19587bc0dac against base 828ac0b2ae74aac181ba128fb59b08a1534f2041; its merge preview is clean. Environment: Linux x86_64, kernel 6.1.0-54-amd64, Python 3.11.2.

python3 tools/pr_precheck.py --repo boykopovar/AnyPS5 --pr 13812
git merge-tree --write-tree refs/review/pr-13812 refs/review/pr-13813
git merge-tree --write-tree refs/review/pr-13812 refs/review/pr-12498
git merge-tree --write-tree refs/review/pr-13812 refs/review/pr-12499

Results

Check Result
Diff and conventions Passed.
Python syntax Passed.
tools.tests.test_symbolize_samples 38 tests passed, 2 skipped.
Python test registration Passed: 230 test scripts are registered.
Merge previews Clean against base and pairwise with #13813, #12498, and #12499. No declared dependency.
Hosted CI Conventions, intake, labels, eligibility, relinker Linux/Windows, and ASan pass; macOS relinker jobs are queued. Product and specialized jobs are skipped.
Test-quality helper Could not run in the isolated precheck checkout because the workspace-only helper is absent there.
Unedited output from the precheck
................................s...s.
----------------------------------------------------------------------
Ran 38 tests in 0.929s

OK (skipped=2)

230 test script(s), each run by an add_test or a workflow

Negative control

Assertion Change to code under test Did the new test fail?
Collapsed input with --thread is rejected without printing or changing the output file Ran the new test against base 828ac0b2ae74aac181ba128fb59b08a1534f2041 Yes. It failed by assertion: the old code returned 0 and printed the unfiltered report.

Findings

Blocking

None found.

Non-blocking

None.

Sources

Not verified

No C++ build or product runtime test was relevant or run. Two Python tests were skipped; the macOS relinker CI jobs were queued at the last snapshot.

<!-- greyfinch-sync:boykopovar/AnyPS5:review:5721879041 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/pull/13812#pullrequestreview-5721879041). Originally posted by [MarcZX10](https://github.com/MarcZX10) on 2026-10-31T07:52:18Z. **Review:** APPROVED --- # Reviewed — looks good The CLI now rejects `--thread` for collapsed stacks, which contain no thread IDs, before emitting a report or writing `--out`. ## What I ran Reviewed head `e6a5d64332e9e80f1a0deadf2aaee19587bc0dac` against base `828ac0b2ae74aac181ba128fb59b08a1534f2041`; its merge preview is clean. Environment: Linux x86_64, kernel 6.1.0-54-amd64, Python 3.11.2. ```sh python3 tools/pr_precheck.py --repo boykopovar/AnyPS5 --pr 13812 git merge-tree --write-tree refs/review/pr-13812 refs/review/pr-13813 git merge-tree --write-tree refs/review/pr-13812 refs/review/pr-12498 git merge-tree --write-tree refs/review/pr-13812 refs/review/pr-12499 ``` ## Results | Check | Result | |---|---| | Diff and conventions | Passed. | | Python syntax | Passed. | | `tools.tests.test_symbolize_samples` | 38 tests passed, 2 skipped. | | Python test registration | Passed: 230 test scripts are registered. | | Merge previews | Clean against base and pairwise with #13813, #12498, and #12499. No declared dependency. | | Hosted CI | Conventions, intake, labels, eligibility, relinker Linux/Windows, and ASan pass; macOS relinker jobs are queued. Product and specialized jobs are skipped. | | Test-quality helper | Could not run in the isolated precheck checkout because the workspace-only helper is absent there. | <details> <summary>Unedited output from the precheck</summary> ```text ................................s...s. ---------------------------------------------------------------------- Ran 38 tests in 0.929s OK (skipped=2) 230 test script(s), each run by an add_test or a workflow ``` </details> ## Negative control | Assertion | Change to code under test | Did the new test fail? | |---|---|---| | Collapsed input with `--thread` is rejected without printing or changing the output file | Ran the new test against base `828ac0b2ae74aac181ba128fb59b08a1534f2041` | Yes. It failed by assertion: the old code returned 0 and printed the unfiltered report. | ## Findings ### Blocking None found. ### Non-blocking None. ## Sources - [Input-format validation at the reviewed head](https://github.com/boykopovar/AnyPS5/blob/e6a5d64332e9e80f1a0deadf2aaee19587bc0dac/tools/symbolize_samples.py) - [Regression test at the reviewed head](https://github.com/boykopovar/AnyPS5/blob/e6a5d64332e9e80f1a0deadf2aaee19587bc0dac/tools/tests/test_symbolize_samples.py) ## Not verified No C++ build or product runtime test was relevant or run. Two Python tests were skipped; the macOS relinker CI jobs were queued at the last snapshot.
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!13812
No description provided.