Request for a maintainer to carry ten separate AnyPS5 fixes #3321

Closed
opened 2026-10-11 07:26:33 +00:00 by cookie42073-cmd · 2 comments
cookie42073-cmd commented 2026-10-11 07:26:33 +00:00 (Migrated from github.com)
Contributor

Imported from boykopovar/AnyPS5. Originally posted by cookie42073-cmd on 2026-10-11T07:26:33Z.


Hi, I’m Blazing Cook.

I have ten small, independently reviewable fixes prepared on separate branches in cookie42073-cmd/AnyPS5. They target the main snapshot 52ce9b8af2025ac4169db2df366c69ad3764f5af. A review of newer main at 1690db9a found seven commits across nine files. None touches production code or tests in these ten fixes; the only related file change was an unrelated TechnicalDebt line. The review found no duplicate open PR for these fixes.

My account currently has zero merged PRs. The upstream PR intake workflow requires ten merged PRs and closes new PRs targeting main below that threshold. I am not claiming that opening ten PRs satisfies the merged-PR requirement or asking for a formal waiver. Would an eligible maintainer be willing to review and, if appropriate, carry each fix as its own separate PR under the project's normal process?

There are community examples at #3143 and #3266; I cite them as precedent for maintainer-carried contributions, not as evidence of a policy exception.

Each item below links to its own branch commit. The short repro describes the behavior before and after the fix. The combined Windows validation has completed against base 52ce9b8af2025ac4169db2df366c69ad3764f5af at integration commit 29d4d4b00d8740f2a0d81699b76cf256edfe2bb4: the Windows build and libs target passed; the full suite registered 769 tests, with 764 passed, 0 failed, and 5 skipped in 285.61 seconds. Seven targeted Windows checks passed in 19.80 seconds; the longest individual test was conventions at 23.7099 seconds. These are combined integration results, not isolated full-suite results for each branch. No Linux, console, or game validation is claimed.

Runtime evidence update — October 12

We already have Ratchet & Clank: Rift Apart memory-placement evidence: #2704 includes an inline runtime memory trace, #2687 describes the related reservation/hint failure, and #3146 reports AMM mappings overwriting command-buffer objects. There is no need to resend those reports, and I am not asking for a game dump.

For the remaining memory/AMPR proposals, the missing evidence is a title run that reaches the specific defect, with the title/version, exact AnyPS5 commit and patch stack, relevant values or mapping sequence, and matching before/after logs for the isolated fix. The existing Ratchet reports do not demonstrate the separate recorder/packet-bounds, pool-ownership or flexible-memory accounting failures.

