Skip to content

fix(encode): derive png-seq frame index from task position - #136

Merged
LeadcodeDev merged 1 commit into
mainfrom
fix/png-seq-frame-order
Aug 2, 2026
Merged

fix(encode): derive png-seq frame index from task position#136
LeadcodeDev merged 1 commit into
mainfrom
fix/png-seq-frame-order

Conversation

@LeadcodeDev

Copy link
Copy Markdown
Owner

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.

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
@LeadcodeDev
LeadcodeDev merged commit 7338332 into main Aug 2, 2026
3 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

fix(encode): derive png-seq frame index from task position, not a shared atomic

1 participant