fix(windows): use precise waits in sub-millisecond polling loops #1551

Merged
MarcZX10 merged 2 commits from upstream-pr/1551 into main 2026-10-10 08:52:49 +00:00
MarcZX10 commented 2026-10-08 12:06:25 +00:00 (Migrated from github.com)

Imported from boykopovar/AnyPS5. Originally posted by MarcZX10 on 2026-10-08T12:06:25Z.


What

Replace sub-millisecond std::this_thread::sleep_for polling with PreciseSleepUs() in three host-side loops. On Windows, winpthreads truncates these nanosleep requests to whole milliseconds, so requests below 1 ms return immediately and spin. This addresses the Windows busy-spin behavior documented in #1471.

  • AGC WAIT_REG_MEM: 50 µs
  • APR counter/address wait: 50 µs
  • Font lock backoff: 30 µs

Keep the focused precise_wait CTest for the helper.

Relationship to #1576

The production call-site changes originated in #1576 and are retained here with Shaan credited as co-author. The maintainer closed #1576 as a duplicate of this PR on 2026-10-10, identifying #1551 as the single carrier. This PR also includes the focused PreciseSleepUs helper regression test.

The AIO substitutions were removed after Windows measurements showed that the AIO wait loops return on their first check and the change had no measurable benefit. The same report found each precise wait takes about 0.5 ms instead of the requested 10–50 µs, so no AIO performance claim is made.

Overlap audit

The automated overlap notice for #1360 is only the insertion point in core/libs/prx/libc/CMakeLists.txt. #1360 registers its mapping-history test; this PR registers the precise-wait helper test. They add separate targets and test behavior, with no production-file overlap or dependency.

Tested

Current PR head is 54a90185147ea49d1913bccfed53fb477e619b9f, rebased linearly onto upstream main at 6cc33583326dd86c35f14710b984d767405d203e. The five-file diff contains three production call sites, the helper test, and its CMake registration.

  • Linux x86-64, GCC 12.2, Release, Unix Makefiles: built libc, libSceAgcDriver, libSceFont, libkernel, precise_wait_tests, agc_driver_pm4_tests, guest_aio_tests, guest_font_tests, and guest_font_writing_line_tests.
  • Focused CTest on this head: 5/5 passed (precise_wait, agc_driver_pm4, guest_aio, guest_font, guest_font_writing_line; 0.08 s total).
  • python3 tools/check_conventions.py --base upstream/main and git diff --check upstream/main...HEAD pass locally.
  • A contributor's Windows 10 / MinGW GCC 15.2 report measured sleep_for(10/50/200 µs) returning immediately and PreciseSleepUs taking about 0.50 ms; see the report. An independent Windows 11 Pro 25H2 report on earlier head d6c7e2f6, cherry-picked onto main d70b8998, used RTX 5060 Ti / NVIDIA 617.42, MinGW-w64 GCC 15.2.0, Release and a full build plus libs: precise_wait passed and full CTest passed (511/511) (report). These Windows runs predate this rebase.
  • The helper test verifies the requested minimum delay; it does not independently detect a call site reverting to sleep_for.
  • GitHub Build run 38038198535 and Conventions run 38038197304 are queued on this head. The fork eligibility gate skips full Linux and Windows builds; eligible register-context, write-watch, and relinker jobs are pending.

Checklist

  • Based on current main; one topic: use the precise wait helper at sub-millisecond host polling sites and test the helper
  • The duplicate production call-site changes from #1576 are consolidated here, with the original author credited; #1576 is closed
  • No comments added to code
  • No notes or investigation files added
  • No third-party code added
  • Depends on: none
  • AI-assisted: yes
