diff --git a/crates/nodes/src/function/assigned_product.rs b/crates/nodes/src/function/assigned_product.rs index f2ef86ed..27f10775 100644 --- a/crates/nodes/src/function/assigned_product.rs +++ b/crates/nodes/src/function/assigned_product.rs @@ -1,19 +1,25 @@ use super::{EvaluationState, Program, instruction::Instruction, product_sum::ProductSum, returned_product::float_width}; use materialcraft_core::Value; -use std::collections::{BTreeMap, BTreeSet}; +use std::collections::BTreeMap; -/// Factors from the current frame, or a snapshot supplied when its caller entered this frame. #[derive(Clone, Copy)] -pub(super) enum Binding { +enum Registers { Local { left: usize, right: usize, assignment: Option }, Argument(usize), } +/// Factors from this frame or its caller, and the components also read as a rounded product. +#[derive(Clone, Copy)] +pub(super) struct Binding { + registers: Registers, + pub(super) rounded_components: u8, +} + impl Binding { pub(super) fn read(self, state: &EvaluationState) -> Option<[Value; 2]> { - match self { - Self::Argument(slot) => state.assigned_arguments.get(slot)?.clone(), - Self::Local { left, right, assignment } => { + match self.registers { + Registers::Argument(slot) => state.assigned_arguments.get(slot)?.clone(), + Registers::Local { left, right, assignment } => { if let Some(index) = assignment { state.registers.get(index)?.as_ref()?; } @@ -21,6 +27,12 @@ impl Binding { } } } + + fn import(self, arguments: &mut Vec) -> Self { + let slot = arguments.len(); + arguments.push(self); + Self { registers: Registers::Argument(slot), ..self } + } } fn variable(op: &Instruction) -> Option<&str> { @@ -41,65 +53,103 @@ fn unit(op: &Instruction, instructions: &[Instruction]) -> Option { .then_some(input) } +type ReadMasks = BTreeMap; + #[derive(Default)] struct Uses { - reads: BTreeSet, + reads: ReadMasks, writes: BTreeMap, - observed: BTreeSet, - rounded: Vec, + rounded: Vec, + live: Vec, + ordered: bool, + loops: bool, calls: BTreeMap, } impl Uses { fn analyze(program: &Program) -> Self { - let mut uses = Self { rounded: vec![false; program.instructions.len()], ..Self::default() }; - if let Some(output) = uses.rounded.get_mut(program.output) { - *output = true; + let len = program.instructions.len(); + let mut uses = Self { rounded: vec![0; len], live: vec![false; len], ordered: true, ..Self::default() }; + if let (Some(mask), Some(live)) = (uses.rounded.get_mut(program.output), uses.live.get_mut(program.output)) { + *mask = 15; + *live = true; } for (index, op) in program.instructions.iter().enumerate().rev() { - let observed = uses.rounded.get(index).copied().unwrap_or(true); - let mut mark = |input: usize, rounded: bool| { - if let Some(flag) = uses.rounded.get_mut(input) { - *flag |= rounded; + if !uses.live[index] { + continue; + } + let observed = uses.rounded[index]; + let mut mark = |input: usize, mask: u8| { + if let (Some(bits), Some(live)) = (uses.rounded.get_mut(input), uses.live.get_mut(input)) { + *bits |= mask; + *live = true; } }; if let Some(call) = &op.call { let child = Self::analyze(&call.program); for (name, register) in call.inputs.iter().zip(&op.inputs) { - mark(*register, child.observed.contains(name)); + mark(*register, child.reads.get(name).copied().unwrap_or(0)); + } + for (name, &mask) in &child.reads { + if !call.defaults.contains_key(name) { + *uses.reads.entry(name.clone()).or_default() |= mask; + } } - let free = |name: &String| !call.defaults.contains_key(name); - uses.reads.extend(child.reads.iter().filter(|name| free(name)).cloned()); - uses.observed.extend(child.observed.iter().filter(|name| free(name)).cloned()); for (name, count) in &child.writes { - if free(name) { + if !call.defaults.contains_key(name) { *uses.writes.entry(name.clone()).or_default() += count; } } uses.calls.insert(index, child); } else if let Some(input) = unit(op, &program.instructions) { mark(input, observed); + } else if let [input] = op.inputs.as_slice() + && let Some(mask) = super::product_sum::selected_components(op) + { + mark(*input, mask); } else { match (op.definition.id, op.inputs.as_slice()) { - ("add" | "sub", _) => {} - ("sequence", &[_, last]) | ("passthrough", &[last]) => mark(last, observed), + ("add" | "sub", &[left, right]) => { + mark(left, 0); + mark(right, 0); + } + ("sequence", &[first, last]) => { + mark(first, 0); + mark(last, observed); + } + ("passthrough", &[last]) => mark(last, observed), + ("ifelse", &[condition, yes, no]) => { + mark(condition, 15); + for &shared in &op.control_registers { + mark(shared, 0); + } + let test = program.instructions.get(condition); + if let Some(Instruction { value: Some(Value::Bool(value)), .. }) = test.filter(|op| op.definition.id == "const_bool") { + mark(if *value { yes } else { no }, observed); + } else { + uses.ordered = false; + mark(yes, observed); + mark(no, observed); + } + } ("set", &[input]) => { - mark(input, observed || program.instructions.get(input).and_then(product).is_none()); + mark(input, if program.instructions.get(input).and_then(product).is_some() { observed } else { 15 }); if let Some(name) = variable(op) { *uses.writes.entry(name.to_owned()).or_default() += 1; } } ("get_float1" | "get_float2" | "get_float3" | "get_float4", []) => { if let Some(name) = variable(op) { - uses.reads.insert(name.to_owned()); - if observed { - uses.observed.insert(name.to_owned()); - } + *uses.reads.entry(name.to_owned()).or_default() |= observed; } } _ => { + if op.definition.id == "while" { + uses.ordered = false; + uses.loops = true; + } for &input in &op.inputs { - mark(input, true); + mark(input, 15); } } } @@ -119,40 +169,51 @@ fn has_assignment(program: &Program) -> bool { pub(super) fn identify(program: &mut Program) { if program.instructions.iter().any(|op| op.call.is_some()) && has_assignment(program) { let uses = Uses::analyze(program); - install(program, &uses, &uses.observed, BTreeMap::new()); + install(program, &uses, &uses.reads, BTreeMap::new()); } } -fn install(program: &mut Program, uses: &Uses, observed: &BTreeSet, mut names: BTreeMap) { +fn install(program: &mut Program, uses: &Uses, observed: &ReadMasks, mut names: BTreeMap) { let instructions = &program.instructions; - // An outer binding must remain unchanged throughout the call. Repeated assignments in a loop can replace cached factors. - names.retain(|name, _| !uses.writes.contains_key(name)); + // A dynamic branch can skip a write. Only a unique, executed assignment is eligible in that case. + if !uses.ordered { + names.retain(|name, _| !uses.writes.contains_key(name)); + } let mut sources = vec![None; instructions.len()]; + let mut setters = BTreeMap::new(); let mut products_written = BTreeMap::::new(); - let straight = instructions.iter().all(|op| !matches!(op.definition.id, "ifelse" | "while")); - if !instructions.iter().any(|op| op.definition.id == "while") { - for op in instructions { - if let ("set", &[input]) = (op.definition.id, op.inputs.as_slice()) { + if !uses.loops { + for (op, &live) in instructions.iter().zip(&uses.live) { + if live && let ("set", &[input]) = (op.definition.id, op.inputs.as_slice()) { *products_written.entry(input).or_default() += 1; } } for (index, setter) in instructions.iter().enumerate() { - if let ("set", &[input], Some(name)) = (setter.definition.id, setter.inputs.as_slice(), variable(setter)) - && uses.writes.get(name) == Some(&1) + if uses.live[index] + && let ("set", &[input], Some(name)) = (setter.definition.id, setter.inputs.as_slice(), variable(setter)) + && (uses.ordered || uses.writes.get(name) == Some(&1)) && products_written.get(&input) == Some(&1) - && !observed.contains(name) - && !uses.observed.contains(name) - && uses.rounded.get(input) == Some(&false) - && let Some((left, right)) = instructions.get(input).and_then(product) + && let Some(product_op) = instructions.get(input) + && let Some((left, right)) = product(product_op) { - names.insert(name.to_owned(), Binding::Local { left, right, assignment: Some(index) }); - if let Some(slot) = sources.get_mut(input) { - *slot = Some(Binding::Local { left, right, assignment: None }); + let mask = (1_u8 << float_width(product_op.type_code)) - 1; + let rounded_components = observed.get(name).copied().unwrap_or(0) | uses.reads.get(name).copied().unwrap_or(0) | uses.rounded[input]; + if mask & !rounded_components == 0 { + continue; } + let binding = Binding { registers: Registers::Local { left, right, assignment: Some(index) }, rounded_components }; + setters.insert(index, binding); + if !uses.ordered { + names.insert(name.to_owned(), binding); + } + sources[input] = Some(Binding { registers: Registers::Local { left, right, assignment: None }, ..binding }); } } } for index in 0..program.instructions.len() { + if !uses.live[index] { + continue; + } let (previous, current) = program.instructions.split_at_mut(index); let Some(op) = current.first_mut() else { continue }; let source = |input: usize| sources.get(input).copied().flatten(); @@ -160,36 +221,42 @@ fn install(program: &mut Program, uses: &Uses, observed: &BTreeSet, mut let Some(child) = uses.calls.get(&index) else { continue }; let mut imported = BTreeMap::new(); for (name, binding) in &names { - if !call.defaults.contains_key(name) && child.reads.contains(name) && !child.observed.contains(name) && !child.writes.contains_key(name) { - imported.insert(name.clone(), Binding::Argument(call.assigned_products.len())); - call.assigned_products.push(*binding); + if !call.defaults.contains_key(name) && child.reads.contains_key(name) && (child.ordered || !child.writes.contains_key(name)) { + imported.insert(name.clone(), binding.import(&mut call.assigned_products)); } } for (name, register) in call.inputs.iter().zip(&op.inputs) { - if child.reads.contains(name) - && !child.observed.contains(name) - && !child.writes.contains_key(name) + if child.reads.contains_key(name) && let Some(binding) = source(*register) { - imported.insert(name.clone(), Binding::Argument(call.assigned_products.len())); - call.assigned_products.push(binding); + imported.insert(name.clone(), binding.import(&mut call.assigned_products)); } } install(&mut call.program, child, observed, imported); + if uses.ordered { + names.retain(|name, _| !child.writes.contains_key(name) || call.defaults.contains_key(name)); + } continue; } + if uses.ordered + && op.definition.id == "set" + && let Some(name) = variable(op) + { + if let Some(&binding) = setters.get(&index) { + names.insert(name.to_owned(), binding); + } else { + names.remove(name); + } + } let forwarded = match (op.definition.id, op.inputs.as_slice()) { - ("get_float1" | "get_float2" | "get_float3" | "get_float4", []) => variable(op).and_then(|name| names.get(name)).copied().filter(|binding| { - // In straight-line code an earlier getter can retain the value from before the Set. - !matches!(binding, Binding::Local { assignment: Some(set), .. } if !straight || *set >= index) - }), + ("get_float1" | "get_float2" | "get_float3" | "get_float4", []) => { + variable(op).and_then(|name| names.get(name)).copied().filter(|binding| uses.ordered || matches!(binding.registers, Registers::Argument(_))) + } ("passthrough", &[i]) => source(i), _ => unit(op, previous).and_then(source), }; - if let Some(binding) = forwarded - && let Some(slot) = sources.get_mut(index) - { - *slot = Some(binding); + if let Some(binding) = forwarded { + sources[index] = Some(binding); } if let ("add" | "sub", &[left, right]) = (op.definition.id, op.inputs.as_slice()) { let a = sources.get(left).copied().flatten(); diff --git a/crates/nodes/src/function/product_sum.rs b/crates/nodes/src/function/product_sum.rs index 2fa03f2b..0491424f 100644 --- a/crates/nodes/src/function/product_sum.rs +++ b/crates/nodes/src/function/product_sum.rs @@ -47,7 +47,7 @@ impl ProductSum { negated: false, operation: "mulscalar", literal_divisor: false, - rounded_components: 0, + rounded_components: source.rounded_components, retained: Some(Box::new(Retained::Assigned(source))), } } @@ -125,7 +125,7 @@ struct ProductUsage { repeated: bool, } -fn selected_components(op: &Instruction) -> Option { +pub(super) fn selected_components(op: &Instruction) -> Option { let count = match op.definition.id { "swizzle1" => 1, "swizzle2" => 2, diff --git a/crates/nodes/src/function/tests.rs b/crates/nodes/src/function/tests.rs index cb59402c..f426911c 100644 --- a/crates/nodes/src/function/tests.rs +++ b/crates/nodes/src/function/tests.rs @@ -564,9 +564,15 @@ fn pixel_sums_retain_assigned_factors_until_a_component_is_observed() { assert_eq!(pixel(&graph), Value::Float4([0xc01e_2a90, 0xbf45_6d7a, 0x3e19_f2c0, 0x3f51_5a4e].map(f32::from_bits))); } -#[test] -fn called_pixel_sums_use_the_factors_of_a_free_or_wired_step() { - let sample = [0x3ef4_615d, 0xbf0c_f4e5, 0x3f25_886e, 0xbfbe_1bf6].map(f32::from_bits); +#[derive(Clone, Copy)] +enum StepRead { + Sum, + Blue, + BeforeWrite, + AfterWrite, +} + +fn called_pixel_step(sample: [f32; 4], wired: bool, guard: Option, read: StepRead) -> Value { let variables = BTreeMap::from([("field".into(), Value::Float4(sample))]); let context = EvaluationContext { scope: super::FunctionScope::PixelProcessor, @@ -577,50 +583,97 @@ fn called_pixel_sums_use_the_factors_of_a_free_or_wired_step() { tile: false, variables: &variables, }; - for (wired, run_assignment) in [(false, true), (true, true), (false, false), (true, false)] { - let mut graph = FunctionGraph::default(); - let field = graph.add("get_float4", &[], Some(Value::Text("field".into()))); - let dir = graph.add("swizzle4", &[field], Some(Value::Int4([2, 0, 1, 3]))); - let gain = graph.add("swizzle1", &[field], Some(Value::Int(3))); - let pos = graph.add("swizzle4", &[field], Some(Value::Int4([1, 2, 3, 0]))); - let product = graph.add("mulscalar", &[dir, gain], None); - let set = graph.add("set", &[product], Some(Value::Text("stride".into()))); - let setup = if run_assignment { - set - } else { - let skip = graph.add_constant(Value::Bool(false)); - let zero = graph.add_constant(Value::Float4([0.0; 4])); - graph.add("ifelse", &[skip, set, zero], None) - }; - let mut args = vec![("origin", pos)]; - if wired { - args.push(("step", graph.add("get_float4", &[], Some(Value::Text("stride".into()))))); - } - let mut body = FunctionGraph::default(); - let origin = body.add("get_float4", &[], Some(Value::Text("origin".into()))); - let step = body.add("get_float4", &[], Some(Value::Text(if wired { "step" } else { "stride" }.into()))); - body.output = Some(body.add("add", &[origin, step], None)); - let call = graph.add("instance", &[], None); - let node = graph.nodes.last_mut().unwrap(); - node.instance = Some(materialcraft_core::GraphInstance { - label: String::new(), - package: String::new(), - graph: "advance".into(), - inputs: args.iter().map(|(name, _)| materialcraft_core::GraphPort { identifier: (*name).into(), type_code: 2048 }).collect(), - outputs: vec![materialcraft_core::GraphPort { identifier: "output".into(), type_code: 2048 }], - defaults: args.iter().map(|(name, _)| ((*name).into(), Value::Float4([0.0; 4]))).collect(), - }); - node.inputs = args.iter().map(|(_, id)| Some(*id)).collect(); - node.source = Some(Ok(std::sync::Arc::new(body))); - graph.output = Some(graph.add("sequence", &[setup, call], None)); - let actual = compile(&graph, 0).unwrap().evaluate_pixel(&context, &mut EvaluationState::default()).unwrap(); - let expected = if run_assignment { - [0xbfc1_67c9, 0xbd7f_2862, 0xbf2a_dd9e, 0x402b_b9b0].map(f32::from_bits) - } else { - [sample[1], sample[2], sample[3], sample[0]] - }; - assert_eq!(actual, Value::Float4(expected), "wired {wired}, assignment executed {run_assignment}"); + let mut graph = FunctionGraph::default(); + let field = graph.add("get_float4", &[], Some(Value::Text("field".into()))); + let dir = graph.add("swizzle4", &[field], Some(Value::Int4([2, 0, 1, 3]))); + let gain = graph.add("swizzle1", &[field], Some(Value::Int(3))); + let pos = graph.add("swizzle4", &[field], Some(Value::Int4([1, 2, 3, 0]))); + let product = graph.add("mulscalar", &[dir, gain], None); + let set = graph.add("set", &[product], Some(Value::Text("stride".into()))); + let setup = if let Some(run) = guard { + let condition = graph.add_constant(Value::Bool(run)); + let zero = graph.add_constant(Value::Float4([0.0; 4])); + graph.add("ifelse", &[condition, set, zero], None) + } else { + set + }; + let mut args = vec![("origin", pos)]; + if wired { + args.push(("step", graph.add("get_float4", &[], Some(Value::Text("stride".into()))))); } + let mut body = FunctionGraph::default(); + let origin = body.add("get_float4", &[], Some(Value::Text("origin".into()))); + let step = body.add("get_float4", &[], Some(Value::Text(if wired { "step" } else { "stride" }.into()))); + let sum = body.add("add", &[origin, step], None); + body.output = Some(match read { + StepRead::Sum | StepRead::Blue => sum, + StepRead::BeforeWrite => { + let answer = body.add("set", &[sum], Some(Value::Text("answer".into()))); + let write = body.add("set", &[origin], Some(Value::Text("stride".into()))); + let effects = body.add("sequence", &[answer, write], None); + let saved = body.add("get_float4", &[], Some(Value::Text("answer".into()))); + body.add("sequence", &[effects, saved], None) + } + StepRead::AfterWrite => { + let write = body.add("set", &[origin], Some(Value::Text("stride".into()))); + body.add("sequence", &[write, sum], None) + } + }); + let call = graph.add("instance", &[], None); + let node = graph.nodes.last_mut().unwrap(); + node.instance = Some(materialcraft_core::GraphInstance { + label: String::new(), + package: String::new(), + graph: "advance".into(), + inputs: args.iter().map(|(name, _)| materialcraft_core::GraphPort { identifier: (*name).into(), type_code: 2048 }).collect(), + outputs: vec![materialcraft_core::GraphPort { identifier: "output".into(), type_code: 2048 }], + defaults: args.iter().map(|(name, _)| ((*name).into(), Value::Float4([0.0; 4]))).collect(), + }); + node.inputs = args.iter().map(|(_, id)| Some(*id)).collect(); + node.source = Some(Ok(std::sync::Arc::new(body))); + let result = if matches!(read, StepRead::Blue) { + let color = graph.add("swizzle3", &[call], Some(Value::Int3([0, 1, 2]))); + let stored = graph.add("get_float4", &[], Some(Value::Text("stride".into()))); + let blue = graph.add("swizzle1", &[stored], Some(Value::Int(2))); + graph.add("vector4", &[color, blue], None) + } else { + call + }; + graph.output = Some(graph.add("sequence", &[setup, result], None)); + compile(&graph, 0).unwrap().evaluate_pixel(&context, &mut EvaluationState::default()).unwrap() +} + +#[test] +fn called_pixel_sums_use_the_factors_of_a_free_or_wired_step() { + let sample = [0x3ef4_615d, 0xbf0c_f4e5, 0x3f25_886e, 0xbfbe_1bf6].map(f32::from_bits); + for wired in [false, true] { + assert_eq!( + called_pixel_step(sample, wired, None, StepRead::Sum), + Value::Float4([0xbfc1_67c9, 0xbd7f_2862, 0xbf2a_dd9e, 0x402b_b9b0].map(f32::from_bits)) + ); + assert_eq!(called_pixel_step(sample, wired, Some(false), StepRead::Sum), Value::Float4([sample[1], sample[2], sample[3], sample[0]])); + } +} + +#[test] +fn called_pixel_sums_round_the_observed_components_of_the_stored_step() { + let sample = [0xbed0_b7e6, 0x3ee9_4b78, 0xbf01_df0b, 0xbf9a_729d].map(f32::from_bits); + let expected = Value::Float4([0x3f88_ad30, 0xbc7c_be30, 0xbfe0_d28a, 0xbf0c_bfd9].map(f32::from_bits)); + for wired in [false, true] { + assert_eq!(called_pixel_step(sample, wired, None, StepRead::Blue), expected, "wired {wired}"); + } +} + +#[test] +fn called_pixel_sums_follow_assignments_in_execution_order() { + let sample = [0xbed0_b7e6, 0x3ee9_4b78, 0xbf01_df0b, 0xbf9a_729d].map(f32::from_bits); + let sum = Value::Float4([0x3f88_ad30, 0xbc7c_be30, 0xbfe0_d289, 0x3f86_2e37].map(f32::from_bits)); + for wired in [false, true] { + assert_eq!(called_pixel_step(sample, wired, None, StepRead::BeforeWrite), sum, "before write, wired {wired}"); + assert_eq!(called_pixel_step(sample, wired, Some(true), StepRead::Sum), sum, "executed write, wired {wired}"); + } + let origin = [sample[1], sample[2], sample[3], sample[0]]; + assert_eq!(called_pixel_step(sample, false, None, StepRead::AfterWrite), Value::Float4(origin.map(|v| v + v))); } #[test] diff --git a/docs/parity-fixes.md b/docs/parity-fixes.md index 60bd93ef..3b9a2f22 100644 --- a/docs/parity-fixes.md +++ b/docs/parity-fixes.md @@ -59,6 +59,26 @@ The first pass classifies all 546 roots: 166 Parity and 380 Too hard. These meas ## 2026-11-23 root comparisons +### Component reads and writes across pixel function calls + +In the shared Pixel Processor evaluator, a call can read individual components of a stored product. The observed components round at the multiplication. The other components retain their factors for an addition or subtraction. A getter evaluated before a later assignment keeps its earlier value. A getter evaluated after the assignment reads the replacement. + +Repeat the [called ray-step probes](#assigned-ray-steps-inside-pixel-function-calls) with the same signed procedural fields, including the 13 settings for each repeated call. In six additional graphs, return the leading components of the sum followed by the stored product's R, G, B, A, AR or GB components. Pass the step through a free variable or a connected function argument. In five further graphs, compare the fresh sum, a write before or after the sum, a write visible to the caller, and a free-variable write alongside a connected argument. Use 64 × 32 F32 and F16 at seed 379131, 32 × 64 F32 at 379172, 16 × 64 F32 at 394167 and 32² F32 at 394213. + +| Comparison | Renders | U8 exact / total · max | U16 exact / total · max | F16 exact / total · max | F32 exact / total · max | +|---|---:|---:|---:|---:|---:| +| Sixteen one-addition graphs | 16 | — | — | — | 32,768/32,768 · 0 | +| Nine repeated addition, subtraction, observation and reassignment graphs | 117 | 27,648/27,648 · 0 | 27,648/27,648 · 0 | 27,648/27,648 · 0 | 119,808/119,808 · 0 | +| Assignment guarded by literal true or false, free or connected step | 4 | — | — | — | 8,192/8,192 · 0 | +| Six independent component selections | 30 | — | — | 12,288/12,288 · 0 | 36,864/36,864 · 0 | +| Five read and write orders | 25 | — | — | 10,240/10,240 · 0 | 30,720/30,720 · 0 | +| Assignment guarded by sampled alpha | 13 | 1,547/3,072 · 255 | 1,545/3,072 · 65,535 | 1,505/3,072 · 31.9316406 | 6,576/13,312 · 31.9348962 | +| Getter also assigned to an unread variable before a write | 5 | — | — | 2,048/2,048 · 0 | 1,920/6,144 · 4.76837158e-07 | + +The sixteen one-addition cases previously matched 29,800/32,768 pixels. The six component selections previously matched 33,520/49,152. Seven existing MaterialCraft saves now match 96,256/96,256 pixels. The saved sampled-alpha graph matches 11,173/22,528, with the same per-format counts and maxima as the original. Seven additional saves cover the R, B and AR reads, the two write orders, the second assignment and the literal-true connected step. They match 65,536/65,536 pixels across 39 settings. Together the 15 saves reopened in the reference app and reproduced 184,320/184,320 original pixels. + +Both new regressions failed on the preceding evaluator. All 400 node release tests passed on the correction, along with formatting, strict workspace Clippy, dependency layers and WebAssembly checks. The [wired irradiance pass](#whole-specular-outputs-and-wired-irradiance-stages) remains in progress. + ### Whole specular outputs and wired irradiance stages The first eighth specular pass (root 396) was rerun after correcting [floating-point Switch Blend](#signed-zero-when-switch-blend-selects-a-floating-point-color-input). All five [128² environment and material controls](#environment-and-intermediate-precision-in-the-eighth-specular-passes) now match 81,920/81,920 F32 output pixels and 81,920/81,920 F32 first-processor pixels. This includes the 31 zero signs in the black-specular control. The [original matrix and five saved cases](#whole-and-reopened-eighth-specular-passes) have four remaining zero-sign differences in F16. Three occur in the 256² default. The fourth occurs in the 128² changed case and repeats when reopened. All five saved reference images reproduced the originals. diff --git a/docs/sbs-root-nodes.md b/docs/sbs-root-nodes.md index 44f46cc8..eda1c153 100644 --- a/docs/sbs-root-nodes.md +++ b/docs/sbs-root-nodes.md @@ -532,7 +532,7 @@ Creased matches 10,947,840/10,947,840 pixels across 100 distinct settings throug | [pbr_render.sbs/ibl_specular_contrib_anisotropic/panoramic_lod](../assets/sbs/pbr_render.sbs) | 1 | Yes | [Parity · 18 cases, 186,624 exact pixels](parity-fixes.md#stored-precision-in-transform-mip-levels) | | [pbr_render.sbs/position_to_normal](../assets/sbs/pbr_render.sbs) | 2 | Yes | [Parity · 30 renders, all 515,328 RGBA pixels exact](parity-fixes.md#position-to-normal-outputs-in-both-renderers) | | [pbr_render.sbs/raytrace_position](../assets/sbs/pbr_render.sbs) | 4 | Yes | [Parity · 26 renders, all 142,340 RGBA pixels exact](parity-fixes.md#small-graph-parents-and-raytrace-positions) | -| [pbr_render.sbs/raytraced_irradiance_pass_8](../assets/sbs/pbr_render.sbs) | 10 | Yes | [In progress · 22,016/22,016 unwired pixels through 64², 4,537/4,608 wired, 23/23 pass indices](parity-fixes.md#whole-specular-outputs-and-wired-irradiance-stages) · [Earlier 26-setting matrix](parity-fixes.md#irradiance-with-a-connected-pass-index) · [First processor, 4,096/4,096 in both F16 and F32 across called ray steps](parity-fixes.md#assigned-ray-steps-inside-pixel-function-calls) · [Earlier first-processor comparison](parity-fixes.md#stored-products-in-pixel-expressions-and-irradiance-ray-steps) | +| [pbr_render.sbs/raytraced_irradiance_pass_8](../assets/sbs/pbr_render.sbs) | 10 | Yes | [In progress · 22,016/22,016 unwired pixels through 64², 4,537/4,608 wired, 23/23 pass indices](parity-fixes.md#whole-specular-outputs-and-wired-irradiance-stages) · [Stored product component and assignment-order controls](parity-fixes.md#component-reads-and-writes-across-pixel-function-calls) · [Earlier 26-setting matrix](parity-fixes.md#irradiance-with-a-connected-pass-index) · [First processor, 4,096/4,096 in both F16 and F32 across called ray steps](parity-fixes.md#assigned-ray-steps-inside-pixel-function-calls) · [Earlier first-processor comparison](parity-fixes.md#stored-products-in-pixel-expressions-and-irradiance-ray-steps) | | [pbr_render.sbs/raytraced_specular_pass_8](../assets/sbs/pbr_render.sbs) | 9 | Yes | [In progress · 143,296/143,300 original and rectangular pixels, 16,703/16,704 reopened, five exact paired 128² controls](parity-fixes.md#whole-specular-outputs-and-wired-irradiance-stages) · [Switch precision measurements](parity-fixes.md#signed-zero-when-switch-blend-selects-a-floating-point-color-input) · [Earlier F16 comparisons](parity-fixes.md#eighth-raytraced-specular-passes) · [rectangular fields and saved packages](parity-fixes.md#rectangular-inputs-and-remaining-half-float-pixels-in-the-eighth-specular-passes) · [Environment controls and F32 boundary values](parity-fixes.md#environment-and-intermediate-precision-in-the-eighth-specular-passes) · [Reciprocal rounding and 128² recheck](parity-fixes.md#reciprocal-division-through-pixel-function-calls) | | [pbr_render2.sbs/PBR_render_mapping_color](../assets/sbs/pbr_render2.sbs) | 2 | No | [Parity · 13 cases, 163,840 exact pixels](parity-fixes.md#height-distance-texture-mapping-skew-and-weave) | | [pbr_render2.sbs/PBR_render_mapping_grayscale](../assets/sbs/pbr_render2.sbs) | 2 | No | [Parity · 13 cases, 163,840 exact pixels](parity-fixes.md#height-distance-texture-mapping-skew-and-weave) |