Skip to content

fix(ngs2): start the custom Gain ramp at the previous gain - #11352

Closed
edubox wants to merge 2 commits into
boykopovar:mainfrom
edubox:fix/ngs2-gain-ramp
Closed

edubox wants to merge 2 commits into
boykopovar:mainfrom
edubox:fix/ngs2-gain-ramp

Conversation

@edubox

@edubox edubox commented Oct 26, 2026

Copy link
Copy Markdown
Contributor

What

Start the custom Gain module's ramp at the previous gain. Sample i of N now gets old + (new - old) * i / N, so the new gain is first reached at the next grain, instead of the previous implementation that reached it on the last sample of the current grain.

This follows fma-rc's reading of the 12.70 module: the ramp starts at the old gain, equal gains skip the ramp and zero writes zeros. The debt entry and the existing TestCustomGain expectations are updated.

Tested

Linux, GCC 16.2.1. All 16 ngs2_* tests pass, including the updated TestCustomGain ramp expectations.

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

@MarcZX10 MarcZX10 left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I reviewed the custom Gain interpolation, test expectations and debt update. The new expression samples the ramp at i / grain, leaving the old gain at the first sample and reaching the new gain at the next grain; the updated assertions cover both increasing and decreasing transitions. The code, test and documentation describe the same behavior.

The PR description reports all 16 ngs2_* tests passing on Linux. The hosted checks did not run the Build test jobs (they are marked skipped), so this is the author’s local result rather than CI. I did not independently run the suite in this review.

@github-actions

github-actions Bot commented Oct 26, 2026 •

Copy link
Copy Markdown

Some comparisons could not be completed because a pull request conflicts with the base branch. Review these shared files manually before concluding that there is no overlap.

Pull request Shared files not compared
PR 5548 docs/dev/debt/libSceNgs2.native.md
PR 9149 docs/dev/debt/libSceNgs2.native.md
PR 9324 docs/dev/debt/libSceNgs2.native.md
PR 10249 core/libs/prx/libSceNgs2.native/src/Custom.cpp
PR 10599 core/libs/prx/libSceNgs2.native/src/Custom.cpp
core/libs/prx/libSceNgs2.native/tests/Ngs2Custom.cpp
docs/dev/debt/libSceNgs2.native.md
PR 11104 docs/dev/debt/libSceNgs2.native.md
PR 11315 core/libs/prx/libSceNgs2.native/src/Custom.cpp
core/libs/prx/libSceNgs2.native/tests/Ngs2Custom.cpp
docs/dev/debt/libSceNgs2.native.md
PR 11388 docs/dev/debt/libSceNgs2.native.md

@MarcZX10

Copy link
Copy Markdown
Contributor

I manually compared the current head of #11352 (130e6c586410ab1085320a2fbd5a5f13bd4a4edc) with #10599 (54ac175ee309d0a7a517d7bd3524413e6ad8383c) and #11315 (316f48500a7193fb89aae6d3d9b2c260df55b409) using git merge-tree --write-tree. In both previews, the code and tests auto-merge; the only content conflict is docs/dev/debt/libSceNgs2.native.md. Please preserve the custom Gain ramp entry together with the Reverb/PitchShift entries when integrating. This is a merge preview, not an independent test run.

@MarcZX10

Copy link
Copy Markdown
Contributor

Current main is b27cc8416f820e40ce187f165d34138e24373dd7; this head is 2 ahead/108 behind. The merge preview is clean, and main has not changed the PR's touched code/test paths since its base. Please refresh the branch per the repository base-sync rule and rerun the focused custom-Gain interpolation tests on the resulting exact head. The existing hosted checks are policy/report checks; Build test jobs are skipped, so the earlier 16-test result remains author-reported.

@edubox
edubox force-pushed the fix/ngs2-gain-ramp branch from 130e6c5 to 66bca23 Compare October 26, 2026 09:04
@edubox

edubox commented Oct 26, 2026

Copy link
Copy Markdown
Contributor Author

Rebased onto current main (c3db979cd3); the change itself is unchanged. All 16 ngs2_* tests pass on the rebased head 66bca2376f (ctest -R "^ngs2_" -j16).

@MarcZX10 MarcZX10 left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Reviewed exact head 66bca2376f64b8846397063c646f4f1c57673730 against current main 8100e480f7d55e87afb5376b8f784bf17df0f75c.

The custom Gain update now samples the interpolation at i / grain, keeping the old gain at sample 0 and reaching the target on the next grain. The updated increasing/decreasing assertions match that formula, and the shortened debt entry preserves the remaining unverified cases. The merge preview is clean and retains both this debt entry and main’s separate mastering-gain entry. Current-main conventions and git diff --check pass.

The author reports all 16 ngs2_* tests pass on this rebased head. I did not independently run them; hosted eligibility, conventions, labels and report checks pass, while the product/build test jobs are skipped by path policy.

AI-assisted review.