<!-- greyfinch-sync:boykopovar/AnyPS5:issue:4786516952 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/pull/1551). Originally posted by [MarcZX10](https://github.com/MarcZX10) on 2026-10-08T12:06:25Z. --- ### What Replace sub-millisecond `std::this_thread::sleep_for` polling with `PreciseSleepUs()` in three host-side loops. On Windows, winpthreads truncates these `nanosleep` requests to whole milliseconds, so requests below 1 ms return immediately and spin. This addresses the Windows busy-spin behavior documented in #1471. - AGC `WAIT_REG_MEM`: 50 µs - APR counter/address wait: 50 µs - Font lock backoff: 30 µs Keep the focused `precise_wait` CTest for the helper. ### Relationship to #1576 The production call-site changes originated in #1576 and are retained here with Shaan credited as co-author. The maintainer closed #1576 as a duplicate of this PR on 2026-10-10, identifying #1551 as the single carrier. This PR also includes the focused `PreciseSleepUs` helper regression test. The AIO substitutions were removed after Windows measurements showed that the AIO wait loops return on their first check and the change had no measurable benefit. The same report found each precise wait takes about 0.5 ms instead of the requested 10–50 µs, so no AIO performance claim is made. ### Overlap audit The automated overlap notice for #1360 is only the insertion point in `core/libs/prx/libc/CMakeLists.txt`. #1360 registers its mapping-history test; this PR registers the precise-wait helper test. They add separate targets and test behavior, with no production-file overlap or dependency. ### Tested Current PR head is `54a90185147ea49d1913bccfed53fb477e619b9f`, rebased linearly onto upstream `main` at `6cc33583326dd86c35f14710b984d767405d203e`. The five-file diff contains three production call sites, the helper test, and its CMake registration. - Linux x86-64, GCC 12.2, Release, Unix Makefiles: built `libc`, `libSceAgcDriver`, `libSceFont`, `libkernel`, `precise_wait_tests`, `agc_driver_pm4_tests`, `guest_aio_tests`, `guest_font_tests`, and `guest_font_writing_line_tests`. - Focused CTest on this head: 5/5 passed (`precise_wait`, `agc_driver_pm4`, `guest_aio`, `guest_font`, `guest_font_writing_line`; 0.08 s total). - `python3 tools/check_conventions.py --base upstream/main` and `git diff --check upstream/main...HEAD` pass locally. - A contributor's Windows 10 / MinGW GCC 15.2 report measured `sleep_for(10/50/200 µs)` returning immediately and `PreciseSleepUs` taking about 0.50 ms; see [the report](https://github.com/boykopovar/AnyPS5/pull/1576#issuecomment-6077516702). An independent Windows 11 Pro 25H2 report on earlier head `d6c7e2f6`, cherry-picked onto `main` `d70b8998`, used RTX 5060 Ti / NVIDIA 617.42, MinGW-w64 GCC 15.2.0, Release and a full build plus `libs`: `precise_wait` passed and full CTest passed (511/511) ([report](https://github.com/boykopovar/AnyPS5/pull/1551#issuecomment-6081053209)). These Windows runs predate this rebase. - The helper test verifies the requested minimum delay; it does not independently detect a call site reverting to `sleep_for`. - GitHub Build run [38038198535](https://github.com/boykopovar/AnyPS5/actions/runs/38038198535) and Conventions run [38038197304](https://github.com/boykopovar/AnyPS5/actions/runs/38038197304) are queued on this head. The fork eligibility gate skips full Linux and Windows builds; eligible register-context, write-watch, and relinker jobs are pending. ### Checklist - [x] Based on current `main`; one topic: use the precise wait helper at sub-millisecond host polling sites and test the helper - [x] The duplicate production call-site changes from #1576 are consolidated here, with the original author credited; #1576 is closed - [x] No comments added to code - [x] No notes or investigation files added - [x] No third-party code added - [x] Depends on: none - [x] AI-assisted: yes
MarcZX10 commented 2026-10-08 12:07:00 +00:00 (Migrated from github.com)

Imported from boykopovar/AnyPS5. Originally posted by MarcZX10 on 2026-10-08T12:07:00Z.


Rebased directly onto upstream/main (c68c7576); current head is 679549800f5083fffe17d5ca820af7c2e7fcc3af. The five focused Linux tests passed, including five consecutive precise_wait runs; conventions and git diff --check pass. Windows remains untested locally. Could a maintainer approve the current-head workflows, which are action_required with no jobs?

<!-- greyfinch-sync:boykopovar/AnyPS5:comment:6059491432 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/pull/1551#issuecomment-6059491432). Originally posted by [MarcZX10](https://github.com/MarcZX10) on 2026-10-08T12:07:00Z. --- Rebased directly onto `upstream/main` (`c68c7576`); current head is `679549800f5083fffe17d5ca820af7c2e7fcc3af`. The five focused Linux tests passed, including five consecutive `precise_wait` runs; conventions and `git diff --check` pass. Windows remains untested locally. Could a maintainer approve the current-head workflows, which are `action_required` with no jobs?
MarcZX10 commented 2026-10-08 20:29:01 +00:00 (Migrated from github.com)

Imported from boykopovar/AnyPS5. Originally posted by MarcZX10 on 2026-10-08T20:29:01Z.


Rebased this PR onto current upstream main (4b6ab6bb) and updated the body with the new head and validation. I also moved the precise_wait CMake registration beside guest_time_conversion, away from the common if(BUILD_TESTING) insertion point used by #1806 and #1814. Those PRs remain independent; this one has no dependency on either. The current CMake configure/build and focused CTest pass, and conventions plus git diff --check pass.

<!-- greyfinch-sync:boykopovar/AnyPS5:comment:6068461440 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/pull/1551#issuecomment-6068461440). Originally posted by [MarcZX10](https://github.com/MarcZX10) on 2026-10-08T20:29:01Z. --- Rebased this PR onto current upstream `main` (`4b6ab6bb`) and updated the body with the new head and validation. I also moved the `precise_wait` CMake registration beside `guest_time_conversion`, away from the common `if(BUILD_TESTING)` insertion point used by #1806 and #1814. Those PRs remain independent; this one has no dependency on either. The current CMake configure/build and focused CTest pass, and conventions plus `git diff --check` pass.
MarcZX10 commented 2026-10-08 20:29:16 +00:00 (Migrated from github.com)

Imported from boykopovar/AnyPS5. Originally posted by MarcZX10 on 2026-10-08T20:29:16Z.


The current-head Build, Conventions and Progress report runs were created as action_required (no PR checks are reported). The contribution guide says a maintainer must approve fork workflows before they can run. Could a maintainer approve the runs for head 0999ed5a so upstream CI can validate this rebase?

<!-- greyfinch-sync:boykopovar/AnyPS5:comment:6068465853 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/pull/1551#issuecomment-6068465853). Originally posted by [MarcZX10](https://github.com/MarcZX10) on 2026-10-08T20:29:16Z. --- The current-head Build, Conventions and Progress report runs were created as `action_required` (no PR checks are reported). The contribution guide says a maintainer must approve fork workflows before they can run. Could a maintainer approve the runs for head `0999ed5a` so upstream CI can validate this rebase?
MarcZX10 commented 2026-10-08 21:22:52 +00:00 (Migrated from github.com)

Imported from boykopovar/AnyPS5. Originally posted by MarcZX10 on 2026-10-08T21:22:52Z.


Rebased onto current upstream main (364a56b; head 0812c0bc). The reviewed six-file diff is unchanged in scope. The focused helper test compiles and passes directly on this head; the prior head passed the CMake configure/build and focused CTest runs. Conventions and git diff --check pass. No checks are reported for the rebased head; Windows remains untested locally.

<!-- greyfinch-sync:boykopovar/AnyPS5:comment:6069312517 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/pull/1551#issuecomment-6069312517). Originally posted by [MarcZX10](https://github.com/MarcZX10) on 2026-10-08T21:22:52Z. --- Rebased onto current upstream `main` (`364a56b`; head `0812c0bc`). The reviewed six-file diff is unchanged in scope. The focused helper test compiles and passes directly on this head; the prior head passed the CMake configure/build and focused CTest runs. Conventions and `git diff --check` pass. No checks are reported for the rebased head; Windows remains untested locally.
MarcZX10 commented 2026-10-08 21:24:41 +00:00 (Migrated from github.com)

Imported from boykopovar/AnyPS5. Originally posted by MarcZX10 on 2026-10-08T21:24:41Z.


The Build/Conventions workflow runs for current head 0812c0bcec6cfcd55af3902dda6cd2ba561a857f are marked action_required and have no jobs, so upstream CI has not run yet. CONTRIBUTING requires maintainer approval for fork workflows. Could an authorized maintainer approve these current-head runs?

<!-- greyfinch-sync:boykopovar/AnyPS5:comment:6069339354 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/pull/1551#issuecomment-6069339354). Originally posted by [MarcZX10](https://github.com/MarcZX10) on 2026-10-08T21:24:41Z. --- The Build/Conventions workflow runs for current head `0812c0bcec6cfcd55af3902dda6cd2ba561a857f` are marked `action_required` and have no jobs, so upstream CI has not run yet. CONTRIBUTING requires maintainer approval for fork workflows. Could an authorized maintainer approve these current-head runs?
MarcZX10 commented 2026-10-08 21:51:10 +00:00 (Migrated from github.com)

Imported from boykopovar/AnyPS5. Originally posted by MarcZX10 on 2026-10-08T21:51:10Z.


The fork Build on the previous head found a Windows link failure in precise_wait_tests.exe: undefined __gxx_personality_v0. The test target was missing configure_windows_unwind, which the repository applies to other C++ test executables. Added that configuration in head b439aa29, rebased onto current main 94b1eecb; conventions, diff check and the focused helper test pass. I dispatched a new fork Build (37849602930); its Windows result is still pending. Upstream checks remain action_required.

<!-- greyfinch-sync:boykopovar/AnyPS5:comment:6069732245 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/pull/1551#issuecomment-6069732245). Originally posted by [MarcZX10](https://github.com/MarcZX10) on 2026-10-08T21:51:10Z. --- The fork Build on the previous head found a Windows link failure in `precise_wait_tests.exe`: undefined `__gxx_personality_v0`. The test target was missing `configure_windows_unwind`, which the repository applies to other C++ test executables. Added that configuration in head `b439aa29`, rebased onto current `main` `94b1eecb`; conventions, diff check and the focused helper test pass. I dispatched a new fork Build (`37849602930`); its Windows result is still pending. Upstream checks remain `action_required`.
MarcZX10 commented 2026-10-08 22:06:58 +00:00 (Migrated from github.com)

Imported from boykopovar/AnyPS5. Originally posted by MarcZX10 on 2026-10-08T22:06:58Z.


The second Windows failure on head b439aa29 confirmed that configure_windows_unwind only renames unwind sections after linking; it does not provide __gxx_personality_v0. The test now links libc (which supplies the project personality symbol) and adds the matching Windows DLL path, while retaining unwind setup. Current head 1f8a2ccc is rebased onto ae91d978; conventions, diff check and the focused helper test pass. New fork Build 37851358263 is queued; its Windows result is pending. Upstream checks remain action_required.

<!-- greyfinch-sync:boykopovar/AnyPS5:comment:6069968936 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/pull/1551#issuecomment-6069968936). Originally posted by [MarcZX10](https://github.com/MarcZX10) on 2026-10-08T22:06:58Z. --- The second Windows failure on head `b439aa29` confirmed that `configure_windows_unwind` only renames unwind sections after linking; it does not provide `__gxx_personality_v0`. The test now links `libc` (which supplies the project personality symbol) and adds the matching Windows DLL path, while retaining unwind setup. Current head `1f8a2ccc` is rebased onto `ae91d978`; conventions, diff check and the focused helper test pass. New fork Build `37851358263` is queued; its Windows result is pending. Upstream checks remain `action_required`.
MarcZX10 commented 2026-10-08 22:27:46 +00:00 (Migrated from github.com)

Imported from boykopovar/AnyPS5. Originally posted by MarcZX10 on 2026-10-08T22:27:46Z.


The re-scoped test-only head is adc6a7ed. Its upstream Build and Conventions runs are action_required with no jobs, while the fork Build is running. CONTRIBUTING says a maintainer must approve fork workflows; could an authorized maintainer approve the current-head runs?

<!-- greyfinch-sync:boykopovar/AnyPS5:comment:6070309349 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/pull/1551#issuecomment-6070309349). Originally posted by [MarcZX10](https://github.com/MarcZX10) on 2026-10-08T22:27:46Z. --- The re-scoped test-only head is `adc6a7ed`. Its upstream Build and Conventions runs are `action_required` with no jobs, while the fork Build is running. CONTRIBUTING says a maintainer must approve fork workflows; could an authorized maintainer approve the current-head runs?
MarcZX10 commented 2026-10-08 22:55:42 +00:00 (Migrated from github.com)

Imported from boykopovar/AnyPS5. Originally posted by MarcZX10 on 2026-10-08T22:55:42Z.


The test-only PR is now rebased onto current main f1451396 at head 87b26330; local conventions and the focused CTest pass. The new upstream Build and Conventions runs are action_required with no jobs, per the documented fork policy. Could an authorized maintainer approve those current-head runs? The fork Build is queued.

<!-- greyfinch-sync:boykopovar/AnyPS5:comment:6070677433 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/pull/1551#issuecomment-6070677433). Originally posted by [MarcZX10](https://github.com/MarcZX10) on 2026-10-08T22:55:42Z. --- The test-only PR is now rebased onto current `main` `f1451396` at head `87b26330`; local conventions and the focused CTest pass. The new upstream Build and Conventions runs are `action_required` with no jobs, per the documented fork policy. Could an authorized maintainer approve those current-head runs? The fork Build is queued.
MarcZX10 commented 2026-10-09 08:35:53 +00:00 (Migrated from github.com)

Imported from boykopovar/AnyPS5. Originally posted by MarcZX10 on 2026-10-09T08:35:53Z.


Rebased the isolated test-only change onto current upstream main 6cc0503d; the full diff is still just CTest registration and one small regression test. The current Linux precise_wait test passes (1/1, 0.00 s), conventions and diff checks pass, and prior Linux/Windows full CTest both passed on this exact test source. Fork Build 37905909616 is running on the updated head.

<!-- greyfinch-sync:boykopovar/AnyPS5:comment:6077433053 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/pull/1551#issuecomment-6077433053). Originally posted by [MarcZX10](https://github.com/MarcZX10) on 2026-10-09T08:35:53Z. --- Rebased the isolated test-only change onto current upstream `main` `6cc0503d`; the full diff is still just CTest registration and one small regression test. The current Linux `precise_wait` test passes (1/1, 0.00 s), conventions and diff checks pass, and prior Linux/Windows full CTest both passed on this exact test source. Fork Build [37905909616](https://github.com/MarcZX100/AnyPS5/actions/runs/37905909616) is running on the updated head.
MarcZX10 commented 2026-10-09 08:47:14 +00:00 (Migrated from github.com)

Imported from boykopovar/AnyPS5. Originally posted by MarcZX10 on 2026-10-09T08:47:14Z.


Fork Build completed with Linux and Windows blocked on the unrelated agc_shader_fusion_tests compile error: VulkanTestDevice.hpp cannot find spirv/unified1/spirv.hpp. All three relinker jobs passed. I recorded the result in the PR description and linked #2093 as the dependency fix.

<!-- greyfinch-sync:boykopovar/AnyPS5:comment:6077594926 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/pull/1551#issuecomment-6077594926). Originally posted by [MarcZX10](https://github.com/MarcZX10) on 2026-10-09T08:47:14Z. --- Fork Build completed with Linux and Windows blocked on the unrelated `agc_shader_fusion_tests` compile error: `VulkanTestDevice.hpp` cannot find `spirv/unified1/spirv.hpp`. All three relinker jobs passed. I recorded the result in the PR description and linked #2093 as the dependency fix.
MarcZX10 commented 2026-10-09 11:18:32 +00:00 (Migrated from github.com)

Imported from boykopovar/AnyPS5. Originally posted by MarcZX10 on 2026-10-09T11:18:32Z.


Rebased PR #1551 linearly onto current main (d70b8998). On head 46c8f5af, the focused Linux CTest passes (1/1, 0.02 s), conventions and diff checks pass, and GitHub reports it mergeable. The previous fork full CTest results remain disclosed in the body and were not rerun after this rebase. Under #2113, could a collaborator with write access run Actions → Build for this PR so the full Linux, Windows and relinker checks are recorded on the new head?

<!-- greyfinch-sync:boykopovar/AnyPS5:comment:6079815963 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/pull/1551#issuecomment-6079815963). Originally posted by [MarcZX10](https://github.com/MarcZX10) on 2026-10-09T11:18:32Z. --- Rebased PR #1551 linearly onto current `main` (`d70b8998`). On head `46c8f5af`, the focused Linux CTest passes (1/1, 0.02 s), conventions and diff checks pass, and GitHub reports it mergeable. The previous fork full CTest results remain disclosed in the body and were not rerun after this rebase. Under #2113, could a collaborator with write access run Actions → Build for this PR so the full Linux, Windows and relinker checks are recorded on the new head?
MarcZX10 commented 2026-10-09 12:04:39 +00:00 (Migrated from github.com)

Imported from boykopovar/AnyPS5. Originally posted by MarcZX10 on 2026-10-09T12:04:39Z.


I expanded this PR to include the four sub-millisecond polling call-site changes from #1576 and credited Shaan as co-author. On exact head d6c7e2f6, the Linux Release build and focused CTest pass (7/7), conventions pass, and git diff --check passes. The fork Build dispatch is skipped by its eligibility gate because manual full builds require a PR open in the fork; upstream currently reports only Conventions. Under #2113, could a collaborator with upstream write access run/approve Build for this head, including the Windows full CTest?

<!-- greyfinch-sync:boykopovar/AnyPS5:comment:6080515330 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/pull/1551#issuecomment-6080515330). Originally posted by [MarcZX10](https://github.com/MarcZX10) on 2026-10-09T12:04:39Z. --- I expanded this PR to include the four sub-millisecond polling call-site changes from #1576 and credited Shaan as co-author. On exact head `d6c7e2f6`, the Linux Release build and focused CTest pass (7/7), conventions pass, and `git diff --check` passes. The fork Build dispatch is skipped by its eligibility gate because manual full builds require a PR open in the fork; upstream currently reports only Conventions. Under #2113, could a collaborator with upstream write access run/approve Build for this head, including the Windows full CTest?
rmz-24 commented 2026-10-09 12:38:45 +00:00 (Migrated from github.com)

Imported from boykopovar/AnyPS5. Originally posted by rmz-24 on 2026-10-09T12:38:45Z.


Windows run: Windows 11 Pro 25H2 (10.0.26200.9457), RTX 5060 Ti (NVIDIA 617.42), MinGW-w64 GCC 15.2.0 (WinLibs r7), Release, -DANYPS5_ENABLE_SPIRV_TOOLS=ON, full build plus libs. d6c7e2f6 cherry-picked onto current main d70b8998 (applies cleanly).

  • precise_wait passes.
  • Full ctest: 511/511, including guest_aio, guest_ampr_markers, guest_font, guest_font_writing_line and agc_driver_pm4_failure.

AI-assisted: yes

<!-- greyfinch-sync:boykopovar/AnyPS5:comment:6081053209 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/pull/1551#issuecomment-6081053209). Originally posted by [rmz-24](https://github.com/rmz-24) on 2026-10-09T12:38:45Z. --- Windows run: Windows 11 Pro 25H2 (10.0.26200.9457), RTX 5060 Ti (NVIDIA 617.42), MinGW-w64 GCC 15.2.0 (WinLibs r7), Release, `-DANYPS5_ENABLE_SPIRV_TOOLS=ON`, full build plus `libs`. d6c7e2f6 cherry-picked onto current `main` d70b8998 (applies cleanly). - `precise_wait` passes. - Full ctest: 511/511, including `guest_aio`, `guest_ampr_markers`, `guest_font`, `guest_font_writing_line` and `agc_driver_pm4_failure`. AI-assisted: yes
MarcZX10 commented 2026-10-09 13:11:14 +00:00 (Migrated from github.com)

Imported from boykopovar/AnyPS5. Originally posted by MarcZX10 on 2026-10-09T13:11:14Z.


Thanks for the Windows report: it covers the exact PR head d6c7e2f6 on current main, and the full Windows CTest passes (511/511). That supplies the Windows evidence. The upstream PR still reports only Conventions; could an authorized collaborator run the official Build for this head to record Linux and the relinker matrix as well?

<!-- greyfinch-sync:boykopovar/AnyPS5:comment:6081563397 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/pull/1551#issuecomment-6081563397). Originally posted by [MarcZX10](https://github.com/MarcZX10) on 2026-10-09T13:11:14Z. --- Thanks for the Windows report: it covers the exact PR head `d6c7e2f6` on current `main`, and the full Windows CTest passes (511/511). That supplies the Windows evidence. The upstream PR still reports only Conventions; could an authorized collaborator run the official Build for this head to record Linux and the relinker matrix as well?
MarcZX10 commented 2026-10-09 19:33:15 +00:00 (Migrated from github.com)

Imported from boykopovar/AnyPS5. Originally posted by MarcZX10 on 2026-10-09T19:33:15Z.


Rebased the existing PR linearly onto current main (ae3d5f95) at head a62e5f49. The diff still contains the same four wait-site changes and focused helper test. On this source diff, all affected Linux libraries and test targets build, and the seven focused CTests pass (7/7). Local and GitHub Conventions pass. I updated the description to label the Windows full-suite report as pre-rebase evidence.\n\nCould a collaborator with write access run the required upstream Linux/Windows Build and relinker matrix for this exact head under #2113?

<!-- greyfinch-sync:boykopovar/AnyPS5:comment:6087877846 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/pull/1551#issuecomment-6087877846). Originally posted by [MarcZX10](https://github.com/MarcZX10) on 2026-10-09T19:33:15Z. --- Rebased the existing PR linearly onto current `main` (`ae3d5f95`) at head `a62e5f49`. The diff still contains the same four wait-site changes and focused helper test. On this source diff, all affected Linux libraries and test targets build, and the seven focused CTests pass (7/7). Local and GitHub Conventions pass. I updated the description to label the Windows full-suite report as pre-rebase evidence.\n\nCould a collaborator with write access run the required upstream Linux/Windows Build and relinker matrix for this exact head under #2113?
MarcZX10 commented 2026-10-09 20:02:08 +00:00 (Migrated from github.com)

Imported from boykopovar/AnyPS5. Originally posted by MarcZX10 on 2026-10-09T20:02:08Z.


Validation on the updated head

I rebased the existing branch linearly onto upstream main at 8b393b6e and pushed head 46a77cca. The full six-file diff still contains the same four polling changes and focused helper test. On this source, all affected libraries and seven focused tests build; CTest passes 7/7. Local Conventions and git diff --check pass. The Windows full-suite report remains clearly labeled as pre-rebase evidence.

The matching production call-site work from #1576 is integrated here with Shaan credited as co-author. #1551 remains the fuller candidate because it includes the same production changes plus the helper regression test. The required upstream Build and relinker matrix is still pending for this head.

<!-- greyfinch-sync:boykopovar/AnyPS5:comment:6088323053 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/pull/1551#issuecomment-6088323053). Originally posted by [MarcZX10](https://github.com/MarcZX10) on 2026-10-09T20:02:08Z. --- ### Validation on the updated head I rebased the existing branch linearly onto upstream `main` at `8b393b6e` and pushed head `46a77cca`. The full six-file diff still contains the same four polling changes and focused helper test. On this source, all affected libraries and seven focused tests build; CTest passes 7/7. Local Conventions and `git diff --check` pass. The Windows full-suite report remains clearly labeled as pre-rebase evidence. The matching production call-site work from #1576 is integrated here with Shaan credited as co-author. #1551 remains the fuller candidate because it includes the same production changes plus the helper regression test. The required upstream Build and relinker matrix is still pending for this head.
adriadam10 commented 2026-10-09 23:57:49 +00:00 (Migrated from github.com)

Imported from boykopovar/AnyPS5. Originally posted by adriadam10 on 2026-10-09T23:57:49Z.

Review: CHANGES_REQUESTED


Thanks for the Windows evidence and the helper test. One blocker:

  • The four production changes (Pm4.cpp:816, Apr.cpp:589, Aio.cpp:256/:281, State.cpp:60) are the same edits as the open #1576, which CONTRIBUTING doesn't allow (no open PR implementing the same change). Co-authoring the commit doesn't change that: two PRs can't both land them.
    • Fix: drop the call-site changes from this PR and keep only core/libs/tests/PreciseWait.cpp + its CMake registration (the scope it had before 2026-10-09), with #1576 in Depends on if you want the test to cover it. Or, if you and the author of #1576 prefer this one to carry the change, agree that there and close the other.
  • Minor: precise_wait passes on main without any of these changes (it only exercises the helper), so it won't catch a call site reverting to sleep_for. That's fine as a helper test, just don't claim it covers the call sites.

Checked: Linux build, precise_wait, agc_driver_pm4, guest_aio, guest_font* pass on this head.

<!-- greyfinch-sync:boykopovar/AnyPS5:review:5476465140 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/pull/1551#pullrequestreview-5476465140). Originally posted by [adriadam10](https://github.com/adriadam10) on 2026-10-09T23:57:49Z. **Review:** CHANGES_REQUESTED --- Thanks for the Windows evidence and the helper test. One blocker: - The four production changes (`Pm4.cpp:816`, `Apr.cpp:589`, `Aio.cpp:256`/`:281`, `State.cpp:60`) are the same edits as the open #1576, which CONTRIBUTING doesn't allow (no open PR implementing the same change). Co-authoring the commit doesn't change that: two PRs can't both land them. - Fix: drop the call-site changes from this PR and keep only `core/libs/tests/PreciseWait.cpp` + its CMake registration (the scope it had before 2026-10-09), with #1576 in **Depends on** if you want the test to cover it. Or, if you and the author of #1576 prefer this one to carry the change, agree that there and close the other. - Minor: `precise_wait` passes on `main` without any of these changes (it only exercises the helper), so it won't catch a call site reverting to `sleep_for`. That's fine as a helper test, just don't claim it covers the call sites. Checked: Linux build, `precise_wait`, `agc_driver_pm4`, `guest_aio`, `guest_font*` pass on this head.
MarcZX10 commented 2026-10-10 07:22:03 +00:00 (Migrated from github.com)

Imported from boykopovar/AnyPS5. Originally posted by MarcZX10 on 2026-10-10T07:22:03Z.


Thanks for the review. I agree that the two PRs cannot both land the same production changes, and that the helper test does not prove the call sites use the helper.

I rebased #1551 onto current main (a291ae0f) and reran the affected Linux builds and focused tests: all five focused CTests pass, and local Conventions passes. I updated the description to state the helper test's limits and to mark the overlap with #1576 explicitly.

I have asked Shaan on #1576 to confirm one carrier. My preference is #1551 because it preserves the four production changes with Shaan credited and includes the helper regression test. If Shaan prefers #1576, I will remove the production changes from #1551. I will not ask for both to merge; the overlap remains unresolved until Shaan replies.

<!-- greyfinch-sync:boykopovar/AnyPS5:comment:6095074802 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/pull/1551#issuecomment-6095074802). Originally posted by [MarcZX10](https://github.com/MarcZX10) on 2026-10-10T07:22:03Z. --- Thanks for the review. I agree that the two PRs cannot both land the same production changes, and that the helper test does not prove the call sites use the helper. I rebased #1551 onto current `main` (`a291ae0f`) and reran the affected Linux builds and focused tests: all five focused CTests pass, and local Conventions passes. I updated the description to state the helper test's limits and to mark the overlap with #1576 explicitly. I have asked Shaan on #1576 to confirm one carrier. My preference is #1551 because it preserves the four production changes with Shaan credited and includes the helper regression test. If Shaan prefers #1576, I will remove the production changes from #1551. I will not ask for both to merge; the overlap remains unresolved until Shaan replies.
MarcZX10 commented 2026-10-10 07:27:22 +00:00 (Migrated from github.com)

Imported from boykopovar/AnyPS5. Originally posted by MarcZX10 on 2026-10-10T07:27:22Z.


Follow-up to the review

  • Duplicate PR: maintainer adriadam10 closed #1576 as a duplicate of this PR on 2026-10-10. Shaan remains credited as co-author on the production-change commit.
  • AIO: I removed both AIO substitutions. The Windows measurement in #1576 found the wait loops return on the first check, so that change had no measured benefit; the approximately 0.5 ms wait could also exceed short AIO timeouts.
  • Test scope: the precise_wait test covers the helper's requested minimum delay. It does not prove production call sites use the helper; the PR description now states that limitation.
  • Current diff: three production call sites (AGC, APR, Font), the helper test, and CMake registration. The focused Linux CTests pass 5/5 on head 6c240d55; local Conventions and git diff --check pass.

The current GitHub Build has passed eligibility and Ubuntu register-context jobs. Its Linux and Windows full-build jobs are skipped by the fork eligibility gate; macOS and relinker jobs are still running. The PR description records these limits. Please re-review this updated scope when convenient.

<!-- greyfinch-sync:boykopovar/AnyPS5:comment:6095113741 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/pull/1551#issuecomment-6095113741). Originally posted by [MarcZX10](https://github.com/MarcZX10) on 2026-10-10T07:27:22Z. --- ### Follow-up to the review - **Duplicate PR:** maintainer adriadam10 closed #1576 as a duplicate of this PR on 2026-10-10. Shaan remains credited as co-author on the production-change commit. - **AIO:** I removed both AIO substitutions. The Windows measurement in #1576 found the wait loops return on the first check, so that change had no measured benefit; the approximately 0.5 ms wait could also exceed short AIO timeouts. - **Test scope:** the `precise_wait` test covers the helper's requested minimum delay. It does not prove production call sites use the helper; the PR description now states that limitation. - **Current diff:** three production call sites (AGC, APR, Font), the helper test, and CMake registration. The focused Linux CTests pass 5/5 on head `6c240d55`; local Conventions and `git diff --check` pass. The current GitHub Build has passed eligibility and Ubuntu register-context jobs. Its Linux and Windows full-build jobs are skipped by the fork eligibility gate; macOS and relinker jobs are still running. The PR description records these limits. Please re-review this updated scope when convenient.
MarcZX10 commented 2026-10-10 07:29:26 +00:00 (Migrated from github.com)

Imported from boykopovar/AnyPS5. Originally posted by MarcZX10 on 2026-10-10T07:29:26Z.


Current-head CI result

Build run 38034401344 completed successfully on head 6c240d55.

Check group Result
Register-context (Ubuntu Debug/Release, macOS Intel Debug/Release) Passed
Write-watch (macOS and macOS Intel) Passed
Relinker (Ubuntu, macOS, Windows) Passed
Full Linux and Windows Build Skipped by the fork eligibility gate
Conventions Passed in run 38034477114

The local focused Linux CTests pass 5/5 as recorded in the description. The full CI build matrix did not run on this fork PR; Windows reports in the body are from earlier heads. Please re-review this updated scope and CI result when convenient.

<!-- greyfinch-sync:boykopovar/AnyPS5:comment:6095128770 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/pull/1551#issuecomment-6095128770). Originally posted by [MarcZX10](https://github.com/MarcZX10) on 2026-10-10T07:29:26Z. --- ### Current-head CI result Build run [38034401344](https://github.com/boykopovar/AnyPS5/actions/runs/38034401344) completed successfully on head `6c240d55`. | Check group | Result | |---|---| | Register-context (Ubuntu Debug/Release, macOS Intel Debug/Release) | Passed | | Write-watch (macOS and macOS Intel) | Passed | | Relinker (Ubuntu, macOS, Windows) | Passed | | Full Linux and Windows Build | Skipped by the fork eligibility gate | | Conventions | Passed in run [38034477114](https://github.com/boykopovar/AnyPS5/actions/runs/38034477114) | The local focused Linux CTests pass 5/5 as recorded in the description. The full CI build matrix did not run on this fork PR; Windows reports in the body are from earlier heads. Please re-review this updated scope and CI result when convenient.
MarcZX10 commented 2026-10-10 08:36:22 +00:00 (Migrated from github.com)

Imported from boykopovar/AnyPS5. Originally posted by MarcZX10 on 2026-10-10T08:36:22Z.


Rebased #1551 onto upstream main at 6cc33583 (head 54a90185). The affected Linux Release libraries and tests build; the five focused CTests pass (5/5), and local Conventions plus git diff --check pass.

The maintainer closed #1576 as a duplicate of this PR, so the three production call sites remain consolidated here with Shaan credited as co-author. The current Build and Conventions runs are queued (Build, Conventions); full Linux and Windows jobs are skipped by the fork eligibility gate. Please re-review when the current checks finish.

<!-- greyfinch-sync:boykopovar/AnyPS5:comment:6095737503 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/pull/1551#issuecomment-6095737503). Originally posted by [MarcZX10](https://github.com/MarcZX10) on 2026-10-10T08:36:22Z. --- Rebased #1551 onto upstream `main` at `6cc33583` (head `54a90185`). The affected Linux Release libraries and tests build; the five focused CTests pass (5/5), and local Conventions plus `git diff --check` pass. The maintainer closed #1576 as a duplicate of this PR, so the three production call sites remain consolidated here with Shaan credited as co-author. The current Build and Conventions runs are queued ([Build](https://github.com/boykopovar/AnyPS5/actions/runs/38038198535), [Conventions](https://github.com/boykopovar/AnyPS5/actions/runs/38038267889)); full Linux and Windows jobs are skipped by the fork eligibility gate. Please re-review when the current checks finish.
MarcZX10 commented 2026-10-10 08:52:26 +00:00 (Migrated from github.com)

Imported from boykopovar/AnyPS5. Originally posted by MarcZX10 on 2026-10-10T08:52:26Z.


Follow-up on the review blocker

The duplicate has now been resolved: maintainer adriadam10 closed #1576 as a duplicate of #1551, noting that this PR is the single carrier for the shared call-site changes and includes the helper regression test. Shaan remains credited as co-author.

The current posted head is 54a90185147ea49d1913bccfed53fb477e619b9f. Its eligible GitHub checks have completed:

Check group Result
Conventions Passed
Register-context (Ubuntu and macOS Intel, Debug/Release) Passed
Write-watch (macOS and macOS Intel) Passed
Relinker (Ubuntu, Windows and macOS) Passed
Full Linux and Windows build/test jobs Skipped by the fork eligibility gate

The PR description also clarifies that precise_wait tests the helper's requested minimum delay; it does not prove that production call sites remain wired to the helper. The local focused Linux test results are recorded there as well.

Could you revisit the CHANGES_REQUESTED review with the duplicate closed and these checks complete? I understand the skipped full Linux/Windows jobs still require collaborator-triggered validation under the contribution guide.

<!-- greyfinch-sync:boykopovar/AnyPS5:comment:6095856143 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/pull/1551#issuecomment-6095856143). Originally posted by [MarcZX10](https://github.com/MarcZX10) on 2026-10-10T08:52:26Z. --- ### Follow-up on the review blocker The duplicate has now been resolved: maintainer adriadam10 closed [#1576](https://github.com/boykopovar/AnyPS5/pull/1576) as a duplicate of #1551, noting that this PR is the single carrier for the shared call-site changes and includes the helper regression test. Shaan remains credited as co-author. The current posted head is `54a90185147ea49d1913bccfed53fb477e619b9f`. Its eligible GitHub checks have completed: | Check group | Result | |---|---| | Conventions | Passed | | Register-context (Ubuntu and macOS Intel, Debug/Release) | Passed | | Write-watch (macOS and macOS Intel) | Passed | | Relinker (Ubuntu, Windows and macOS) | Passed | | Full Linux and Windows build/test jobs | Skipped by the fork eligibility gate | The PR description also clarifies that `precise_wait` tests the helper's requested minimum delay; it does not prove that production call sites remain wired to the helper. The local focused Linux test results are recorded there as well. Could you revisit the `CHANGES_REQUESTED` review with the duplicate closed and these checks complete? I understand the skipped full Linux/Windows jobs still require collaborator-triggered validation under the contribution guide.
adriadam10 commented 2026-10-10 08:52:46 +00:00 (Migrated from github.com)

Imported from boykopovar/AnyPS5. Originally posted by adriadam10 on 2026-10-10T08:52:46Z.

Review: APPROVED


Checked the three call sites (Pm4.cpp WAIT_REG_MEM, Apr.cpp counter/address wait, State.cpp font backoff) against the existing PreciseSleepUs helper on main; they build and precise_wait passes on main + this PR (Linux). Windows evidence from @rmz-24 (full ctest 511/511) and @popcoder565's measurements in #1471 cover the behaviour we can't run here. Note the helper test only pins the minimum delay, not the call sites. Merging.

<!-- greyfinch-sync:boykopovar/AnyPS5:review:5478378544 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/pull/1551#pullrequestreview-5478378544). Originally posted by [adriadam10](https://github.com/adriadam10) on 2026-10-10T08:52:46Z. **Review:** APPROVED --- Checked the three call sites (`Pm4.cpp` WAIT_REG_MEM, `Apr.cpp` counter/address wait, `State.cpp` font backoff) against the existing `PreciseSleepUs` helper on main; they build and `precise_wait` passes on main + this PR (Linux). Windows evidence from @rmz-24 (full ctest 511/511) and @popcoder565's measurements in #1471 cover the behaviour we can't run here. Note the helper test only pins the minimum delay, not the call sites. Merging.
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!1551
No description provided.