mirror of
https://github.com/storytold/materialcraft.git
synced 2026-11-28 17:19:17 +01:00
Retain original reciprocal factors through pixel function calls
This commit is contained in:
1 parent
a6cf436e1e
commit
1edf59c7e1
11 files changed
+364
-50
No files matched your search
@@ -19,7 +19,9 @@ pub(super) fn compile_program(
|
||||
) -> Result<Program, String> {
|
||||
let mut remaining = super::MAX_EXPANDED_NODES;
|
||||
let mut program = compile_nested(graph, seed, 0, &mut remaining)?;
|
||||
mark_literals(&mut program, literal_inputs.iter().map(String::as_str).collect(), pixel);
|
||||
mark_literals(&mut program, literal_inputs.iter().map(|name| (name.as_str(), ())).collect());
|
||||
super::reciprocal::identify_products(&mut program, BTreeMap::new());
|
||||
plan_pixel_operations(&mut program, pixel);
|
||||
Ok(program)
|
||||
}
|
||||
|
||||
@@ -125,6 +127,7 @@ fn compile_nested(graph: &FunctionGraph, seed: u32, depth: usize, remaining: &mu
|
||||
type_code,
|
||||
literal: true,
|
||||
literal_divisor: false,
|
||||
reciprocal_factor: None,
|
||||
pixel_product_sum: None,
|
||||
pixel_interval: None,
|
||||
control_registers: Vec::new(),
|
||||
@@ -171,7 +174,7 @@ fn compile_nested(graph: &FunctionGraph, seed: u32, depth: usize, remaining: &mu
|
||||
let exports =
|
||||
program.instructions.iter().any(|instruction| instruction.definition.id == "set" || instruction.call.as_ref().is_some_and(|call| call.exports));
|
||||
let pattern_arguments = super::function_call::PatternArguments::identify(&program, &names, &defaults, &inputs);
|
||||
Some(super::function_call::FunctionCall { program, inputs: names, defaults, argument_factors: None, pattern_arguments, exports })
|
||||
Some(super::function_call::FunctionCall { program, inputs: names, defaults, argument_factors: None, reciprocals: None, pattern_arguments, exports })
|
||||
} else {
|
||||
None
|
||||
};
|
||||
@@ -195,6 +198,7 @@ fn compile_nested(graph: &FunctionGraph, seed: u32, depth: usize, remaining: &mu
|
||||
type_code,
|
||||
literal: false,
|
||||
literal_divisor: false,
|
||||
reciprocal_factor: None,
|
||||
pixel_product_sum: None,
|
||||
pixel_interval: None,
|
||||
control_registers: Vec::new(),
|
||||
@@ -230,12 +234,12 @@ fn compile_nested(graph: &FunctionGraph, seed: u32, depth: usize, remaining: &mu
|
||||
Ok(Program { instructions, output, seed, pattern_draws: BTreeMap::new(), pattern_components: BTreeMap::new(), loop_sums: BTreeMap::new() })
|
||||
}
|
||||
|
||||
fn mark_literals(program: &mut Program, mut arguments: BTreeSet<&str>, pixel: Option<&super::EvaluationContext<'_>>) -> super::returned_product::Lanes {
|
||||
// A write in the callee can replace a literal argument before its next read.
|
||||
/// A write can replace an argument before its next read.
|
||||
pub(super) fn remove_written_arguments<T>(program: &Program, arguments: &mut BTreeMap<&str, T>) {
|
||||
for op in &program.instructions {
|
||||
if op.call.as_ref().is_some_and(|call| call.exports) {
|
||||
arguments.clear();
|
||||
break;
|
||||
return;
|
||||
}
|
||||
if op.definition.id == "set"
|
||||
&& let Some(materialcraft_core::Value::Text(name)) = &op.value
|
||||
@@ -243,30 +247,39 @@ fn mark_literals(program: &mut Program, mut arguments: BTreeSet<&str>, pixel: Op
|
||||
arguments.remove(name.as_str());
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
fn mark_literals(program: &mut Program, mut arguments: BTreeMap<&str, ()>) {
|
||||
remove_written_arguments(program, &mut arguments);
|
||||
let mut literals = Vec::with_capacity(program.instructions.len());
|
||||
let mut returned = BTreeMap::new();
|
||||
for (index, op) in program.instructions.iter_mut().enumerate() {
|
||||
for op in &mut program.instructions {
|
||||
let literal = |index: &usize| literals.get(*index) == Some(&true);
|
||||
let id = op.definition.id;
|
||||
op.literal_divisor = id == "div" && op.inputs.get(1).is_some_and(literal);
|
||||
if let Some(call) = &mut op.call {
|
||||
let bound = call.inputs.iter().zip(&op.inputs).filter(|(_, index)| literal(index)).map(|(name, _)| name.as_str()).collect();
|
||||
let lanes = mark_literals(&mut call.program, bound, None);
|
||||
let bound = call.inputs.iter().zip(&op.inputs).filter(|(_, index)| literal(index)).map(|(name, _)| (name.as_str(), ())).collect();
|
||||
mark_literals(&mut call.program, bound);
|
||||
op.literal = call.program.output_is_literal();
|
||||
// Returned products read the call's evaluated registers after its assignments have run.
|
||||
if lanes.iter().any(Option::is_some) {
|
||||
returned.insert(index, lanes);
|
||||
}
|
||||
} else {
|
||||
op.literal = id.starts_with("const_")
|
||||
|| (id.starts_with("get_") && matches!(&op.value, Some(materialcraft_core::Value::Text(name)) if arguments.contains(name.as_str())))
|
||||
|| (id.starts_with("get_") && matches!(&op.value, Some(materialcraft_core::Value::Text(name)) if arguments.contains_key(name.as_str())))
|
||||
|| (op.depends_only_on_operands() && op.inputs.iter().all(literal));
|
||||
}
|
||||
literals.push(op.literal);
|
||||
}
|
||||
}
|
||||
|
||||
fn plan_pixel_operations(program: &mut Program, pixel: Option<&super::EvaluationContext<'_>>) -> super::returned_product::Lanes {
|
||||
let mut returned = BTreeMap::new();
|
||||
for index in 0..program.instructions.len() {
|
||||
let (previous, current) = program.instructions.split_at_mut(index);
|
||||
if let Some(op) = current.first_mut() {
|
||||
if let Some(call) = &mut op.call {
|
||||
let lanes = plan_pixel_operations(&mut call.program, None);
|
||||
if lanes.iter().any(Option::is_some) {
|
||||
returned.insert(index, lanes);
|
||||
}
|
||||
}
|
||||
op.pixel_interval = pixel_interval(op, previous).map(Box::new);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -12,6 +12,8 @@ pub struct EvaluationState {
|
||||
pub(crate) assignments: BTreeMap<String, Value>,
|
||||
pub(crate) random: crate::random::FunctionRandom,
|
||||
pub(super) argument_factors: Option<[f32; 2]>,
|
||||
pub(super) reciprocal_arguments: Vec<Option<f32>>,
|
||||
pub(super) returned_reciprocals: [Option<f32>; 4],
|
||||
pub(crate) calls: BTreeMap<usize, EvaluationState>,
|
||||
}
|
||||
|
||||
|
||||
@@ -9,7 +9,8 @@ pub(crate) struct FunctionCall {
|
||||
pub inputs: Vec<String>,
|
||||
pub defaults: BTreeMap<String, Value>,
|
||||
/// Parent registers for an argument used only in scalar sums within the call.
|
||||
pub argument_factors: Option<[usize; 2]>,
|
||||
pub(super) argument_factors: Option<[super::reciprocal::Factor; 2]>,
|
||||
pub(super) reciprocals: Option<Box<super::reciprocal::CallFactors>>,
|
||||
pub(super) pattern_arguments: Option<PatternArguments>,
|
||||
/// The called graph sets variables, directly or in a graph it calls; the caller reads them after the call
|
||||
pub exports: bool,
|
||||
|
||||
@@ -11,6 +11,8 @@ pub(crate) struct Instruction {
|
||||
pub literal: bool,
|
||||
/// A constant denominator folds to its rounded reciprocal even with a varying numerator.
|
||||
pub(super) literal_divisor: bool,
|
||||
/// Original scalar divisor retained when a pixel expression divides by its reciprocal.
|
||||
pub(super) reciprocal_factor: Option<super::reciprocal::Factor>,
|
||||
pub(super) pixel_product_sum: Option<super::product_sum::ProductSum>,
|
||||
/// Registers for max(lower, min(value, upper)) with literal scalar bounds.
|
||||
pub(super) pixel_interval: Option<Box<PixelInterval>>,
|
||||
@@ -25,6 +27,11 @@ impl Instruction {
|
||||
}
|
||||
|
||||
pub(super) fn product_operation(&self) -> Option<&'static str> {
|
||||
// A cancelled reciprocal keeps the original operands live for their other readers.
|
||||
// The retained-product pass can use its factor after both operands have run.
|
||||
if self.reciprocal_factor.is_some() {
|
||||
return None;
|
||||
}
|
||||
let [_, _] = self.inputs.as_slice() else { return None };
|
||||
match self.definition.id {
|
||||
"rand" => Some("mul"),
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
use super::{EvaluationState, arithmetic::flush_subnormal, instruction::Instruction, returned_product::Source, value_type};
|
||||
use super::{EvaluationState, arithmetic::flush_subnormal, instruction::Instruction, reciprocal::Factor, returned_product::Source, value_type};
|
||||
use materialcraft_core::Value;
|
||||
use std::collections::BTreeMap;
|
||||
|
||||
@@ -45,12 +45,12 @@ impl ProductSum {
|
||||
}
|
||||
let passed;
|
||||
let (a, b, c, blend, subtract) = if let Some(Retained::Argument { source, addend, subtract }) = self.retained.as_deref() {
|
||||
let (a, b) = source.factors(state)?;
|
||||
passed = source.factors(state)?.map(Value::Float);
|
||||
let c = match addend {
|
||||
Addend::Argument(i) => arguments.get(*i).ok_or("missing product addend")?,
|
||||
Addend::Literal(value) => value,
|
||||
};
|
||||
(a, b, c, None, *subtract)
|
||||
(&passed[0], &passed[1], c, None, *subtract)
|
||||
} else if matches!(self.retained.as_deref(), Some(Retained::PassedArgument)) {
|
||||
let [left, right] = arguments else { return Err("missing scalar sum operands".into()) };
|
||||
passed = state.argument_factors.ok_or("missing scalar argument factors")?.map(Value::Float);
|
||||
@@ -118,6 +118,18 @@ fn selected_components(op: &Instruction) -> Option<u8> {
|
||||
components.iter().take(count).try_fold(0, |mask, &i| (0..4).contains(&i).then(|| mask | 1 << i))
|
||||
}
|
||||
|
||||
fn scalar_product(op: &Instruction) -> Option<(&'static str, [Factor; 2])> {
|
||||
let &[a, b] = op.inputs.as_slice() else { return None };
|
||||
if op.literal || op.type_code != 256 {
|
||||
return None;
|
||||
}
|
||||
match (op.definition.id, op.reciprocal_factor) {
|
||||
("div", Some(factor)) => Some(("mul", [Factor::Register(a), factor])),
|
||||
(operation @ ("mul" | "div"), _) => Some((operation, [a, b].map(Factor::Register))),
|
||||
_ => None,
|
||||
}
|
||||
}
|
||||
|
||||
/// A scalar argument can contract with a callee's addition when that addition is its only use.
|
||||
fn called_sum(op: &Instruction, instructions: &[Instruction], usage: &[ProductUsage]) -> Option<ProductSum> {
|
||||
let call = op.call.as_ref()?;
|
||||
@@ -146,16 +158,16 @@ fn called_sum(op: &Instruction, instructions: &[Instruction], usage: &[ProductUs
|
||||
let Addend::Argument(slot) = operand else { return None };
|
||||
let index = *op.inputs.get(*slot)?;
|
||||
let product = instructions.get(index)?;
|
||||
if usage.get(index)?.count != 1 || product.literal || product.type_code != 256 || !matches!(product.definition.id, "mul" | "div") {
|
||||
if usage.get(index)?.count != 1 {
|
||||
return None;
|
||||
}
|
||||
let &[a, b] = product.inputs.as_slice() else { return None };
|
||||
let retained = Retained::Argument { source: Source::local([a, b]), addend: addend.clone(), subtract: sum.definition.id == "sub" };
|
||||
let (operation, factors) = scalar_product(product)?;
|
||||
let retained = Retained::Argument { source: Source::local(factors), addend: addend.clone(), subtract: sum.definition.id == "sub" };
|
||||
Some(ProductSum {
|
||||
inputs: op.inputs.clone(),
|
||||
product_on_right,
|
||||
negated: false,
|
||||
operation: product.definition.id,
|
||||
operation,
|
||||
literal_divisor: product.literal_divisor,
|
||||
rounded_components: 0,
|
||||
retained: Some(Box::new(retained)),
|
||||
@@ -168,11 +180,10 @@ fn called_sum(op: &Instruction, instructions: &[Instruction], usage: &[ProductUs
|
||||
fn pass_into_sums(call: &mut super::function_call::FunctionCall, inputs: &[usize], previous: &[Instruction], usage: &[ProductUsage]) {
|
||||
let mut candidates = call.inputs.iter().zip(inputs).filter_map(|(name, &index)| {
|
||||
let product = previous.get(index)?;
|
||||
(usage.get(index)?.count == 1 && !product.literal && product.type_code == 256 && matches!(product.definition.id, "mul" | "div"))
|
||||
.then_some((name, product))
|
||||
let (operation, factors) = scalar_product(product)?;
|
||||
(usage.get(index)?.count == 1).then_some((name, product.literal_divisor, operation, factors))
|
||||
});
|
||||
let Some((name, product)) = candidates.next() else { return };
|
||||
let &[a, b] = product.inputs.as_slice() else { return };
|
||||
let Some((name, literal_divisor, operation, factors)) = candidates.next() else { return };
|
||||
let body = &mut call.program.instructions;
|
||||
if candidates.next().is_some() || call.exports || body.iter().any(|op| op.call.is_some() || matches!(op.definition.id, "ifelse" | "sequence" | "while")) {
|
||||
return;
|
||||
@@ -192,15 +203,15 @@ fn pass_into_sums(call: &mut super::function_call::FunctionCall, inputs: &[usize
|
||||
if sums.is_empty() {
|
||||
return;
|
||||
}
|
||||
call.argument_factors = Some([a, b]);
|
||||
call.argument_factors = Some(factors);
|
||||
for (index, product_on_right) in sums {
|
||||
if let Some(sum) = body.get_mut(index) {
|
||||
sum.pixel_product_sum = Some(ProductSum {
|
||||
inputs: sum.inputs.clone(),
|
||||
product_on_right,
|
||||
negated: false,
|
||||
operation: product.definition.id,
|
||||
literal_divisor: product.literal_divisor,
|
||||
operation,
|
||||
literal_divisor,
|
||||
rounded_components: 0,
|
||||
retained: Some(Box::new(Retained::PassedArgument)),
|
||||
});
|
||||
|
||||
@@ -248,6 +248,11 @@ impl Program {
|
||||
let pattern =
|
||||
instruction.call.as_ref().and_then(|call| call.pattern_arguments.as_ref()).filter(|_| context.scope == super::FunctionScope::FxMap);
|
||||
let result = if context.scope == super::FunctionScope::PixelProcessor
|
||||
&& let Some(factor) = instruction.reciprocal_factor
|
||||
&& let Some(product) = super::reciprocal::multiply_original(arguments.first(), factor.read(state))
|
||||
{
|
||||
Ok(product)
|
||||
} else if context.scope == super::FunctionScope::PixelProcessor
|
||||
&& let Some(value) = instruction.pixel_interval.as_deref().and_then(|interval| interval.saturate(state))
|
||||
{
|
||||
Ok(value)
|
||||
@@ -259,11 +264,19 @@ impl Program {
|
||||
super::function_call::pack_scalars(arguments)
|
||||
} else if let Some(call) = &instruction.call {
|
||||
let factors = if let Some([a, b]) = call.argument_factors.filter(|_| context.scope == super::FunctionScope::PixelProcessor) {
|
||||
let factor = |i| state.scalar_register(i).ok_or("missing scalar argument factor");
|
||||
Some([factor(a)?, factor(b)?])
|
||||
Some([a.read(state).ok_or("missing scalar argument factor")?, b.read(state).ok_or("missing scalar argument factor")?])
|
||||
} else {
|
||||
None
|
||||
};
|
||||
let reciprocals = call.reciprocals.as_deref().filter(|_| context.scope == super::FunctionScope::PixelProcessor);
|
||||
if let Some(plan) = reciprocals
|
||||
&& !plan.arguments.is_empty()
|
||||
{
|
||||
let mut values = state.calls.get_mut(&index).map(|child| std::mem::take(&mut child.reciprocal_arguments)).unwrap_or_default();
|
||||
values.clear();
|
||||
values.extend(plan.arguments.iter().map(|factor| factor.read(state)));
|
||||
state.calls.entry(index).or_default().reciprocal_arguments = values;
|
||||
}
|
||||
let storage = state.calls.entry(index).or_default();
|
||||
storage.argument_factors = factors;
|
||||
storage.variables.clone_from(&state.variables);
|
||||
@@ -281,6 +294,9 @@ impl Program {
|
||||
storage.random = state.random;
|
||||
let child = CallBindings { call, caller_assignments: &state.assignments, parent: bindings };
|
||||
let result = call.program.run(context, storage, remaining_steps, Some(&child));
|
||||
if let Some(plan) = reciprocals {
|
||||
storage.returned_reciprocals = plan.results.map(|factor| factor.and_then(|f| f.read(storage)));
|
||||
}
|
||||
state.random = storage.random;
|
||||
if call.exports && result.is_ok() {
|
||||
// A free assignment can pass through a caller with a formal of the same name.
|
||||
|
||||
@@ -1,6 +1,145 @@
|
||||
//! Fixed-point reciprocal used by runtime pixel division.
|
||||
|
||||
use super::fixed_point::square_fraction;
|
||||
use super::{EvaluationState, Program, fixed_point::square_fraction, function_call::FunctionCall, returned_product::forwarded, value_type};
|
||||
use materialcraft_core::Value;
|
||||
use std::collections::BTreeMap;
|
||||
|
||||
/// A scalar before its reciprocal rounded, in the frame which evaluated it.
|
||||
#[derive(Clone, Copy, PartialEq, Eq, PartialOrd, Ord)]
|
||||
pub(super) enum Factor {
|
||||
Register(usize),
|
||||
Argument(usize),
|
||||
Returned { call: usize, lane: u8 },
|
||||
}
|
||||
|
||||
impl Factor {
|
||||
pub(super) fn read(self, state: &EvaluationState) -> Option<f32> {
|
||||
match self {
|
||||
Self::Register(i) => state.scalar_register(i),
|
||||
Self::Argument(i) => state.reciprocal_arguments.get(i).copied().flatten(),
|
||||
Self::Returned { call, lane } => state.calls.get(&call)?.returned_reciprocals.get(usize::from(lane)).copied().flatten(),
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
#[derive(Clone, Copy)]
|
||||
pub(super) enum Origin {
|
||||
One,
|
||||
Reciprocal(Factor),
|
||||
}
|
||||
|
||||
type Lanes = [Option<Origin>; 4];
|
||||
|
||||
pub(super) struct CallFactors {
|
||||
pub arguments: Vec<Factor>,
|
||||
pub results: [Option<Factor>; 4],
|
||||
}
|
||||
|
||||
fn call_origins(call: &mut FunctionCall, index: usize, inputs: &[usize], origins: &[Lanes]) -> Lanes {
|
||||
let mut factors = CallFactors { arguments: Vec::new(), results: [None; 4] };
|
||||
let mut bound = BTreeMap::new();
|
||||
for (name, register) in call.inputs.iter().zip(inputs) {
|
||||
if let Some(lanes) = origins.get(*register)
|
||||
&& lanes.iter().any(Option::is_some)
|
||||
{
|
||||
bound.insert(
|
||||
name.as_str(),
|
||||
lanes.map(|lane| match lane {
|
||||
Some(Origin::Reciprocal(factor)) => {
|
||||
let slot = factors.arguments.len();
|
||||
factors.arguments.push(factor);
|
||||
Some(Origin::Reciprocal(Factor::Argument(slot)))
|
||||
}
|
||||
other => other,
|
||||
}),
|
||||
);
|
||||
}
|
||||
}
|
||||
let mut result = identify_products(&mut call.program, bound);
|
||||
for (lane, origin) in result.iter_mut().enumerate() {
|
||||
if let Some(Origin::Reciprocal(factor)) = origin {
|
||||
factors.results[lane] = Some(*factor);
|
||||
*factor = Factor::Returned { call: index, lane: lane as u8 };
|
||||
}
|
||||
}
|
||||
if !factors.arguments.is_empty() || factors.results.iter().any(Option::is_some) {
|
||||
call.reciprocals = Some(Box::new(factors));
|
||||
}
|
||||
result
|
||||
}
|
||||
|
||||
/// Track the literal unit numerator and the original divisor through vector lanes and calls.
|
||||
/// The caller still evaluates both operands, including assignments and random draws.
|
||||
pub(super) fn identify_products(program: &mut Program, mut arguments: BTreeMap<&str, Lanes>) -> Lanes {
|
||||
super::compile::remove_written_arguments(program, &mut arguments);
|
||||
let instructions = &mut program.instructions;
|
||||
if instructions.iter().any(|op| op.definition.id == "while") {
|
||||
// A loop can clear the original divisor while another register still holds its reciprocal.
|
||||
for call in instructions.iter_mut().filter_map(|op| op.call.as_mut()) {
|
||||
identify_products(&mut call.program, BTreeMap::new());
|
||||
}
|
||||
return [None; 4];
|
||||
}
|
||||
let mut origins: Vec<Lanes> = Vec::with_capacity(instructions.len());
|
||||
for index in 0..instructions.len() {
|
||||
let (previous, current) = instructions.split_at_mut(index);
|
||||
let op = &mut current[0];
|
||||
if let Some(call) = &mut op.call {
|
||||
let result = call_origins(call, index, &op.inputs, &origins);
|
||||
origins.push(result);
|
||||
continue;
|
||||
}
|
||||
let lane = |register: usize, component: usize| origins.get(register).and_then(|v| v.get(component)).copied().flatten();
|
||||
let mut result = [None; 4];
|
||||
match (op.definition.id, op.inputs.as_slice()) {
|
||||
("get_float1" | "get_float2" | "get_float3" | "get_float4", []) => {
|
||||
if let Some(Value::Text(name)) = &op.value
|
||||
&& !name.starts_with('$')
|
||||
&& let Some(lanes) = arguments.get(name.as_str())
|
||||
{
|
||||
result = *lanes;
|
||||
}
|
||||
}
|
||||
("const_float1" | "const_float2" | "const_float3" | "const_float4", []) => {
|
||||
if let Some(value) = op.value.as_ref()
|
||||
&& let Ok(components) = value_type::floats(value)
|
||||
{
|
||||
for (slot, component) in result.iter_mut().zip(components).take(value_type::dimensions(value)) {
|
||||
*slot = (component == 1.0).then_some(Origin::One);
|
||||
}
|
||||
}
|
||||
}
|
||||
("div", &[a, b]) if op.type_code == 256 && !op.literal => {
|
||||
if let Some(Origin::Reciprocal(factor)) = lane(b, 0) {
|
||||
op.reciprocal_factor = Some(factor);
|
||||
}
|
||||
if matches!(lane(a, 0), Some(Origin::One)) {
|
||||
result[0] = Some(Origin::Reciprocal(Factor::Register(b)));
|
||||
}
|
||||
}
|
||||
("mul" | "mulscalar", &[a, b]) => {
|
||||
for (i, slot) in result.iter_mut().enumerate().take(super::returned_product::float_width(op.type_code)) {
|
||||
let left = lane(a, i);
|
||||
let right = lane(b, if op.definition.id == "mulscalar" { 0 } else { i });
|
||||
*slot = match (left, right) {
|
||||
(Some(Origin::One), other) | (other, Some(Origin::One)) => other,
|
||||
_ => None,
|
||||
};
|
||||
}
|
||||
}
|
||||
("passthrough", &[input]) => result = origins.get(input).copied().unwrap_or(result),
|
||||
_ => result = forwarded(op, previous, &origins, None).unwrap_or(result),
|
||||
}
|
||||
origins.push(result);
|
||||
}
|
||||
origins.get(program.output).copied().unwrap_or([None; 4])
|
||||
}
|
||||
|
||||
pub(super) fn multiply_original(numerator: Option<&Value>, factor: Option<f32>) -> Option<Value> {
|
||||
let Value::Float(numerator) = numerator? else { return None };
|
||||
let flush = super::arithmetic::flush_subnormal;
|
||||
Some(Value::Float(flush(flush(*numerator) * flush(factor?))))
|
||||
}
|
||||
|
||||
#[derive(Clone, Copy)]
|
||||
struct Polynomial {
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
use super::{EvaluationState, Program, arithmetic::flush_subnormal, instruction::Instruction, product_sum::ProductSum, value_type};
|
||||
use super::{EvaluationState, Program, arithmetic::flush_subnormal, instruction::Instruction, product_sum::ProductSum, reciprocal::Factor, value_type};
|
||||
use materialcraft_core::Value;
|
||||
use std::collections::BTreeMap;
|
||||
|
||||
@@ -6,8 +6,8 @@ use std::collections::BTreeMap;
|
||||
#[derive(Clone, PartialEq, Eq, PartialOrd, Ord)]
|
||||
pub(super) struct Source {
|
||||
calls: Vec<usize>,
|
||||
factors: [usize; 2],
|
||||
components: [usize; 2],
|
||||
factors: [Factor; 2],
|
||||
components: [u8; 2],
|
||||
operation: Operation,
|
||||
}
|
||||
|
||||
@@ -18,7 +18,7 @@ enum Operation {
|
||||
}
|
||||
|
||||
impl Source {
|
||||
pub(super) fn local(factors: [usize; 2]) -> Self {
|
||||
pub(super) fn local(factors: [Factor; 2]) -> Self {
|
||||
Self { calls: Vec::new(), factors, components: [0, 0], operation: Operation::Multiply }
|
||||
}
|
||||
|
||||
@@ -34,7 +34,10 @@ impl Source {
|
||||
let members = &program.instructions[index].control_registers;
|
||||
if members.binary_search(&sum).is_ok() {
|
||||
inside = true;
|
||||
} else if self.factors.iter().any(|factor| members.binary_search(factor).is_ok()) {
|
||||
} else if self.factors.iter().any(|factor| match factor {
|
||||
Factor::Register(i) => members.binary_search(i).is_ok(),
|
||||
_ => true,
|
||||
}) {
|
||||
// A separate loop can clear a factor while the packed vector still holds its old value.
|
||||
return false;
|
||||
}
|
||||
@@ -42,13 +45,18 @@ impl Source {
|
||||
inside
|
||||
}
|
||||
|
||||
pub(super) fn factors<'a>(&self, mut state: &'a EvaluationState) -> Result<(&'a Value, &'a Value), String> {
|
||||
pub(super) fn factors(&self, mut state: &EvaluationState) -> Result<[f32; 2], String> {
|
||||
for call in &self.calls {
|
||||
state = state.calls.get(call).ok_or("missing evaluated product call")?;
|
||||
}
|
||||
let read = |index| state.registers.get(index).and_then(Option::as_ref).ok_or("missing evaluated product factor");
|
||||
let [a, b] = self.factors;
|
||||
Ok((read(a)?, read(b)?))
|
||||
let read = |factor: Factor, component| match factor {
|
||||
Factor::Register(i) => {
|
||||
let value = state.registers.get(i).and_then(Option::as_ref).ok_or("missing evaluated product factor")?;
|
||||
value_type::floats(value)?.get(usize::from(component)).copied().ok_or_else(|| "invalid product component".to_owned())
|
||||
}
|
||||
factor => factor.read(state).ok_or_else(|| "missing reciprocal factor".to_owned()),
|
||||
};
|
||||
Ok([read(self.factors[0], self.components[0])?, read(self.factors[1], self.components[1])?])
|
||||
}
|
||||
}
|
||||
|
||||
@@ -70,10 +78,7 @@ pub(super) fn evaluate_sum(terms: &Sum, arguments: &[Value], subtract: bool, sta
|
||||
let mut result = [0.0; 4];
|
||||
for (((output, term), left), right) in result.iter_mut().zip(terms).zip(left).zip(right).take(width) {
|
||||
let sum = if let Some(term) = term {
|
||||
let (a, b) = term.source.factors(state)?;
|
||||
let [i, j] = term.source.components;
|
||||
let a = flush_subnormal(*value_type::floats(a)?.get(i).ok_or("invalid product component")?);
|
||||
let b = flush_subnormal(*value_type::floats(b)?.get(j).ok_or("invalid product component")?);
|
||||
let [a, b] = term.source.factors(state)?.map(flush_subnormal);
|
||||
let a = if subtract && term.on_right { -a } else { a };
|
||||
let addend = if term.on_right {
|
||||
left
|
||||
@@ -147,7 +152,12 @@ pub(super) fn forwarded<T: Copy>(op: &Instruction, instructions: &[Instruction],
|
||||
|
||||
pub(super) fn identify(program: &mut Program, mut returned: BTreeMap<usize, Lanes>) -> Lanes {
|
||||
let empty = || std::array::from_fn(|_| None);
|
||||
if returned.is_empty() && !program.instructions.iter().any(|op| op.product_operation().is_some() && float_width(op.type_code) > 0 && !op.literal) {
|
||||
if returned.is_empty()
|
||||
&& !program
|
||||
.instructions
|
||||
.iter()
|
||||
.any(|op| op.reciprocal_factor.is_some() || op.product_operation().is_some() && float_width(op.type_code) > 0 && !op.literal)
|
||||
{
|
||||
return empty();
|
||||
}
|
||||
|
||||
@@ -179,7 +189,12 @@ pub(super) fn identify(program: &mut Program, mut returned: BTreeMap<usize, Lane
|
||||
}
|
||||
|
||||
let mut lanes = [None; 4];
|
||||
if let Some(operation) = op.product_operation()
|
||||
if let Some(factor) = op.reciprocal_factor
|
||||
&& let &[a, _] = op.inputs.as_slice()
|
||||
{
|
||||
lanes[0] = Some(products.len());
|
||||
products.push((Source::local([Factor::Register(a), factor]), 0));
|
||||
} else if let Some(operation) = op.product_operation()
|
||||
&& !op.literal
|
||||
&& let &[a, b] = op.inputs.as_slice()
|
||||
{
|
||||
@@ -187,7 +202,7 @@ pub(super) fn identify(program: &mut Program, mut returned: BTreeMap<usize, Lane
|
||||
for (i, lane) in lanes.iter_mut().take(width).enumerate() {
|
||||
*lane = Some(products.len());
|
||||
let j = if op.definition.id == "mulscalar" { 0 } else { i };
|
||||
products.push((Source { components: [i, j], operation, ..Source::local([a, b]) }, 0));
|
||||
products.push((Source { components: [i as u8, j as u8], operation, ..Source::local([a, b].map(Factor::Register)) }, 0));
|
||||
}
|
||||
} else if let Some(exports) = returned.remove(&index) {
|
||||
// Two returned lanes can reference the same product. Count their downstream reads together.
|
||||
|
||||
@@ -2560,3 +2560,88 @@ fn packed_loop_products_keep_the_factors_from_the_current_iteration() {
|
||||
assert_eq!(actual.map(f32::to_bits), [x, y, z, alpha].map(f32::to_bits), "nested read {nested_read}");
|
||||
}
|
||||
}
|
||||
|
||||
#[test]
|
||||
fn pixel_division_by_a_literal_unit_reciprocal_uses_the_original_factor() {
|
||||
let variables = BTreeMap::from([
|
||||
("a".into(), Value::Float(f32::from_bits(0x4076_3400))),
|
||||
("b".into(), Value::Float(f32::from_bits(0x3f68_c2ba))),
|
||||
("unit".into(), Value::Float(1.0)),
|
||||
]);
|
||||
let context = EvaluationContext {
|
||||
image_formats: &[],
|
||||
scope: super::FunctionScope::PixelProcessor,
|
||||
position: [0.5; 2],
|
||||
size: [1.0; 2],
|
||||
images: &[],
|
||||
tile: true,
|
||||
variables: &variables,
|
||||
};
|
||||
for (literal, expected) in [(true, 0x405f_da66), (false, 0x405f_da65)] {
|
||||
let mut graph = FunctionGraph::default();
|
||||
let [a, b, unit] = ["a", "b", "unit"].map(|name| graph.add("get_float1", &[], Some(Value::Text(name.into()))));
|
||||
let one = if literal { graph.add_constant(Value::Float(1.0)) } else { unit };
|
||||
let reciprocal = graph.add("div", &[one, b], None);
|
||||
let quotient = graph.add("div", &[a, reciprocal], None);
|
||||
graph.output = Some(graph.add("vector2", &[quotient, reciprocal], None));
|
||||
let value = compile(&graph, 0).unwrap().evaluate_pixel(&context, &mut EvaluationState::default()).unwrap();
|
||||
assert_eq!(value, Value::Float2([expected, 0x3f8c_c7a2].map(f32::from_bits)), "literal unit {literal}");
|
||||
}
|
||||
}
|
||||
|
||||
#[test]
|
||||
fn pixel_division_keeps_the_original_length_across_vector_and_scalar_calls() {
|
||||
fn call(graph: &mut FunctionGraph, body: FunctionGraph, input: u32, kind: u32, default: Value) -> u32 {
|
||||
let id = graph.add("instance", &[input], None);
|
||||
let node = graph.nodes.last_mut().unwrap();
|
||||
node.instance = Some(materialcraft_core::GraphInstance {
|
||||
graph: "operation".into(),
|
||||
label: String::new(),
|
||||
package: String::new(),
|
||||
inputs: vec![materialcraft_core::GraphPort { identifier: "v".into(), type_code: kind }],
|
||||
outputs: Vec::new(),
|
||||
defaults: BTreeMap::from([("v".into(), default)]),
|
||||
});
|
||||
node.source = Some(Ok(std::sync::Arc::new(body)));
|
||||
id
|
||||
}
|
||||
|
||||
let variables = ["a", "b", "c", "z"]
|
||||
.map(str::to_owned)
|
||||
.into_iter()
|
||||
.zip([0x3f80_d400, 0x3fb2_a18e, 0x3e74_0000, 0x3f80_0000].map(|bits| Value::Float(f32::from_bits(bits))))
|
||||
.collect();
|
||||
let context = EvaluationContext {
|
||||
scope: super::FunctionScope::PixelProcessor,
|
||||
position: [0.5; 2],
|
||||
size: [1.0; 2],
|
||||
images: &[],
|
||||
image_formats: &[],
|
||||
tile: true,
|
||||
variables: &variables,
|
||||
};
|
||||
let mut normalize = FunctionGraph::default();
|
||||
let vector = normalize.add("get_float3", &[], Some(Value::Text("v".into())));
|
||||
let squared = normalize.add("dot", &[vector, vector], None);
|
||||
let length = normalize.add("sqrt", &[squared], None);
|
||||
let one = normalize.add_constant(Value::Float(1.0));
|
||||
let reciprocal = normalize.add("div", &[one, length], None);
|
||||
normalize.output = Some(normalize.add("mulscalar", &[vector, reciprocal], None));
|
||||
|
||||
let mut quotient = FunctionGraph::default();
|
||||
let [a, v] = ["a", "v"].map(|name| quotient.add("get_float1", &[], Some(Value::Text(name.into()))));
|
||||
quotient.output = Some(quotient.add("div", &[a, v], None));
|
||||
for (constant_z, expected) in [(true, 0x3fdf_4c75), (false, 0x3fdf_4c76)] {
|
||||
let mut graph = FunctionGraph::default();
|
||||
let [c, b, z] = ["c", "b", "z"].map(|name| graph.add("get_float1", &[], Some(Value::Text(name.into()))));
|
||||
let xy = graph.add("vector2", &[c, b], None);
|
||||
let z = if constant_z { graph.add_constant(Value::Float(1.0)) } else { z };
|
||||
let xyz = graph.add("vector3", &[xy, z], None);
|
||||
let direction = call(&mut graph, normalize.clone(), xyz, 1024, Value::Float3([0.0; 3]));
|
||||
let den = graph.add("swizzle1", &[direction], Some(Value::Int(2)));
|
||||
let result = call(&mut graph, quotient.clone(), den, 256, Value::Float(0.0));
|
||||
graph.output = Some(graph.add("vector2", &[result, den], None));
|
||||
let value = compile(&graph, 0).unwrap().evaluate_pixel(&context, &mut EvaluationState::default()).unwrap();
|
||||
assert_eq!(value, Value::Float2([expected, 0x3f13_b1cf].map(f32::from_bits)), "constant Z {constant_z}");
|
||||
}
|
||||
}
|
||||
@@ -59,6 +59,29 @@ The first pass classifies all 546 roots: 166 Parity and 380 Too hard. These meas
|
||||
|
||||
## 2026-11-22 root comparisons
|
||||
|
||||
### Reciprocal division through pixel function calls
|
||||
|
||||
The two eighth specular passes divide a lighting term by the Z component of a normalized direction. Returning the environment lookup alone matched the 128-pixel scanline through (62,57) of the second pass. Returning the scalar lighting quotient exposed a rounding difference. Both operands matched at that pixel. In a separate original graph, the pixel expression `A / (1 / B)` reproduced A × B throughout the signed field. At (1,0) the inputs have F32 words `40763400` and `3f68c2ba`. A separate read of the inner reciprocal returns `3f8cc7a2`. The outer quotient returns `405fda66`. Supplying the one from a sampled channel returns `405fda65`. The latter control matched before the change.
|
||||
|
||||
The pixel evaluator now retains the original factor through scalar calls, vector construction, component selection and multiplication by a literal unit lane. Other readers of the reciprocal receive its rounded value. A sole downstream add or subtract can contract with the resulting product. The original operands still evaluate in graph order. The two measured roots use their existing SBS operations. Loop-carried reciprocal factors remain unmeasured.
|
||||
|
||||
Use a nearest-filtered four-channel F32 procedural input. Number pixels in row-major order from zero and number the fields j = 0, 1, 2. Use sizes 64 × 32, 32 × 64 and 64², with seeds 364801 + 31j. Let m be the low 32 bits of 747796405i + 2891336453 + 997j. Red is ((1103515245i + 53719 + 57j) mod 65521)/8192 − 4. For green, combine the low 23 bits of m with exponent field 126 + ((m >> 22) mod 3). In field two use 1 + (m mod 131071)/16777216 instead. Blue is (((m >> 8) mod 257) − 128)/512. Alpha is one. At the first size, render in F32, U8, U16 and F16. Render the other sizes in F32 and return to the original F32 setting.
|
||||
|
||||
For the direct graphs, pack the quotient, its denominator, the underlying factor and red into RGBA. Compare ordinary division with a unit reciprocal, a connected Dot inside the expression, multiplication by one or two, a sampled numerator of one, a squared or square-root divisor, two equivalent vector-pack controls, normalization with Z equal to one or one plus blue, a reciprocal numerator of .625, and the sum of two quotients. For the call graphs, move the inverse, the division or both into reusable functions. Normalize (blue, green, Z) in a function and pass its Z lane to a scalar division function. Compare literal Z against sampled alpha. Also add two called quotients, add or subtract blue, and expose an additional read of the quotient in the sum graph. At 64 × 32 the sole-read sum matched all 2,048 fused results. The shared sum matched all 2,048 separately rounded results. For the two called quotients, contracting the left product matched all 2,048 pixels.
|
||||
|
||||
| Graphs and comparisons | Renders | U8 exact / total · max | U16 exact / total · max | F16 exact / total · max | F32 exact / total · max |
|
||||
|---|---:|---:|---:|---:|---:|
|
||||
| 14 direct graphs, previous cook | 98 | 28,672/28,672 · 0 | 28,670/28,672 · 1 | 28,671/28,672 · 0.001953125 | 130,734/143,360 · 3.81469726562e-06 |
|
||||
| 14 direct graphs, corrected cook | 98 | 28,672/28,672 · 0 | 28,672/28,672 · 0 | 28,672/28,672 · 0 | 143,360/143,360 · 0 |
|
||||
| 9 call and arithmetic controls, previous cook | 63 | 18,432/18,432 · 0 | 18,430/18,432 · 1 | 18,429/18,432 · 0.00390625 | 81,058/92,160 · 1.90734863281e-06 |
|
||||
| 9 call and arithmetic controls, corrected cook | 63 | 18,432/18,432 · 0 | 18,432/18,432 · 0 | 18,432/18,432 · 0 | 92,160/92,160 · 0 |
|
||||
| 8 saved graphs reopened in both applications | 56 | 16,384/16,384 · 0 | 16,384/16,384 · 0 | 16,384/16,384 · 0 | 81,920/81,920 · 0 |
|
||||
| 3 signed boundary controls | 18 | 1,536/1,536 · 0 | 1,536/1,536 · 0 | 1,536/1,536 · 0 | 4,608/4,608 · 0 |
|
||||
|
||||
The saved graphs cover the simple reciprocal, packed lane, sampled one, two reads, both operations in calls, both normalization inputs and the sum of two calls. The reference also reproduced its original 131,072 pixels after reopening. For the boundary controls use the quotient, a direct product and a sampled-unit numerator at 32 × 16 and 16 × 32. Cycle green through both signs of the F32 magnitudes `00000000 00000001 007fffff 00800000 00800001 3f68c2ba 3f800000 3f801001 40000000 7d7fffff 7e800000 7f000000 7f7fffff`. Select the magnitude at index (i + 5j) mod 13 and flip its sign on alternate blocks of 13 pixels. Select red from +0, −0, 1, −1, 1.53247, −.8125, .0003771 and 259.3 at index (floor(i/26) + j) mod 8. Return self-equality, equality to zero, less than zero and the value clamped to [−256,256]. Use seeds 367811 and 367842, all four formats at the first size, F32 at the second, then repeat the first F32 setting. The reference quotient and product also matched one another across all 3,072 boundary pixels.
|
||||
|
||||
For the specular controls, retain the initial assignments and the first n contributions for n = 0 through 8. Preserve the original normalization after the sum. At 128² read every pixel of row 36 in pass 396 with the changed controls, and row 57 in pass 408 with the default controls. Both full eight-contribution reference buffers reproduced the original intermediate, 16,384/16,384 per graph. The corrected scanlines match 1,152/1,152 pixels per graph over the nine prefixes. The previous counts were 1,064/1,152, maximum 5.96046447754e−8, and 1,075/1,152, maximum 1.19209289551e−7, respectively. The changed 128² F16 root 396 scores **16,384/16,384 · 0**. The default 128² F16 root 408 scores **16,384/16,384 · 0**. The earlier full-size matrix includes additional seeds and 256² renders. [Original fields and half-precision differences](#rectangular-inputs-and-remaining-half-float-pixels-in-the-eighth-specular-passes)
|
||||
|
||||
### Patterns with an explicit reference worker count
|
||||
|
||||
The desktop process affinity and the worker count chosen by the standalone renderer select different execution conditions. For the latter, use Direct3D 11, publish the normally saved SBS with optimization disabled, expose random seed, and inherit the graph seed from the render request. Set the final filter to the desired storage precision before publishing each of the four variants. Request the graph output as a 32-bit floating-point TIFF and convert back to its declared storage for comparison. Integer maxima are stored levels. For floating-point images compare component bit patterns and report absolute error. [Overlap repeatability and desktop property inspection](#worker-count-and-repeatability-of-overlapping-patterns)
|
||||
|
||||
@@ -37,6 +37,8 @@ Statuses: **Not checked**, **In progress**, **Parity** (exact pixels or typed va
|
||||
|
||||
The first pass covered all **546 roots**, with **166 Parity** and **380 Too hard**. The current inventory has **475 Parity**, **71 In progress** and **0 Too hard**. The November 17–22 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) · [November 20 measurements](parity-fixes.md#2026-11-20-root-comparisons) · [November 21 measurements](parity-fixes.md#2026-11-21-root-comparisons) · [November 22 measurements](parity-fixes.md#2026-11-22-root-comparisons)
|
||||
|
||||
In the two eighth specular passes, the corrected pixel arithmetic matched all 2,304 scanline pixels across zero through eight contributions. The changed 128² pass 396 scores 16,384/16,384 · 0 in F16 and the default 128² pass 408 scores 16,384/16,384 · 0. All 376,832 pixels in the direct and reusable function graphs match, as do all 131,072 reopened pixels. [Raw counts and procedural inputs](parity-fixes.md#reciprocal-division-through-pixel-function-calls)
|
||||
|
||||
Across five whole spots and cloud graphs, ordinary Quadrant traversal matched 1,803,008/1,803,008 pixels on the explicit one-worker renderer. The current cook matched 1,797,291/1,803,008 pixels against the desktop. Repeated eight-worker renders differed on identical settings. [Whole graphs, generator readouts and repeat counts](parity-fixes.md#patterns-with-an-explicit-reference-worker-count)
|
||||
|
||||
Each of ten corrected scalar-luminosity saves opened in the reference app. The two applications matched all 14,080 reopened grayscale and color pixels. [Scalar Quadrant luminosity in saved packages](parity-fixes.md#scalar-quadrant-luminosity-in-saved-packages)
|
||||
@@ -525,7 +527,7 @@ Creased matches 10,947,840/10,947,840 pixels across 100 distinct settings throug
|
||||
| [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 · 124,769/124,928 pixels and 26/26 wired or default pass indices](parity-fixes.md#irradiance-with-a-connected-pass-index) |
|
||||
| [pbr_render.sbs/raytraced_specular_pass_8](../assets/sbs/pbr_render.sbs) | 9 | Yes | [In progress · 142,335/142,340 pixels, five F16 differences](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) |
|
||||
| [pbr_render.sbs/raytraced_specular_pass_8](../assets/sbs/pbr_render.sbs) | 9 | Yes | [In progress · 142,335/142,340 pixels, five F16 differences](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) |
|
||||
| [pbr_render2.sbs/chroma_shift](../assets/sbs/pbr_render2.sbs) | 1 | Yes | [Parity · 13 cases, 163,840 exact pixels](parity-fixes.md#height-distance-texture-mapping-skew-and-weave) |
|
||||
@@ -537,7 +539,7 @@ Creased matches 10,947,840/10,947,840 pixels across 100 distinct settings throug
|
||||
| [pbr_render2.sbs/position_to_normal](../assets/sbs/pbr_render2.sbs) | 2 | Yes | [Parity · 30 renders, all 515,328 RGBA pixels exact](parity-fixes.md#position-to-normal-outputs-in-both-renderers) |
|
||||
| [pbr_render2.sbs/raytrace_position](../assets/sbs/pbr_render2.sbs) | 4 | Yes | [Parity · 26 renders, all 142,340 RGBA pixels exact](parity-fixes.md#small-graph-parents-and-raytrace-positions) |
|
||||
| [pbr_render2.sbs/raytraced_irradiance_is_pass_8](../assets/sbs/pbr_render2.sbs) | 9 | Yes | [Parity · 18 renders, 136,704 exact RGBA pixels](parity-fixes.md#material-bundles-and-the-eighth-irradiance-pass) |
|
||||
| [pbr_render2.sbs/raytraced_specular_pass_8](../assets/sbs/pbr_render2.sbs) | 9 | Yes | [In progress · 142,337/142,340 pixels, three F16 differences](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) |
|
||||
| [pbr_render2.sbs/raytraced_specular_pass_8](../assets/sbs/pbr_render2.sbs) | 9 | Yes | [In progress · 142,337/142,340 pixels, three F16 differences](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/sat/sat_iteration](../assets/sbs/pbr_render2.sbs) | 1 | Yes | [Parity: 4 cases](parity-fixes.md#verified-cases) |
|
||||
| [pbr_render_ortho.sbs/blue_noise](../assets/sbs/pbr_render_ortho.sbs) | 0 | Yes | [Parity · 285,184 exact pixels in 38 renders](parity-fixes.md#shared-lookups-and-environment-shadow-pass) |
|
||||
| [pbr_render_ortho.sbs/environment_map_rescale](../assets/sbs/pbr_render_ortho.sbs) | 1 | Yes | [Parity · 171,264 exact pixels in 18 renders](parity-fixes.md#centered-transform-resizing-and-untiled-edges) |
|
||||
|
||||
Reference in new issue
Block a user