Check authored integer constants separately from cooked port values

This commit is contained in:
chasse20 committed 2026-11-19 02:50:08 -05:00
1 parent 93e4ed74e0
commit 18ab27631d
3 files changed
+11 -3

No files matched your search

+9 -1
View File
@@ -132,7 +132,15 @@ fn native_value_types_survive_processors_and_sbs() {
let mut session = Session::new(read.pkg);
session.preview_size = Some(16);
session.cook();
for (node, expected) in session.graph().unwrap().nodes.iter().zip(values) {
for (node, authored) in session.graph().unwrap().nodes.iter().zip(values) {
let Some(Value::Function(function)) = node.params.get("function") else { panic!("missing value function") };
let constant = function.node(function.output.unwrap()).unwrap();
assert_eq!(constant.value.as_ref(), Some(&authored));
let expected = match authored {
Value::Int(16_777_217) => Value::Int(16_777_216),
Value::Int2([i32::MIN, i32::MAX]) => Value::Int2([i32::MIN, i32::MIN]),
value => value,
};
assert_eq!(session.cooked.value(node.id, 0), Some(&expected), "{:?}", session.cooked.nodes[&node.id].error);
}
}
+1 -1
View File
@@ -727,7 +727,7 @@ On an independently authored blend with scalar inputs H₁ and H₂, compare the
### Stored integer value outputs
The four-integer root matches **41/41 typed vectors**, maximum absolute component error zero. A stored graph input of (−31,0,1,2147483647) cooks to (−31,0,1,−2147483648). Independent scalar, two-, three- and four-component processors matched **132/132 typed results** across immediate constants and direct input reads. In 32 input cases per width, the reference app’s value constructor and graph property preserved all 320 requested integer lanes. At the processor and graph output ports, all 320 matched rounding to binary32 followed by conversion back to signed 32-bit integer. The positive endpoint rounds to 2³¹ and stores −2³¹. For example, 16777217 stores 16777216, −16777219 stores −16777220, and 2147483583 stores 2147483520. The regression checks uncached and cached outputs at all four widths.
The four-integer root matches **41/41 typed vectors**, maximum absolute component error zero. A stored graph input of (−31,0,1,2147483647) cooks to (−31,0,1,−2147483648). Independent scalar, two-, three- and four-component processors matched **132/132 typed results** across immediate constants and direct input reads. In 32 input cases per width, the reference app’s value constructor and graph property preserved all 320 requested integer lanes. At the processor and graph output ports, all 320 matched rounding to binary32 followed by conversion back to signed 32-bit integer. The positive endpoint rounds to 2³¹ and stores −2³¹. For example, 16777217 stores 16777216, −16777219 stores −16777220, and 2147483583 stores 2147483520. The regression checks uncached and cached outputs at all four widths. A MaterialCraft save and reload also preserves all ten authored constant values across scalar and vector integers, floats, Boolean and text. After reopening, the authored integer 16777217 is intact and its cooked output is 16777216. The authored pair (−2147483648,2147483647) is intact and both cooked lanes are −2147483648.
For the 32 boundary cases let T=2²⁴ and M=2³¹. In order, take 0, 1, −1, 257, 65537, −65537, 2²³+1, T−1, T, T+1, T+2, T+3, −T−1, −T−3, 2²⁵+1, 2²⁵+3, 2³⁰+1, M−258, M−193, M−192, M−191, M−129, M−128, M−65, M−64, M−63, M−3, M−2, M−1, −M, −M+1 and −M+65. In case j, fill lane c from index (j+7c) mod 32. Cycle parent sides 16/32/64/128 and requested U8/F16/U16/F32 with seed 29+37j. All outputs report their integer type. Also cook defaults at 16² and the first d components of (M−1,T+1,−T−3,−M+1) as a literal at 32², seed 83. The three existing scalar, two- and three-integer root cases per width also still match.
+1 -1
View File
@@ -162,7 +162,7 @@ The first pass covered all **546 roots**, with **166 Parity** and **380 Too hard
| [constant_values.sbs/integer/constant_integer](../assets/sbs/constant_values.sbs) | 0 | No | [Parity: 3 typed values](parity-fixes.md#verified-cases) |
| [constant_values.sbs/integer/constant_integer2](../assets/sbs/constant_values.sbs) | 0 | No | [Parity: 3 typed values](parity-fixes.md#verified-cases) |
| [constant_values.sbs/integer/constant_integer3](../assets/sbs/constant_values.sbs) | 0 | No | [Parity: 3 typed values](parity-fixes.md#verified-cases) |
| [constant_values.sbs/integer/constant_integer4](../assets/sbs/constant_values.sbs) | 0 | No | [Parity · 41 typed vectors, all components exact](parity-fixes.md#stored-integer-value-outputs) |
| [constant_values.sbs/integer/constant_integer4](../assets/sbs/constant_values.sbs) | 0 | No | [Parity · 41 exact typed vectors, authored constants checked on reload](parity-fixes.md#stored-integer-value-outputs) |
| [contrast_luminosity.sbs/contrast_luminosity](../assets/sbs/contrast_luminosity.sbs) | 1 | No | [Parity: 4 cases](parity-fixes.md#verified-cases) |
| [contrast_luminosity.sbs/contrast_luminosity_grayscale](../assets/sbs/contrast_luminosity.sbs) | 1 | No | [Parity: 4 cases](parity-fixes.md#verified-cases) |
| [creased.sbs/creased](../assets/sbs/creased.sbs) | 0 | Yes | [In progress · 19 renders, 243/172,288 exact pixels](parity-fixes.md#filtering-unequal-inputs-to-a-blend) |