fix(agc): name the RELEASE_MEM system counter instead of GDS data #7911

Merged
savvaniss merged 2 commits from upstream-pr/7911 into main 2026-10-21 12:54:28 +00:00
savvaniss commented 2026-10-19 13:21:16 +00:00 (Migrated from github.com)

Imported from boykopovar/AnyPS5. Originally posted by savvaniss on 2026-10-19T13:21:16Z.


What

A RELEASE_MEM with DATA_SEL = 4 was refused as "GDS RELEASE_MEM data is not implemented". In amdgpu's GFX10 packet header, 4 is "send 64bit sys counter value"; GDS data is 5, as in Mesa's EOP_DATA_SEL_GDS. The validator now gives each its own refusal:

  • 4: "RELEASE_MEM of the 64-bit system counter (DATA_SEL 4) is not implemented";
  • 5: the existing GDS message;
  • 6 and 7: "reserved RELEASE_MEM DATA_SEL".

DATA_SEL = 4 keeps throwing, because the frequency and epoch of the console's system counter are not known. Writing the 100 MHz count DATA_SEL = 3 uses would be a guess. The debt file now records the gap, and notes that an older KFD header names 4 a CP performance counter instead.

A PS4 title running through #6977's PS4 path writes DATA_SEL = 4 at the end of each frame, which is where the misleading message showed up (#7198).

Tested

Windows 11 Pro 26300, WinLibs GCC 15.2.0, Release.

  • agc_driver_pm4 has a new testReleaseMemDataSelects: data selects 0 to 3 validate, 4 throws the system-counter message, 5 the GDS message, and 6 and 7 the reserved one. It passes 3 of 3 with ANYPS5_GPU=Intel and with ANYPS5_GPU=AMD.
  • agc_driver_pm4_replay and agc_driver_pm4_replay_tool pass.
  • tools/check_conventions.py passes.

Validation: Khronos validation layer 1.4.363 (Vulkan SDK), VK_INSTANCE_LAYERS=VK_LAYER_KHRONOS_validation, ANYPS5_REQUIRE_VULKAN=1, ANYPS5_NO_SHADER_CACHE=1, ctest -R <tests> -V, on main cded26c68 and on this PR merged into it, on both GPUs (AMD driver cache emptied first). Neither log has was not found but was requested by env var VK_INSTANCE_LAYERS. Tests: agc_driver_pm4, agc_driver_pm4_replay and agc_driver_pm4_replay_tool. No validation message on either side; these tests open no Vulkan device.

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: AMD Radeon RX 9070 XT, driver 32.0.31041.1004, Windows 11 Pro 26300; Intel UHD Graphics 770, driver 32.0.101.7088, Windows 11 Pro 26300
  • AI-assisted: yes

🤖 Generated with Claude Code

