feat(ngs2): implement the custom Reverb module #10599

Merged
kyon-eth merged 8 commits from upstream-pr/10599 into main 2026-11-02 10:23:13 +00:00
kyon-eth commented 2026-10-24 11:59:39 +00:00 (Migrated from github.com)

Imported from boykopovar/AnyPS5. Originally posted by kyon-eth on 2026-10-24T11:59:39Z.


What

Custom racks containing Reverb (0x1b) currently throw before processing audio. Implement the module for the existing supported one-buffer custom sampler and submixer paths, with independent state per voice and module, both creation sizes, indexed I3DL2 controls, channel exclusion and normalized input folding.

Reuse the existing reverb DSP with the custom module's ring sizes, signed wet/dry gains and four-sample room filter. Preserve bypass until parameters are supplied and after setup; clear history on a fresh PLAY while retaining parameters. Sampler completion still ends its voice. Reuse working buffers across grains.

Multiple-buffer routing, custom mastering modules, unsupported rates and NaN controls remain explicit refusals, documented in the library debt file. No complete title unblock is claimed.

Integration status

#10347 has merged. This branch incorporates main fe2b52c7e4 and resolves the shared DSP conflict by retaining input-channel folding and mapped dry output alongside the custom profile, four-sample filter and reusable scratch buffers. It has no outstanding functional dependency on #10347.

#5548 and #9926 remain open. Their test-registration conflicts are covered by a separate local integration preview that retains every test and passes 17/17 NGS2 checks on ARM64 and seven focused checks on x86-64. Those branches are not included in this PR. Their authors were asked to confirm that maintainers may choose their order, with the later branch preserving both registrations; confirmation is pending in the coordination thread.

Manual review of #1384/#6044: the former contains the older experimental built-in DSP and must preserve main's reference-based DSP and this custom profile when rebased. The latter changes test categorization; the new regression must receive the media category if it lands first. Their authors have been notified.

This PR is ready for review. Maintainers may choose the landing order; the later branch must preserve both test registrations. Author confirmation on that ordering remains pending. The diff contains only custom-Reverb work.

Tested

Current-main validation (2026-10-27): integrated main 9ae2f7d22a in 61908b16ac. The rebuilt macOS x86-64 production-source fixture passes the requested Reverb/custom/render/core-render tests and related Gain/routing safety cases (11/11). Conventions, whitespace and privacy checks pass. No new Linux/Windows execution or complete-title unblock is claimed.

Updated onto main fe2b52c7e4; all four requested rendering/custom checks and seven related Gain/routing safety cases pass in the rebuilt macOS x86-64 production-source fixture (11/11). Earlier ARM64 results are historical.

Earlier validation based on main c9b2660d56: macOS ARM64 and x86-64 (Rosetta): rebuilt the production NGS2 sources using a focused external CMake fixture, the repository's module CMake definitions and pinned local LibAtrac9 dependency. Only unrelated host libc boundaries are adapted; this is not a full application build.

  • ngs2_customreverb, ngs2_custom, ngs2_render and ngs2_core_render: 4/4 pass on each architecture after rebasing, including the merged built-in channel-conversion coverage.
  • The new regression fails with main's original Custom.cpp at the unsupported-Reverb refusal.
  • Original 13.60 library voice-graph checks cover both sizes, bypass/setup, independent instances, stop/play and sampler completion/restart. They run with host synchronization/math/SDK adapters and an equivalent lowering of one SSE4a extraction for Rosetta. No console execution is claimed.
  • DSP comparisons against 3.20 and 13.60 cover 48 kHz impulses and parameter updates. Maximum observed ordinary stereo error is below 2e-8; strong HF attenuation is below 8e-8. This is numerical comparison, not bit-exact validation.
  • No author Linux, Windows or game run. Independent Linux/title results are linked below; they predate this update. No performance claim.
  • Conventions and whitespace checks pass. The required open-PR overlap scan completed; integration overlaps are described above.

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

Review follow-up: production Voice.cpp now uses the public API header, with no test helpers in the shipped library. Integrated main fe2b52c7e4 while retaining its Gain/routing safety changes and every test registration. The four requested rendering/custom tests and the seven related Gain/routing safety cases pass in the rebuilt macOS x86-64 production-source fixture (11/11). No new Windows or Linux execution is claimed; the full fixture also has an unrelated filesystem-adapter failure in ngs2_parse.

