fix(ngs2): return native voice-index error for Dark Forces #4788

Closed
PrintOrb wants to merge 1 commit from upstream-pr/4788 into main
PrintOrb commented 2026-10-12 21:56:16 +00:00 (Migrated from github.com)

Imported from boykopovar/AnyPS5. Originally posted by PrintOrb on 2026-10-12T21:56:16Z.


What

STAR WARS: Dark Forces Remaster (PPSA19728 02.000.000) terminates during startup with sceNgs2RackGetVoiceHandle: invalid argument. The title creates a one-voice reverb rack, obtains index 0 and requests index 1. Return the native bounds error 0x804A8305 without changing the output handle rather than throwing. The value and no-output-write path follow prosper's pinned native-module analysis linked in the debt note; no independent PS5 probe performed here.

Tested

Native Windows, Release build, based on main 529f7bfd4. Full libs build passes. The new ngs2_voiceindex regression aborts with current main's Rack.cpp and passes after restoring the fix. Existing ngs2_render and ngs2_stream also pass (3/3). Conventions, test registration and whitespace checks pass. Newer main ee4962190 was checked before publication: neither affected library changed, and the branch merges cleanly; the build/test results above are for the stated tested base.

Earlier title testing with this fix passed the reported stop and exposed a separate SDL audio initialization race. With both fixes, manual testing completed the first mission; Tab/PDA performance problems remain. Gameplay was not repeated on the refreshed main build.

Checklist

  • Based on current main; no other open PR implements the same functions
  • One topic per PR
  • No comments in code except technical debt
  • Unimplemented paths throw; no new silent stubs
  • No notes, investigation files or images added to the repository
  • New third-party code is a submodule built from source (none added)
  • Generic behaviour, not specific to one title
  • Depends on: none
  • Unblocks: PPSA19728 #4310
  • AI-assisted: yes (Codex)
