test(ngs2): guard reported PCM input lifetime and late tail writes #19349
Loading…
Reference in a new issue
No description provided.
Delete branch "upstream-pr/19349"
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 JJenkx on 2026-11-13T05:03:35Z.
What
Add PCM lifetime regression coverage to both existing NGS2 PCM suites. For all six formats, mono/stereo, three input rates and three pitches (108 combinations per library), overwrite only bytes reported decoded after each render. Patch an unreported tail inside the same submitted block after the first render. Require exact samples against an immutable-prefix reference carrying the expected new tail, and require the changed tail to affect output against an unchanged-tail control.
This protects the ownership property discussed in #5548: callers can reuse reported bytes without hiding later writes to unreported input. It changes no production code, byte accounting or console decode policy. The case keeps playback active because
VoiceGetStateclears counters once a voice is empty.--reported-lifetimeruns this matrix separately for focused diagnosis. The normal PCM suite includes it too.Tested
Linux, GCC 16.2.1 Release; base
e8b95881c391, head060555b89ee0. Builtngs2_pcm_testsandngs2_core_pcm_tests; both complete PCM suites pass, including 108 new cases each (0.13/0.15 s, no skips).Private negative controls independently introduce (1) whole-block first-read snapshots and (2) decoded-byte accounting twice as far as the consumed cursor. Both controls fail the new isolated mode at the output/reference sample comparison in both libraries, four expected failures. Restoring main's production code returns both complete PCM suites to green. Conventions and whitespace pass. No game/audio, Windows, GPU, physical-console or performance result is claimed; repeat visibility and console granularity remain outside this test.
Verbose runs, control patches, regression patch, exact pins and manifest — SHA-256
89476a4f9853fb89c2fdc17060e279cb2f014b9a26f46c5c17c2eed284193c96; downloaded again and all 15 manifest members verified.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)