Skip to content

ci(sanitizers): list precise_wait as a known failure of the hosted runner - #13250

Closed
xXPBSXx wants to merge 2 commits into
boykopovar:mainfrom
xXPBSXx:san_precise_wait_known
Closed

xXPBSXx wants to merge 2 commits into
boykopovar:mainfrom
xXPBSXx:san_precise_wait_known

Conversation

@xXPBSXx

@xXPBSXx xXPBSXx commented Oct 30, 2026 •

Copy link
Copy Markdown
Contributor

What

The nightly Sanitizers workflow reports precise_wait as a failed test in its runs of 28 October, 29 October and 30 October: the median of a 50 us sleep is 120 us, 117 us and 117 us against the test's bound of 90 us. The release.yml workflow already leaves this test out of its Linux run (commit 20c425aabe); the Release runs of 18 October and 19 October, which are unsanitized builds on a hosted ubuntu-latest runner, failed the same 50 us check at 111 us and 114 us. The Build workflow's Linux job, where the test passes, runs on the self-hosted runners. The three nightly runs contain no sanitizer report for precise_wait, only the timing lines.

This adds one line for precise_wait (address,undefined) to .github/sanitizer-known-failures.txt, so the sanitizer report lists it as a known failure of the hosted runner. It does not hide a fault of a library: the line names the runner effect. In the three runs the 50 us checks of PreciseWait.cpp end at a stable 117 to 120 us. Its "busy runner" skip, which needs a probe gap above 25 us or a spread above 1 ms, applied to PreciseSleepUs(50) on 29 and 30 October but not to PreciseSleepUntil(+50us), the check that fails. Should the test be adapted instead of listed here?