Independent title evidence: Project Zero: Maiden of Black Water, PPSA04333 passes the previous custom-Reverb refusal on the prior head, then reaches an unsupported custom-mastering module chain. This removes one reported blocker; it does not establish playable gameplay. BLUE REFLECTION Quartet PPSA33655 discussion 10271 reports the same Reverb refusal, but has not been tested with this implementation.

Subsequent independent validation

Native Windows full-build report covers exact published head 61908b16ac: 31/31 NGS2 tests pass on Windows 11. This is the reviewer's execution evidence, not an author Windows run.

BLUE REFLECTION Quartet follow-up confirms that the custom-Reverb refusal is removed at this head. The next blocker is an existing two-buffer UserFx submixer configuration. It is outside this one-buffer Reverb change, and no complete-title unblock is claimed. The independent Trails in the Sky 2nd result likewise requires the separate PitchShift PR and subsequent reconciliation.

<!-- greyfinch-sync:boykopovar/AnyPS5:issue:4995195025 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/pull/10599). Originally posted by [kyon-eth](https://github.com/kyon-eth) on 2026-10-24T11:59:39Z. --- ### What Custom racks containing Reverb (`0x1b`) currently throw before processing audio. Implement the module for the existing supported one-buffer custom sampler and submixer paths, with independent state per voice and module, both creation sizes, indexed I3DL2 controls, channel exclusion and normalized input folding. Reuse the existing reverb DSP with the custom module's ring sizes, signed wet/dry gains and four-sample room filter. Preserve bypass until parameters are supplied and after setup; clear history on a fresh PLAY while retaining parameters. Sampler completion still ends its voice. Reuse working buffers across grains. Multiple-buffer routing, custom mastering modules, unsupported rates and NaN controls remain explicit refusals, documented in the library debt file. No complete title unblock is claimed. ### Integration status #10347 has merged. This branch incorporates main `fe2b52c7e4` and resolves the shared DSP conflict by retaining input-channel folding and mapped dry output alongside the custom profile, four-sample filter and reusable scratch buffers. It has no outstanding functional dependency on #10347. #5548 and #9926 remain open. Their test-registration conflicts are covered by a separate local integration preview that retains every test and passes 17/17 NGS2 checks on ARM64 and seven focused checks on x86-64. Those branches are not included in this PR. Their authors were asked to confirm that maintainers may choose their order, with the later branch preserving both registrations; confirmation is pending in [the coordination thread](https://github.com/boykopovar/AnyPS5/pull/10599#issuecomment-6384322137). Manual review of #1384/#6044: the former contains the older experimental built-in DSP and must preserve main's reference-based DSP and this custom profile when rebased. The latter changes test categorization; the new regression must receive the media category if it lands first. Their authors have been notified. This PR is ready for review. Maintainers may choose the landing order; the later branch must preserve both test registrations. Author confirmation on that ordering remains pending. The diff contains only custom-Reverb work. ### Tested Current-main validation (2026-10-27): integrated main `9ae2f7d22a` in `61908b16ac`. The rebuilt macOS x86-64 production-source fixture passes the requested Reverb/custom/render/core-render tests and related Gain/routing safety cases (**11/11**). Conventions, whitespace and privacy checks pass. No new Linux/Windows execution or complete-title unblock is claimed. Updated onto main `fe2b52c7e4`; all four requested rendering/custom checks and seven related Gain/routing safety cases pass in the rebuilt macOS x86-64 production-source fixture (11/11). Earlier ARM64 results are historical. Earlier validation based on main `c9b2660d56`: macOS ARM64 and x86-64 (Rosetta): rebuilt the production NGS2 sources using a focused external CMake fixture, the repository's module CMake definitions and pinned local LibAtrac9 dependency. Only unrelated host libc boundaries are adapted; this is not a full application build. - `ngs2_customreverb`, `ngs2_custom`, `ngs2_render` and `ngs2_core_render`: **4/4 pass on each architecture** after rebasing, including the merged built-in channel-conversion coverage. - The new regression fails with main's original Custom.cpp at the unsupported-Reverb refusal. - Original 13.60 library voice-graph checks cover both sizes, bypass/setup, independent instances, stop/play and sampler completion/restart. They run with host synchronization/math/SDK adapters and an equivalent lowering of one SSE4a extraction for Rosetta. No console execution is claimed. - DSP comparisons against 3.20 and 13.60 cover 48 kHz impulses and parameter updates. Maximum observed ordinary stereo error is below 2e-8; strong HF attenuation is below 8e-8. This is numerical comparison, not bit-exact validation. - No author Linux, Windows or game run. Independent Linux/title results are linked below; they predate this update. No performance claim. - Conventions and whitespace checks pass. The required open-PR overlap scan completed; integration overlaps are described above. <!-- 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: none <!-- #PR, or none --> - [x] Fixes: none <!-- issue it closes as Fixes #N, or none --> - [x] Unblocks: none <!-- title ID and Game bring-up discussion, e.g. PPSA01325 #3232, or none --> - [x] GPUs tested: n/a <!-- for AGC, shader recompiler or VideoOut changes: vendor, model, driver and OS of each GPU the GPU tests ran on; otherwise n/a --> - [x] AI-assisted: yes <!-- yes / no --> Review follow-up: production Voice.cpp now uses the public API header, with no test helpers in the shipped library. Integrated main fe2b52c7e4 while retaining its Gain/routing safety changes and every test registration. The four requested rendering/custom tests and the seven related Gain/routing safety cases pass in the rebuilt macOS x86-64 production-source fixture (11/11). No new Windows or Linux execution is claimed; the full fixture also has an unrelated filesystem-adapter failure in ngs2_parse. Independent title evidence: [Project Zero: Maiden of Black Water, PPSA04333](https://github.com/boykopovar/AnyPS5/pull/10599#issuecomment-6430075348) passes the previous custom-Reverb refusal on the prior head, then reaches an unsupported custom-mastering module chain. This removes one reported blocker; it does not establish playable gameplay. BLUE REFLECTION Quartet PPSA33655 [discussion 10271](https://github.com/boykopovar/AnyPS5/discussions/10271) reports the same Reverb refusal, but has not been tested with this implementation. ### Subsequent independent validation [Native Windows full-build report](https://github.com/boykopovar/AnyPS5/pull/10599#issuecomment-6450733113) covers exact published head `61908b16ac`: 31/31 NGS2 tests pass on Windows 11. This is the reviewer's execution evidence, not an author Windows run. [BLUE REFLECTION Quartet follow-up](https://github.com/boykopovar/AnyPS5/pull/10599#issuecomment-6443996849) confirms that the custom-Reverb refusal is removed at this head. The next blocker is an existing two-buffer UserFx submixer configuration. It is outside this one-buffer Reverb change, and no complete-title unblock is claimed. The independent Trails in the Sky 2nd result likewise requires the separate PitchShift PR and subsequent reconciliation.
MarcZX10 commented 2026-10-24 14:00:39 +00:00 (Migrated from github.com)

Imported from boykopovar/AnyPS5. Originally posted by MarcZX10 on 2026-10-24T14:00:39Z.

Review: COMMENTED


Reviewed updated head 022c609f947fef3fa0bc4f205f7a2aec75980556. The #10347 integration prerequisite is now merged and the body records that its channel folding and mapped dry path remain alongside custom Reverb. git diff --check upstream/main...HEAD passes. I reviewed the rebase and the custom state lifecycle (module creation, parameter activation, PLAY reset, setup reset and sampler completion paths); I found no new standalone source issue in this update.

The 4/4 results per macOS architecture and the combined-preview results are author-reported; I did not independently run these focused production-source fixtures. The PR remains draft while agreement on the test-registration ordering with #5548 and #9926 is pending. Please retain all test registrations when the later branch is rebased. The stale #1384 comparison also needs a fresh check if that PR's source changes are brought into the integration tree.

<!-- greyfinch-sync:boykopovar/AnyPS5:review:5638511528 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/pull/10599#pullrequestreview-5638511528). Originally posted by [MarcZX10](https://github.com/MarcZX10) on 2026-10-24T14:00:39Z. **Review:** COMMENTED --- Reviewed updated head `022c609f947fef3fa0bc4f205f7a2aec75980556`. The #10347 integration prerequisite is now merged and the body records that its channel folding and mapped dry path remain alongside custom Reverb. `git diff --check upstream/main...HEAD` passes. I reviewed the rebase and the custom state lifecycle (module creation, parameter activation, PLAY reset, setup reset and sampler completion paths); I found no new standalone source issue in this update. The 4/4 results per macOS architecture and the combined-preview results are author-reported; I did not independently run these focused production-source fixtures. The PR remains draft while agreement on the test-registration ordering with #5548 and #9926 is pending. Please retain all test registrations when the later branch is rebased. The stale #1384 comparison also needs a fresh check if that PR's source changes are brought into the integration tree.
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!10599
No description provided.