River 2 : HLE: Use per-program ownership for PTC disk caches #115

Merged
LotP merged 3 commits from Babib3l/Ryubing:per-program-cache-ownership into master 2026-08-24 17:50:02 +00:00
Contributor

This PR threads process/program identity into PTC disk cache initialization so cache ownership is selected from the launched process rather than global/shared application state.

Previously, the PTC initialization path only propagated loose title/version information into the CPU layer. That was mostly fine for a single launched application, but will introduce many problems once multiple programs can be launched during the same session, given later processes could inherit cache identity from the first loaded application.
To address this issue, this PR introduces a PtcCacheInfo payload and applies it through the process context, CPU context, translator, and PTC initialization paths. Cache ownership is now resolved once the kernel process PID is known and includes:

  • PID
  • Program ID / Title ID
  • Application ID
  • Program index
  • Display version
  • Process kind
  • Cache selector

PtcCacheInfo now owns its default title/application/version values, and Ptc uses that cache info directly instead of mirroring title/version fields internally.

The persistent cache key itself does remains title/version/selector based rather than PID based, so caches remain reusable across launches while still being selected from the correct process context. PID is only used for diagnostics and ownership tracing in logs.

Additional PTC logging has also been added to report cache ownership and selected paths during PTC initialization, Profiling info load/save and translation cache load/save

Both the PTC and profiler internal versions were bumped (a bunch of times lol).