<!-- greyfinch-sync:boykopovar/AnyPS5:issue:4921607611 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/pull/7911). Originally posted by [savvaniss](https://github.com/savvaniss) on 2026-10-19T13:21:16Z. --- ### What A `RELEASE_MEM` with `DATA_SEL = 4` was refused as "GDS RELEASE_MEM data is not implemented". In [amdgpu's GFX10 packet header](https://github.com/torvalds/linux/blob/master/drivers/gpu/drm/amd/amdgpu/nvd.h), 4 is "send 64bit sys counter value"; GDS data is 5, as in Mesa's `EOP_DATA_SEL_GDS`. The validator now gives each its own refusal: - 4: "RELEASE_MEM of the 64-bit system counter (DATA_SEL 4) is not implemented"; - 5: the existing GDS message; - 6 and 7: "reserved RELEASE_MEM DATA_SEL". `DATA_SEL = 4` keeps throwing, because the frequency and epoch of the console's system counter are not known. Writing the 100 MHz count `DATA_SEL = 3` uses would be a guess. The debt file now records the gap, and notes that an older KFD header names 4 a CP performance counter instead. A PS4 title running through #6977's PS4 path writes `DATA_SEL = 4` at the end of each frame, which is where the misleading message showed up (#7198). ### Tested Windows 11 Pro 26300, WinLibs GCC 15.2.0, Release. - `agc_driver_pm4` has a new `testReleaseMemDataSelects`: data selects 0 to 3 validate, 4 throws the system-counter message, 5 the GDS message, and 6 and 7 the reserved one. It passes 3 of 3 with `ANYPS5_GPU=Intel` and with `ANYPS5_GPU=AMD`. - `agc_driver_pm4_replay` and `agc_driver_pm4_replay_tool` pass. - `tools/check_conventions.py` passes. Validation: Khronos validation layer 1.4.363 (Vulkan SDK), `VK_INSTANCE_LAYERS=VK_LAYER_KHRONOS_validation`, `ANYPS5_REQUIRE_VULKAN=1`, `ANYPS5_NO_SHADER_CACHE=1`, `ctest -R <tests> -V`, on `main` `cded26c68` and on this PR merged into it, on both GPUs (AMD driver cache emptied first). Neither log has `was not found but was requested by env var VK_INSTANCE_LAYERS`. Tests: `agc_driver_pm4`, `agc_driver_pm4_replay` and `agc_driver_pm4_replay_tool`. No validation message on either side; these tests open no Vulkan device. ### 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: AMD Radeon RX 9070 XT, driver 32.0.31041.1004, Windows 11 Pro 26300; Intel UHD Graphics 770, driver 32.0.101.7088, Windows 11 Pro 26300 - [x] AI-assisted: yes 🤖 Generated with [Claude Code](https://claude.com/claude-code)
github-actions[bot] commented 2026-10-19 13:38:25 +00:00 (Migrated from github.com)

Imported from boykopovar/AnyPS5. Originally posted by github-actions[bot] on 2026-10-19T13:38:25Z.


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 6639 docs/dev/debt/libSceAgcDriver.md L19-20

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 2434 docs/dev/debt/libSceAgcDriver.md
PR 4448 docs/dev/debt/libSceAgcDriver.md
PR 4449 docs/dev/debt/libSceAgcDriver.md
PR 5058 docs/dev/debt/libSceAgcDriver.md
PR 5372 docs/dev/debt/libSceAgcDriver.md
PR 5499 docs/dev/debt/libSceAgcDriver.md
PR 5925 docs/dev/debt/libSceAgcDriver.md
PR 6146 docs/dev/debt/libSceAgcDriver.md
PR 6186 core/libs/prx/libSceAgcDriver/tests/Pm4.cpp
PR 6188 core/libs/prx/libSceAgcDriver/Execution/src/Pm4.cpp
PR 6194 docs/dev/debt/libSceAgcDriver.md
PR 6223 docs/dev/debt/libSceAgcDriver.md
PR 6280 docs/dev/debt/libSceAgcDriver.md
PR 6300 docs/dev/debt/libSceAgcDriver.md
PR 6412 docs/dev/debt/libSceAgcDriver.md
PR 6481 docs/dev/debt/libSceAgcDriver.md
PR 6548 docs/dev/debt/libSceAgcDriver.md
PR 6549 core/libs/prx/libSceAgcDriver/Execution/src/Pm4.cpp
core/libs/prx/libSceAgcDriver/tests/Pm4.cpp
docs/dev/debt/libSceAgcDriver.md
PR 6612 docs/dev/debt/libSceAgcDriver.md
PR 6801 docs/dev/debt/libSceAgcDriver.md
PR 6808 docs/dev/debt/libSceAgcDriver.md
PR 6867 docs/dev/debt/libSceAgcDriver.md
PR 6868 docs/dev/debt/libSceAgcDriver.md
PR 6887 docs/dev/debt/libSceAgcDriver.md
PR 6946 docs/dev/debt/libSceAgcDriver.md
PR 6947 docs/dev/debt/libSceAgcDriver.md
PR 6965 docs/dev/debt/libSceAgcDriver.md
PR 6973 docs/dev/debt/libSceAgcDriver.md
PR 6977 docs/dev/debt/libSceAgcDriver.md
PR 6987 docs/dev/debt/libSceAgcDriver.md
PR 6989 docs/dev/debt/libSceAgcDriver.md
PR 6995 docs/dev/debt/libSceAgcDriver.md
PR 7002 docs/dev/debt/libSceAgcDriver.md
PR 7256 docs/dev/debt/libSceAgcDriver.md
PR 7449 docs/dev/debt/libSceAgcDriver.md
PR 7505 docs/dev/debt/libSceAgcDriver.md
PR 7604 docs/dev/debt/libSceAgcDriver.md
PR 7642 docs/dev/debt/libSceAgcDriver.md
PR 7800 docs/dev/debt/libSceAgcDriver.md
PR 7803 docs/dev/debt/libSceAgcDriver.md
PR 7883 docs/dev/debt/libSceAgcDriver.md
PR 7893 docs/dev/debt/libSceAgcDriver.md
PR 7910 docs/dev/debt/libSceAgcDriver.md
PR 8014 docs/dev/debt/libSceAgcDriver.md
PR 8395 docs/dev/debt/libSceAgcDriver.md
PR 8424 docs/dev/debt/libSceAgcDriver.md
PR 8538 docs/dev/debt/libSceAgcDriver.md
PR 8564 docs/dev/debt/libSceAgcDriver.md
PR 8592 docs/dev/debt/libSceAgcDriver.md
PR 9020 docs/dev/debt/libSceAgcDriver.md
PR 9077 docs/dev/debt/libSceAgcDriver.md
<!-- greyfinch-sync:boykopovar/AnyPS5:comment:6268579544 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/pull/7911#issuecomment-6268579544). Originally posted by [github-actions[bot]](https://github.com/apps/github-actions) on 2026-10-19T13:38:25Z. --- <!-- pr-overlap --> 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 6639](https://www.github.com/boykopovar/AnyPS5/pull/6639) | `docs/dev/debt/libSceAgcDriver.md` [L19-20](https://github.com/boykopovar/AnyPS5/blob/ce7d547175649416170e8a075f38872669c7e328/docs/dev/debt/libSceAgcDriver.md#L19-L20) | | | 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 2434](https://www.github.com/boykopovar/AnyPS5/pull/2434) | `docs/dev/debt/libSceAgcDriver.md` | | [PR 4448](https://www.github.com/boykopovar/AnyPS5/pull/4448) | `docs/dev/debt/libSceAgcDriver.md` | | [PR 4449](https://www.github.com/boykopovar/AnyPS5/pull/4449) | `docs/dev/debt/libSceAgcDriver.md` | | [PR 5058](https://www.github.com/boykopovar/AnyPS5/pull/5058) | `docs/dev/debt/libSceAgcDriver.md` | | [PR 5372](https://www.github.com/boykopovar/AnyPS5/pull/5372) | `docs/dev/debt/libSceAgcDriver.md` | | [PR 5499](https://www.github.com/boykopovar/AnyPS5/pull/5499) | `docs/dev/debt/libSceAgcDriver.md` | | [PR 5925](https://www.github.com/boykopovar/AnyPS5/pull/5925) | `docs/dev/debt/libSceAgcDriver.md` | | [PR 6146](https://www.github.com/boykopovar/AnyPS5/pull/6146) | `docs/dev/debt/libSceAgcDriver.md` | | [PR 6186](https://www.github.com/boykopovar/AnyPS5/pull/6186) | `core/libs/prx/libSceAgcDriver/tests/Pm4.cpp` | | [PR 6188](https://www.github.com/boykopovar/AnyPS5/pull/6188) | `core/libs/prx/libSceAgcDriver/Execution/src/Pm4.cpp` | | [PR 6194](https://www.github.com/boykopovar/AnyPS5/pull/6194) | `docs/dev/debt/libSceAgcDriver.md` | | [PR 6223](https://www.github.com/boykopovar/AnyPS5/pull/6223) | `docs/dev/debt/libSceAgcDriver.md` | | [PR 6280](https://www.github.com/boykopovar/AnyPS5/pull/6280) | `docs/dev/debt/libSceAgcDriver.md` | | [PR 6300](https://www.github.com/boykopovar/AnyPS5/pull/6300) | `docs/dev/debt/libSceAgcDriver.md` | | [PR 6412](https://www.github.com/boykopovar/AnyPS5/pull/6412) | `docs/dev/debt/libSceAgcDriver.md` | | [PR 6481](https://www.github.com/boykopovar/AnyPS5/pull/6481) | `docs/dev/debt/libSceAgcDriver.md` | | [PR 6548](https://www.github.com/boykopovar/AnyPS5/pull/6548) | `docs/dev/debt/libSceAgcDriver.md` | | [PR 6549](https://www.github.com/boykopovar/AnyPS5/pull/6549) | `core/libs/prx/libSceAgcDriver/Execution/src/Pm4.cpp`<br>`core/libs/prx/libSceAgcDriver/tests/Pm4.cpp`<br>`docs/dev/debt/libSceAgcDriver.md` | | [PR 6612](https://www.github.com/boykopovar/AnyPS5/pull/6612) | `docs/dev/debt/libSceAgcDriver.md` | | [PR 6801](https://www.github.com/boykopovar/AnyPS5/pull/6801) | `docs/dev/debt/libSceAgcDriver.md` | | [PR 6808](https://www.github.com/boykopovar/AnyPS5/pull/6808) | `docs/dev/debt/libSceAgcDriver.md` | | [PR 6867](https://www.github.com/boykopovar/AnyPS5/pull/6867) | `docs/dev/debt/libSceAgcDriver.md` | | [PR 6868](https://www.github.com/boykopovar/AnyPS5/pull/6868) | `docs/dev/debt/libSceAgcDriver.md` | | [PR 6887](https://www.github.com/boykopovar/AnyPS5/pull/6887) | `docs/dev/debt/libSceAgcDriver.md` | | [PR 6946](https://www.github.com/boykopovar/AnyPS5/pull/6946) | `docs/dev/debt/libSceAgcDriver.md` | | [PR 6947](https://www.github.com/boykopovar/AnyPS5/pull/6947) | `docs/dev/debt/libSceAgcDriver.md` | | [PR 6965](https://www.github.com/boykopovar/AnyPS5/pull/6965) | `docs/dev/debt/libSceAgcDriver.md` | | [PR 6973](https://www.github.com/boykopovar/AnyPS5/pull/6973) | `docs/dev/debt/libSceAgcDriver.md` | | [PR 6977](https://www.github.com/boykopovar/AnyPS5/pull/6977) | `docs/dev/debt/libSceAgcDriver.md` | | [PR 6987](https://www.github.com/boykopovar/AnyPS5/pull/6987) | `docs/dev/debt/libSceAgcDriver.md` | | [PR 6989](https://www.github.com/boykopovar/AnyPS5/pull/6989) | `docs/dev/debt/libSceAgcDriver.md` | | [PR 6995](https://www.github.com/boykopovar/AnyPS5/pull/6995) | `docs/dev/debt/libSceAgcDriver.md` | | [PR 7002](https://www.github.com/boykopovar/AnyPS5/pull/7002) | `docs/dev/debt/libSceAgcDriver.md` | | [PR 7256](https://www.github.com/boykopovar/AnyPS5/pull/7256) | `docs/dev/debt/libSceAgcDriver.md` | | [PR 7449](https://www.github.com/boykopovar/AnyPS5/pull/7449) | `docs/dev/debt/libSceAgcDriver.md` | | [PR 7505](https://www.github.com/boykopovar/AnyPS5/pull/7505) | `docs/dev/debt/libSceAgcDriver.md` | | [PR 7604](https://www.github.com/boykopovar/AnyPS5/pull/7604) | `docs/dev/debt/libSceAgcDriver.md` | | [PR 7642](https://www.github.com/boykopovar/AnyPS5/pull/7642) | `docs/dev/debt/libSceAgcDriver.md` | | [PR 7800](https://www.github.com/boykopovar/AnyPS5/pull/7800) | `docs/dev/debt/libSceAgcDriver.md` | | [PR 7803](https://www.github.com/boykopovar/AnyPS5/pull/7803) | `docs/dev/debt/libSceAgcDriver.md` | | [PR 7883](https://www.github.com/boykopovar/AnyPS5/pull/7883) | `docs/dev/debt/libSceAgcDriver.md` | | [PR 7893](https://www.github.com/boykopovar/AnyPS5/pull/7893) | `docs/dev/debt/libSceAgcDriver.md` | | [PR 7910](https://www.github.com/boykopovar/AnyPS5/pull/7910) | `docs/dev/debt/libSceAgcDriver.md` | | [PR 8014](https://www.github.com/boykopovar/AnyPS5/pull/8014) | `docs/dev/debt/libSceAgcDriver.md` | | [PR 8395](https://www.github.com/boykopovar/AnyPS5/pull/8395) | `docs/dev/debt/libSceAgcDriver.md` | | [PR 8424](https://www.github.com/boykopovar/AnyPS5/pull/8424) | `docs/dev/debt/libSceAgcDriver.md` | | [PR 8538](https://www.github.com/boykopovar/AnyPS5/pull/8538) | `docs/dev/debt/libSceAgcDriver.md` | | [PR 8564](https://www.github.com/boykopovar/AnyPS5/pull/8564) | `docs/dev/debt/libSceAgcDriver.md` | | [PR 8592](https://www.github.com/boykopovar/AnyPS5/pull/8592) | `docs/dev/debt/libSceAgcDriver.md` | | [PR 9020](https://www.github.com/boykopovar/AnyPS5/pull/9020) | `docs/dev/debt/libSceAgcDriver.md` | | [PR 9077](https://www.github.com/boykopovar/AnyPS5/pull/9077) | `docs/dev/debt/libSceAgcDriver.md` |
ntamas94 commented 2026-10-20 02:19:20 +00:00 (Migrated from github.com)

Imported from boykopovar/AnyPS5. Originally posted by ntamas94 on 2026-10-20T02:19:20Z.


On the PS4 path the rate of DATA_SEL 4 is known, in case it helps decide what #6977 writes there.

  • shadPS4 names 4 PerfCounter, matching the older KFD name your debt entry mentions, and writes the GPU core clock count: the TSC scaled to sceGnmGetGpuCoreClockFrequency(), which it returns as 800 MHz, 911 MHz in Neo mode (src/video_core/amdgpu/pm4_cmds.h, src/core/libraries/gnmdriver/gnmdriver.cpp).
  • Gang Beasts (CUSA04865) divides the difference of two of its end-of-frame stamps by sceKernelIsNeoMode() ? 911000000 : 800000000, so only the rate matters to it, not the epoch.
  • On a local branch over #6977, writing the host steady clock as an 800 MHz count for GCN guests gets that title through; it now plays a full round (#7941). I could not measure the counter on a PS4 (FW 10.71): a homebrew GPU submission crashes the app.

The PS5 counter is a separate question, so keeping the refusal there makes sense to me. Once this PR settles the naming, I can send the PS4-only part to Get-fix's branch.

<!-- greyfinch-sync:boykopovar/AnyPS5:comment:6281807786 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/pull/7911#issuecomment-6281807786). Originally posted by [ntamas94](https://github.com/ntamas94) on 2026-10-20T02:19:20Z. --- On the PS4 path the rate of `DATA_SEL 4` is known, in case it helps decide what #6977 writes there. - shadPS4 names 4 `PerfCounter`, matching the older KFD name your debt entry mentions, and writes the GPU core clock count: the TSC scaled to `sceGnmGetGpuCoreClockFrequency()`, which it returns as 800 MHz, 911 MHz in Neo mode (`src/video_core/amdgpu/pm4_cmds.h`, `src/core/libraries/gnmdriver/gnmdriver.cpp`). - Gang Beasts (CUSA04865) divides the difference of two of its end-of-frame stamps by `sceKernelIsNeoMode() ? 911000000 : 800000000`, so only the rate matters to it, not the epoch. - On a local branch over #6977, writing the host steady clock as an 800 MHz count for GCN guests gets that title through; it now plays a full round (#7941). I could not measure the counter on a PS4 (FW 10.71): a homebrew GPU submission crashes the app. The PS5 counter is a separate question, so keeping the refusal there makes sense to me. Once this PR settles the naming, I can send the PS4-only part to Get-fix's branch.
savvaniss commented 2026-10-21 11:16:17 +00:00 (Migrated from github.com)

Imported from boykopovar/AnyPS5. Originally posted by savvaniss on 2026-10-21T11:16:17Z.


Merged main 3e91c8edf to clear the conflict; the head is now 123768abc. The conflict was two new entries at the same place in docs/dev/debt/libSceAgcDriver.md: this PR's RELEASE_MEM system counter entry and #7869's point and line polygon modes entry. Both are kept. Pm4.cpp and tests/Pm4.cpp merged without conflicts.

All 16 agc_driver_pm4* tests pass on Windows (RX 9070 XT), and tools/check_conventions.py --base origin/main passes.

AI-assisted: yes (Claude Code)

<!-- greyfinch-sync:boykopovar/AnyPS5:comment:6314584144 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/pull/7911#issuecomment-6314584144). Originally posted by [savvaniss](https://github.com/savvaniss) on 2026-10-21T11:16:17Z. --- Merged `main` `3e91c8edf` to clear the conflict; the head is now `123768abc`. The conflict was two new entries at the same place in `docs/dev/debt/libSceAgcDriver.md`: this PR's `RELEASE_MEM` system counter entry and #7869's point and line polygon modes entry. Both are kept. `Pm4.cpp` and `tests/Pm4.cpp` merged without conflicts. All 16 `agc_driver_pm4*` tests pass on Windows (RX 9070 XT), and `tools/check_conventions.py --base origin/main` passes. AI-assisted: yes (Claude Code)
ntamas94 commented 2026-10-21 11:26:06 +00:00 (Migrated from github.com)

Imported from boykopovar/AnyPS5. Originally posted by ntamas94 on 2026-10-21T11:26:06Z.


Measured on the console now, as a follow-up to my note above. PS4 Pro, FW 10.71, with the measuring app in base mode (sceKernelIsNeoMode() = 0): a homebrew Gnm submission of the EVENT_WRITE_EOP packets Gang Beasts writes (c0044700 00038504), DATA_SEL 4 and DATA_SEL 3 back to back, timed against the TSC over 124 s. The crash I mentioned earlier was in my own submission code; this one ran 13 submissions without a fault.

  • DATA_SEL 4 advances at 798.017 MHz of console time (TSC at sceKernelGetTscFrequency(), 1 594 013 629 Hz here), 0.25% under the 800 MHz that sceGnmGetGpuCoreClockFrequency() reports and that Gang Beasts divides by. It read zero about 2 s before the measuring app started, not at power-on.
  • DATA_SEL 3 is exactly the TSC divided by 16 (99.626 MHz of console time), with a constant offset to within ±15 ticks over 13 stamps. Its value fits a 40-bit counter that started with the TSC and has wrapped five times since boot.

So an 800 MHz count for GCN guests matches the hardware to 0.25%, and starting it near zero is as close as any epoch gets. This is the PS4 counter only; it says nothing about the PS5 one this PR keeps refusing.

<!-- greyfinch-sync:boykopovar/AnyPS5:comment:6314756233 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/pull/7911#issuecomment-6314756233). Originally posted by [ntamas94](https://github.com/ntamas94) on 2026-10-21T11:26:06Z. --- Measured on the console now, as a follow-up to my note above. PS4 Pro, FW 10.71, with the measuring app in base mode (`sceKernelIsNeoMode()` = 0): a homebrew Gnm submission of the `EVENT_WRITE_EOP` packets Gang Beasts writes (`c0044700 00038504`), DATA_SEL 4 and DATA_SEL 3 back to back, timed against the TSC over 124 s. The crash I mentioned earlier was in my own submission code; this one ran 13 submissions without a fault. - DATA_SEL 4 advances at 798.017 MHz of console time (TSC at `sceKernelGetTscFrequency()`, 1 594 013 629 Hz here), 0.25% under the 800 MHz that `sceGnmGetGpuCoreClockFrequency()` reports and that Gang Beasts divides by. It read zero about 2 s before the measuring app started, not at power-on. - DATA_SEL 3 is exactly the TSC divided by 16 (99.626 MHz of console time), with a constant offset to within ±15 ticks over 13 stamps. Its value fits a 40-bit counter that started with the TSC and has wrapped five times since boot. So an 800 MHz count for GCN guests matches the hardware to 0.25%, and starting it near zero is as close as any epoch gets. This is the PS4 counter only; it says nothing about the PS5 one this PR keeps refusing.
savvaniss commented 2026-10-21 16:26:30 +00:00 (Migrated from github.com)

Imported from boykopovar/AnyPS5. Originally posted by savvaniss on 2026-10-21T16:26:30Z.


@ntamas94 thank you for measuring this on the console. https://github.com/Get-fix/AnyPS5/pull/19 applies it on #6977's branch.

A PS4 (GCN) guest's DATA_SEL 4 now writes an 800 MHz count of the host's steady clock. The count starts at zero when libSceAgcDriver loads. A PS5 guest's DATA_SEL 4 still throws, as this PR does on main.

Your measurement is linked and credited in the RELEASE_MEM entry of docs/dev/debt/libSceAgcDriver.md. That entry also records two things the PR leaves for later: the Neo rate, which is not measured, and PS4 DATA_SEL 3 as TSC / 16 in 40 bits.

<!-- greyfinch-sync:boykopovar/AnyPS5:comment:6320986093 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/pull/7911#issuecomment-6320986093). Originally posted by [savvaniss](https://github.com/savvaniss) on 2026-10-21T16:26:30Z. --- @ntamas94 thank you for measuring this on the console. https://github.com/Get-fix/AnyPS5/pull/19 applies it on #6977's branch. A PS4 (GCN) guest's `DATA_SEL 4` now writes an 800 MHz count of the host's steady clock. The count starts at zero when libSceAgcDriver loads. A PS5 guest's `DATA_SEL 4` still throws, as this PR does on main. Your measurement is linked and credited in the `RELEASE_MEM` entry of `docs/dev/debt/libSceAgcDriver.md`. That entry also records two things the PR leaves for later: the Neo rate, which is not measured, and PS4 `DATA_SEL 3` as TSC / 16 in 40 bits.
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!7911
No description provided.