@MarcZX10 MarcZX10 left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Follow-up on my approval of exact head 66bca2376f64b8846397063c646f4f1c57673730: current upstream main is now 63 commits beyond merge base c3db979cd33a65a0a651f1e7ba7958137a961413. The branch still merges cleanly, and my current-head conventions/diff checks pass. The PR's reported 16-test run was on c3db; since then main changed NGS2 source/test/debt paths. Product test jobs remain skipped by path policy, so there is no hosted run on the current merged tree. Please rebase onto current main and rerun the focused NGS2 suite on the resulting head. I cannot independently execute it here because this host's CPU preflight lacks the required instruction set.

There is also a current pairwise debt-file conflict with #11354 in docs/dev/debt/libSceNgs2.native.md (the code changes are separate). Please coordinate the order and retain both entries. This branch's Depends on: none can remain if there is no functional dependency, but the shared file still needs reconciliation.

@MarcZX10

Copy link
Copy Markdown
Contributor

Current-main follow-up (5b5d24cb223ede690fe5eab1fe2f7a1736b801a5): this branch is still 2 commits ahead and 66 behind merge base c3db979cd33a65a0a651f1e7ba7958137a961413. The merge preview is clean, but main has since changed docs/dev/debt/libSceNgs2.native.md, which this PR also edits. It also changed src/Custom.cpp and tests/Ngs2Custom.cpp in the same area as the gain-ramp implementation/assertions; those hunks merge automatically but the reported test run predates them. Please rebase onto current main, preserve the current-main filter-reset initialization and this gain-ramp behavior, then rerun the focused ngs2_* tests on the exact rebased head. Current hosted checks are policy/report checks; product tests are skipped by path policy.

@edubox

edubox commented Oct 26, 2026

Copy link
Copy Markdown
Contributor Author

Rebased onto current main 035ac96edd; the change itself is unchanged. All 16 ngs2_* tests pass on the rebased head 6fee515a77 (ctest -R "^ngs2_" -j16), and check_conventions.py / git diff --check are clean. Could you re-review the exact head?

@edubox
edubox force-pushed the fix/ngs2-gain-ramp branch from 66bca23 to 6fee515 Compare October 26, 2026 13:10

@THEMANnt THEMANnt left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Reviewed 6fee515 against 035ac96. No actionable findings. The gain ramp samples old + (new - old) * i / grain, so sample zero uses the old gain and the target takes effect on the next grain. The updated regression checks both increasing and decreasing transitions and the following grain at the target value. I built ngs2_custom_tests in Release with WinLibs GCC 15.2.0 and ran focused CTest: 1 passed, 0 skipped, 0 failed. The exact-head Actions run passed eligibility only; product build/test jobs were skipped. This is an independent Windows/MinGW build and runtime check of the affected target, not a run of the full NGS2 suite or console firmware.

@edubox

edubox commented Oct 26, 2026

Copy link
Copy Markdown
Contributor Author

Rebased onto current main (518d36eaec); head is now 37a52aaceb. Rebuilt and ran the full focused suite on the rebased head: 16/16 ngs2_* tests pass. check_conventions.py --base origin/main: all checks passed. No changes to the debt-file content beyond the rebase.

@edubox
edubox force-pushed the fix/ngs2-gain-ramp branch 2 times, most recently from 37a52aa to d1d22e1 Compare October 26, 2026 17:57
@edubox

edubox commented Oct 26, 2026

Copy link
Copy Markdown
Contributor Author

Rebased onto current main (88795ed448); head is now d1d22e1a0c. The change itself is unchanged. Rebuilt and ran the focused NGS2 suite on the rebased head: 16/16 tests pass. check_conventions.py --base origin/main and git diff --check are clean. Could you re-check the exact head?

@edubox
edubox force-pushed the fix/ngs2-gain-ramp branch from d1d22e1 to 74c6c93 Compare October 26, 2026 21:39
@edubox

edubox commented Oct 26, 2026

Copy link
Copy Markdown
Contributor Author

Rebased again onto current main (85071975fb); head is now 74c6c93481. No code changes. 16/16 focused NGS2 tests pass; conventions/diff-check clean. Could you re-check the exact head?

@edubox

edubox commented Oct 26, 2026

Copy link
Copy Markdown
Contributor Author

I did not push a rebased head: this change is already in main and has no remaining delta.

main contains the same i/N ramp from #10851 (93b887e514, feat(ngs2): route custom submixer buffers through Gain). Its TestCustomGain already asserts the previous-gain start (0.5f * 2.0f * i / Grain, no i + 1), and the debt entry already documents the i/N ramp and equal-gain paths. Rebasing onto 74acfad65b makes both commits empty, so force-pushing would leave the PR with no diff.

I left the branch and PR untouched. This looks superseded by #10851; closing it is your call. The equivalent ngs2_custom test passes on the current main-based focused runs (21/21 in libSceNgs2.native, 9/9 in libSceNgs2).

@github-actions github-actions Bot added the needs rebase Conflicts with main, rebase needed label Oct 26, 2026
@edubox

edubox commented Oct 26, 2026

Copy link
Copy Markdown
Contributor Author

Closing as superseded by #10851. Main already contains the same i/N custom Gain ramp, and rebasing this branch leaves both commits empty, so there is no remaining delta to merge.

@edubox edubox closed this Oct 26, 2026
@edubox
edubox deleted the fix/ngs2-gain-ramp branch October 26, 2026 22:29
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

docs needs rebase Conflicts with main, rebase needed prx

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants