fix(ngs2): return documented Delay option errors #12107

Merged
Th3EvilGod merged 7 commits from upstream-pr/12107 into main 2026-11-09 13:33:03 +00:00
Th3EvilGod commented 2026-10-27 20:54:50 +00:00 (Migrated from github.com)

Imported from boykopovar/AnyPS5. Originally posted by Th3EvilGod on 2026-10-27T20:54:50Z.


What

For malformed custom Delay options, return the PS5 errors through both rack-creation APIs: 0x804A8013 for option size, 0x804A8095 for type, 0x804A8096 for tap count, and 0x804A8097 for an out-of-range finite maximum length. The source is fma-rc's reading of PS5 12.70 libSceNgs2.native.sprx, Delay setup at 0x30b80, not disassembly or console measurements I performed. The constant names are local descriptive names.

Keep the agreed Delay creation/audio compatibility path and unsupported-path throws. Null-option processor initialization, nonfinite/reserved values, unsupported rack/state shapes and precedence among multiple invalid payload fields remain unresolved. Delay DSP and controls remain unimplemented; the existing debt entry records these gaps.

Run the custom-rack suite against both NGS2 libraries. Following the current-main integration report, guard the Delay control-rejection loop and its callback assertion for APS5_NGS2_PS4_LIBRARY, as already done for PS5 filter controls. Also keep main's new PS5-only wrong-module/position error assertions native-only, retain the previous PS4 UserFx rejection assertions, and expect the existing PS4 channel error in the two invalid-channel setup cases. Both libraries retain malformed-option, valid-creation, varying-PCM and silence coverage; the native library retains all 256 Delay parameter-ID checks. Production behavior is unchanged by these test corrections; no PS4 error code is invented.

Merged main d222b34fabc63a904d9f99f4cde2269be5b4f61b with the published branch, preserving contributor commits and main's updated UserFx debt entry. The earlier requested test cleanup remains intact. #10599 and #11315 are merged. The agreed order remains #12107 before #13491 (proposal, acceptance).

The refreshed overlap scan examined 1,941 open PRs and failed closed on four stale branches. I manually compared every reported shared file: #1384 changes Reverb declarations/test registration; #5548 changes PCM test registration and decoding/streaming debt; #10249 changes the Reverb/PitchShift option-word helper; #14212 changes the pending-export debt wording. None implements these Delay option errors. The automatic comparisons remain unresolved, so this is not reported as a clean scan. A direct merge preview of final head e385df1347f086bfeeb4266cdeabf325dbea219f with #13491 f4b5b8040bd4629ea675379388fbe66580af161c succeeds; this is not combined runtime validation.

Tested

Windows 11 build 26300, AMD Ryzen 7 9800X3D, WinLibs MinGW-w64 GCC 15.2.0 r7, Release full-runtime configuration (ANYPS5_RELINKER_ONLY=OFF, BUILD_TESTING=ON), pinned source dependencies. Tested head e385df1347f086bfeeb4266cdeabf325dbea219f, merged with main d222b34fabc63a904d9f99f4cde2269be5b4f61b.

  • Before the guard, merged tree 145168376bf2247cb367253478e07a69879d15ec reproduces the reported failure: ngs2_core_custom aborts with NGS2: the custom Delay module parameters are not implemented; native ngs2_custom passes.
  • Built all 35 currently registered NGS2 test executables and requested the NID-patched libSceNgs2, libSceNgs2.native, libkernel and libc outputs in the full-runtime build. Both NGS2 modules were NID-patched successfully.
  • ctest --test-dir build/windows-cnd -R '^ngs2_' -V: 49/49 pass, 6.23 seconds, including ngs2_core_custom (0.02 s) and ngs2_custom (0.05 s).
  • The independent 20-byte fixture uses literal module ID 0x1d and literal expected error codes. It covers 26 malformed options at positions 0, 1 and 23 in 1-, 2- and 24-module racks through both creation APIs, checking the output handle is unchanged and no allocator is called. It includes unsigned extremes and floats immediately outside the finite length endpoints. Valid creation, varying PCM and silence remain checked in both libraries.
  • Native-only control assertions retain all 256 Delay IDs and main's wrong-module/position error coverage. PS4 UserFx invalid-index assertions and PS4 invalid-channel return checks run in the core suite. No newly introduced assertions on unknown query or multiple-invalid-field console behavior remain.
  • Final conventions and whitespace checks pass. The fresh overlap scan's unresolved comparisons and manual inspection are described above.

