feat(denoise): forward-lookahead (cadence-aware) bidirectional temporal denoise (ADR-0137)#36
Merged
Merged
Conversation
…al denoise (ADR-0137) The causal temporal walk only denoises the TRAILING frame of each held animation drawing (2s/3s cadence): A1 finds A0 (prev, same drawing, averaged), but the LEADING frame A0 sees only the previous, different drawing (tcut breaks) and is under-denoised. Add an opt-in forward lookahead so the walk is bidirectional. lookahead AVOption (default 0 = causal, bit-identical, no latency; 1 = one forward tap). When 1, the filter delays output by a frame (activate() delay-line + EOF flush — the filter was causal with no latency/flush) and the temporal loop adds one same-coordinate sample of the NEXT frame, tcut-gated like the prev taps. A 6th next0_images storage-image binding (index 9) + a push-const actual_next; pelorus_denoise.comp kept in lockstep (a nextImg tap). Validated against the cadence oracle (2s-cadence noisy clip, 24f): lookahead=1 35.98 dB vs lookahead=0 35.60 dB (+0.37 dB), frame count preserved across the delay/flush, lookahead=0 bit-identical to the causal filter. An independent review confirmed the activate() frame-ownership, descriptor wiring, push-constant std430 layout and shader/filter lockstep are correct. The gain is real but modest (~+0.37 dB, concentrated on the leading frames; well short of the +1.5 dB upper-bound premise because the spatial NLM partly covers them) and the benefit is niche (animation cadence), so it ships OPT-IN (default 0) — the common live-action path is untouched (the forward tap tcut-breaks on motion anyway), matching the tile opt-in pattern; tune=anime enables it. This is the first positive direction after the v0.11-v0.13 encoder-RC negatives — PREPROCESSING (Pelorus's lane), premise-validated before the build. Regenerates patch 0003. ADR: docs/adr/0137-denoise-forward-lookahead-cadence.md (Accepted) Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
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.
What
Implements ADR-0137 (now Accepted): forward-lookahead (bidirectional) temporal denoise — an opt-in
lookaheadoption (default 0) forvf_pelorus_denoise_vulkan.Why
The causal walk only denoises the trailing frame of each held animation drawing (2s/3s cadence):
A1findsA0(prev, same drawing → averaged), but the leading frameA0sees a different drawing (tcut-breaks) and is under-denoised. A forward tap closes it.How
lookahead=1delays output one frame (activate()delay-line + EOF flush — the filter was causal with no latency/flush) and the temporal loop adds one same-coordinate sample of the next frame,tcut-gated like the prev taps. A 6thnext0_imagesbinding (index 9) + push-constactual_next;.compkept in lockstep.Validation
lookahead=0bit-identical to causal; frame count preserved across the delay/flush. An independent review confirmed theactivate()frame-ownership, descriptor wiring, push-constant std430 layout, and shader/filter lockstep are all correct. Fast gate 11/11.Disposition
Real but modest (~+0.37 dB, concentrated on the leading frames; the spatial NLM already partly covers them) and the benefit is niche (animation cadence) → ships opt-in, default 0. The common live-action path is untouched (the forward tap
tcut-breaks on motion); matches thetileopt-in pattern;tune=animeenables it.The first positive direction after the v0.11–v0.13 encoder-RC negatives — preprocessing (Pelorus's lane), premise-validated before the build.
Deliverables
ADR-0137→Accepted (+ Built result),
denoise.mdlookaheadrow, changelog, bench-results v0.14, regenerated patch 0003.🤖 Generated with Claude Code