Repository navigation
fix(tools): read BOM-prefixed sanitizer lists - #15339
Conversation
MarcZX10
left a comment
There was a problem hiding this comment.
Reviewed — no blocking findings
The BOM-aware decoder fixes the reproduced first-entry mismatch; the focused suite and assertion-based base negative control pass, while hosted checks are still pending.
What I ran
Reviewed both changed files at head 4a9956c1d6328ca21377ce8d001da497e3e26716, based on 7feb37ee3e30e10139b483fb4df689d5b5b69ab8. The current-base merge preview was clean. Environment: Debian Linux x86_64, Python 3.11.2, GCC 12.2.0 installed. The exact-head no-build precheck ran Python syntax, all 29 sanitizer-report tests, test registration and a negative control against the base implementation. No build was needed for this Python-only change.
The PR description reports a separate Windows/Python 3.12 run; I did not independently run that environment.
python3 tools/pr_precheck.py --repo boykopovar/AnyPS5 --pr 15339 --output-dir /tmp/anyps5-pr-precheck/15339-session-20261103
gh pr checks 15339 --repo boykopovar/AnyPS5Results
| Check | Result | Note |
|---|---|---|
| Diff and conventions | passed | Exact-head checks passed. |
| Python syntax | passed | The changed module compiled. |
| Sanitizer-report suite | passed | All 29 tests passed. |
| Test registration | passed | The Python suite is registered. |
| Base negative control | passed | The new assertion failed on base with the leading BOM in the key. |
| Current-base merge preview | passed | Clean against the reviewed base. |
| Test-quality heuristic | failed | Its helper script is missing from the isolated snapshot; no code conclusion follows. |
| Hosted checks | not run | Four current jobs were pending at final refresh. |
| Build | not applicable | The change is Python-only. |
Precheck table and unedited output
| Check | Status | Command / reason |
|---|---|---|
| build_and_compile | not_applicable | The precheck deliberately does not configure, build, or compile AnyPS5. |
| diff_check | passed | git diff --check 7feb37ee3e30e10139b483fb4df689d5b5b69ab8...4a9956c1d6328ca21377ce8d001da497e3e26716 |
| conventions_and_pr_template | passed | /usr/bin/python3 tools/check_conventions.py --base 7feb37ee3e30e10139b483fb4df689d5b5b69ab8 --head 4a9956c1d6328ca21377ce8d001da497e3e26716 --title fix(tools): read BOM-prefixed sanitizer lists --body /tmp/anyps5-pr-precheck/15339-session-20261103/pr-body.md |
| changed_export_abi_audit | not_applicable | No changed source or public header under core/libs/prx. |
| python_syntax | passed | /usr/bin/python3 -m py_compile tools/sanitizer_report.py |
| unit:tools/tests/test_sanitizer_report.py | passed | /usr/bin/python3 -m unittest tools.tests.test_sanitizer_report |
| python_test_registration | passed | /usr/bin/python3 tools/check_test_registration.py --scripts |
| live_dependency_and_mergeability_check | passed | /usr/bin/python3 /marc/AnyPS5/tools/pr_stack_check.py 15339 --repo boykopovar/AnyPS5 --output-dir /tmp/anyps5-pr-precheck/15339-session-20261103/stack |
| build_dependent_cpp_tests | not_applicable | No C/C++ implementation or test files changed. |
| test_quality_heuristics | failed | /usr/bin/python3 /tmp/anyps5-pr-precheck/15339-session-20261103/head-4a9956c1d632-76795cad/tools/pr_test_quality.py --root /tmp/anyps5-pr-precheck/15339-session-20261103/head-4a9956c1d632-76795cad --json tools/sanitizer_report.py tools/tests/test_sanitizer_report.py |
| negative_controls | passed | A pass means every candidate failed by assertion on base; a failure means at least one did not discriminate or could not run. See per-test results. |
Precheck command output:
/tmp/anyps5-pr-precheck/15339-session-20261103/report.md
/tmp/anyps5-pr-precheck/15339-session-20261103/report.json
Conclusion: checks failed
Exact-head unit-test output:
.............................
----------------------------------------------------------------------
Ran 29 tests in 0.333s
OK
Base negative-control output:
........................F....
======================================================================
FAIL: test_utf8_bom_does_not_change_the_first_known_test_name (tools.tests.test_sanitizer_report.SanitizerReportTests.test_utf8_bom_does_not_change_the_first_known_test_name)
----------------------------------------------------------------------
Traceback (most recent call last):
File "/tmp/anyps5-pr-precheck/15339-session-20261103/negative-control-base-9c80f514/tools/tests/test_sanitizer_report.py", line 175, in test_utf8_bom_does_not_change_the_first_known_test_name
self.assertEqual(sanitizer_report.load_known(known, ["address"]), {"fiber": "stack switch"})
AssertionError: {'\ufefffiber': 'stack switch'} != {'fiber': 'stack switch'}
- {'\ufefffiber': 'stack switch'}
? ------
+ {'fiber': 'stack switch'}
----------------------------------------------------------------------
Ran 29 tests in 0.335s
FAILED (failures=1)
The isolated test-quality-helper error:
/usr/bin/python3: can't open file '/tmp/anyps5-pr-precheck/15339-session-20261103/head-4a9956c1d632-76795cad/tools/pr_test_quality.py': [Errno 2] No such file or directory
Convention output:
All conventions checks passed.
Test-registration output:
251 test script(s), each run by an add_test or a workflow
Hosted-check output:
conventions pending 0 https://github.com/boykopovar/AnyPS5/actions/runs/41554245797/job/125649105325
eligibility pending 0 https://github.com/boykopovar/AnyPS5/actions/runs/41554251002/job/125649120628
intake pending 0 https://github.com/boykopovar/AnyPS5/actions/runs/41554246010/job/125649105913
labels pending 0 https://github.com/boykopovar/AnyPS5/actions/runs/41554245796/job/125649105735
Negative control
| Assertion | Change under test | Did it fail? |
|---|---|---|
First BOM-prefixed known test is recognized as fiber, and selected-sanitizer exit codes are preserved |
Reverted the decoder to base utf-8 while running the PR's new test |
Yes; the assertion failed because the key remained \ufefffiber. |
Findings
Blocking
None found in the reviewed head.
Non-blocking
The PR description's Windows run was not independently reproduced here. The exact-head suite and the base control provide local evidence for the parser change on Linux.
Sources
- Known-list decoding strips an initial UTF-8 BOM at the reviewed head
- Regression assertions cover the first test name and selected sanitizer results
Not verified
I did not run the Windows/Python 3.12 environment reported by the author. Four hosted checks were pending at the final refresh.
To get this to a good state
No code change is requested from this review. I will recheck this exact head after the pending hosted checks complete.
gabichuuuuu
left a comment
There was a problem hiding this comment.
Windows check of head 4a9956c1d6, merged onto main 286b14d2f7, run with Python 3.15 from the repository root and from tools/tests.
test_sanitizer_report.py: the newtest_utf8_bom_does_not_change_the_first_known_test_namepasses.- Negative control, with
main'ssanitizer_report.pyand this PR's test: that test fails,{'fiber': 'stack switch'} != {'fiber': 'stack switch'}.
What
Read an optional UTF-8 BOM at the beginning of a sanitizer known-failure list as an encoding signature. The first test name then matches the JUnit result, so a listed failure is not incorrectly reported as unexpected. Plain UTF-8 lists and sanitizer-specific selection retain their existing behavior.
Tested
Windows / Python 3.12. Local commit
538a2860fc091d5a7e6ac510067ae6b1d0c1dc37, tree909f6f195d11e1a08da0e6cb74299f03a7cf20a7, based on upstream7feb37ee3e30e10139b483fb4df689d5b5b69ab8.python -B -m unittest tools.tests.test_sanitizer_report: 29 tests passed, no skips. The regression checks the first BOM-prefixed test name, sanitizer selection, and the command exit codes for known and unexpected failures. The full suite includes ordinary UTF-8 lists, malformed entries and report input-alias protection. The final run was outside the sandbox because its temporary hard-link fixture is denied inside the sandbox.\ufefffiberinstead offiber; the corrected implementation passes.git diff --check origin/main...HEAD: passed.python -B tools/check_conventions.py --base origin/main --head HEADwith this title and description: passed.tools/pr_overlap.pycomparison used 1,726 unique captured open PR heads and the exact live upstream base. No confirmed overlap was reported. It returned 2 for one unverified branch, fix(relinker): match AppContent utility import to provider #13486 (0bde10d243b63a08556f9ceda6912cf5fef2b824); both shared files were compared manually against both merge bases and the exact branch tip. Its changes concern summary-path RuntimeError handling and symlink-loop tests already in main; its known-list decoder still uses plain UTF-8. It does not implement this fix. The other related branch tips (fix(tools): report sanitizer_report symlink-loop summary paths without traceback #13189, fix(tools): escape sanitizer report test names #12493 and fix(tools): keep explicit sanitizer failures from being skipped #12483) also retain plain UTF-8 list decoding. The public REST transport and exact-head caches replaced unavailablegh; the checker's comparison logic was unchanged.Tooling-only change. No runtime, title compatibility, GPU or performance claim.
Published head
4a9956c1d6328ca21377ce8d001da497e3e26716has exactly the tested tree909f6f195d11e1a08da0e6cb74299f03a7cf20a7.Checklist
main; no other open PR implements the same functionsNotImplemented_nid_no_patch); silent stubs are listed under Silent stubs in their library's technical debt file.mdfiles or images added to the repository (attach them to this PR)