Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 5 additions & 0 deletions crates/automation/tests/it/main.rs
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
//! One integration-test executable avoids linking the same dependencies for every feature.

mod normal_maps;
mod package_files;
mod view_settings;
1 change: 1 addition & 0 deletions crates/engine/tests/it/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,7 @@ mod node_library;
mod normal_maps;
mod open_documents;
mod optimization_perf;
mod package_resources;
mod parameter_functions;
mod pattern_graph;
mod perf;
Expand Down
7 changes: 7 additions & 0 deletions crates/eval/tests/it/main.rs
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
//! One integration-test executable avoids linking the same dependencies for every feature.

mod filter_tiling;
mod instance_image_properties;
mod instance_pixel_size;
mod pattern_opacity;
mod seed_arithmetic;
Original file line number Diff line number Diff line change
Expand Up @@ -123,7 +123,7 @@ fn supplied_function_package_round_trip() {
assert!(read.warnings.is_empty(), "{:?}", read.warnings);
assert!(read.pkg.graphs.iter().all(|graph| graph.function.as_ref().is_some_and(|function| !function.nodes.is_empty())));
let saved = read_sbs(&write_sbs(&read.pkg).unwrap(), "saved.sbs", &|_| None).unwrap();
let bundled = read_sbs(include_bytes!("../../../assets/sbs/functions.sbs"), "functions.sbs", &|_| None).unwrap();
let bundled = read_sbs(include_bytes!("../../../../assets/sbs/functions.sbs"), "functions.sbs", &|_| None).unwrap();
assert!(saved.warnings.is_empty(), "{:?}", saved.warnings);
assert!(bundled.warnings.is_empty(), "{:?}", bundled.warnings);
assert_eq!(read.pkg.graphs.len(), 171);
Expand Down Expand Up @@ -220,7 +220,7 @@ fn bundled_vector_equality_compares_each_lane() {

#[test]
fn bundled_library_has_complete_bodies_and_current_export_metadata() {
let bytes = include_bytes!("../../../assets/sbs/functions.sbs");
let bytes = include_bytes!("../../../../assets/sbs/functions.sbs");
let read = read_sbs(bytes, "functions.sbs", &|_| None).unwrap();
let xml = roxmltree::Document::parse(std::str::from_utf8(bytes).unwrap()).unwrap();

Expand Down
16 changes: 16 additions & 0 deletions crates/formats/tests/it/main.rs
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
//! One integration-test executable avoids linking the same dependencies for every feature.

mod bitmap_imports;
mod curve_tables;
mod explorer_folders;
mod font_fallback;
mod foreign_resources;
mod function_library;
mod fx_map_roughness;
mod gradient_values;
mod graph_attributes;
mod library_native_ports;
mod parity_function_loop;
mod parity_input_defaults;
mod project_packages;
mod resource_replacements;
File renamed without changes.
8 changes: 8 additions & 0 deletions crates/nodes/tests/it/main.rs
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
//! One integration-test executable avoids linking the same dependencies for every feature.

mod atomic_filter_parity;
mod brick_primitives;
mod distance;
mod fx_map_opacity;
mod fx_map_regions;
mod parity_unconnected;
Original file line number Diff line number Diff line change
Expand Up @@ -14,8 +14,8 @@ fn finish_args(manifest: &str) -> Vec<&str> {
#[test]
fn flatpak_update_permissions() {
let manifests = [
include_str!("../../../packaging/linux/flatpak/ai.storyteller.MaterialCraft.bundle.yml"),
include_str!("../../../packaging/linux/flatpak/ai.storyteller.MaterialCraft.yml"),
include_str!("../../../../packaging/linux/flatpak/ai.storyteller.MaterialCraft.bundle.yml"),
include_str!("../../../../packaging/linux/flatpak/ai.storyteller.MaterialCraft.yml"),
];
let args = manifests.map(finish_args);
assert_eq!(args[0], args[1], "source and release permissions must agree");
Expand Down
1 change: 1 addition & 0 deletions crates/ui-egui/tests/it/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ mod canvas_focus;
mod clipboard_shortcuts;
mod dialogs;
mod export_window;
mod flatpak_updates;
mod graph_properties;
mod interface_scale;
mod menu_bar;
Expand Down
4 changes: 2 additions & 2 deletions docs/atomic-parity-improvements.md
Original file line number Diff line number Diff line change
Expand Up @@ -30,8 +30,8 @@ Local tests cover fractional filter footprints, directional extent, sharpen gain
Float32 cancellation, rectangular images, independent tiling and cache invalidation,
gray/color channel selection, signed-selector round trips and transparent backgrounds:

- [Filter and channel tests](../crates/nodes/tests/atomic_filter_parity.rs)
- [Tiling and cache tests](../crates/eval/tests/filter_tiling.rs)
- [Filter and channel tests](../crates/nodes/tests/it/atomic_filter_parity.rs)
- [Tiling and cache tests](../crates/eval/tests/it/filter_tiling.rs)
- [SBS round-trip tests](../crates/formats/src/sbs/tests.rs)

Save/load fixtures use explicit blur strengths and compatible background kinds so their
Expand Down
8 changes: 4 additions & 4 deletions docs/parity-fixes.md
Original file line number Diff line number Diff line change
Expand Up @@ -3788,7 +3788,7 @@ The closed-Switch regression returned zero in place of 2⁻²⁵ before the chan

### Published filter properties upstream of a quadrant draw

Connect each of six filters to the unused pattern image socket of the [four-square first-read probe](#connected-image-properties-and-the-first-quadrant-draw). Supply a fixed white Uniform where the filter takes an image. Use a per-pixel function returning .5, a Transform 2D offset of (0,0), grayscale weights (1,0,0,0), a Directional Blur angle of .25, a Levels input low of zero or Warp intensity zero. Make two graphs per filter. In one, compute the value entirely from constants. In the other, add zero times the published scalar to each component. The fixed graph draws .375 in all four quadrants. A published drawing input changes the first quadrant to .625 even when the filter returns identical pixels. The evaluator carries the property read through the image output and its cache entry. The Pixel Processor reports the reads of the same compiled function that produces its pixels. [Parameter evaluation](../crates/eval/src/parameter.rs) · [Pixel function](../crates/nodes/src/function/processor.rs) · [Cache and sampling-mode regressions](../crates/eval/tests/pattern_opacity.rs)
Connect each of six filters to the unused pattern image socket of the [four-square first-read probe](#connected-image-properties-and-the-first-quadrant-draw). Supply a fixed white Uniform where the filter takes an image. Use a per-pixel function returning .5, a Transform 2D offset of (0,0), grayscale weights (1,0,0,0), a Directional Blur angle of .25, a Levels input low of zero or Warp intensity zero. Make two graphs per filter. In one, compute the value entirely from constants. In the other, add zero times the published scalar to each component. The fixed graph draws .375 in all four quadrants. A published drawing input changes the first quadrant to .625 even when the filter returns identical pixels. The evaluator carries the property read through the image output and its cache entry. The Pixel Processor reports the reads of the same compiled function that produces its pixels. [Parameter evaluation](../crates/eval/src/parameter.rs) · [Pixel function](../crates/nodes/src/function/processor.rs) · [Cache and sampling-mode regressions](../crates/eval/tests/it/pattern_opacity.rs)

Render the twelve graphs at 16 × 32 F32, 32 × 16 U8, 32² F16 and 16² U16 with seeds 41671, 41684, 41697 and 41710 respectively. Use the published default .8125 in F32 and F16 and change it to .3125 in U8 and U16. Save each graph normally in MaterialCraft, reopen the SBS in both applications and compare again. The original and reopened reference bits agree across all 48 settings.

Expand Down Expand Up @@ -3841,7 +3841,7 @@ The two-square regression first returned zero in place of 2⁻²⁵. All 506 rel

### Connected image properties and the first quadrant draw

Connect a white Uniform to the pattern socket of the [four-square writable-float graph](#first-reads-of-writable-quadrant-floats). Use square mode so the draw does not sample this socket. Give each component of the Uniform the value one plus zero times the published scalar. The first square contributes .625, and the other three contribute .375. Replacing the Uniform with literal white, computing white entirely from constants or disconnecting it gives four .375 contributions. A Uniform with a published output-size offset of zero reproduces the first result. The evaluator carries this dependency through connected image outputs and includes it in the cook cache. [Graph evaluator](../crates/eval/src/node_execution.rs) · [Cache regression](../crates/eval/tests/pattern_opacity.rs)
Connect a white Uniform to the pattern socket of the [four-square writable-float graph](#first-reads-of-writable-quadrant-floats). Use square mode so the draw does not sample this socket. Give each component of the Uniform the value one plus zero times the published scalar. The first square contributes .625, and the other three contribute .375. Replacing the Uniform with literal white, computing white entirely from constants or disconnecting it gives four .375 contributions. A Uniform with a published output-size offset of zero reproduces the first result. The evaluator carries this dependency through connected image outputs and includes it in the cook cache. [Graph evaluator](../crates/eval/src/node_execution.rs) · [Cache regression](../crates/eval/tests/it/pattern_opacity.rs)

Use eight original graphs. Connect the live Uniform to the pattern and background sockets in turn. Use the literal and disconnected controls on the pattern socket. Insert a zero-intensity Blur after the live Uniform, then test a Blend whose opacity evaluates to one from a published input and whose source is fixed. For the last two graphs, connect another FX-Map whose square luminosity or outer opacity evaluates to one from that input. Render all eight with default .8125 at 16 × 32 F32 and 32² F16, and changed .3125 at 32 × 16 U8 and 16² U16. The respective seeds in table order are 41671, 41684, 41697 and 41710. Save each graph normally in MaterialCraft and repeat the measurements on the reopened graph in the reference desktop.

Expand Down Expand Up @@ -3871,7 +3871,7 @@ Use the eleven [tint and blend configurations](#undefined-components-in-a-comput
| F16 | 768/2,816 | 2,816/2,816 | .25 | 0 |
| F32 | 768/2,816 | 2,816/2,816 | .25 | 0 |

The previous F16 and F32 results each had 768 differing nonfinite channels. All stored floating-point channels now match. Independently save each original in MaterialCraft and reopen it in the reference desktop. The original and reopened reference outputs agree on all 16,896 pixels. The five [nested caller configurations](#writable-first-reads-through-graph-instances) now match all 3,840 original and all 3,840 reopened F32 pixels, maximum zero in both sets. Changing only the origin of an opacity value of one also changes the first square when reusing the cook cache. [Cache regression](../crates/eval/tests/pattern_opacity.rs)
The previous F16 and F32 results each had 768 differing nonfinite channels. All stored floating-point channels now match. Independently save each original in MaterialCraft and reopen it in the reference desktop. The original and reopened reference outputs agree on all 16,896 pixels. The five [nested caller configurations](#writable-first-reads-through-graph-instances) now match all 3,840 original and all 3,840 reopened F32 pixels, maximum zero in both sets. Changing only the origin of an opacity value of one also changes the first square when reusing the cook cache. [Cache regression](../crates/eval/tests/it/pattern_opacity.rs)

For the component-width control, store the local plus a zero vector and start luminosity at .125. For each component unequal to itself, add 1/32, 2/32, 4/32 or 8/32 according to its position. Compare fixed opacity one with opacity one plus zero times a published input. The scalar, float2 and float3 cases match all 4,608 F32 pixels, maximum zero. The live float4 case still matches 0/768, maximum .21875. The fourth component can retain a finite value across reference cooks. The two integer controls match 0/1,536 with maximum .75. These initial values remain open.

Expand Down Expand Up @@ -4200,7 +4200,7 @@ Across three interleaved single-processor release runs per build, median process

### Runtime scalar arithmetic in graph and node seeds

A graph or node can compute its random seed from a caller's parameters. Converting a driven float to a seed preserves the 32-bit representation of its floored value. For example, a width of 16 supplies `0x41800000`. Runtime scalar addition in a seed expression adds the operand words modulo 2³². With .75 and .25 the resulting word is `0x7dc00000`. Subtraction and multiplication in the measured expressions use ordinary float arithmetic. A folded conversion of the constant −1.5 returns the integer −2. The shared evaluator now selects these operations when evaluating a base random seed. [Regression covering both seed properties](../crates/eval/tests/seed_arithmetic.rs)
A graph or node can compute its random seed from a caller's parameters. Converting a driven float to a seed preserves the 32-bit representation of its floored value. For example, a width of 16 supplies `0x41800000`. Runtime scalar addition in a seed expression adds the operand words modulo 2³². With .75 and .25 the resulting word is `0x7dc00000`. Subtraction and multiplication in the measured expressions use ordinary float arithmetic. A folded conversion of the constant −1.5 returns the integer −2. The shared evaluator now selects these operations when evaluating a base random seed. [Regression covering both seed properties](../crates/eval/tests/it/seed_arithmetic.rs)

To reproduce the direct measurement, feed two exposed floats from a parent to a child. Use the first operand, their sum, their difference or their product, followed by a scalar float-to-integer conversion. Apply the result to the graph or to a grayscale F32 Pixel Processor returning Random(1). Compare all 256 stored pixels at 16² for (.75,.25), (1.75,.25), (−.25,.5), (−1.25,−.5), (5.125,1), (16,1), (32,2) and (0,−1). Each seed property matches **8,192/8,192 pixels**, maximum zero. Return the same expressions through a typed Value Processor, an integer instance argument and a float instance argument. Each matches 32/32 typed results, maximum zero.

Expand Down
4 changes: 3 additions & 1 deletion docs/testing-ci.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,9 @@ The engine and UI integration tests share one `it` executable per crate. This
avoids compiling and linking the same crate dependencies into a separate
executable for every feature. Feature modules keep their own helpers and tests.
When adding a file under `tests/it/`, register it with `mod name;` in that
folder's `main.rs` so Cargo runs it.
folder's `main.rs` so Cargo runs it. The `automation`, `eval`, `formats` and
`nodes` crates follow the same layout; `render` keeps its single integration
test file as it is.

Run a feature module with a test-name filter, for example:

Expand Down