Proposed separate fixes

  1. Reject out-of-range AMPR recorder offsets - branch fix/ampr-command-buffer-bounds, commit. Repro: bind a recorder to a memory extent, then append with an offset beyond that extent. Before, unsigned subtraction can turn the invalid offset into a large remaining size; after, reject it before bytes or recorder state change.

  2. Validate submitted AMPR packet bounds - branch fix/ampr-submit-bounds, commit. Repro: submit a packet with an invalid extent, undersized typed payload, or wrapped length. Before, the invalid command can reach execution; after, reject it before that command executes, preserving effects of earlier valid commands.

  3. Retain pooled-page references across AMM aliases - branch fix/amm-pool-references, commit. Repro: with a one-page pool, map a page through aliases and remove only one mapping. Before, the still-mapped page can be returned and reused; after, it remains owned until its last alias is unmapped.

  4. Validate kernel mappings before replacement - branch fix/kernel-map-validation, commit. Repro: keep an existing mapping, then request a replacement with unsupported flags, invalid protection, a misaligned address, or an overflowing range. Before, the request is rejected after expected mapping state is lost; after, flags, alignment, ranges, and protection are checked before replacement.

  5. Unmap live fragments across holes - branch fix/guest-unmap-holes, commit. Repro: unmap a range spanning multiple mapped pages with a removed page in the middle. Before, the operation fails to process the surviving fragments; after, it walks the live registry fragments and releases the mappings in range. Related PRs #1324 and #1360 touch this path; this fix addresses the hole behavior.

  6. Bound physical-memory range arithmetic - branch fix/direct-memory-range-bounds, commit. Repro: request a huge allocation length or an alignment adjustment that would wrap. Before, arithmetic can wrap past the requested range or physical capacity; after, reject out-of-range requests and preserve failure outputs.

  7. Limit silent-stub exemptions to the documented section - branch fix/conventions-silent-stub-section, commit. Repro: place silent-stub marker text outside the documented Silent stubs section. Before, the checker can incorrectly exempt it; after, only entries in that section receive the exemption.

  8. Reserve another AMM arena range when the upper range is occupied - branch fix/ampr-upper-range-availability, commit. Repro: with the upper contiguous range occupied by host or guest memory, request AMM reservation. Before, the dependent change in PR #3281 does not find another available range; after, choose the highest remaining contiguous aligned range and preserve the occupied contents. This is a follow-up depending on Dean Galvin (oneandonlydean)'s PR #3281; please retain his original authorship and credit.

  9. Preserve AMM target reservation when a replacement fails - branch fix/amm-map-failure-ownership, commit. Repro: use a one-page pool, map one page, then request a two-page replacement that exhausts the pool. Before, the released backing page can leave the old target exposed as a live alias; after, the target is reserved before pool ownership is released, so failure does not expose a stale live mapping. The fix does not restore the prior mapping.

  10. Account for flexible-memory ranges replaced by fixed mappings - branch fix/flexible-memory-replacement-accounting, commit. Repro: create a three-page flexible mapping and replace one page with a fixed flexible mapping, then check available flexible memory and unmap. Before, the replacement is counted as extra usage and range tracking can be wrong; after, the replaced bytes are accounted for once and the correct remaining amount is released. Rejected no-overwrite and invalid-length requests preserve existing contents and accounting; no broader native-allocation rollback behavior is claimed.

Dependencies and authorship

The eighth item depends on PR #3281 and must preserve Dean Galvin (oneandonlydean)'s existing authorship and credit. Each proposed carried change is separate; the AMM and memory fixes should not be combined into one PR.

AI-assisted: yes (Codex, with Astra used for the deeper memory audit). Windows results are local validation; no upstream CI run is claimed.