Historical regression evidence: the original new malformed-option fixture failed on unchanged main 771d8b5bf7 with NGS2: this custom Delay module option size is not implemented. B-Howell independently reported Linux/WSL2 GCC 11.4.0 runs: both custom suites passed ten repetitions at earlier head 6bb9fe3ac7 merged onto 6e9b9134f6, and both failed when production was restored to main. Those are attributed historical results, not a Linux run of the current head.

No current-head Linux/macOS, PS5 hardware, commercial-title or complete repository test-suite run. No performance claim; the PCM regression preserves host compatibility rather than establishing console-equivalent Delay DSP.

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: n/a
  • AI-assisted: yes
<!-- greyfinch-sync:boykopovar/AnyPS5:issue:5040969542 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/pull/12107). Originally posted by [Th3EvilGod](https://github.com/Th3EvilGod) on 2026-10-27T20:54:50Z. --- ### What For malformed custom Delay options, return the PS5 errors through both rack-creation APIs: `0x804A8013` for option size, `0x804A8095` for type, `0x804A8096` for tap count, and `0x804A8097` for an out-of-range finite maximum length. The source is [fma-rc's reading of PS5 12.70 `libSceNgs2.native.sprx`, Delay setup at `0x30b80`](https://github.com/boykopovar/AnyPS5/issues/8039#issuecomment-6391072574), not disassembly or console measurements I performed. The constant names are local descriptive names. Keep the agreed Delay creation/audio compatibility path and unsupported-path throws. Null-option processor initialization, nonfinite/reserved values, unsupported rack/state shapes and precedence among multiple invalid payload fields remain unresolved. Delay DSP and controls remain unimplemented; the existing debt entry records these gaps. Run the custom-rack suite against both NGS2 libraries. Following [the current-main integration report](https://github.com/boykopovar/AnyPS5/pull/12107#issuecomment-6739633330), guard the Delay control-rejection loop and its callback assertion for `APS5_NGS2_PS4_LIBRARY`, as already done for PS5 filter controls. Also keep main's new PS5-only wrong-module/position error assertions native-only, retain the previous PS4 UserFx rejection assertions, and expect the existing PS4 channel error in the two invalid-channel setup cases. Both libraries retain malformed-option, valid-creation, varying-PCM and silence coverage; the native library retains all 256 Delay parameter-ID checks. Production behavior is unchanged by these test corrections; no PS4 error code is invented. Merged main `d222b34fabc63a904d9f99f4cde2269be5b4f61b` with the published branch, preserving contributor commits and main's updated UserFx debt entry. The earlier requested test cleanup remains intact. #10599 and #11315 are merged. The agreed order remains #12107 before #13491 ([proposal](https://github.com/boykopovar/AnyPS5/pull/12107#issuecomment-6528425363), [acceptance](https://github.com/boykopovar/AnyPS5/pull/12107#issuecomment-6535142114)). The refreshed overlap scan examined 1,941 open PRs and failed closed on four stale branches. I manually compared every reported shared file: #1384 changes Reverb declarations/test registration; #5548 changes PCM test registration and decoding/streaming debt; #10249 changes the Reverb/PitchShift option-word helper; #14212 changes the pending-export debt wording. None implements these Delay option errors. The automatic comparisons remain unresolved, so this is not reported as a clean scan. A direct merge preview of final head `e385df1347f086bfeeb4266cdeabf325dbea219f` with #13491 `f4b5b8040bd4629ea675379388fbe66580af161c` succeeds; this is not combined runtime validation. ### Tested Windows 11 build 26300, AMD Ryzen 7 9800X3D, WinLibs MinGW-w64 GCC 15.2.0 r7, Release full-runtime configuration (`ANYPS5_RELINKER_ONLY=OFF`, `BUILD_TESTING=ON`), pinned source dependencies. Tested head `e385df1347f086bfeeb4266cdeabf325dbea219f`, merged with main `d222b34fabc63a904d9f99f4cde2269be5b4f61b`. - Before the guard, merged tree `145168376bf2247cb367253478e07a69879d15ec` reproduces the reported failure: `ngs2_core_custom` aborts with `NGS2: the custom Delay module parameters are not implemented`; native `ngs2_custom` passes. - Built all 35 currently registered NGS2 test executables and requested the NID-patched `libSceNgs2`, `libSceNgs2.native`, `libkernel` and `libc` outputs in the full-runtime build. Both NGS2 modules were NID-patched successfully. - `ctest --test-dir build/windows-cnd -R '^ngs2_' -V`: **49/49 pass, 6.23 seconds**, including `ngs2_core_custom` (0.02 s) and `ngs2_custom` (0.05 s). - The independent 20-byte fixture uses literal module ID `0x1d` and literal expected error codes. It covers 26 malformed options at positions 0, 1 and 23 in 1-, 2- and 24-module racks through both creation APIs, checking the output handle is unchanged and no allocator is called. It includes unsigned extremes and floats immediately outside the finite length endpoints. Valid creation, varying PCM and silence remain checked in both libraries. - Native-only control assertions retain all 256 Delay IDs and main's wrong-module/position error coverage. PS4 UserFx invalid-index assertions and PS4 invalid-channel return checks run in the core suite. No newly introduced assertions on unknown query or multiple-invalid-field console behavior remain. - Final conventions and whitespace checks pass. The fresh overlap scan's unresolved comparisons and manual inspection are described above. Historical regression evidence: the original new malformed-option fixture failed on unchanged main `771d8b5bf7` with `NGS2: this custom Delay module option size is not implemented`. [B-Howell independently reported Linux/WSL2 GCC 11.4.0 runs](https://github.com/boykopovar/AnyPS5/pull/12107#issuecomment-6456597024): both custom suites passed ten repetitions at earlier head `6bb9fe3ac7` merged onto `6e9b9134f6`, and both failed when production was restored to main. Those are attributed historical results, not a Linux run of the current head. No current-head Linux/macOS, PS5 hardware, commercial-title or complete repository test-suite run. No performance claim; the PCM regression preserves host compatibility rather than establishing console-equivalent Delay DSP. <!-- OS, title or homebrew, what was checked. "Not tested" is a valid answer. A performance change: the summary lines of main and of this PR from the same machine and scene, with the traces attached, captured as the Performance report issue form describes. --> ### 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: <!-- #PR, or none --> none - [x] Fixes: <!-- issue it closes as Fixes #N, or none --> none - [x] Unblocks: <!-- title ID and Game bring-up discussion, e.g. PPSA01325 #3232, or none --> none - [x] GPUs tested: <!-- for AGC, shader recompiler or VideoOut changes: vendor, model, driver and OS of each GPU the GPU tests ran on; otherwise n/a --> n/a - [x] AI-assisted: <!-- yes / no --> yes
MarcZX10 commented 2026-10-27 21:09:15 +00:00 (Migrated from github.com)

Imported from boykopovar/AnyPS5. Originally posted by MarcZX10 on 2026-10-27T21:09:15Z.

Review: DISMISSED


The current branch merges cleanly with main, and I independently confirmed that it conflicts in docs/dev/debt/libSceNgs2.native.md with each open PR #10599 and #11315. Your integration section says the proposed landing order is not yet agreed, while the checklist says Depends on: none. CONTRIBUTING.md requires the authors to agree on which overlapping PR lands first and to record the ordering in Depends on. Please document that agreement with both authors and update the checklist before merge. This is an integration-rule blocker; the PRs can all remain open.

<!-- greyfinch-sync:boykopovar/AnyPS5:review:5674368184 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/pull/12107#pullrequestreview-5674368184). Originally posted by [MarcZX10](https://github.com/MarcZX10) on 2026-10-27T21:09:15Z. **Review:** DISMISSED --- The current branch merges cleanly with main, and I independently confirmed that it conflicts in docs/dev/debt/libSceNgs2.native.md with each open PR #10599 and #11315. Your integration section says the proposed landing order is not yet agreed, while the checklist says Depends on: none. CONTRIBUTING.md requires the authors to agree on which overlapping PR lands first and to record the ordering in Depends on. Please document that agreement with both authors and update the checklist before merge. This is an integration-rule blocker; the PRs can all remain open.
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!12107
No description provided.