<!-- greyfinch-sync:boykopovar/AnyPS5:issue:4835452464 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/pull/4788). Originally posted by [PrintOrb](https://github.com/PrintOrb) on 2026-10-12T21:56:16Z. --- ### What STAR WARS: Dark Forces Remaster (PPSA19728 02.000.000) terminates during startup with `sceNgs2RackGetVoiceHandle: invalid argument`. The title creates a one-voice reverb rack, obtains index 0 and requests index 1. Return the native bounds error 0x804A8305 without changing the output handle rather than throwing. The value and no-output-write path follow prosper's pinned native-module analysis linked in the debt note; no independent PS5 probe performed here. ### Tested Native Windows, Release build, based on main `529f7bfd4`. Full `libs` build passes. The new `ngs2_voiceindex` regression aborts with current main's Rack.cpp and passes after restoring the fix. Existing `ngs2_render` and `ngs2_stream` also pass (3/3). Conventions, test registration and whitespace checks pass. Newer main `ee4962190` was checked before publication: neither affected library changed, and the branch merges cleanly; the build/test results above are for the stated tested base. Earlier title testing with this fix passed the reported stop and exposed a separate SDL audio initialization race. With both fixes, manual testing completed the first mission; Tab/PDA performance problems remain. Gameplay was not repeated on the refreshed main build. ### Checklist - [x] Based on current `main`; no other open PR implements the same functions - [x] One topic per PR - [x] No comments in code except technical debt - [x] Unimplemented paths throw; no new silent stubs - [x] No notes, investigation files or images added to the repository - [x] New third-party code is a submodule built from source (none added) - [x] Generic behaviour, not specific to one title - [x] Depends on: none - [x] Unblocks: PPSA19728 #4310 - [x] AI-assisted: yes (Codex)
github-actions[bot] commented 2026-10-13 23:24:59 +00:00 (Migrated from github.com)

Imported from boykopovar/AnyPS5. Originally posted by github-actions[bot] on 2026-10-13T23:24:59Z.


Other open pull requests touch the same code. Merging one will break the other, or both implement the same thing. If this one builds on them, list them in Depends on.

Pull request Conflicting files (lines on main) Same exports Same new files
#5470 docs/dev/debt/libSceNgs2.native.md L27
#5548 docs/dev/debt/libSceNgs2.native.md L27
<!-- greyfinch-sync:boykopovar/AnyPS5:comment:6157329506 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/pull/4788#issuecomment-6157329506). Originally posted by [github-actions[bot]](https://github.com/apps/github-actions) on 2026-10-13T23:24:59Z. --- <!-- pr-overlap --> Other open pull requests touch the same code. Merging one will break the other, or both implement the same thing. If this one builds on them, list them in **Depends on**. | Pull request | Conflicting files (lines on `main`) | Same exports | Same new files | |---|---|---|---| | #5470 | `docs/dev/debt/libSceNgs2.native.md` [L27](https://github.com/boykopovar/AnyPS5/blob/0df6e295c52e7cd6afa394ed35513bd252045c74/docs/dev/debt/libSceNgs2.native.md#L27) | | | | #5548 | `docs/dev/debt/libSceNgs2.native.md` [L27](https://github.com/boykopovar/AnyPS5/blob/0df6e295c52e7cd6afa394ed35513bd252045c74/docs/dev/debt/libSceNgs2.native.md#L27) | | |
johnohhh1 commented 2026-10-14 02:02:18 +00:00 (Migrated from github.com)

Imported from boykopovar/AnyPS5. Originally posted by johnohhh1 on 2026-10-14T02:02:18Z.


Independent Linux validation of 62978cda4cde7f6171cfceacf8668a8e8838754c, applied alone to main 959d39fb2b050fa76beed0b49b4c2f13a119ab5a.

Ubuntu 26.04.1 x86-64, GCC 15.2.0, Release, bundled dependencies, testing and SPIR-V Tools enabled.

  • Full baseline and patched builds pass. All 12 selected NGS2/patched-library suites pass on the candidate without skips, including ngs2_voiceindex; serial CTest with a 30-second maximum.
  • The identical candidate ngs2_voiceindex_tests executable aborts against frozen baseline libraries with sceNgs2RackGetVoiceHandle: invalid argument, and passes against the patched libraries.
  • A supplemental probe passes 24 configurations: sampler, submixer, reverb and mastering racks with 1, 2, 3, 17, 255 and 256 voices. It checks 2,136 valid indices and 432 invalid-index/output-sentinel combinations, guarded outputs, stable valid handles after errors, preserved null-output/invalid-rack behavior, and 1,024 concurrent valid/invalid lookup pairs across eight threads. All 10,544 probe assertions pass. The same probe aborts against baseline libraries at an invalid index.
  • Conventions and whitespace checks pass; the local change matches the original stable patch ID and retains its author.

These are synthetic Linux checks of the implementation and its documented bounds-error contract. No title or native PS5 was run, and this does not independently establish the console's error code or the unchanged validation-order semantics. No additional Windows run. SDL_AUDIODRIVER=dummy was set only in child test processes.

AI-assisted validation/report: Codex. Original implementation and authorship preserved.

<!-- greyfinch-sync:boykopovar/AnyPS5:comment:6159229347 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/pull/4788#issuecomment-6159229347). Originally posted by [johnohhh1](https://github.com/johnohhh1) on 2026-10-14T02:02:18Z. --- Independent Linux validation of `62978cda4cde7f6171cfceacf8668a8e8838754c`, applied alone to main `959d39fb2b050fa76beed0b49b4c2f13a119ab5a`. Ubuntu 26.04.1 x86-64, GCC 15.2.0, Release, bundled dependencies, testing and SPIR-V Tools enabled. - Full baseline and patched builds pass. All 12 selected NGS2/patched-library suites pass on the candidate without skips, including `ngs2_voiceindex`; serial CTest with a 30-second maximum. - The identical candidate `ngs2_voiceindex_tests` executable aborts against frozen baseline libraries with `sceNgs2RackGetVoiceHandle: invalid argument`, and passes against the patched libraries. - A supplemental probe passes 24 configurations: sampler, submixer, reverb and mastering racks with 1, 2, 3, 17, 255 and 256 voices. It checks 2,136 valid indices and 432 invalid-index/output-sentinel combinations, guarded outputs, stable valid handles after errors, preserved null-output/invalid-rack behavior, and 1,024 concurrent valid/invalid lookup pairs across eight threads. All 10,544 probe assertions pass. The same probe aborts against baseline libraries at an invalid index. - Conventions and whitespace checks pass; the local change matches the original stable patch ID and retains its author. These are synthetic Linux checks of the implementation and its documented bounds-error contract. No title or native PS5 was run, and this does not independently establish the console's error code or the unchanged validation-order semantics. No additional Windows run. `SDL_AUDIODRIVER=dummy` was set only in child test processes. AI-assisted validation/report: Codex. Original implementation and authorship preserved.

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