<!-- greyfinch-sync:boykopovar/AnyPS5:issue:5798981473 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/issues/3321). Originally posted by [cookie42073-cmd](https://github.com/cookie42073-cmd) on 2026-10-11T07:26:33Z. --- Hi, I’m Blazing Cook. I have ten small, independently reviewable fixes prepared on separate branches in [cookie42073-cmd/AnyPS5](https://github.com/cookie42073-cmd/AnyPS5). They target the `main` snapshot `52ce9b8af2025ac4169db2df366c69ad3764f5af`. A review of newer `main` at `1690db9a` found seven commits across nine files. None touches production code or tests in these ten fixes; the only related file change was an unrelated TechnicalDebt line. The review found no duplicate open PR for these fixes. My account currently has zero merged PRs. The upstream PR intake workflow requires ten merged PRs and closes new PRs targeting `main` below that threshold. I am not claiming that opening ten PRs satisfies the merged-PR requirement or asking for a formal waiver. Would an eligible maintainer be willing to review and, if appropriate, carry each fix as its own separate PR under the project's normal process? There are community examples at [#3143](https://github.com/boykopovar/AnyPS5/issues/3143) and [#3266](https://github.com/boykopovar/AnyPS5/issues/3266); I cite them as precedent for maintainer-carried contributions, not as evidence of a policy exception. Each item below links to its own branch commit. The short repro describes the behavior before and after the fix. The combined Windows validation has completed against base `52ce9b8af2025ac4169db2df366c69ad3764f5af` at integration commit `29d4d4b00d8740f2a0d81699b76cf256edfe2bb4`: the Windows build and libs target passed; the full suite registered 769 tests, with 764 passed, 0 failed, and 5 skipped in 285.61 seconds. Seven targeted Windows checks passed in 19.80 seconds; the longest individual test was conventions at 23.7099 seconds. These are combined integration results, not isolated full-suite results for each branch. No Linux, console, or game validation is claimed. ## Runtime evidence update — October 12 We already have Ratchet & Clank: Rift Apart memory-placement evidence: [#2704](https://github.com/boykopovar/AnyPS5/issues/2704) includes an inline runtime memory trace, [#2687](https://github.com/boykopovar/AnyPS5/issues/2687) describes the related reservation/hint failure, and [#3146](https://github.com/boykopovar/AnyPS5/issues/3146) reports AMM mappings overwriting command-buffer objects. There is no need to resend those reports, and I am not asking for a game dump. For the remaining memory/AMPR proposals, the missing evidence is a title run that reaches the specific defect, with the title/version, exact AnyPS5 commit and patch stack, relevant values or mapping sequence, and matching before/after logs for the isolated fix. The existing Ratchet reports do not demonstrate the separate recorder/packet-bounds, pool-ownership or flexible-memory accounting failures. ## Proposed separate fixes 1. **Reject out-of-range AMPR recorder offsets** - branch [`fix/ampr-command-buffer-bounds`](https://github.com/cookie42073-cmd/AnyPS5/tree/fix/ampr-command-buffer-bounds), [commit](https://github.com/cookie42073-cmd/AnyPS5/commit/b92287dc68d538d44369d2a09500b4404ca53fca). Repro: bind a recorder to a memory extent, then append with an offset beyond that extent. Before, unsigned subtraction can turn the invalid offset into a large remaining size; after, reject it before bytes or recorder state change. 2. **Validate submitted AMPR packet bounds** - branch [`fix/ampr-submit-bounds`](https://github.com/cookie42073-cmd/AnyPS5/tree/fix/ampr-submit-bounds), [commit](https://github.com/cookie42073-cmd/AnyPS5/commit/12bc4e2f1ec2bd0abc24c53d7d324057d16fe008). Repro: submit a packet with an invalid extent, undersized typed payload, or wrapped length. Before, the invalid command can reach execution; after, reject it before that command executes, preserving effects of earlier valid commands. 3. **Retain pooled-page references across AMM aliases** - branch [`fix/amm-pool-references`](https://github.com/cookie42073-cmd/AnyPS5/tree/fix/amm-pool-references), [commit](https://github.com/cookie42073-cmd/AnyPS5/commit/a2408b5244c663849ae4f7022e7aff01f2ba5abc). Repro: with a one-page pool, map a page through aliases and remove only one mapping. Before, the still-mapped page can be returned and reused; after, it remains owned until its last alias is unmapped. 4. **Validate kernel mappings before replacement** - branch [`fix/kernel-map-validation`](https://github.com/cookie42073-cmd/AnyPS5/tree/fix/kernel-map-validation), [commit](https://github.com/cookie42073-cmd/AnyPS5/commit/c8ca10586c04939fdf4806b4bfab749db29c1199). Repro: keep an existing mapping, then request a replacement with unsupported flags, invalid protection, a misaligned address, or an overflowing range. Before, the request is rejected after expected mapping state is lost; after, flags, alignment, ranges, and protection are checked before replacement. 5. **Unmap live fragments across holes** - branch [`fix/guest-unmap-holes`](https://github.com/cookie42073-cmd/AnyPS5/tree/fix/guest-unmap-holes), [commit](https://github.com/cookie42073-cmd/AnyPS5/commit/6b4ad3e9406a01734f3b4ee70a86f2a01ea5a57a). Repro: unmap a range spanning multiple mapped pages with a removed page in the middle. Before, the operation fails to process the surviving fragments; after, it walks the live registry fragments and releases the mappings in range. Related PRs [#1324](https://github.com/boykopovar/AnyPS5/pull/1324) and [#1360](https://github.com/boykopovar/AnyPS5/pull/1360) touch this path; this fix addresses the hole behavior. 6. **Bound physical-memory range arithmetic** - branch [`fix/direct-memory-range-bounds`](https://github.com/cookie42073-cmd/AnyPS5/tree/fix/direct-memory-range-bounds), [commit](https://github.com/cookie42073-cmd/AnyPS5/commit/eb937c6ab14bac34562d339a11d004fcdab2a1e5). Repro: request a huge allocation length or an alignment adjustment that would wrap. Before, arithmetic can wrap past the requested range or physical capacity; after, reject out-of-range requests and preserve failure outputs. 7. **Limit silent-stub exemptions to the documented section** - branch [`fix/conventions-silent-stub-section`](https://github.com/cookie42073-cmd/AnyPS5/tree/fix/conventions-silent-stub-section), [commit](https://github.com/cookie42073-cmd/AnyPS5/commit/cf5e04c95f56422973e514f4457766d48ca3c8cf). Repro: place silent-stub marker text outside the documented Silent stubs section. Before, the checker can incorrectly exempt it; after, only entries in that section receive the exemption. 8. **Reserve another AMM arena range when the upper range is occupied** - branch [`fix/ampr-upper-range-availability`](https://github.com/cookie42073-cmd/AnyPS5/tree/fix/ampr-upper-range-availability), [commit](https://github.com/cookie42073-cmd/AnyPS5/commit/5b15969f98fc86d4583391f76721126ed597da11). Repro: with the upper contiguous range occupied by host or guest memory, request AMM reservation. Before, the dependent change in PR #3281 does not find another available range; after, choose the highest remaining contiguous aligned range and preserve the occupied contents. This is a follow-up depending on [Dean Galvin (oneandonlydean)'s PR #3281](https://github.com/boykopovar/AnyPS5/pull/3281); please retain his original authorship and credit. 9. **Preserve AMM target reservation when a replacement fails** - branch [`fix/amm-map-failure-ownership`](https://github.com/cookie42073-cmd/AnyPS5/tree/fix/amm-map-failure-ownership), [commit](https://github.com/cookie42073-cmd/AnyPS5/commit/3e9a37eaa34c4d543f775bece42de3eb7a4647ea). Repro: use a one-page pool, map one page, then request a two-page replacement that exhausts the pool. Before, the released backing page can leave the old target exposed as a live alias; after, the target is reserved before pool ownership is released, so failure does not expose a stale live mapping. The fix does not restore the prior mapping. 10. **Account for flexible-memory ranges replaced by fixed mappings** - branch [`fix/flexible-memory-replacement-accounting`](https://github.com/cookie42073-cmd/AnyPS5/tree/fix/flexible-memory-replacement-accounting), [commit](https://github.com/cookie42073-cmd/AnyPS5/commit/369cfec9fdce61c700e137975073bd1cdaad6051). Repro: create a three-page flexible mapping and replace one page with a fixed flexible mapping, then check available flexible memory and unmap. Before, the replacement is counted as extra usage and range tracking can be wrong; after, the replaced bytes are accounted for once and the correct remaining amount is released. Rejected no-overwrite and invalid-length requests preserve existing contents and accounting; no broader native-allocation rollback behavior is claimed. ## Dependencies and authorship The eighth item depends on PR #3281 and must preserve Dean Galvin (oneandonlydean)'s existing authorship and credit. Each proposed carried change is separate; the AMM and memory fixes should not be combined into one PR. AI-assisted: yes (Codex, with Astra used for the deeper memory audit). Windows results are local validation; no upstream CI run is claimed.
cookie42073-cmd commented 2026-10-11 07:32:53 +00:00 (Migrated from github.com)
Author
Contributor

Imported from boykopovar/AnyPS5. Originally posted by cookie42073-cmd on 2026-10-11T07:32:53Z.


Hi, I’m Blazing Cook. Here’s an update on the fix and the Windows testing.

Follow-up: the flexible-memory replacement change has a remaining accounting gap when another kernel export replaces a flexible range. This separate branch routes direct-memory mapping and virtual reservation exports through the same flexible-range accounting used by flexible mappings.

Repro: map three flexible pages, replace the middle page through a direct-map export or reserve it as a virtual range, then query available flexible memory and unmap. The replaced page should stop counting as flexible, while the two remaining flexible pages stay accounted for until unmapped. The focused regression covers sceKernelMapDirectMemory, sceKernelMapDirectMemory2, named direct mapping, sceKernelBatchMap2, and sceKernelReserveVirtualRange.

The fix is branch fix/flexible-memory-cross-api-accounting, commit 82469c976b6989471c95cc9501c46f82e7e66a1c. It depends on the preceding fix/flexible-memory-replacement-accounting commit. Could an eligible maintainer carry this as a separate follow-up PR?

Tested combined integration: 6f6d139d, based on main snapshot 52ce9b8a.

Windows validation: the eleven-fix combined build and libs target passed; the full suite registered 769 tests, with 764 passed, 0 failed, and 5 skipped in 225.42 seconds. Seven targeted checks passed in 13.35 seconds; the longest individual test was 18.5212 seconds. These combined results do not isolate this PR. The change covers the listed kernel exports; it does not establish internal AMM/APR or MemoryPool coverage, native allocation rollback behavior, or concurrent-unmap behavior. No Linux, console, or game validation is claimed.

AI-assisted: yes (Codex/Astra).

<!-- greyfinch-sync:boykopovar/AnyPS5:comment:6106712706 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/issues/3321#issuecomment-6106712706). Originally posted by [cookie42073-cmd](https://github.com/cookie42073-cmd) on 2026-10-11T07:32:53Z. --- Hi, I’m Blazing Cook. Here’s an update on the fix and the Windows testing. Follow-up: the flexible-memory replacement change has a remaining accounting gap when another kernel export replaces a flexible range. This separate branch routes direct-memory mapping and virtual reservation exports through the same flexible-range accounting used by flexible mappings. Repro: map three flexible pages, replace the middle page through a direct-map export or reserve it as a virtual range, then query available flexible memory and unmap. The replaced page should stop counting as flexible, while the two remaining flexible pages stay accounted for until unmapped. The focused regression covers `sceKernelMapDirectMemory`, `sceKernelMapDirectMemory2`, named direct mapping, `sceKernelBatchMap2`, and `sceKernelReserveVirtualRange`. The fix is [branch `fix/flexible-memory-cross-api-accounting`](https://github.com/cookie42073-cmd/AnyPS5/tree/fix/flexible-memory-cross-api-accounting), [commit `82469c976b6989471c95cc9501c46f82e7e66a1c`](https://github.com/cookie42073-cmd/AnyPS5/commit/82469c976b6989471c95cc9501c46f82e7e66a1c). It depends on the preceding [`fix/flexible-memory-replacement-accounting` commit](https://github.com/cookie42073-cmd/AnyPS5/commit/369cfec9fdce61c700e137975073bd1cdaad6051). Could an eligible maintainer carry this as a separate follow-up PR? Tested combined integration: [6f6d139d](https://github.com/cookie42073-cmd/AnyPS5/commit/6f6d139d5adf6aa48578fa396b4a72483d7c3418), based on main snapshot 52ce9b8a. Windows validation: the eleven-fix combined build and libs target passed; the full suite registered 769 tests, with 764 passed, 0 failed, and 5 skipped in 225.42 seconds. Seven targeted checks passed in 13.35 seconds; the longest individual test was 18.5212 seconds. These combined results do not isolate this PR. The change covers the listed kernel exports; it does not establish internal AMM/APR or MemoryPool coverage, native allocation rollback behavior, or concurrent-unmap behavior. No Linux, console, or game validation is claimed. AI-assisted: yes (Codex/Astra).
reyani-dev commented 2026-10-11 07:47:50 +00:00 (Migrated from github.com)
Author
Contributor

Imported from boykopovar/AnyPS5. Originally posted by reyani-dev on 2026-10-11T07:47:50Z.


Carried item 7 (fix/conventions-silent-stub-section, cf5e04c9) as #3326 with your commit unchanged. Over the last 200 commits, the stricter rule finds one merged export that relied on an out-of-section link (sceAudioInInit, #3006), so the PR adds a Silent stubs line for it. I haven't carried the memory/AMPR items: maintainers here close changes that no title is shown stopping on, so those would need a title's log line first.

<!-- greyfinch-sync:boykopovar/AnyPS5:comment:6106825979 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/issues/3321#issuecomment-6106825979). Originally posted by [reyani-dev](https://github.com/reyani-dev) on 2026-10-11T07:47:50Z. --- Carried item 7 (`fix/conventions-silent-stub-section`, `cf5e04c9`) as #3326 with your commit unchanged. Over the last 200 commits, the stricter rule finds one merged export that relied on an out-of-section link (`sceAudioInInit`, #3006), so the PR adds a Silent stubs line for it. I haven't carried the memory/AMPR items: maintainers here close changes that no title is shown stopping on, so those would need a title's log line first.
Sign in to join this conversation.
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#3321
No description provided.