fix(encode): derive png-seq frame index from task position - #136
Merged
Conversation
The output index came from a shared atomic incremented in rayon's completion order rather than from the frame's position, so frames landed out of order within each batch. Two runs of the same input differed on 114 frames, and multi-threaded output was a strict permutation of single-threaded output with 436 of 486 frames misplaced. It raised the measured noise floor 9.4x and manufactured spikes that corrupted an analysis before being caught. The index is now batch_base + local position. Rendering stays fully parallel — only the index computation changed. Two multi-threaded runs and a single-threaded run now produce byte-identical sequences, cross-checked against the --frame N path on three sample frames. mp4 and gif were never affected and are unchanged. Closes #129
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Closes #129. Part of the chantier #123.
Independent of the other six workstreams: disjoint file set, compiles and tests green on its own against
main. Mergeable in any order.Full rationale, measurements and evidence are in the commit message and in #129.