feat(ngs2): accept custom submixers with more than eight channels #11347
Loading…
Reference in a new issue
No description provided.
Delete branch "upstream-pr/11347"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Imported from boykopovar/AnyPS5. Originally posted by edubox on 2026-10-26T06:07:30Z.
What
Accept custom submixer racks with more than eight channels (9 to 37) instead of throwing at creation. The rack limit still applies to the matrix-level count and the legacy UserFx channel-pointer array.
Voices on those racks stay limited to eight input and eight output channels, as firmware 13.42 does (
0x804A8052for 9/9, 12/12 and 37/37). A port into more than eight channels without a matrix therefore remains unsupported and throws; the explicit-matrix path is unchanged.This removes the first blocker of Fatal Frame II (PPSA32802), which creates a 12-channel custom submixer rack during start-up. The voice and matrixless-map limits mean the title still stops later at
NGS2: custom module id 0x17 is not implemented(the EQ module, outside this change).Tested
Linux, GCC 16.2.1, RTX 4080 SUPER. All 16
ngs2_*tests pass.TestWideCustomSubmixernow creates a 12-channel custom submixer rack, checks that a 12/12 voice setup is rejected, and renders an 8/8 voice through explicit matrices.BunnyFl measured the voice limit on firmware 13.42: a custom submixer rack accepts
max_channels2 to 37, while voice setup returns0x804A8052above 8 inputs or outputs; the same run confirms the rack limit of 37. Fatal Frame II (PPSA32802 01.002.002) passes the 12-channel rack creation on this head.Checklist
main; no other open PR implements the same functionsNotImplemented_nid_no_patch); silent stubs are listed under Silent stubs in their library's technical debt file.mdfiles or images added to the repository (attach them to this PR)Imported from boykopovar/AnyPS5. Originally posted by MarcZX10 on 2026-10-26T06:09:00Z.
Review: APPROVED
I reviewed the current-main diff in
Rack.cpp,Render.cpp,Voice.cpp, and the custom-FX path. The expanded 9–37 channel allowance is limited to custom submixer racks; custom mastering and the existing sampler/render limits remain bounded. Matrix validation now uses the public rack maximum, the legacy callback channel array uses the matching capacity, and the default map selects identity only when both wide channel counts match. The new test exercises a 12-channel rack with explicit source/destination matrices and verifies the rendered output, while the updated checks cover 16 and 37 channels. The author reports all 16 NGS2 tests passing on Linux/GCC 16.2.1; hosted product jobs are path-skipped, so those are not independent hosted results. I found no remaining actionable issue in the reviewed scope.Imported from boykopovar/AnyPS5. Originally posted by MarcZX10 on 2026-10-26T06:16:31Z.
Review: CHANGES_REQUESTED
I found a cross-path correctness issue in the newly enabled 32–37 channel range.
Ngs2CheckCustomRackacceptsSCE_NGS2_CUSTOM_MODULE_ID_PITCH_SHIFTon a custom submixer;Ngs2SetupUserFxallocates pitch-shift state torack.maxChannels, andSetupCustomSubmixernow accepts a voice count through that maximum. When such a voice is rendered,Ngs2ProcessPitchShiftcomputes((1u << voice.channels) - 1)and later tests(1u << c)with a 32-bit1u(seePitchShift.cpp:223,230in the integrated NGS2 implementation). For a 32–37 channel voice these shifts have an exponent at least 32, which is undefined behavior; the parameter’sbypass_maskandinitializedChannelsare also 32-bit, so channels above bit 31 need defined semantics. I confirmed the shift expression triggers UBSan at channel count 37. The new wide-rack test uses no pitch-shift module, so it does not cover this reachable configuration. Please either implement well-defined channel-mask handling for the newly supported range or reject pitch-shift configurations that cannot be represented, and add a focused regression for the selected behavior before this wide-channel support is approved.Imported from boykopovar/AnyPS5. Originally posted by MarcZX10 on 2026-10-26T06:17:01Z.
Review: APPROVED
Correction to my prior review: the 32-bit shift concern I raised is in the separate, unmerged PitchShift implementation from #11315. In this PR’s exact current-main base,
Ngs2CheckCustomRackstill rejects the built-in PitchShift module, so that execution path is not introduced by this diff. The request for changes was therefore too strong for #11347 in isolation; I have restored approval. I will flag the integration risk on #11315, since its implementation would make the newly supported 32–37 channel custom-submixer range relevant.Imported from boykopovar/AnyPS5. Originally posted by MarcZX10 on 2026-10-26T09:37:53Z.
Review: DISMISSED
Re-reviewed exact head
726587dead747f3af1a4206e69c693b859b0beb5against currentmain4e43321bd6ceccdc1ae28568bbbc35d9a6446464. Conventions andgit diff --checkpass, and the merge preview is clean. The branch is nevertheless 63 commits behind current main;Render.cpp,Voice.cppand the NGS2 debt file changed on main since its base. The reported 16-test run and PPSA32802 startup run were on the earlierc3dbbase. Product test jobs are skipped by path policy, and I cannot run the NGS2 binary on this host because its CPU preflight requires unsupported instructions. Please rebase and rerun the focused suite on the resulting head.There is also an unverified behavior in the implementation:
Ngs2DefaultLevelselects an identity map for a matrixless port when either side has more than eight channels and source/destination counts match. The debt entry calls that mapping unverified, butAGENTS.mdrequires unknown behavior to remain unsupported. The newTestWideCustomSubmixersets explicit matrices on both ports, so it does not exercise this new default-map path. Please provide console evidence for the identity mapping and cover it, or keep matrixless wide-channel routing unsupported until its behavior is known; retain the explicit-matrix path separately.Finally, the checklist says
Unblocks: PPSA32802 (no game bring-up discussion). The contribution rule asks for the title's Game bring-up discussion when a PR unblocks it. Please link the applicable discussion, or clarify that this is not a title-unblocking change and update the checklist accordingly.The previously reported pairwise conflict with #11315 in
Rack.cppand the NGS2 debt file remains; coordinate integration and preserve both changes when resolving it.AI-assisted review.
Imported from boykopovar/AnyPS5. Originally posted by THEMANnt on 2026-10-26T15:13:33Z.
Review: DISMISSED
core/libs/prx/libSceNgs2.native/src/Voice.cpp:118: the expanded limit accepts 65 matrix levels, butsceNgs2VoiceGetMatrixInfostill writes into the fixed 64-floatNgs2VoiceMatrixInfo::levelsarray. Reading that matrix copies the 65th float past the caller’s output buffer and corrupts adjacent memory. Please preserve the ABI capacity or make the getter safely reject/limit matrices that do not fit, and add a regression for this boundary.Validation: the Release
ngs2_custom_testsbuild succeeded and the author suite passed (1 passed, 0 skipped, 0 failed). A review-only guarded test accepted 65 levels, returnednum_levels=65, and changed the adjacent canary from0x51a7c0deto0x3e800000. The pinned-base control rejects the 65-level input and preserves the canary. Hosted Actions passed eligibility only; product build/test jobs were skipped.Imported from boykopovar/AnyPS5. Originally posted by THEMANnt on 2026-10-28T15:56:19Z.
Review: APPROVED
Re-reviewed
0c4d2ca7a58b7505d82aa984fd844fc5d78a2619against17f8dfad513b134a4996991109fc9db47a3bb905— approve. The earlier matrix-output overflow is fixed:sceNgs2VoiceGetMatrixInforejects stored matrices larger than its 64-float ABI buffer before any output write. The rack allowance remains separate from the eight-channel voice limit, and unsupported matrixless wide-channel routing still throws.Validation: Windows/GCC 15.3 Release, isolated pinned checkouts: all 30 NGS2 CTests passed on the head and all 30 passed on the baseline, with no skips. Independent guarded-buffer checks cover 63/64-level success, 65/66/1369-level rejection with the entire output and canary unchanged, rejection above the 37×37 setter maximum, and recovery to a readable 64-level matrix. Removing only the getter guard reproduces the 65-level overwrite and fails the control; restoring the original sources passes. The direct conventions check passes.
Current-head hosted Windows CI succeeded, including its host-only linking step; its CTest step was skipped, so the NGS2 execution results above are local. No console/title run or independent firmware measurement is claimed. I found no remaining blocker in this reviewed scope.