fix(ngs2): roll back failed system and rack creation #1876

Closed
Albaloola wants to merge 1 commit from upstream-pr/1876 into main
Albaloola commented 2026-10-08 22:38:45 +00:00 (Migrated from github.com)

Imported from boykopovar/AnyPS5. Originally posted by Albaloola on 2026-10-08T22:38:45Z.


What

Failed NGS2 system/rack creation can leak allocator-owned storage and placement-created host objects. Keep both under ownership guards until registration succeeds, clean up successfully initialized custom effects in reverse order, and preserve the original error if cleanup or free also fails. Snapshot allocator callbacks and reject a parent destroyed or replaced during creation. The fix applies to both library aliases and retains the successful destruction path.

The overlap bot flags the shared TechnicalDebt.md insertion line with #1616 and #1650. Their patches implement other functions and contain no NGS2 changes; this PR depends on neither.

Tested

Exact published head: 04dfe7164594ca112dc063db48f7dcb88b3c77c4, based on upstream ce64d8eb3603078b597a60a37496328de63df72a. Windows x86-64, WinLibs MinGW-w64 GCC 15.2.0, CMake 4.3.1, Ninja 1.13.2, Release.

Checked out this exact source head cleanly, reconfigured the isolated build directory used for #1875, then completed both build targets again (37 compile/link steps). Unchanged objects were reused; geometry-reset source changes were absent. Full default build and libs build passed. No AnyPS5 source or objects from the combined development checkout were reused; the pinned upstream FFmpeg package was reused read-only. All 1,629 compile commands were checked for source isolation. Test registration, conventions and git diff --check passed; source remained clean and the head/tree matched before and after testing.

All 10 NGS2 tests passed (0 failed, 0 skipped), including ngs2_allocation and ngs2_core_allocation. These exercise allocator/setup failures, reverse cleanup, cleanup exceptions, allocator mutation, parent removal/replacement during callbacks, caller-owned buffer reuse, unchanged outputs and successful ownership transfer.

Independent source/ABI/ownership review found no blocking findings. Host vector/registry allocation failures were structurally reviewed, not runtime fault-injected. Console cleanup order after failed creation has not been measured. No PS5 hardware, retail-title or Linux runtime validation is claimed. This isolated run covers the NGS2 suites, not the full GPU suite. GitHub Actions currently requires maintainer approval; no hosted CI pass is claimed.

Checklist

  • Exact branch head independently built and tested; base recorded above
  • Open-PR implementation overlap screened; documentation overlap disclosed above
  • One topic per PR; follow-up work is separate
  • No investigation notes or images added to repository source
  • Unsupported paths remain explicit failures; limitations are recorded in TechnicalDebt
  • New third-party dependencies, if any, are pinned submodules built from source
  • Generic behavior, not specific to one title
  • Depends on: none
  • AI-assisted: yes, with OpenAI Codex; the PR author remains responsible for the submitted changes
<!-- greyfinch-sync:boykopovar/AnyPS5:issue:4793632077 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/pull/1876). Originally posted by [Albaloola](https://github.com/Albaloola) on 2026-10-08T22:38:45Z. --- ### What Failed NGS2 system/rack creation can leak allocator-owned storage and placement-created host objects. Keep both under ownership guards until registration succeeds, clean up successfully initialized custom effects in reverse order, and preserve the original error if cleanup or free also fails. Snapshot allocator callbacks and reject a parent destroyed or replaced during creation. The fix applies to both library aliases and retains the successful destruction path. The overlap bot flags the shared `TechnicalDebt.md` insertion line with #1616 and #1650. Their patches implement other functions and contain no NGS2 changes; this PR depends on neither. ### Tested Exact published head: `04dfe7164594ca112dc063db48f7dcb88b3c77c4`, based on upstream `ce64d8eb3603078b597a60a37496328de63df72a`. Windows x86-64, WinLibs MinGW-w64 GCC 15.2.0, CMake 4.3.1, Ninja 1.13.2, Release. Checked out this exact source head cleanly, reconfigured the isolated build directory used for #1875, then completed both build targets again (37 compile/link steps). Unchanged objects were reused; geometry-reset source changes were absent. Full default build and `libs` build passed. No AnyPS5 source or objects from the combined development checkout were reused; the pinned upstream FFmpeg package was reused read-only. All 1,629 compile commands were checked for source isolation. Test registration, conventions and `git diff --check` passed; source remained clean and the head/tree matched before and after testing. All 10 NGS2 tests passed (0 failed, 0 skipped), including `ngs2_allocation` and `ngs2_core_allocation`. These exercise allocator/setup failures, reverse cleanup, cleanup exceptions, allocator mutation, parent removal/replacement during callbacks, caller-owned buffer reuse, unchanged outputs and successful ownership transfer. Independent source/ABI/ownership review found no blocking findings. Host vector/registry allocation failures were structurally reviewed, not runtime fault-injected. Console cleanup order after failed creation has not been measured. No PS5 hardware, retail-title or Linux runtime validation is claimed. This isolated run covers the NGS2 suites, not the full GPU suite. GitHub Actions currently requires maintainer approval; no hosted CI pass is claimed. ### Checklist - [x] Exact branch head independently built and tested; base recorded above - [x] Open-PR implementation overlap screened; documentation overlap disclosed above - [x] One topic per PR; follow-up work is separate - [x] No investigation notes or images added to repository source - [x] Unsupported paths remain explicit failures; limitations are recorded in TechnicalDebt - [x] New third-party dependencies, if any, are pinned submodules built from source - [x] Generic behavior, not specific to one title - [x] Depends on: none - [x] AI-assisted: yes, with OpenAI Codex; the PR author remains responsible for the submitted changes
github-actions[bot] commented 2026-10-08 22:42:59 +00:00 (Migrated from github.com)

Imported from boykopovar/AnyPS5. Originally posted by github-actions[bot] on 2026-10-08T22:42:59Z.


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
#1947 docs/dev/TechnicalDebt.md L40
<!-- greyfinch-sync:boykopovar/AnyPS5:comment:6070519624 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/pull/1876#issuecomment-6070519624). Originally posted by [github-actions[bot]](https://github.com/apps/github-actions) on 2026-10-08T22:42:59Z. --- <!-- 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 | |---|---|---|---| | #1947 | `docs/dev/TechnicalDebt.md` [L40](https://github.com/boykopovar/AnyPS5/blob/6cc0503dacc9d9697d23001d4103780ad2e9acba/docs/dev/TechnicalDebt.md#L40) | | |
oneandonlydean commented 2026-10-09 08:57:31 +00:00 (Migrated from github.com)

Imported from boykopovar/AnyPS5. Originally posted by oneandonlydean on 2026-10-09T08:57:31Z.


Same as #1875: no title or crash shown that hits a failed NGS2 system or rack creation. Reopen with one.

<!-- greyfinch-sync:boykopovar/AnyPS5:comment:6077745552 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/pull/1876#issuecomment-6077745552). Originally posted by [oneandonlydean](https://github.com/oneandonlydean) on 2026-10-09T08:57:31Z. --- Same as #1875: no title or crash shown that hits a failed NGS2 system or rack creation. Reopen with one.

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