This PR threads process/program identity into PTC disk cache initialization so cache ownership is selected from the launched process rather than global/shared application state. Previously, the PTC initialization path only propagated loose title/version information into the CPU layer. That was mostly fine for a single launched application, but will introduce many problems once multiple programs can be launched during the same session, given later processes could inherit cache identity from the first loaded application. To address this issue, this PR introduces a `PtcCacheInfo` payload and applies it through the process context, CPU context, translator, and PTC initialization paths. Cache ownership is now resolved once the kernel process PID is known and includes: - PID - Program ID / Title ID - Application ID - Program index - Display version - Process kind - Cache selector `PtcCacheInfo` now owns its default title/application/version values, and `Ptc` uses that cache info directly instead of mirroring title/version fields internally. The persistent cache key itself does remains title/version/selector based rather than PID based, so caches remain reusable across launches while still being selected from the correct process context. PID is only used for diagnostics and ownership tracing in logs. Additional PTC logging has also been added to report cache ownership and selected paths during PTC initialization, Profiling info load/save and translation cache load/save Both the PTC and profiler internal versions were bumped (a bunch of times lol).
Babib3l force-pushed per-program-cache-ownership from dfc0744ace
Some checks failed
Pull Request Triage / triage (pull_request_target) Successful in 34s
Build PR / linux-arm64 (Release) (pull_request) Successful in 4m2s
Build PR / win-arm64 (Release) (pull_request) Successful in 7m6s
Build PR / linux-x64 (Release) (pull_request) Successful in 7m8s
Build PR / win-x64 (Release) (pull_request) Successful in 6m36s
Build PR / macOS Universal (Release) (pull_request) Failing after 11m40s
to a6e3b10ba8
All checks were successful
Build PR / linux-arm64 (Release) (pull_request) Successful in 4m23s
Build PR / win-arm64 (Release) (pull_request) Successful in 6m50s
Build PR / linux-x64 (Release) (pull_request) Successful in 7m5s
Build PR / macOS Universal (Release) (pull_request) Successful in 7m48s
Build PR / win-x64 (Release) (pull_request) Successful in 12m6s
2026-05-27 14:39:33 +00:00
Compare
Ghost added this to the 1.5.0 milestone 2026-05-31 11:10:26 +00:00
Babib3l force-pushed per-program-cache-ownership from 4b40578e2c
All checks were successful
Build PR / win-x64 (Release) (pull_request) Successful in 11m20s
Build PR / linux-arm64 (Release) (pull_request) Successful in 4m40s
Build PR / win-arm64 (Release) (pull_request) Successful in 8m5s
Build PR / linux-x64 (Release) (pull_request) Successful in 8m11s
Build PR / macOS Universal (Release) (pull_request) Successful in 6m31s
to 291811bfd0
All checks were successful
Build PR / linux-arm64 (Release) (pull_request) Successful in 3m45s
Build PR / win-x64 (Release) (pull_request) Successful in 7m42s
Build PR / win-arm64 (Release) (pull_request) Successful in 8m22s
Build PR / linux-x64 (Release) (pull_request) Successful in 8m27s
Build PR / macOS Universal (Release) (pull_request) Successful in 7m43s
2026-06-18 21:32:43 +00:00
Compare
Babib3l force-pushed per-program-cache-ownership from 291811bfd0
All checks were successful
Build PR / linux-arm64 (Release) (pull_request) Successful in 3m45s
Build PR / win-x64 (Release) (pull_request) Successful in 7m42s
Build PR / win-arm64 (Release) (pull_request) Successful in 8m22s
Build PR / linux-x64 (Release) (pull_request) Successful in 8m27s
Build PR / macOS Universal (Release) (pull_request) Successful in 7m43s
to 6e0725370b
Some checks failed
Build PR / linux-arm64 (Release) (pull_request) Successful in 4m16s
Build PR / win-x64 (Release) (pull_request) Successful in 8m2s
Build PR / linux-x64 (Release) (pull_request) Successful in 8m6s
Build PR / macOS Universal (Release) (pull_request) Successful in 8m42s
Build PR / win-arm64 (Release) (pull_request) Failing after 9m47s
2026-06-30 01:12:00 +00:00
Compare
Neo force-pushed per-program-cache-ownership from 6e0725370b
Some checks failed
Build PR / linux-arm64 (Release) (pull_request) Successful in 4m16s
Build PR / win-x64 (Release) (pull_request) Successful in 8m2s
Build PR / linux-x64 (Release) (pull_request) Successful in 8m6s
Build PR / macOS Universal (Release) (pull_request) Successful in 8m42s
Build PR / win-arm64 (Release) (pull_request) Failing after 9m47s
to b51dadc851
Some checks failed
Build PR / linux-arm64 (Release) (pull_request) Has been cancelled
Build PR / linux-x64 (Release) (pull_request) Has been cancelled
Build PR / win-arm64 (Release) (pull_request) Has been cancelled
Build PR / win-x64 (Release) (pull_request) Has been cancelled
Build PR / macOS Universal (Release) (pull_request) Has been cancelled
2026-07-20 11:52:57 +00:00
Compare
Babib3l force-pushed per-program-cache-ownership from b51dadc851
Some checks failed
Build PR / linux-arm64 (Release) (pull_request) Has been cancelled
Build PR / linux-x64 (Release) (pull_request) Has been cancelled
Build PR / win-arm64 (Release) (pull_request) Has been cancelled
Build PR / win-x64 (Release) (pull_request) Has been cancelled
Build PR / macOS Universal (Release) (pull_request) Has been cancelled
to 4ed5843958
All checks were successful
Build PR / linux-arm64 (Release) (pull_request) Successful in 3m26s
Build PR / linux-x64 (Release) (pull_request) Successful in 6m25s
Build PR / win-arm64 (Release) (pull_request) Successful in 5m28s
Build PR / win-x64 (Release) (pull_request) Successful in 4m48s
Build PR / macOS Universal (Release) (pull_request) Successful in 4m14s
2026-08-17 11:25:51 +00:00
Compare
LotP merged commit 7cc2975eba into master 2026-08-24 17:50:02 +00:00
Babib3l deleted branch per-program-cache-ownership 2026-08-24 18:55:40 +00:00
Sign in to join this conversation.
No reviewers
No milestone
No assignees
2 participants
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Reference
projects/Ryubing!115
No description provided.