Files
DarkRoom/core/dr-pipeline/ops/noise_reduction.yaml
T
dtourolle 35b126449b Order the detail stage so the repair runs before the enhancements
Capture sharpening and noise reduction were written in parallel and both
claimed `order: 110`; the codegen refuses that, which is the guard working —
two nodes at one order is an ambiguous pipeline and operation order changes
the result.

Resolved in noise reduction's favour, for the reason its own `placement:`
block already gives: denoising is a repair and everything else in this stage
is an enhancement. Sharpening or adding clarity to a noisy frame amplifies the
grain along with the detail, and no later pass can separate them again. So the
detail stage now runs noise reduction, capture sharpening, clarity, texture,
and the other three shift up a slot to keep the multiple-of-ten convention the
rest of the chain uses.

Noise reduction was also missing the required `attributes:` key. The order
collision aborted the build before the attribute check could report it, so it
arrived looking like one fault and was two.
2026-08-22 19:32:59 +02:00

32 lines
1.6 KiB
YAML

# A hand-written node. `rust:` names the type in `crate::ops` that implements
# `Operation`; its descriptor, its parameters and its passes come from that
# type rather than from this file.
#
# It appears here anyway so that `ops/` lists the whole pipeline in order —
# including the neighbourhood operations, which run as a group after every
# point operation but are still ordered among themselves.
id: noise_reduction
order: 110
attributes: [detail]
rust: NoiseReduction
why_rust: |
A kernel, not four facts. The declarative schema hands a fragment a colour
and no coordinate, which is precisely what a denoiser cannot work with — it
is defined by what the neighbouring pixels are doing. It is therefore a
`DetailStage` (see `../src/detail.rs`), which means deciding at every render
how many dispatches to emit, converting a radius stated in *source* pixels
into the render pixels this frame is being drawn at, and declaring the halo
the tile scheduler needs. None of that is expressible as a uniform
expression, and stretching the schema to cover it would produce a worse
language than Rust aimed at one caller.
placement: |
First among the detail operations, because denoising is a repair and
everything else in this stage is an enhancement: sharpening or adding
clarity to a noisy frame amplifies the grain along with the detail, and no
later pass can separate them again. Its position relative to the point
operations is not this number's to decide — the whole detail stage runs
after the fused pass, in linear light, before the output transform.