diff --git a/crates/eval/src/node_execution.rs b/crates/eval/src/node_execution.rs index 7f9aa3b6..9d431d29 100644 --- a/crates/eval/src/node_execution.rs +++ b/crates/eval/src/node_execution.rs @@ -157,6 +157,7 @@ pub(crate) fn cook_node( | "blur" | "directional_blur" | "directional_warp" + | "warp" | "sharpen" | "distance" | "emboss" diff --git a/crates/eval/src/tests.rs b/crates/eval/src/tests.rs index 6d719f77..6e8cd382 100644 --- a/crates/eval/src/tests.rs +++ b/crates/eval/src/tests.rs @@ -51,7 +51,7 @@ fn cooks_and_caches() { fn fixed_filters_preserve_each_tiling_axis_when_resizing_an_input() { use materialcraft_core::{OutputFormat, ParameterInheritance, SizeMode}; - for (filter, port) in [("levels", "input"), ("blend", "foreground")] { + for (filter, port) in [("levels", "input"), ("blend", "foreground"), ("warp", "input")] { let mut graph = Graph::new("Tiling"); let input = graph.add_node("input_grayscale", [0.0; 2]); let output = graph.add_node(filter, [100.0, 0.0]); diff --git a/crates/formats/src/sbs/filter_map.rs b/crates/formats/src/sbs/filter_map.rs index 606f2a33..59757207 100644 --- a/crates/formats/src/sbs/filter_map.rs +++ b/crates/formats/src/sbs/filter_map.rs @@ -100,7 +100,12 @@ pub(super) const FILTERS: &[FilterMap] = &[ ("manualmiplevel", "mip_level"), ], }, - FilterMap { sbs: "warp", def: "warp", inputs: &[("input1", "input"), ("inputgradient", "gradient")], params: &[("intensity", "intensity")] }, + FilterMap { + sbs: "warp", + def: "warp", + inputs: &[("input1", "input"), ("inputgradient", "gradient")], + params: &[("intensity", "intensity"), ("warpfilter", "nearest")], + }, FilterMap { sbs: "passthrough", def: "dot", inputs: &[("input", "input"), ("input1", "input")], params: &[] }, FilterMap { sbs: "text", diff --git a/crates/formats/tests/library_native_ports.rs b/crates/formats/tests/library_native_ports.rs index 581d5c9a..14146b2a 100644 --- a/crates/formats/tests/library_native_ports.rs +++ b/crates/formats/tests/library_native_ports.rs @@ -162,6 +162,22 @@ fn native_pattern_inputs_and_hsl_luminosity_round_trip() { assert_eq!(legacy.pkg.graphs[0].connections.len(), 1); assert_eq!(legacy.pkg.graphs[0].nodes.iter().find(|node| node.def == "hsl").unwrap().params["lightness"], materialcraft_core::Value::Float(0.75)); } +#[test] +fn warp_filtering_round_trips_as_a_boolean() { + let xml = br#" + + + "#; + let mut read = read_sbs(xml, "warp.sbs", &|_| None).unwrap(); + for _ in 0..2 { + assert!(read.warnings.is_empty(), "{:?}", read.warnings); + assert_eq!(read.pkg.graphs[0].nodes[0].params.get("nearest"), Some(&materialcraft_core::Value::Bool(true))); + let bytes = write_sbs(&read.pkg).unwrap(); + assert!(std::str::from_utf8(&bytes).unwrap().contains("")); + read = read_sbs(&bytes, "saved.sbs", &|_| None).unwrap(); + } +} + #[test] fn transform_mip_settings_survive_sbs_round_trip() { let xml = br#" diff --git a/crates/nodes/src/atomic/directional_warp.rs b/crates/nodes/src/atomic/directional_warp.rs index 94354993..608c4860 100644 --- a/crates/nodes/src/atomic/directional_warp.rs +++ b/crates/nodes/src/atomic/directional_warp.rs @@ -1,7 +1,7 @@ use super::ATOMIC; +use super::input_resize::warp_input; use crate::{CookContext, CookResult, NodeDefinition, node}; -use craft_texture::{Image, Kind}; -use materialcraft_core::OutputFormat; +use craft_texture::Image; pub(super) fn definition() -> NodeDefinition { node("directional_warp", "Directional warp", ATOMIC) @@ -18,8 +18,8 @@ pub(super) fn definition() -> NodeDefinition { fn directional_warp(context: &CookContext) -> CookResult { let target = [context.w, context.h].map(|side| side.clamp(1, craft_texture::MAX_SIDE)); let tiling = context.tiling_axes(); - let (image, format) = warp_input(context, 0, target, tiling); - let (map, map_format) = warp_input(context, 1, target, tiling); + let (image, format) = warp_input(context, 0); + let (map, map_format) = warp_input(context, 1); let map = map.to_gray(); let same_size = [map.width(), map.height()] == target; let radians = context.f("angle") * std::f32::consts::TAU; @@ -39,38 +39,3 @@ fn directional_warp(context: &CookContext) -> CookResult { crate::texture_sampler::sample(&image, uv, tiling, format, None) })]) } - -fn warp_input(context: &CookContext, index: usize, target: [u32; 2], tiling: [bool; 2]) -> (Image, OutputFormat) { - let Some(mut image) = context.input(index).cloned() else { - return (Image::filled(target[0], target[1], Kind::Gray, [0.0; 4]), context.format); - }; - let mut format = context.input_formats.get(index).copied().unwrap_or(if image.integer_sampling() { OutputFormat::U16 } else { OutputFormat::F32 }); - let mut size = [image.width(), image.height()]; - // A source up to twice the output on either axis can supply the final taps directly. - if size.into_iter().zip(target).all(|(side, output)| (output..=output.saturating_mul(2)).contains(&side)) { - return (image, format); - } - let storage = match (format, context.format) { - (OutputFormat::F32, _) | (_, OutputFormat::F32) => OutputFormat::F32, - (OutputFormat::F16, _) | (_, OutputFormat::F16) => OutputFormat::F16, - (OutputFormat::U8, OutputFormat::U8) => OutputFormat::U8, - _ => OutputFormat::U16, - }; - while size != target { - // Hold an axis within one level of the output until both axes can take their final step together. - let next = std::array::from_fn(|i| { - if size[i].saturating_mul(2) < target[i] { - size[i] * 2 - } else if size[i] > target[i].saturating_mul(2) { - size[i].div_ceil(2) - } else { - size[i] - } - }); - size = if next == size { target } else { next }; - image = crate::texture_sampler::resize_input_level(&image, size[0], size[1], format, tiling); - image = crate::output_precision::apply(image, storage); - format = storage; - } - (image, format) -} diff --git a/crates/nodes/src/atomic/input_resize.rs b/crates/nodes/src/atomic/input_resize.rs index e9cdabcb..87b257f3 100644 --- a/crates/nodes/src/atomic/input_resize.rs +++ b/crates/nodes/src/atomic/input_resize.rs @@ -7,6 +7,7 @@ pub(crate) enum InputResize { Copy, Filter, Levels, + Warp, } pub(crate) fn resized_input(context: &CookContext, port: usize, mode: InputResize) -> Option { @@ -19,11 +20,19 @@ pub(super) fn blur_input(context: &CookContext, intensity: f32) -> (Image, Outpu resized_texture(context, 0, mode).unwrap_or_else(|| (Image::filled(context.w, context.h, Kind::Gray, [0.0; 4]), OutputFormat::F32)) } +pub(super) fn warp_input(context: &CookContext, port: usize) -> (Image, OutputFormat) { + resized_texture(context, port, InputResize::Warp).unwrap_or_else(|| (Image::filled(context.w, context.h, Kind::Gray, [0.0; 4]), context.format)) +} + fn resized_texture(context: &CookContext, port: usize, mode: InputResize) -> Option<(Image, OutputFormat)> { let mut image = context.input(port)?.clone(); let mut source = context.input_formats.get(port).copied().unwrap_or(if image.integer_sampling() { OutputFormat::U16 } else { OutputFormat::F32 }); let target = craft_texture::clamp_size(context.w, context.h); - if (image.width(), image.height()) == target { + let size = (image.width(), image.height()); + // A warp can take its final taps directly from an input up to one level larger on either axis. + let direct_warp = + mode == InputResize::Warp && (target.0..=target.0.saturating_mul(2)).contains(&size.0) && (target.1..=target.1.saturating_mul(2)).contains(&size.1); + if size == target || direct_warp { return Some((image, source)); } let storage = if mode == InputResize::Copy { diff --git a/crates/nodes/src/atomic/warp.rs b/crates/nodes/src/atomic/warp.rs index ba9ae42a..59899bc5 100644 --- a/crates/nodes/src/atomic/warp.rs +++ b/crates/nodes/src/atomic/warp.rs @@ -1,7 +1,7 @@ use super::ATOMIC; -use crate::ops; -use crate::{CookContext, CookResult, NodeDefinition, node}; -use craft_texture::{Image, Kind}; +use super::input_resize::warp_input; +use crate::{CookContext, CookResult, NodeDefinition, node, texture_sampler}; +use craft_texture::Image; pub(super) fn definition() -> NodeDefinition { node("warp", "Warp", ATOMIC) @@ -10,17 +10,35 @@ pub(super) fn definition() -> NodeDefinition { .any_in("input", "Input") .gray_in("gradient", "Gradient input") .float("intensity", "Intensity", 1.0, 0.0, 32.0) + .boolean("nearest", "Nearest filtering", false) .any_out() .cook(warp) } fn warp(context: &CookContext) -> CookResult { - let image = context.any_or(0, Kind::Gray, [0.0; 4]); - let gradient = context.gray_or(1, 0.0); - let intensity = context.f("intensity"); - Ok(vec![Image::generate_uv(context.w, context.h, image.kind(), |u, v| { - let (x, y) = ((u * context.w as f32) as i64, (v * context.h as f32) as i64); - let (dx, dy) = ops::slope(&gradient, x, y, context.tile); - image.sample(u + dx * intensity, v + dy * intensity, context.tile) + let (width, height) = craft_texture::clamp_size(context.w, context.h); + let (image, format) = warp_input(context, 0); + let (map, map_format) = warp_input(context, 1); + let map = map.to_gray(); + let same_size = (map.width(), map.height()) == (width, height); + let (w, h) = (width as f32, height as f32); + let (mw, mh) = (map.width() as f32, map.height() as f32); + let shorter = w.min(h); + let strength = context.f("intensity") * (shorter / 256.0); + // A difference spans one texel of the stored gradient. Both displacements scale in pixels of the shorter output axis. + let scale = [strength * (shorter / w) * (mw / w), strength * (shorter / h) * (mh / h)]; + let tile = context.tiling_axes(); + let nearest = context.b("nearest"); + Ok(vec![Image::generate(width, height, image.kind(), |x, y| { + let (u, v) = ((x as f32 + 0.5) / w, (y as f32 + 0.5) / h); + let (center, left, above) = if same_size { + let (x, y) = (i64::from(x), i64::from(y)); + (map.get_gray(x, y, false), map.get_axes(x - 1, y, tile)[0], map.get_axes(x, y - 1, tile)[0]) + } else { + let read = |u, v| texture_sampler::sample(&map, [u, v], tile, map_format, None)[0]; + (read(u, v), read(u - mw.recip(), v), read(u, v - mh.recip())) + }; + let uv = [scale[0].mul_add(center - left, u), scale[1].mul_add(center - above, v)]; + if nearest { image.sample_nearest_axes(uv[0], uv[1], tile) } else { texture_sampler::sample(&image, uv, tile, format, None) } })]) } diff --git a/crates/nodes/tests/atomic_filter_parity.rs b/crates/nodes/tests/atomic_filter_parity.rs index 974b24d6..cdd2c380 100644 --- a/crates/nodes/tests/atomic_filter_parity.rs +++ b/crates/nodes/tests/atomic_filter_parity.rs @@ -25,6 +25,43 @@ fn min_blend_accumulates_the_background_weight_on_the_foreground_product() { assert_eq!(out.get_gray(0, 0, false).to_bits(), 0x3e730783); } +#[test] +fn warp_uses_the_current_gradient_texel_and_its_predecessors() { + let source = Image::gray(32, 32, |x, _| (x as f32 + 0.5) / 32.0); + let gradient = Image::gray(32, 32, |x, y| f32::from(x == 16 && y == 16)); + let image = cook("warp", &[Some(source), Some(gradient)], &[], [32, 32], true); + for (x, y, expected) in [(15, 16, 15.5), (16, 16, 20.5), (17, 16, 13.5), (16, 17, 16.5)] { + assert_eq!(image.get_gray(x, y, false), expected / 32.0); + } +} + +#[test] +fn warp_differences_span_one_stored_gradient_texel_when_inputs_are_larger() { + let field = |width, height, seed| { + Image::gray(width, height, |x, y| { + let code = (131 * x + 367 * y + 29 * x * y + seed) % 2053; + 1.5 * (code as f32 / 2052.0) - 0.25 + }) + }; + let inputs = [Some(field(64, 32, 17473)), Some(field(32, 64, 17486))]; + let image = cook("warp", &inputs, &[("intensity", Value::Float(0.8375))], [32, 32], true); + for (x, y, bits) in [(5, 0, 0x3ef4626f), (6, 0, 0x3e969df1), (13, 17, 0x3e9b9a34), (31, 31, 0x3eec51f7)] { + assert_eq!(image.get_gray(x, y, false).to_bits(), bits); + } +} + +#[test] +fn rectangular_warp_scales_displacement_by_the_shorter_side_and_preserves_nearest_filtering() { + let source = Image::generate(32, 16, Kind::Color, |x, y| [(x as f32 + 0.5) / 32.0, (y as f32 + 0.5) / 16.0, 0.0, 1.0]); + let gradient = Image::gray(32, 16, |x, y| 0.5 * f32::from(x >= 16) + 0.25 * f32::from(y >= 8)); + let inputs = [Some(source), Some(gradient)]; + for (nearest, expected) in [(false, [0.53125, 0.546875]), (true, [0.546875, 0.53125])] { + let image = cook("warp", &inputs, &[("nearest", Value::Bool(nearest))], [32, 16], true); + let [x, y, _, _] = image.get(16, 8, false); + assert_eq!([x, y], expected); + } +} + #[test] fn emboss_applies_each_tint_to_a_one_sided_height_difference() { let color = Image::filled(32, 32, Kind::Color, [0.25, 0.5, 0.75, 0.375]); diff --git a/docs/parity-fixes.md b/docs/parity-fixes.md index 422b87f5..7f22db23 100644 --- a/docs/parity-fixes.md +++ b/docs/parity-fixes.md @@ -156,6 +156,67 @@ For the threshold series, take the 128² U16 field from j=0 at the 32² setting. For the two signed series, generate a 32² U16 image with level ((17x+113y+59xy+19)×7919) mod 65536. Reduce to 8² U8, F16 and F32. At seed 15709 test box intensities 0, 2⁻¹⁰, 3.2, 16, −2⁻¹⁰ and −3.2. At U8 the row-zero pixels at columns 2 and 5 are 145 and 139 at zero and 146 and 140 at ±3.2. At seed 15709, repeat both filter types at 0, 2⁻¹⁰, 3.2, −3.2, 64 and −64, with an eighth turn for directional blur. The +64 directional F32 result matches 62/64 pixels, maximum 2.98023224e−8. The independent directional angles retain the F32 differences shown above. +### Gradient warp displacement and sampling + +Both Mosaic roots and all three Slope Blur roots match the reference in **88 renders and 722,176 output pixels**, maximum error zero. The new intermediate comparisons also match all **3,461,888 pixels across 2,369 images**, including the input bridges. Each Mosaic contains 16 gradient warps and each Slope Blur contains 32. Before the fix the color Mosaic matched 1,024/142,592 pixels and the gray Mosaic matched 2,695/142,592 on the same inputs. + +| Root | Renders | Exact pixels / compared | Maximum error | +|---|---:|---:|---:| +| `mosaic.sbs/mosaic` | 17 | 142,592/142,592 | 0 | +| `mosaic.sbs/mosaic_grayscale` | 17 | 142,592/142,592 | 0 | +| `slope_blur.sbs/slope_blur` | 18 | 145,664/145,664 | 0 | +| `slope_blur.sbs/slope_blur_grayscale` | 18 | 145,664/145,664 | 0 | +| `slope_blur.sbs/slope_blur_grayscale_2` | 18 | 145,664/145,664 | 0 | + +All five include the four original renders, the [four-format comparison and independent 32² case](#four-format-inventory-comparison). For each Mosaic, the totals are 119,808 U8, 5,120 U16, 5,120 F16 and 12,544 F32 pixels. For each Slope Blur, the counts are the same except for 15,616 F32 pixels. + +For the eight additional Mosaic renders, use the [modular input field](#stored-input-precision-in-box-and-directional-blur). For source and effect in that order, use channel zero for grayscale and add 31 to the effect's seed. The two root indices i are 227 and 228. Use seed 11003+13i and add 0, 1, 2, 2, 2, 2, 6 and 7. Start with 16² U16 input, F32 output, graph defaults. Use 32² floating input and output with one sample and zero intensity. Next use 32² U16 input with four samples and intensity .25 in U8/U16/F16/F32. Finish with eight samples and intensity .6875, using 128×64 floating inputs at a 64² parent and 32×64 U8 inputs at a 32² parent. Both outputs are F32. Store the floating fields as 1.5 times the normalized value minus .25. + +For Slope Blur, use the same field and channel conventions with seed 18211+17i for root indices 484–486. Add 0, 1, 2, 2, 2, 2, 6, 7 and 8. Use 16² U8 inputs, F32 output and defaults, followed by 32² floating inputs and output with one sample, zero intensity and mode 0. At 32², use U16 inputs with four samples, intensity 1.375 and mode 1 in all four output formats. For the last three F32 outputs use parent 64×32, 32×64 and 64². Use respectively 64×32 floating inputs with eight samples, intensity 2.5 and mode 2, 64² U8 inputs with three samples, intensity .71875 and mode 0, and 64×128 floating inputs with twelve samples, intensity .25 and mode 1. + +The displacement uses the current gradient texel minus its immediate left and upper neighbors. With equal input and output dimensions W×H and S=min(W,H), multiply those differences by intensity×S²/256 to get the source offset in output pixels. On a 32² unit impulse at intensity one, the center moves four pixels in both directions, the texel to its right moves four pixels left, and the texel below moves four pixels up. Each axis respects its own tiling flag. Nearest and bilinear filter the primary image at the displaced coordinates. A gradient up to twice the output size per axis can supply its texels directly. The difference then spans one stored gradient texel, scaled by the gradient-to-output size ratio on that axis. + +| Standalone controls | Renders | Exact pixels / compared | Maximum error | +|---|---:|---:|---:| +| Planar sources, impulses, ramps and signed fields | 180 | 215,040/215,040 | 0 | +| Rectangular and square coordinate controls | 40 | 34,816/34,816 | 0 | +| Color and gray fields, native input sizes | 80 | 219,520/219,520 | 0 | +| Unequal inputs with an explicit output size | 32 | 50,176/50,176 | 0 | + +For the 180 planar renders store the X and Y coordinate ramps (x+.5)/N and (y+.5)/N as separate F32 sources. Use a constant .5 map at 16², then a step map .5[x≥N/2]+.25[y≥N/2] at 16², 32² and 64². At 32² also use a unit center impulse, a ramp (x+2y)/128, and a border map .25[x<2 or y<2]+.5[x=N−1 or y=N−1]. Each bracket is one when true. For the four output formats at 32², use source (((11x+17y+3xy) mod N)+.5)/N and map (((11x+19y+7xy+23) mod 97)−21)/64. Cross these fields with intensities 0, 1, 4, .5, 8, −2.5, 8, 8, 8 and 31. Use nearest for the fifth setting and bilinear for the others. The seventh through ninth use no tiling, X only and Y only. The other settings tile both axes. Start at seed 10009 and add 19 per map/size/output setting. For the 40 coordinate controls, cross both ramps and the step and impulse with nearest and bilinear at 16², 32², 32×16, 16×32 and 64×32. Use intensity one, XY tiling and seed 18121+W+H. + +For the mixed-size fields use the same modular field as the Mosaic roots above. Start at seed 17327+29j, add 13 for the gradient and add 0, 1, 1, 1, 1, 5, 6 and 7 for the eight renders. Use parent 16² F32, 32² in U8/U16/F16/F32, 64×32 F32, 32×64 F32 and 64² F32. The size powers in the table multiply the corresponding parent dimension by two to that power. The first series inherits the source dimensions at the warp. Repeat configurations 5–8 with the output explicitly set to the parent dimensions. + +| j | Source / gradient storage | Source / gradient size powers | Intensity | Filter and wrapping | +|---:|---|---|---:|---| +| 0 | U8 gray / U8 | (0,0) / (0,0) | .0625 | Bilinear XY | +| 1 | U8 RGBA / U8 | (0,0) / (0,0) | .0625 | Bilinear XY | +| 2 | U16 RGBA / U16 | (0,0) / (0,0) | 3.25 | Bilinear XY | +| 3 | F16 gray / F16 | (0,0) / (0,0) | .41875 | Bilinear XY | +| 4 | F32 gray / F32 | (0,0) / (0,0) | .71875 | Nearest XY | +| 5 | F32 gray / F32 | (1,0) / (0,1) | .8375 | Bilinear XY | +| 6 | U16 RGBA / F32 | (−1,0) / (1,−1) | .0625 | Bilinear X | +| 7 | U16 gray / U8 | (2,1) / (1,2) | −1.375 | Bilinear Y | +| 8 | F32 RGBA / U16 | (−1,1) / (−2,−1) | 2.125 | Nearest, clamped | +| 9 | F32 gray / F32 | (0,0) / (0,0) | 1 | Bilinear, clamped | + +Ordinary MaterialCraft saves of the five complete graphs in current-header SBS packages reopened in the reference. Their 43 additional renders reproduced all 61,696 output pixels, maximum error zero. The reference app rejected the two MaterialCraft saves whose inputs retained the older 0.1.3 package header. Three current-header standalone warp saves also matched all 42,496 pixels in 36 additional renders. + +Ten other roots have a reachable gradient warp. Reuse the [square and rectangular generator controls](#square-and-rectangular-pattern-generators) for the first two Crystal roots, the [patch controls](#bitmap-stamp-filtering-and-compositing) for both patch roots and the [four-format inventory controls](#four-format-inventory-comparison) for the others. The color patch differs by one pixel in each of the four 64² formats. Grayscale matches U8 and differs by one pixel in U16, F16 and F32. Both independent 32² F32 patches differ by one pixel. + +| Remaining root | Renders | Exact pixels / compared | Max U8 / U16 levels | Max F16 / F32 error | +|---|---:|---:|---:|---:| +| `crystal_1.sbs/crystal_1` | 17 | 144,060/145,664 | 1 / 55 | 0.000244140625 / 0.000106841326 | +| `crystal_2.sbs/crystal_2` | 17 | 144,468/145,664 | 0 / 19 | 0.000244140625 / 3.05473804e-05 | +| `fluid.sbs/fluid` | 9 | 131,984/132,096 | 0 / 201 | 0 / 0 | +| `make_it_tile_patch.sbs/make_it_tile_patch` | 9 | 132,090/132,096 | 1 / 93 | 0.00146484375 / 0.00212101638 | +| `make_it_tile_patch_grayscale.sbs/make_it_tile_patch_grayscale` | 9 | 132,092/132,096 | 0 / 47 | 0.000732421875 / 0.00105287135 | +| `microscope_view.sbs/microscope_view` | 9 | 131,217/132,096 | 0 / 61 | 0.000244140625 / 1.52606517e-05 | +| `noise_crystal_2.sbs/crystal_2` | 9 | 131,037/132,096 | 0 / 46 | 0.00048828125 / 1.52587891e-05 | +| `noise_fluid.sbs/fluid` | 9 | 129,723/132,096 | 1 / 71 | 0.00048828125 / 0.00016784668 | +| `noise_liquid.sbs/liquid` | 9 | 127,452/132,096 | 1 / 268 | 0.0009765625 / 0.000885009766 | +| `noise_microscope_view.sbs/microscope_view` | 9 | 130,081/132,096 | 1 / 48 | 0.000183105469 / 0.000137329102 | + ### Pattern backgrounds and center culling A connected FX-Map background with matching channels is resized at the wider of its input and output storage precisions. The resize proceeds one power-of-two level at a time. A connected input of the opposite bitmap type produces a zero background in the requested type. With the input disconnected, the authored background color applies. A grayscale map uses the mean of its three color components. diff --git a/docs/sbs-root-nodes.md b/docs/sbs-root-nodes.md index d0d2d285..d77c0e33 100644 --- a/docs/sbs-root-nodes.md +++ b/docs/sbs-root-nodes.md @@ -35,7 +35,7 @@ A graph may accept input pins and still be a root under the dependency criterion Statuses: **Not checked**, **In progress**, **Parity** (exact pixels or typed values for the linked measured cases), or **Too hard** (reason recorded). Function calls do not count as regular graph dependencies. -The first pass covered all **546 roots**, with **166 Parity** and **380 Too hard**. The current inventory has **354 Parity**, **71 In progress** and **121 Too hard**. The November 17–19 comparisons include raw counts, output formats and remaining differences. [November 17 measurements](parity-fixes.md#2026-11-17-root-comparisons) · [November 18 measurements](parity-fixes.md#2026-11-18-root-comparisons) · [November 19 measurements](parity-fixes.md#2026-11-19-root-comparisons) +The first pass covered all **546 roots**, with **166 Parity** and **380 Too hard**. The current inventory has **359 Parity**, **71 In progress** and **116 Too hard**. The November 17–19 comparisons include raw counts, output formats and remaining differences. [November 17 measurements](parity-fixes.md#2026-11-17-root-comparisons) · [November 18 measurements](parity-fixes.md#2026-11-18-root-comparisons) · [November 19 measurements](parity-fixes.md#2026-11-19-root-comparisons) [Pattern tiling axes and copy bounds across 215 renders](parity-fixes.md#tiling-axes-and-pattern-copy-bounds) · [Grayscale sampler measurements](parity-fixes.md#grayscale-sampling-of-color-inputs) · [Value sampling across 240 typed comparisons](parity-fixes.md#value-processor-texture-filtering) · [Five saved graphs reopened in the reference](parity-fixes.md#saved-filter-graphs-and-scalar-levels-controls) @@ -170,8 +170,8 @@ Pattern center culling matched all 356,352 pixels across 204 renders. Background | [creased.sbs/creased](../assets/sbs/creased.sbs) | 0 | Yes | [In progress · 143,706/145,664 pixels across 17 renders](parity-fixes.md#square-and-rectangular-pattern-generators) | | [crop.sbs/crop](../assets/sbs/crop.sbs) | 1 | No | [Parity · 48 renders, all 377,344 pixels across both outputs exact](parity-fixes.md#half-precision-crop-area-and-input-sizes) | | [crop.sbs/crop_grayscale](../assets/sbs/crop.sbs) | 1 | No | [Parity · 48 renders, all 377,344 pixels across both outputs exact](parity-fixes.md#half-precision-crop-area-and-input-sizes) | -| [crystal_1.sbs/crystal_1](../assets/sbs/crystal_1.sbs) | 0 | Yes | [In progress · 99,250/145,664 pixels across 17 renders](parity-fixes.md#square-and-rectangular-pattern-generators) | -| [crystal_2.sbs/crystal_2](../assets/sbs/crystal_2.sbs) | 0 | Yes | [In progress · 104,128/145,664 pixels across 17 renders](parity-fixes.md#stored-input-resizing-and-grayscale-levels-controls) | +| [crystal_1.sbs/crystal_1](../assets/sbs/crystal_1.sbs) | 0 | Yes | [In progress · 144,060/145,664 exact pixels in 17 renders](parity-fixes.md#gradient-warp-displacement-and-sampling) | +| [crystal_2.sbs/crystal_2](../assets/sbs/crystal_2.sbs) | 0 | Yes | [In progress · 144,468/145,664 exact pixels in 17 renders](parity-fixes.md#gradient-warp-displacement-and-sampling) | | [curvature.sbs/curvature](../assets/sbs/curvature.sbs) | 1 | No | [Parity · 20 renders, 176,384 exact pixels](parity-fixes.md#sampling-integer-bitmap-inputs-through-wider-bridges) | | [curvature_smooth.sbs/curvature_smooth](../assets/sbs/curvature_smooth.sbs) | 1 | Yes | [Parity · 20 renders, 176,384 exact pixels](parity-fixes.md#sampling-integer-bitmap-inputs-through-wider-bridges) | | [curvature_smooth_v2.sbs/compute_curvature_v2](../assets/sbs/curvature_smooth_v2.sbs) | 2 | Yes | [Parity: 6 cases](parity-fixes.md#verified-cases) | @@ -206,7 +206,7 @@ Pattern center culling matched all 356,352 pixels across 204 renders. Background | [flood_fill_2.sbs/flood_fill_to_random_color](../assets/sbs/flood_fill_2.sbs) | 1 | No | [Parity · 19 renders, 143,872 exact RGBA pixels](parity-fixes.md#packed-random-draws-in-flood-fill-color) | | [flood_fill_2.sbs/flood_fill_to_random_grayscale](../assets/sbs/flood_fill_2.sbs) | 1 | No | [Parity · 19 renders, 143,872 exact pixels](parity-fixes.md#scaled-random-draws-and-offsets) | | [floodfill_to_index.sbs/pass](../assets/sbs/floodfill_to_index.sbs) | 1 | Yes | [Parity: 4 cases](parity-fixes.md#verified-cases) | -| [fluid.sbs/fluid](../assets/sbs/fluid.sbs) | 0 | Yes | [Too hard: remaining pixel differences](parity-fixes.md#remaining-differences) | +| [fluid.sbs/fluid](../assets/sbs/fluid.sbs) | 0 | Yes | [Too hard · 131,984/132,096 exact pixels in 9 renders](parity-fixes.md#gradient-warp-displacement-and-sampling) | | [fractal_sum_base.sbs/fractal_sum_base](../assets/sbs/fractal_sum_base.sbs) | 0 | Yes | [Too hard: remaining pixel differences](parity-fixes.md#remaining-differences) | | [fur_1.sbs/fur_1](../assets/sbs/fur_1.sbs) | 0 | Yes | [Too hard: remaining pixel differences](parity-fixes.md#remaining-differences) | | [fur_2.sbs/fur_2](../assets/sbs/fur_2.sbs) | 0 | Yes | [Too hard: remaining pixel differences](parity-fixes.md#remaining-differences) | @@ -255,8 +255,8 @@ Pattern center culling matched all 356,352 pixels across 204 renders. Background | [linear_srgb_conversion.sbs/convert_to_linear_grayscale](../assets/sbs/linear_srgb_conversion.sbs) | 1 | Yes | [Parity: 4 cases](parity-fixes.md#verified-cases) | | [linear_srgb_conversion.sbs/convert_to_srgb](../assets/sbs/linear_srgb_conversion.sbs) | 1 | Yes | [Parity: 4 cases](parity-fixes.md#verified-cases) | | [linear_srgb_conversion.sbs/convert_to_srgb_grayscale](../assets/sbs/linear_srgb_conversion.sbs) | 1 | Yes | [Parity: 4 cases](parity-fixes.md#verified-cases) | -| [make_it_tile_patch.sbs/make_it_tile_patch](../assets/sbs/make_it_tile_patch.sbs) | 1 | No | [In progress · 98,161/132,096 exact pixels across nine renders](parity-fixes.md#bitmap-stamp-filtering-and-compositing) | -| [make_it_tile_patch_grayscale.sbs/make_it_tile_patch_grayscale](../assets/sbs/make_it_tile_patch_grayscale.sbs) | 1 | No | [In progress · 117,553/132,096 exact pixels across nine renders](parity-fixes.md#bitmap-stamp-filtering-and-compositing) | +| [make_it_tile_patch.sbs/make_it_tile_patch](../assets/sbs/make_it_tile_patch.sbs) | 1 | No | [In progress · 132,090/132,096 exact pixels in 9 renders](parity-fixes.md#gradient-warp-displacement-and-sampling) | +| [make_it_tile_patch_grayscale.sbs/make_it_tile_patch_grayscale](../assets/sbs/make_it_tile_patch_grayscale.sbs) | 1 | No | [In progress · 132,092/132,096 exact pixels in 9 renders](parity-fixes.md#gradient-warp-displacement-and-sampling) | | [material_switch.sbs/material_switch](../assets/sbs/material_switch.sbs) | 24 | No | [Parity: 4 cases](parity-fixes.md#verified-cases) | | [material_transforms.sbs/material_transforms](../assets/sbs/material_transforms.sbs) | 5 | Yes | [Parity · 856,320 exact pixels across every output](parity-fixes.md#material-bundles-and-the-eighth-irradiance-pass) | | [me_water_level.sbs/scratches_2](../assets/sbs/me_water_level.sbs) | 0 | Yes | [Too hard: remaining pixel differences](parity-fixes.md#remaining-differences) | @@ -277,11 +277,11 @@ Pattern center culling matched all 356,352 pixels across 204 renders. Background | [messy_fibers_2.sbs/messy_fibers_2](../assets/sbs/messy_fibers_2.sbs) | 0 | Yes | [Too hard: remaining pixel differences](parity-fixes.md#remaining-differences) | | [messy_fibers_3.sbs/messy_fibers_3](../assets/sbs/messy_fibers_3.sbs) | 0 | Yes | [In progress · 126,928/132,096 pixels across 9 renders](parity-fixes.md#directional-and-additive-stamp-profiles) | | [messy_fibers_4.sbs/messy_fibers_4](../assets/sbs/messy_fibers_4.sbs) | 0 | Yes | [Too hard: remaining pixel differences](parity-fixes.md#remaining-differences) | -| [microscope_view.sbs/microscope_view](../assets/sbs/microscope_view.sbs) | 0 | Yes | [Too hard: remaining pixel differences](parity-fixes.md#remaining-differences) | +| [microscope_view.sbs/microscope_view](../assets/sbs/microscope_view.sbs) | 0 | Yes | [Too hard · 131,217/132,096 exact pixels in 9 renders](parity-fixes.md#gradient-warp-displacement-and-sampling) | | [min_max.sbs/min_max](../assets/sbs/min_max.sbs) | 1 | No | [Parity · both scalar outputs exact in 25 cases](parity-fixes.md#color-temperature-range-reductions-sky-parameters-and-polygon-paths) | | [moisture_noise.sbs/moisture_noise](../assets/sbs/moisture_noise.sbs) | 0 | Yes | [Too hard: remaining pixel differences](parity-fixes.md#remaining-differences) | -| [mosaic.sbs/mosaic](../assets/sbs/mosaic.sbs) | 2 | No | [Too hard: remaining pixel differences](parity-fixes.md#remaining-differences) | -| [mosaic.sbs/mosaic_grayscale](../assets/sbs/mosaic.sbs) | 2 | No | [Too hard: remaining pixel differences](parity-fixes.md#remaining-differences) | +| [mosaic.sbs/mosaic](../assets/sbs/mosaic.sbs) | 2 | No | [Parity · 17 renders, 142,592 exact pixels](parity-fixes.md#gradient-warp-displacement-and-sampling) | +| [mosaic.sbs/mosaic_grayscale](../assets/sbs/mosaic.sbs) | 2 | No | [Parity · 17 renders, 142,592 exact pixels](parity-fixes.md#gradient-warp-displacement-and-sampling) | | [multi_directional_warp.sbs/multi_directional_warp_color](../assets/sbs/multi_directional_warp.sbs) | 2 | No | [Parity · 19 cases, 175,360 exact pixels and intermediate stages confirmed](parity-fixes.md#multi-directional-warp-and-intermediate-storage) | | [multi_directional_warp.sbs/multi_directional_warp_grayscale](../assets/sbs/multi_directional_warp.sbs) | 2 | No | [Parity · 19 cases, 175,360 exact pixels and intermediate stages confirmed](parity-fixes.md#multi-directional-warp-and-intermediate-storage) | | [multiangle_to_albedo.sbs/multiangle_to_albedo](../assets/sbs/multiangle_to_albedo.sbs) | 8 | No | [Parity · 14 cases, including eight distinct input images](parity-fixes.md#linear-gradient-2-and-multiangle-albedo) | @@ -303,7 +303,7 @@ Pattern center culling matched all 356,352 pixels across 204 renders. Background | [noise_clouds_2_v2.sbs/clouds_2](../assets/sbs/noise_clouds_2_v2.sbs) | 0 | No | [Too hard: remaining pixel differences](parity-fixes.md#remaining-differences) | | [noise_creased.sbs/creased](../assets/sbs/noise_creased.sbs) | 0 | No | [In progress · 37,716/132,096 pixels across 9 renders](parity-fixes.md#directional-and-additive-stamp-profiles) | | [noise_crystal_1.sbs/crystal_1](../assets/sbs/noise_crystal_1.sbs) | 0 | No | [Too hard: remaining pixel differences](parity-fixes.md#remaining-differences) | -| [noise_crystal_2.sbs/crystal_2](../assets/sbs/noise_crystal_2.sbs) | 0 | No | [Too hard: remaining pixel differences](parity-fixes.md#remaining-differences) | +| [noise_crystal_2.sbs/crystal_2](../assets/sbs/noise_crystal_2.sbs) | 0 | No | [Too hard · 131,037/132,096 exact pixels in 9 renders](parity-fixes.md#gradient-warp-displacement-and-sampling) | | [noise_directional_noise_1.sbs/directional_noise_1](../assets/sbs/noise_directional_noise_1.sbs) | 0 | Yes | [Too hard: remaining pixel differences](parity-fixes.md#remaining-differences) | | [noise_directional_noise_1_v2.sbs/directional_noise_1](../assets/sbs/noise_directional_noise_1_v2.sbs) | 0 | No | [Too hard: remaining pixel differences](parity-fixes.md#remaining-differences) | | [noise_directional_noise_2.sbs/directional_noise_2](../assets/sbs/noise_directional_noise_2.sbs) | 0 | Yes | [Too hard: remaining pixel differences](parity-fixes.md#remaining-differences) | @@ -325,7 +325,7 @@ Pattern center culling matched all 356,352 pixels across 204 renders. Background | [noise_dirt_5_v2.sbs/dirt_5](../assets/sbs/noise_dirt_5_v2.sbs) | 0 | No | [Too hard: remaining pixel differences](parity-fixes.md#remaining-differences) | | [noise_dirt_gradient.sbs/dirt_gradient](../assets/sbs/noise_dirt_gradient.sbs) | 0 | Yes | [Too hard: remaining pixel differences](parity-fixes.md#remaining-differences) | | [noise_dirt_gradient_v2.sbs/dirt_gradient](../assets/sbs/noise_dirt_gradient_v2.sbs) | 0 | No | [Too hard: cook timeout](parity-fixes.md#remaining-differences) | -| [noise_fluid.sbs/fluid](../assets/sbs/noise_fluid.sbs) | 0 | No | [Too hard: remaining pixel differences](parity-fixes.md#remaining-differences) | +| [noise_fluid.sbs/fluid](../assets/sbs/noise_fluid.sbs) | 0 | No | [Too hard · 129,723/132,096 exact pixels in 9 renders](parity-fixes.md#gradient-warp-displacement-and-sampling) | | [noise_fractal_sum_base.sbs/fractal_sum_base](../assets/sbs/noise_fractal_sum_base.sbs) | 0 | Yes | [Too hard: remaining pixel differences](parity-fixes.md#remaining-differences) | | [noise_fractal_sum_base.sbs/fractal_sum_base_2](../assets/sbs/noise_fractal_sum_base.sbs) | 0 | Yes | [Too hard: remaining pixel differences](parity-fixes.md#remaining-differences) | | [noise_fractal_sum_base_v2.sbs/noise_blend](../assets/sbs/noise_fractal_sum_base_v2.sbs) | 2 | Yes | [Too hard: remaining pixel differences](parity-fixes.md#remaining-differences) | @@ -340,14 +340,14 @@ Pattern center culling matched all 356,352 pixels across 204 renders. Background | [noise_gaussian_spots_1_v2.sbs/gaussian_spots_1](../assets/sbs/noise_gaussian_spots_1_v2.sbs) | 0 | No | [In progress · 2,984/132,096 pixels across 9 renders](parity-fixes.md#radial-stamp-profiles-and-pattern-generators) | | [noise_gaussian_spots_2.sbs/gaussian_spots_2](../assets/sbs/noise_gaussian_spots_2.sbs) | 0 | Yes | [Too hard: remaining pixel differences](parity-fixes.md#remaining-differences) | | [noise_gaussian_spots_2_v2.sbs/gaussian_spots_2](../assets/sbs/noise_gaussian_spots_2_v2.sbs) | 0 | No | [Too hard: remaining pixel differences](parity-fixes.md#remaining-differences) | -| [noise_liquid.sbs/liquid](../assets/sbs/noise_liquid.sbs) | 0 | No | [Too hard: remaining pixel differences](parity-fixes.md#remaining-differences) | +| [noise_liquid.sbs/liquid](../assets/sbs/noise_liquid.sbs) | 0 | No | [Too hard · 127,452/132,096 exact pixels in 9 renders](parity-fixes.md#gradient-warp-displacement-and-sampling) | | [noise_messy_fibers_1.sbs/messy_fibers_1](../assets/sbs/noise_messy_fibers_1.sbs) | 0 | Yes | [Too hard: remaining pixel differences](parity-fixes.md#remaining-differences) | | [noise_messy_fibers_1_v2.sbs/messy_fibers_1](../assets/sbs/noise_messy_fibers_1_v2.sbs) | 0 | No | [Too hard: remaining pixel differences](parity-fixes.md#remaining-differences) | | [noise_messy_fibers_2.sbs/messy_fibers_2](../assets/sbs/noise_messy_fibers_2.sbs) | 0 | Yes | [Too hard: remaining pixel differences](parity-fixes.md#remaining-differences) | | [noise_messy_fibers_2_v2.sbs/messy_fibers_2](../assets/sbs/noise_messy_fibers_2_v2.sbs) | 0 | No | [Too hard: remaining pixel differences](parity-fixes.md#remaining-differences) | | [noise_messy_fibers_3.sbs/messy_fibers_3](../assets/sbs/noise_messy_fibers_3.sbs) | 0 | Yes | [Too hard: remaining pixel differences](parity-fixes.md#remaining-differences) | | [noise_messy_fibers_3_v2.sbs/messy_fibers_3](../assets/sbs/noise_messy_fibers_3_v2.sbs) | 0 | No | [Too hard: remaining pixel differences](parity-fixes.md#remaining-differences) | -| [noise_microscope_view.sbs/microscope_view](../assets/sbs/noise_microscope_view.sbs) | 0 | No | [Too hard: remaining pixel differences](parity-fixes.md#remaining-differences) | +| [noise_microscope_view.sbs/microscope_view](../assets/sbs/noise_microscope_view.sbs) | 0 | No | [Too hard · 130,081/132,096 exact pixels in 9 renders](parity-fixes.md#gradient-warp-displacement-and-sampling) | | [noise_moisture_noise.sbs/moisture_noise](../assets/sbs/noise_moisture_noise.sbs) | 0 | Yes | [Too hard: measurement timeout](parity-fixes.md#remaining-differences) | | [noise_moisture_noise_1_v2.sbs/moisture_noise_1](../assets/sbs/noise_moisture_noise_1_v2.sbs) | 0 | No | [Too hard: measurement timeout](parity-fixes.md#remaining-differences) | | [noise_moisture_noise_2.sbs/moisture_noise_2](../assets/sbs/noise_moisture_noise_2.sbs) | 0 | No | [Too hard: measurement timeout](parity-fixes.md#remaining-differences) | @@ -537,9 +537,9 @@ Pattern center culling matched all 356,352 pixels across 204 renders. Background | [shape_splatter_v2_companion.sbs/shape_splatter_to_mask](../assets/sbs/shape_splatter_v2_companion.sbs) | 1 | No | [Parity: 4 cases](parity-fixes.md#verified-cases) | | [skew.sbs/skew](../assets/sbs/skew.sbs) | 1 | No | [Parity · 13 cases, 163,840 exact pixels](parity-fixes.md#height-distance-texture-mapping-skew-and-weave) | | [skew.sbs/skew_grayscale](../assets/sbs/skew.sbs) | 1 | No | [Parity · 13 cases, 163,840 exact pixels](parity-fixes.md#height-distance-texture-mapping-skew-and-weave) | -| [slope_blur.sbs/slope_blur](../assets/sbs/slope_blur.sbs) | 2 | No | [Too hard: remaining pixel differences](parity-fixes.md#remaining-differences) | -| [slope_blur.sbs/slope_blur_grayscale](../assets/sbs/slope_blur.sbs) | 2 | Yes | [Too hard: remaining pixel differences](parity-fixes.md#remaining-differences) | -| [slope_blur.sbs/slope_blur_grayscale_2](../assets/sbs/slope_blur.sbs) | 2 | No | [Too hard: remaining pixel differences](parity-fixes.md#remaining-differences) | +| [slope_blur.sbs/slope_blur](../assets/sbs/slope_blur.sbs) | 2 | No | [Parity · 18 renders, 145,664 exact pixels](parity-fixes.md#gradient-warp-displacement-and-sampling) | +| [slope_blur.sbs/slope_blur_grayscale](../assets/sbs/slope_blur.sbs) | 2 | Yes | [Parity · 18 renders, 145,664 exact pixels](parity-fixes.md#gradient-warp-displacement-and-sampling) | +| [slope_blur.sbs/slope_blur_grayscale_2](../assets/sbs/slope_blur.sbs) | 2 | No | [Parity · 18 renders, 145,664 exact pixels](parity-fixes.md#gradient-warp-displacement-and-sampling) | | [smart_auto_tile.sbs/pattern_find_edges_step](../assets/sbs/smart_auto_tile.sbs) | 4 | Yes | [Parity · 16 cases, 3,185,920 exact pixels](parity-fixes.md#tile-edge-masks-and-normalized-spline-distances) | | [splatter.sbs/splatter](../assets/sbs/splatter.sbs) | 1 | No | [Too hard: remaining pixel differences](parity-fixes.md#remaining-differences) | | [splatter_circular.sbs/splatter_circular](../assets/sbs/splatter_circular.sbs) | 2 | Yes | [Too hard: remaining pixel differences](parity-fixes.md#remaining-differences) |