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

Closed
edubox wants to merge 2 commits from upstream-pr/11352 into main
edubox commented 2026-10-26 07:22:05 +00:00 (Migrated from github.com)

Imported from boykopovar/AnyPS5. Originally posted by edubox on 2026-10-26T07:22:05Z.


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
<!-- greyfinch-sync:boykopovar/AnyPS5:issue:5013631747 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/pull/11352). Originally posted by [edubox](https://github.com/edubox) on 2026-10-26T07:22:05Z. --- ### 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](https://github.com/boykopovar/AnyPS5/issues/8039#issuecomment-6319332943): 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 - [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 - [x] Fixes: none - [x] Unblocks: none - [x] GPUs tested: n/a - [x] AI-assisted: yes
MarcZX10 commented 2026-10-26 07:26:36 +00:00 (Migrated from github.com)

Imported from boykopovar/AnyPS5. Originally posted by MarcZX10 on 2026-10-26T07:26:36Z.

Review: COMMENTED


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.

<!-- greyfinch-sync:boykopovar/AnyPS5:review:5648665392 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/pull/11352#pullrequestreview-5648665392). Originally posted by [MarcZX10](https://github.com/MarcZX10) on 2026-10-26T07:26:36Z. **Review:** COMMENTED --- 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.
MarcZX10 commented 2026-10-26 09:14:03 +00:00 (Migrated from github.com)

Imported from boykopovar/AnyPS5. Originally posted by MarcZX10 on 2026-10-26T09:14:03Z.

Review: APPROVED


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.

<!-- greyfinch-sync:boykopovar/AnyPS5:review:5649708965 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/pull/11352#pullrequestreview-5649708965). Originally posted by [MarcZX10](https://github.com/MarcZX10) on 2026-10-26T09:14:03Z. **Review:** APPROVED --- 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 commented 2026-10-26 09:35:34 +00:00 (Migrated from github.com)

Imported from boykopovar/AnyPS5. Originally posted by MarcZX10 on 2026-10-26T09:35:34Z.

Review: CHANGES_REQUESTED


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.

<!-- greyfinch-sync:boykopovar/AnyPS5:review:5649939659 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/pull/11352#pullrequestreview-5649939659). Originally posted by [MarcZX10](https://github.com/MarcZX10) on 2026-10-26T09:35:34Z. **Review:** CHANGES_REQUESTED --- 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.
THEMANnt commented 2026-10-26 15:13:28 +00:00 (Migrated from github.com)

Imported from boykopovar/AnyPS5. Originally posted by THEMANnt on 2026-10-26T15:13:28Z.

Review: APPROVED


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.

<!-- greyfinch-sync:boykopovar/AnyPS5:review:5654338389 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/pull/11352#pullrequestreview-5654338389). Originally posted by [THEMANnt](https://github.com/THEMANnt) on 2026-10-26T15:13:28Z. **Review:** APPROVED --- 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.

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