Tested

  • python -m unittest tools.tests.test_sanitizer_report passes with the line (27 tests, 2 skipped) on Windows 10 (Python 3.12.10), and on Ubuntu 24.04 under WSL2 (a virtualised kernel, not bare-metal, Python 3.12.3) with an earlier wording of the line; only its reason text differs from this head (two heads back), and the WSL2 VM did not start for a re-run on this head. With the sanitizer name misspelled, or with the line twice, test_every_entry_parses fails with a ValueError naming the line, so the file is checked; after restoring it the tests pass again.
  • precise_wait passes 10 of 10 runs in an ASan build and 10 of 10 in a TSan build on that Ubuntu under WSL2 (setarch x86_64 -R).
  • check_conventions --base upstream/main passes, and git merge-tree against main is clean.
  • Not run: the nightly workflow itself with this line (it stays red until fix(build): do not build libSceAddressSanitizer in an ASan or TSan build #12894 lets libSceAddressSanitizer build), and the plain and the sanitized build measured in one job on a hosted runner.

Overlap

I took the changed files of each of the 1480 open PRs from git diff --name-only against its merge base: four change .github/sanitizer-known-failures.txt, tools/sanitizer_report.py, its test or PreciseWait.cpp (#12483, #12493, #12872 and #13189), and none of them changes .github/sanitizer-known-failures.txt or PreciseWait.cpp. git merge-tree of this head with each of the four is clean, and so is git merge-tree of each of them against main alone.

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

AI-assisted (Claude Code).

🤖 Generated with Claude Code

…nner

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
@oneandonlydean

Copy link
Copy Markdown
Collaborator

@xXPBSXx the entry is well formed (exact test name, the two sanitizers of the nightly job), the three nightly logs do show only a timing failure with no sanitizer report next to it, and the new line passes the report tests. The reason it gives does not hold up against the plain builds, though:

  1. The line says the hosted ubuntu-latest runner oversleeps PreciseSleepUs(50). On that same runner the unsanitized Linux job of the Build workflow passes precise_wait (Passed 0.12 sec) in the four most recent workflow_dispatch runs on main (41020461362, 41019136355, 41017927213, 41017890868), while all three nightly Sanitizers runs fail it at 116 to 120 us. So the evidence so far points at the ASan/UBSan build of the test, or at that job's setup, rather than at the runner alone. Please find out which (for example the median of PreciseSleepUs(50) from the plain and the sanitized build in one job) and put the finding in the reason. If it is the instrumentation, consider adapting the test's bound for sanitizer builds instead of listing it.

  2. release.yml excludes the test from the Release run, which is an unsanitized build; unless it is shown to be the same effect, the reason should not say the nightly fails "for the same reason".

  3. A listed failure is reported with its reason only: the "First sanitizer report" column is printed for unlisted failures, so a genuine sanitizer finding inside this test would be hidden behind the timing reason. Please say in the description that the three failing runs contain no sanitizer report for precise_wait (the 30 October log has just the two timing lines PreciseSleepUs(50)/PreciseSleepUntil(+50us) for it).

Optional: in the 29 and 30 October runs the busy-runner skip fires for PreciseSleepUs(50) but not for PreciseSleepUntil(+50us), which is the check that fails; the description says the skip does not apply.

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
@xXPBSXx

xXPBSXx commented Oct 30, 2026

Copy link
Copy Markdown
Contributor Author

Thanks for the review. The three points, with what the stored logs show:

  1. The linux job of the Build workflow does not run on ubuntu-latest: build.yml sets runs-on: [self-hosted, linux, x64, anyps5] for it, and the four runs you list (41020461362, 41019136355, 41017927213, 41017890868) ran on the runners anyps5-linux-05, anyps5-2-linux-12, anyps5-2-linux-1 and anyps5-2-linux-6, all labelled self-hosted,linux,x64,anyps5. So that pass says nothing about the hosted runner. On the hosted runner without a sanitizer the test fails too: the Release runs 39158404755 (18 October) and 39322114724 (19 October), which configure -DCMAKE_BUILD_TYPE=Release and contain no sanitizer flag, report PreciseSleepUs(50) median overslept target bound at 111468 ns and 114223 ns. The nightly values are 117 to 120 us, about 6 us above those, which points to the runner rather than the instrumentation as the main cause, though the two kinds of run were not measured in one job. I did not measure the plain and the sanitized build in one job on a hosted runner; that comparison has not been run.
  2. The reason in the line no longer says "for the same reason". It now states what the logs show: the nightly values, the two Release runs at 111 and 114 us on the same runner type, and that the self-hosted Linux job passes the test.
  3. The description now says that the three failing runs contain no sanitizer report for precise_wait (only the timing lines), and its remark about the busy-runner skip is corrected: on 29 and 30 October the skip applies to PreciseSleepUs(50) but not to PreciseSleepUntil(+50us), the check that fails.

The new head is b9dc24cdd3, one more commit on this branch that changes only the text of the line; python -m unittest tools.tests.test_sanitizer_report passes with it on Windows 10, and with the sanitizer name misspelled or the line twice test_every_entry_parses fails with a ValueError naming the line. It was not run on Linux again because the Ubuntu VM I use did not start.

AI-assisted (Claude Code).

@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.

The updated runner diagnosis is well supported, but I found a blocking policy issue with encoding this timing flake in sanitizer-known-failures.txt. sanitizer_report treats a known failure purely by test name, not by failure cause or whether a sanitizer report was captured. On current code, summarize('ASan', {'precise_wait':'failed'}, {'precise_wait':'hosted runner timing'}, {'precise_wait':'SUMMARY: AddressSanitizer: heap-buffer-overflow in PreciseWait'}) returns failing=False and prints only the Known failure table; the sanitizer report is omitted. So after this line lands, a future real ASan/UBSan defect inside precise_wait would make the nightly pass as a known hosted-runner timing failure. That directly confirms the masking risk oneandonlydean raised; clarifying that the current three runs contain no sanitizer report does not protect future runs. Please handle the hosted timing behavior at the test/workflow level instead (for example a sanitizer/hosted-runner-aware bound or skip), or change the reporting policy so a known test is still unexpected when a sanitizer report is present, with a regression for that distinction. The evidence that ubuntu-latest itself contributes to the current timing failure looks reasonable; my blocker is only the unsafe suppression mechanism.

@adriadam10 adriadam10 left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

Agree with @oneandonlydean and @malekaifa on the mechanism, and the runner diagnosis itself is well supported. Requested change:

  • .github/sanitizer-known-failures.txt:9: summarize in tools/sanitizer_report.py (lines 89-90) treats a known failure by test name only, so once precise_wait is listed a real ASan/UBSan report inside it would be printed as "Known failure: hosted runner timing" and the nightly would stay green. Please don't encode a timing flake there.
  • Handle it at the workflow/test level instead: PreciseWait.cpp already honours APS5_SKIP_TIMING_TESTS (lines 14-19), so set it in the nightly Sanitizers job's test step, or exclude it there with ctest -E '^precise_wait$' as release.yml:90 does, or give the sanitizer/hosted build a wider bound. Then the test is skipped, not listed, and any sanitizer report from it still fails the run.
  • Alternatively, change the reporting policy so a known test with a captured sanitizer report stays unexpected, with a regression test for that distinction (that would be its own PR touching tools/sanitizer_report.py, which overlaps #12483, #12493, #12872 and #13189).

@oneandonlydean oneandonlydean self-assigned this Oct 30, 2026
@xXPBSXx

xXPBSXx commented Oct 30, 2026

Copy link
Copy Markdown
Contributor Author

Closing in favour of #13325, which is merged: malekaifa, oneandonlydean and adriadam10 showed that a known-failures entry matches by test name and could hide a sanitizer report in this test. #13325 sets the existing APS5_SKIP_TIMING_TESTS for the nightly's ctest step instead, so a sanitizer report in precise_wait still fails the run.

AI-assisted (Claude Code).

@xXPBSXx xXPBSXx closed this Oct 30, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants