fix(libkernel): retire range names with their mappings #5537

Closed
JJenkx wants to merge 4 commits from upstream-pr/5537 into main
JJenkx commented 2026-10-13 23:10:09 +00:00 (Migrated from github.com)

Imported from boykopovar/AnyPS5. Originally posted by JJenkx on 2026-10-13T23:10:09Z.


What

After a named mapping was partially unmapped, the label table still covered the removed pages. An unnamed mapping reusing that address inherited the old name, and a later larger mapping could have its virtual-query extent clipped by the stale label boundary.

Erase affected names in the shared mapping backend after a successful unmap or fixed replacement. Split labels around removed intervals so surviving pages keep their names. This covers SCE and POSIX unmaps, direct-memory release across aliases, and fixed replacement without treating protection changes as new mappings. Rejected operations retain labels.

Name lifetime is a host mapping-consistency policy, not measured PS5 behavior. The existing policy for explicitly naming an unmapped range is unchanged; the debt ledger records this uncertainty. No additional imported NIDs are resolved by this change.

Tested

  • Full bundled Linux Release build with 32 jobs.

  • 14 CPU memory, memory-pool, direct-release, JIT, module, filesystem and kernel-error regressions passed, zero skipped.

  • Five native Vulkan regressions per backend on Radeon and lavapipe: host-import unmap, parked-import unmap, retirement, direct-memory transfers and texture readback reuse. All ten passed, zero skipped.

  • New real mapping regression covers partial unmap/reuse, correct query extent, retained neighbouring labels, protection-only changes, rejected invalid unmaps and no-overwrite attempts, unnamed and named fixed replacements, whole-range reuse, rounded POSIX unmap, and release of physical pages shared by two named aliases.

  • Before the product fix, the new regression fails when the reused middle page retains the old name. Disabling only fixed-replacement name cleanup also fails its later name assertion. Restoring the source reproduces a successful full build and guest-memory regression.

  • Local tests ran on the development integration. Standalone Linux/Windows CI: passed on Linux and Windows at the published topic commit.

Checklist

  • AI-assisted: yes.
  • Depends on: none.
  • Unblocks: none.
  • Unmeasured console name-lifetime policy recorded in the debt ledger.

Current upstream validation

Published head 649088cd8db6473c4b9614ec44eee2426516844e contains current main d1670009fbfdfe57f8f26ee09ced77fe6b18c2ca and merges without conflicts. Conventions and whitespace checks pass. The topic's production change is unchanged by this main refresh. Previous validated build passes at 9ba699a952f622a21e1409e4be30b1274531e9c0 against main 7a0c838ca48; any reused Linux results apply to their explicitly recorded earlier head/base. Latest-main full Linux and Windows validation passes for this published head; expected skips remain unvalidated.

<!-- greyfinch-sync:boykopovar/AnyPS5:issue:4850636050 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/pull/5537). Originally posted by [JJenkx](https://github.com/JJenkx) on 2026-10-13T23:10:09Z. --- ### What After a named mapping was partially unmapped, the label table still covered the removed pages. An unnamed mapping reusing that address inherited the old name, and a later larger mapping could have its virtual-query extent clipped by the stale label boundary. Erase affected names in the shared mapping backend after a successful unmap or fixed replacement. Split labels around removed intervals so surviving pages keep their names. This covers SCE and POSIX unmaps, direct-memory release across aliases, and fixed replacement without treating protection changes as new mappings. Rejected operations retain labels. Name lifetime is a host mapping-consistency policy, not measured PS5 behavior. The existing policy for explicitly naming an unmapped range is unchanged; the debt ledger records this uncertainty. No additional imported NIDs are resolved by this change. ### Tested - Full bundled Linux Release build with 32 jobs. - 14 CPU memory, memory-pool, direct-release, JIT, module, filesystem and kernel-error regressions passed, zero skipped. - Five native Vulkan regressions per backend on Radeon and lavapipe: host-import unmap, parked-import unmap, retirement, direct-memory transfers and texture readback reuse. All ten passed, zero skipped. - New real mapping regression covers partial unmap/reuse, correct query extent, retained neighbouring labels, protection-only changes, rejected invalid unmaps and no-overwrite attempts, unnamed and named fixed replacements, whole-range reuse, rounded POSIX unmap, and release of physical pages shared by two named aliases. - Before the product fix, the new regression fails when the reused middle page retains the old name. Disabling only fixed-replacement name cleanup also fails its later name assertion. Restoring the source reproduces a successful full build and guest-memory regression. - Local tests ran on the development integration. [Standalone Linux/Windows CI](https://github.com/JJenkx/AnyPS5/actions/runs/38353308945): passed on Linux and Windows at the published topic commit. ### Checklist - [x] AI-assisted: yes. - [x] Depends on: none. - [x] Unblocks: none. - [x] Unmeasured console name-lifetime policy recorded in the debt ledger. ### Current upstream validation Published head `649088cd8db6473c4b9614ec44eee2426516844e` contains current main `d1670009fbfdfe57f8f26ee09ced77fe6b18c2ca` and merges without conflicts. Conventions and whitespace checks pass. The topic's production change is unchanged by this main refresh. [Previous validated build](https://github.com/JJenkx/AnyPS5/actions/runs/38483317180) passes at `9ba699a952f622a21e1409e4be30b1274531e9c0` against main `7a0c838ca48`; any reused Linux results apply to their explicitly recorded earlier head/base. [Latest-main full Linux and Windows validation](https://github.com/JJenkx/AnyPS5/actions/runs/38486811517) passes for this published head; expected skips remain unvalidated.
github-actions[bot] commented 2026-10-13 23:29:57 +00:00 (Migrated from github.com)

Imported from boykopovar/AnyPS5. Originally posted by github-actions[bot] on 2026-10-13T23:29:57Z.


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
#4953 docs/dev/debt/libkernel.md L13
#5553 docs/dev/debt/libkernel.md L13
<!-- greyfinch-sync:boykopovar/AnyPS5:comment:6157391923 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/pull/5537#issuecomment-6157391923). Originally posted by [github-actions[bot]](https://github.com/apps/github-actions) on 2026-10-13T23:29:57Z. --- <!-- 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 | |---|---|---|---| | #4953 | `docs/dev/debt/libkernel.md` [L13](https://github.com/boykopovar/AnyPS5/blob/71c71f50b7a42ad1a62b78d9cd24f5a356965557/docs/dev/debt/libkernel.md#L13) | | | | #5553 | `docs/dev/debt/libkernel.md` [L13](https://github.com/boykopovar/AnyPS5/blob/71c71f50b7a42ad1a62b78d9cd24f5a356965557/docs/dev/debt/libkernel.md#L13) | | |
oneandonlydean commented 2026-10-14 02:25:38 +00:00 (Migrated from github.com)

Imported from boykopovar/AnyPS5. Originally posted by oneandonlydean on 2026-10-14T02:25:38Z.


Closing: no title is known to reach this. With the queue at 700+ open PRs, please hold off on new PRs that don't name a title needing the change until it's down. If a title stops on this on current main, reopen with the title ID and the log line.

<!-- greyfinch-sync:boykopovar/AnyPS5:comment:6159504060 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/pull/5537#issuecomment-6159504060). Originally posted by [oneandonlydean](https://github.com/oneandonlydean) on 2026-10-14T02:25:38Z. --- Closing: no title is known to reach this. With the queue at 700+ open PRs, please hold off on new PRs that don't name a title needing the change until it's down. If a title stops on this on current main, reopen with the title ID and the log line.

Pull request closed

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!5537
No description provided.