Skip to content

fix(ngs2): use PS5 system and rack handle errors - #6348

Merged
oneandonlydean merged 2 commits into
boykopovar:mainfrom
JJenkx:fix/ngs2-ps5-handle-errors
Oct 17, 2026
Merged

oneandonlydean merged 2 commits into
boykopovar:mainfrom
JJenkx:fix/ngs2-ps5-handle-errors

Conversation

@JJenkx

@JJenkx JJenkx commented Oct 15, 2026 •

Copy link
Copy Markdown
Contributor

What

NGS2 currently returns 0x804A0230 for an invalid system handle and 0x804A0261 for an invalid rack. Use the PS5 handle-type errors 0x804A8201 and 0x804A8202. These shared constants cover the existing system/rack validation paths in both libSceNgs2 builds.

Also validate the rack before the output pointer in sceNgs2RackGetVoiceHandle: an unknown, wrong-kind or retired rack with null output must return the rack error. A live rack with null output still returns 0x804A8010; successful voice lookup is unchanged.

The values follow the handle-type helper in prosper's PS5 module analysis. The lookup order/rack value are independently reported from the native export across firmware 1.00–12.70 in the #5916 review, which explicitly left this correction for a separate PR. This is source-analysis evidence, not a fresh hardware execution test by me. Other exports retain their existing validation order; full invalid-input precedence remains debt.

#5916 is now merged. This branch contains only the two follow-up commits for handle-code/precedence corrections and their tests, rebased onto main ea4cc112a04e6144740756bcd6494bbab5377331. Published head b4a93cd91bcb953c96a20820e80a77675596449e. A merge-tree check against newer main 9e9d86f81c70d5dcd58fee01c4837c18ddd8d0c8 is clean. No remaining prerequisite.

Tested

Rebase validation report, CTest log.

Linux x86-64, GCC, Ryzen 9 7950X:

  • Full libs and all twelve NGS2 test executables build successfully.
  • Final ctest -R '^ngs2_': 12/12 pass, zero skips, 0.41 seconds, including render tests against both libSceNgs2 and libSceNgs2.native, ATRAC9, filters, custom samplers, parsing, streaming, UserFx, reports, geometry and the parent's voice-index regression.
  • New ngs2_handleerrors checks literal PS5 error values for unknown handles, wrong-kind handles, destroyed racks/systems, rack-before-null-output precedence, preserved output sentinels and successful lookup afterwards.
  • Three independent negative controls: restore the old system code; restore the old rack code; restore null-output-first lookup. Each rebuilt native library makes the same unchanged regression executable fail at its matching diagnostic. Its SHA256 stays f7af53442cfd48caebc3477f7a09548c0a6b5496c6bf72d7b5f4ae9274085305. All faults were removed, full libraries/tests rebuilt and the final twelve-test result obtained afterwards.
  • Conventions and whitespace checks pass.

The fresh rebase builds full libs and all twelve NGS2 test executables using main’s published dependency pins. The final twelve-test run passes with no skips in 0.41 seconds. Earlier negative-control results above were obtained before this rebase and were not repeated; no private dependency pin is required for the current build. No Windows execution, full CTest suite, FPS gain or additional title unblock is claimed for this follow-up. The parent #5916 is what removes DOOM's audio initialization stop.

Native integration smoke test

After restoring all faults and rebuilding, a controller-driven DOOM + DOOM II PPSA21444 run entered E1M1: Hangar with the level/weapon/status bar rendered. It completed the planned 140-second watchdog (124), restored the temporary kernel setting and left no native process. Host imports remained enabled. #5916 is what removes the initialization exception; this follow-up claims no additional compatibility or FPS gain. Movement/firing and audible quality were not checked. Exact revisions, settings, limitations and completed/interrupted run accounting.

Checklist

@github-actions

github-actions Bot commented Oct 15, 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 1384 core/libs/prx/libSceNgs2.native/CMakeLists.txt
core/libs/prx/libSceNgs2.native/include/Ngs2Types.hpp
core/libs/prx/libSceNgs2.native/src/Rack.cpp
PR 5797 core/libs/prx/libSceNgs2.native/CMakeLists.txt
core/libs/prx/libSceNgs2.native/include/Ngs2Types.hpp
docs/dev/debt/libSceNgs2.native.md
PR 6044 core/libs/prx/libSceNgs2.native/CMakeLists.txt
PR 6447 docs/dev/debt/libSceNgs2.native.md
PR 6594 docs/dev/debt/libSceNgs2.native.md
PR 6680 core/libs/prx/libSceNgs2.native/include/Ngs2Types.hpp
docs/dev/debt/libSceNgs2.native.md

@JJenkx

JJenkx commented Oct 16, 2026

Copy link
Copy Markdown
Contributor Author

Reviewed the new #6680 overlap at head c5c55fa41512 against this PR. The reported direct conflict is additive debt documentation: #6680 adds sceNgs2GeomApply notes at the end of docs/dev/debt/libSceNgs2.native.md; this branch adds the separate rack voice-index Functional entry there. Both entries should be retained when resolving the document.

The shared source edits are separate: #6680 adds report data types/registration and implements geometry application; this branch changes system/rack/voice handle-error checks. #6680 does not implement those error corrections, and this PR does not build on #6680. Existing declared dependencies are unchanged. GitHub currently marks this branch MERGEABLE against main 5d9dcc42d; this is an overlap review, not an additional build or combined-tree test.

@github-actions github-actions Bot added the needs rebase Conflicts with main, rebase needed label Oct 16, 2026
@JJenkx
JJenkx force-pushed the fix/ngs2-ps5-handle-errors branch from 14bcda2 to b4a93cd Compare October 16, 2026 20:08
@github-actions github-actions Bot removed the needs rebase Conflicts with main, rebase needed label Oct 16, 2026
@oneandonlydean oneandonlydean self-assigned this Oct 17, 2026
@oneandonlydean
oneandonlydean merged commit 8f8bd8c into boykopovar:main Oct 17, 2026
9 of 10 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants