Repository navigation
Conversation
CnRJay
left a comment
There was a problem hiding this comment.
The analysis is good: Quake refills a buffer for each positive delta of decoded_data_size, so on the console those bytes must already be independent of the guest buffer by the time the counter reports them. That points at where the copy should happen. Copying the whole block at AddWaveformBlocks time is earlier than the protocol implies:
- what the title relies on is that bytes counted in
decoded_data_sizeare no longer read from its buffer; - it doesn't follow that bytes not yet counted have been copied. A title that submits a block and fills or patches it shortly afterwards (common with streaming rings that queue the next block before the decoder thread writes it) would play the old contents here, and the console would play the new ones if it reads lazily.
A version that matches both observations: render from the guest buffer as main does, and copy a block's bytes into the voice's retained buffer at the moment they are counted into decoded_data_size (the same point at which the title is allowed to reuse them). Then the counter and the data lifetime are tied together by construction. Your "changing counter timing only reduced it" experiment suggests the counter currently runs ahead of the rendered position somewhere, and this would also surface that.
Smaller: the pcm vectors are allocated per block on the submission path, which is often an audio thread with tight deadlines. Reserving per voice, or pooling the vectors, avoids allocator calls there.
|
Agreed that the refill observation only establishes ownership for bytes counted as decoded; it does not establish that the console copies unread bytes at submission. I have returned this PR to draft and corrected the description to make that limitation explicit. I will not claim this snapshot implementation is ready to merge. The next revision needs late-fill/reuse coverage with retention tied to decoded-byte accounting, reusable storage, and a fresh Quake audio comparison. AI-assisted: yes. |
f0a55cd to
3feddf9
Compare
|
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.
|
3feddf9 to
21e009f
Compare
21e009f to
537bd24
Compare
537bd24 to
b21f78b
Compare
|
Follow-up to the submission-time-copy review: current draft head This resolves the eager-submission-copy approach, but it does not establish that whole-block first-use decoding matches console granularity, repeat visibility or waveform-pointer timing. The PR stays draft. The Quake producer/SDL captures also show different scenes, so their discontinuity statistics do not prove a controlled audible improvement or resolve the earlier static-audio reports. |
|
Current-main integration still blocked, 2026-10-27 UTC: reviewed main Changing only the report counter while retaining a whole-block snapshot would hide legal later writes to an unreported tail in the same block. The earlier late-fill case uses a different future block and does not establish this case. A cache containing only already reported samples has no demonstrated future use in main's monotonic consumed-cursor and repeat-reset flow. A replacement decode/read-ahead policy needs reference evidence of granularity, repeat visibility and waveform-pointer lifetime; neither weakening main's assertions nor an I16-only workaround qualifies as an integration. The attached same-block unreported-tail and 44.1 kHz cases are test designs from source review, not executed runtime tests. No new native, console, Windows or audio validation is claimed. The local integration remains stopped at its reproducible CMake conflicts; no unqualified source change was pushed. Exact pins, unchanged upstream PCM-test hash, staged/stopped patches, counterexample design and bounded handoff. SHA-256: AI-assisted: yes. |
|
Current rebase disposition: this remains a technical draft at The unresolved behavior is substantive: snapshotting a whole PCM block before unreported bytes are consumed can hide legal later writes to that same block. Counter timing, repeat visibility and waveform-pointer lifetime still need reference evidence. A resolution must preserve main’s multiple PCM formats, partial-input checks and consumed-byte assertions; a mechanical conflict edit alone would not establish that. Source-continuity and blocker receipt, SHA-256 AI-assisted: yes (Codex). |
|
The branch remains a technical draft at The PCM regression file matches the earlier5454 snapshot, but newer main also adds rack-limit and default-mapping width guards that a future resolution must preserve. No mechanical source refresh was pushed, and no new build, audio, native-title or Windows test is claimed. Source-continuity receipt, SHA-256 AI-assisted: yes (Codex). |
|
New current-main lifetime evidence, 2026-11-13: main Every case overwrites only the reported prefix after each render, patches an unreported tail within the same submitted block after the first render, compares exact samples with the expected-tail reference, and confirms the late write affects output. Separate private controls for whole-block first-read snapshots and early byte reporting both fail at the sample comparison in both libraries; restoring main returns both complete PCM suites to green. Playback stays active throughout because empty-voice state clears counters. This establishes the tested current-main ownership property, not console decode granularity, repeat visibility, waveform-pointer timing or current Quake audio. The experimental whole-block retention/accounting changes in this draft are not thereby qualified; its public head remains unchanged. A fresh title/audio result is still needed before claiming the historical static is resolved or assigning a remaining cause. Exact pins, verbose tests, fault-control patches, regression and manifest, SHA-256 AI-assisted: yes. |
|
Closing this experimental implementation as superseded by main's sampler architecture, rather than mechanically restoring the old sampler during a rebase. The public head and branch are preserved unchanged at Main The new coverage retains the default four-block queue and changes no production code. This draft's whole-block snapshot, accounting, repeat visibility and pointer-timing policy is not adopted or qualified. These results do not establish console decode granularity or resolve the historical native-game audio/static report. Reproducible tests, logs, control patch and source pins, SHA-256 AI-assisted: yes. |
What
Retain PCM input before reporting its bytes as decoded, so a caller reusing those reported bytes cannot alter samples still waiting in the resampler. This remains an experimental draft: the console's decode granularity, repeat visibility and waveform-pointer timing are not measured.
An ordinary playable block or a clipped stream piece is copied on first use and counted in
decoded_data_sizethen. Submission does not copy or count future input. Resampling andnum_decoded_samplesdrain the retained data independently. Repeat callbacks release the old copy before the next iteration decodes again. Callback metadata andwaveform_datakeep caller addresses and playback position. Integer-phase playback avoids unused lookahead, and high-pitch advancement accounts for skipped decoded input.Two reusable per-voice buffers each retain at most 64 KiB after consumption. Larger allocations, including a final drained piece of a starved stream, are released. Active whole-block copies remain proportional to the submitted playable range; large repeated blocks may allocate again on each loop. These limits and unverified console behavior are documented in library debt. No whole-waveform copy at submission is used.
Main now includes Ondra97's #6029 callback waveform-replacement correction. A callback replacing the waveform stops the old render path.
Tested
New current-main lifetime evidence, 2026-11-13: main
e8b95881c391already converts PCM into resampler scratch/history before reporting the bytes consumed. Its sampler path includes #11315. The focused regression proposed in #19349 passes with unchanged main production code in both NGS2 variants: six formats, mono/stereo, 44.1/48/96 kHz and pitch 0.75/1/2, 108 combinations per library.Every case overwrites only the reported prefix after each render, patches an unreported tail within the same submitted block after the first render, compares exact samples with the expected-tail reference, and confirms the late write affects output. Separate private controls for whole-block first-read snapshots and early byte reporting both fail at the sample comparison in both libraries; restoring main returns both complete PCM suites to green. Playback stays active throughout because empty-voice state clears counters.
This establishes the tested current-main ownership property, not console decode granularity, repeat visibility, waveform-pointer timing or current Quake audio. The experimental whole-block retention/accounting changes in this draft are not thereby qualified; its public head remains unchanged. A fresh title/audio result is still needed before claiming the historical static is resolved or assigning a remaining cause.
Exact pins, verbose tests, fault-control patches, regression and manifest, SHA-256
89476a4f9853fb89c2fdc17060e279cb2f014b9a26f46c5c17c2eed284193c96; downloaded archive and all 15 manifest members verified.Current-main integration still blocked, 2026-10-27 UTC: reviewed main
74acfad65b3f0fd4eab653f3a3989d298fba1157; the public head3b3710efcf760296bb594a748e8ec1c64fd1dbd3was not rewritten and this remains an open technical draft. The #10127 format/accounting integration requirement is substantive. Main's U8/I16/I24/I32/F32/F64 conversion, consumed-byte assertions, partial-input restrictions and additional NGS2 test registrations were preserved in the local analysis.Changing only the report counter while retaining a whole-block snapshot would hide legal later writes to an unreported tail in the same block. The earlier late-fill case uses a different future block and does not establish this case. A cache containing only already reported samples has no demonstrated future use in main's monotonic consumed-cursor and repeat-reset flow. A replacement decode/read-ahead policy needs reference evidence of granularity, repeat visibility and waveform-pointer lifetime; neither weakening main's assertions nor an I16-only workaround qualifies as an integration.
The attached same-block unreported-tail and 44.1 kHz cases are test designs from source review, not executed runtime tests. No new native, console, Windows or audio validation is claimed. The local integration remains stopped at its reproducible CMake conflicts; no unqualified source change was pushed.
Exact pins, unchanged upstream PCM-test hash, staged/stopped patches, counterexample design and bounded handoff. SHA-256:
aa2d6b9083a61cbd4227ff67ff88425dd29b86b608ddbe5b9fb1cd5d12a1aa2a; downloaded copy verified. Earlier passing tests below retain their exact historical scope.2026-10-25: head
ebfaae7a040a009579e4392300cfb5343234ed79, six linear topic commits on mainb90d009d9f73354cbea239a74a8f7e2dcd138772. Linux GCC 16.2.1 Release. Built both NGS2 libraries and all 18 focused test executables, including main's new voice-event tests. All 20 registered CTest groups passed three repetitions (60 passes, zero skips). Restoring the candidate after the main control reproduced all 60 passes and identical hashes for both libraries and all 18 test executables.The new
--reported-regionsmode runs the existing ring-buffer cases separately: mono and stereo at 48 kHz and 44.1 kHz, recycling only the bytes reported decoded, without assuming a whole-block decoded-byte count. Their function bodies are unchanged. Both main and the candidate pass these isolated cases. They do not independently demonstrate a buffer-lifetime failure on main.The control uses this branch's tests/CMake with exactly main's
Render.cpp,Voice.cppandNgs2Internal.hpp. Fourteen groups pass three repetitions; six fail: render, PCM-input and PCM-memory in each library variant. Full PCM-input fails at the decoded accounting assertion before the overwrite check. These failures show differences from the tests' accounting/memory policy; they must not be presented as independent proof of a copying bug or console equivalence.The rebase retains main's input-channel/custom-mastering changes and voice-event tests. Existing PCM helper bodies are unchanged from former public head
ddf93fbe14b4f036131e5c870a43874414414597; the complete render source also contains newer upstream changes. Source/whitespace checks pass. Conventions: zero errors, two existing debt-length warnings. Local merge-tree is clean against the exact tested main.Validation archive: verbose logs, controls, source comparisons and patches. SHA-256:
ecee379ddbd1c1758547169ae101f9b16340e0f820d25248275436761ad7e722; downloaded copy verified.No new native title/audio, Windows, GPU or performance result is claimed. The draft blockers remain console decode granularity, repeat visibility and waveform-pointer timing; CPU test success does not resolve them.
Historical title evidence, retaining its original scope: @DavidAmsellem's randomized blind Quake PPSA01880 comparison used main
0fbfd91e5against main plus this PR at89d293cc6, the same machine/runtime and stationary scene. The tester identified the PR run as clean and main as static before revealing the order. This supports that one-scene audio result, not console semantic equivalence or a freshly repeated result. The preceding report used different scenes and is correspondingly weaker for quantitative attribution. Earlier local diagnostic audio captures also used different rendered scenes. Prior revision-specific details are preserved in the comments and archive's original description.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)