Preserve quadrant draw order when every stamp has one copy

This commit is contained in:
chasse20 committed 2026-11-26 19:35:58 -05:00
1 parent b65a40cdd3
commit f11445f73a
5 files changed
+57 -2

No files matched your search

+3 -1
View File
@@ -388,7 +388,9 @@ impl MixedDepthRuns {
return None;
}
if self.deepest == 9 && self.trees == 1 {
if !self.single_tree_window {
// Every recorded draw has at least one copy. A wider window keeps the same
// batch boundaries when none of those draws crosses a tiling edge.
if !self.single_tree_window && self.copies.as_ref().is_none_or(|copies| copies.copy_count() != self.draws) {
return None;
}
// Only a continuation splits this run. Rejoin the two retained
+10
View File
@@ -689,6 +689,16 @@ fn single_branch_controls_keep_the_order_of_a_complete_nine_level_tree() {
assert_eq!(samples, [0.0, tiny, tiny, 0.0], "one active tree through both iterators");
}
#[test]
fn a_larger_tiled_window_keeps_the_draw_order_when_each_stamp_has_one_copy() {
let variables = BTreeMap::from([("$tiling".into(), Value::Int(3))]);
let window = [-0.5, 1.5, -0.5, 1.5];
let image = cook_in_regions(gated_mixed_depth_tree(true), &variables, 188119, [256; 2], [window; 2], 1.0).unwrap().remove(0);
let samples = [(64, 64), (72, 64), (64, 80), (80, 64)].map(|(x, y)| image.get_gray(x, y, false));
let tiny = f32::EPSILON * 0.25;
assert_eq!(samples, [0.0, tiny, tiny, 0.0]);
}
fn draw_white_image(mut graph: PatternGraph, filter: i32, axes: i32) -> craft_texture::Image {
use craft_texture::Image;
+4
View File
@@ -82,6 +82,10 @@ impl TileCopies {
self.axes == [true; 2]
}
pub(super) fn copy_count(&self) -> usize {
self.positions.total as usize
}
pub(super) fn begin_inactive_subtree(&mut self, trees: usize) -> bool {
if self.subtree_ends.len() >= trees * inactive_children::SUBTREES_PER_TREE {
return false;
+37
View File
@@ -59,6 +59,43 @@ The first pass classifies all 546 roots: 166 Parity and 380 Too hard. These meas
## 2026-11-26 root comparisons
### A complete quadrant tree with one physical copy per draw
A single nine-level tree keeps the same submission order when a larger tiled window contains each draw once. The earlier evaluator used the window coordinates to select this order. It now also checks how many physical copies the draws produced in the common render and tiling region. A retained or discarded drawing stamp contributes at least one copy to this count.
In the [two square Noise Dirt 5 comparisons](#shared-branch-expressions-and-all-sixty-noise-dirt-5-renders), expose the FX-Map alongside Levels and set the FX-Map output to F32. At 32 × 32 use seed 113. At 64 × 64 use seed 42. Use scale 2, disorder .37 and the default expansion setting. Put an integer Minimum after the outer iteration count and keep its original calculation and connections. A cap of one emits one complete tree. Four emits two trees and eight reproduces the complete original local FX-Map buffer at both sizes. The render and tiling regions both run from −.5 to 1.5 on each axis.
| Cap · size | Earlier on one processor | Corrected on one | Corrected on eight | Ordinary save on one |
|---|---:|---:|---:|---:|
| 1 · 32 × 32 | 1,009/1,024 · 1.1920929e-07 | 1,024/1,024 · 0 | 1,004/1,024 · 1.1920929e-07 | 1,024/1,024 · 0 |
| 1 · 64 × 64 | 4,031/4,096 · 1.1920929e-07 | 4,096/4,096 · 0 | 3,990/4,096 · 1.1920929e-07 | 4,096/4,096 · 0 |
| 4 · 32 × 32 | 996/1,024 · 1.1920929e-07 | 996/1,024 · 1.1920929e-07 | 982/1,024 · 5.96046448e-08 | 996/1,024 · 1.1920929e-07 |
| 4 · 64 × 64 | 3,976/4,096 · 1.1920929e-07 | 3,976/4,096 · 1.1920929e-07 | 3,937/4,096 · 1.1920929e-07 | 3,976/4,096 · 1.1920929e-07 |
Each entry gives exact pixels / pixels compared and maximum absolute F32 error. The one-tree controls each have 344,064 draws and 344,064 physical copies before removing stamps that miss every sample. Their one-processor totals improve from 5,040/5,120 to 5,120/5,120. The ordinary saves also match all 5,120. Both two-tree local buffers retain their previous hashes. They contain 889 and 868 additional copies, respectively. Each reopened local FX-Map and Levels output matches its original. Both builds write byte-identical ordinary saves for these controls.
For an independent comparison, use the [nine-level additive square construction](#single-branch-controls-in-complete-quadrant-trees) on white with only outer repetition 3 active. Use the same render and tiling window, with both tiling axes enabled except in the last row. At 256 × 256 use the first and second F32 gain settings, seeds 188119 and 188156. At 128 × 64 use the first gain setting with seed 292177 in F32 and U16. Reopen an ordinary save in both applications. At (72,64) and (64,80) in the centered 256 × 256 first setting, the earlier evaluator returned zero. The corrected release and the one-processor reference return 2⁻²⁵. At (64,64) and (80,64) both return zero.
Each cell gives exact pixels / total, then the maximum F32 and U16 errors for its four settings.
| X window · Y window | Earlier on one processor | Corrected on one | Earlier on eight | Corrected on eight | Ordinary save on one |
|---|---:|---:|---:|---:|---:|
| −.5 to 1.5 · −.5 to 1.5 | 146,368/147,456 · 2.98023224e-08 / 0 | 147,456/147,456 · 0 / 0 | 147,336/147,456 · 2.98023224e-08 / 0 | 146,248/147,456 · 2.98023224e-08 / 0 | 147,456/147,456 · 0 / 0 |
| −.25 to 1.75 · −.25 to 1.75 | 146,368/147,456 · 2.98023224e-08 / 0 | 147,456/147,456 · 0 / 0 | 147,392/147,456 · 2.98023224e-08 / 0 | 146,432/147,456 · 2.98023224e-08 / 0 | 147,456/147,456 · 0 / 0 |
| −.5 to 1.5 · −1.5 to 2.5 | 147,456/147,456 · 0 / 0 | 147,456/147,456 · 0 / 0 | 147,456/147,456 · 0 / 0 | 147,456/147,456 · 0 / 0 | 147,456/147,456 · 0 / 0 |
| −.25 to .75 · −.5 to 1.5 | 145,280/147,456 · 2.98023224e-08 / 0 | 147,456/147,456 · 0 / 0 | 147,456/147,456 · 0 / 0 | 145,280/147,456 · 2.98023224e-08 / 0 | 147,456/147,456 · 0 / 0 |
| −.5 to 1.5 · −.5 to 1.5, tiling off | 147,456/147,456 · 0 / 0 | 147,456/147,456 · 0 / 0 | 146,624/147,456 · 2.98023224e-08 / 0 | 146,624/147,456 · 2.98023224e-08 / 0 | 147,456/147,456 · 0 / 0 |
All 20 corrected one-processor originals and all 20 ordinary saves match, 737,280/737,280 on each route, up from 732,928 on the original. Against the eight-processor captures the earlier total is 736,264/737,280 and the corrected total is 732,040/737,280. The centered, shifted and narrower-X rows lose exact pixels on this comparison.
Repeat both large F32 settings in those three windows twice more on eight processors and once more on one, reversing the case order. Across the six settings the three eight-processor reads agree at 390,788 pixels. The earlier release matches 390,788 of these and the corrected release 388,044. In the narrower-X window all three eight-processor buffers reproduce the earlier release. They differ from the one-processor output at 1,152 pixels with seed 188119 and 1,024 with seed 188156. Across the original, reopened and repeated reads on both processor counts, 388,044 pixels keep the same word and the corrected release matches every one.
An independent signed comparison assigns two original square draws to each readout over a white background, with gains −1 and 2⁻²⁵. Use a common window from −.5 to 1.5 on both axes and four children at each level. For one tree, all 16,383 adjacent depth-seven parent pairs follow the previously measured order with either assignment of the gains, giving 32,766/32,766 signed comparisons, maximum error zero. In the two-tree control all 65,534 signed comparisons reproduce the measured two-tree order. Four active trees still change the result.
For a six-pixel four-tree control, number the depth-seven parents from 0 through 65,535 in tree order, visiting child ports 0 through 3. Use seed 188119, 256 × 256 F32, square size (.875,.875), zero roughness and unit opacity. Give each pair one pixel in the first row, starting at (0,0). The pairs are (38876,46939), (37383,45424), (53619,57876), (58083,61876), (61523,49776) and (57968,53899). Send other depth-seven draws to (252,248) with gain −1. Center all depth-eight and depth-nine draws at (.875,.875) in pattern space with gain .25. On one processor, unchanged reference recooks agree with the first capture at 2/6, 3/6 and 6/6 readouts, maximum 2⁻²⁵, 2⁻²⁵ and 0. Exchanging the gains gives 6/6, 5/6 and 6/6. A one-pair control using only (38876,46939) agrees on all four reads in each direction. A single fixed four-tree order cannot reproduce all the six-pixel captures.
Repeat the [32 original and 32 reopened Dirt 3, Dirt 5, Dirt Gradient and Vertical Noise controls](#shared-branch-expressions-and-all-sixty-noise-dirt-5-renders) in all four formats. All 64 local buffers retain their prior hashes and all earlier raw scores apply. The complete Noise Dirt 5 root remains in progress.
### Shared branch expressions and all sixty Noise Dirt 5 renders
The normal evaluator renders all 60 tiled Noise Dirt 5 originals and all 12 archived ordinary saves on the same release. Earlier runs finished 58 originals and 11 saves. The two remaining originals use 128 × 32, seed 433608, scale 3, disorder .046875 and non-square expansion enabled. Leave the other inputs at their defaults and set the final output to the requested storage. [Original series and parameter combinations](#sixty-whole-settings-for-three-directional-and-dirt-noise-packages) · [Ten earlier recovered settings](#ten-recovered-whole-noise-dirt-5-settings)
+3 -1
View File
@@ -49,6 +49,8 @@ Noise BNW Spots 1 v2 matches both untiled rectangles in U8, U16 and F16 on one p
Noise Dirt Gradient v2 matches both untiled U8 and F16 rectangles on one processor and after ordinary saves, 2,560/2,560 pixels in each format. Five of the eight whole settings match on each route. [Axis-specific background filtering, stored counts and remaining differences](parity-fixes.md#filtering-a-resized-pattern-background-on-each-axis)
The single-tree controls of Noise Dirt 5 match all 5,120 F32 pixels on one processor and after an ordinary save. Summed over 20 independent window and format settings, 737,280/737,280 pixels match on both one-processor routes. The eight-processor capture matches 732,040/737,280. [Reproduction and per-window maximum errors](parity-fixes.md#a-complete-quadrant-tree-with-one-physical-copy-per-draw)
Noise Dirt 5 now renders all 60 originals and all 12 archived ordinary saves in its tiled series. Complete images match in 31/60 comparisons on one processor, 30/60 on eight and 8/12 archived saves. At seeds 113 and 42 a difference of one U16 level appears at the FX-Map output before Levels. [Raw counts, repeated captures and shared branch expressions](parity-fixes.md#shared-branch-expressions-and-all-sixty-noise-dirt-5-renders) · [Ten earlier recovered settings](parity-fixes.md#ten-recovered-whole-noise-dirt-5-settings)
Noise Dirt 1 matches all 43,008 pixels in 12 further settings and Noise Dirt 5 all 40,960 in eight, both on one processor and after ordinary saves. Noise Dirt 1 v2 at 64 × 32 also improved from 1,981 to 2,048 exact F32 pixels. [Tiled subtrees, threshold controls and eight-processor scores](parity-fixes.md#deferring-two-tiled-subtrees-until-a-quadrant-batch-fills) Noise Dirt 1 matches 41/60 ordinary tiled settings on one processor and 32/60 on eight. Noise Dirt 2 matches 53/60 on one and 51/60 on eight. Two wider Noise Dirt 1 originals match 10,239/10,240 F32 pixels on one processor. Their ordinary saves match all 10,240. [Receiving quadrant, independent fields and Noise Dirt 5 comparisons](parity-fixes.md#the-receiving-half-of-a-quadrant-in-two-tiled-trees) Three additional tall Noise Dirt 1 images and their saves match 43,008/43,008 F32 pixels on one processor. [Four-batch threshold and rectangular comparisons](parity-fixes.md#four-full-batches-in-two-tiled-quadrant-trees) [Two-tree tile copies, all formats and ordinary saves](parity-fixes.md#tiled-copies-across-two-complete-quadrant-trees) [Earlier tiled measurements](parity-fixes.md#fixed-image-draws-in-tiled-dirt-graphs) With graph tiling off, Noise Dirt 5 and Noise Dirt Gradient each match eight additional settings and their ordinary saves, 10,240/10,240 pixels per graph. [Five related roots, iteration counts and remaining errors](parity-fixes.md#whole-untiled-dirt-relatives-and-the-depth-seven-iteration) With graph tiling off, Dirt 1 matches all 13 original and reopened settings on one processor and all nine additional settings at three other seeds. [Two-tree order, raw counts and ordinary saves](parity-fixes.md#unfinished-draws-across-two-untiled-quadrant-trees) [Earlier single-tree comparisons](parity-fixes.md#fixed-image-draw-order-in-untiled-noise-dirt-1) In Dirt 1 at 128 × 256, all 32,764 locations shared by seven U16 reads now match. At (59,61) the five individual draws are each exact. Two signed controls independently confirm their order in the combined reference image. [Individual draw comparisons](parity-fixes.md#five-individual-image-draws-at-one-dirt-1-pixel) [Isolated drawing depths and raw values](parity-fixes.md#individual-drawing-depths-at-a-dirt-1-rounding-boundary) On Dirt 2 every one of the 785,643 invariant reference pixels is exact. [Complete render coverage, errors and timing](parity-fixes.md#complete-render-coverage-for-the-two-fixed-image-dirt-graphs) [Formats and repeat comparisons](parity-fixes.md#expanded-image-and-save-comparisons-for-dirt-1-and-dirt-2) Both measured Dirt 2 formats at 32 × 16 match all 512 original and reopened pixels. The Dirt 1 v2 rectangle still reaches its traversal limit. [Whole images and procedural input controls](parity-fixes.md#streaming-deep-quadrants-that-draw-the-same-connected-image)
@@ -469,7 +471,7 @@ Creased matches 10,947,840/10,947,840 pixels across 100 distinct settings throug
| [noise_dirt_3_v2.sbs/dirt_3](../assets/sbs/noise_dirt_3_v2.sbs) | 0 | No | [In progress · 771,398/777,472 whole pixels on one processor, 771,548 on eight, 58/60 settings rendered](parity-fixes.md#whole-and-saved-outputs-for-noise-dirt-3-v2) · [Earlier comparison · 17/19 whole outputs, 136,738/141,568 pixels](parity-fixes.md#dirt-noise-sources-and-downstream-stages) · [6/6 tiled settings render, 4 exact on one processor](parity-fixes.md#tiled-outputs-of-ten-noise-roots-and-the-full-wood-fibers-2-series) |
| [noise_dirt_4.sbs/dirt_4](../assets/sbs/noise_dirt_4.sbs) | 0 | Yes | [In progress · 6/8 complete additional settings on one processor, 8/8 on eight and 7/8 ordinary saves](parity-fixes.md#recovered-dirt-4-and-moisture-renders-at-seed-113) · [Earlier comparison · 10/19 whole renders completed, 89,052/105,728 exact pixels](parity-fixes.md#discarding-pattern-stamps-that-miss-every-output-sample) · [Recovered 16 × 32 F32 setting, 512/512 exact pixels on one processor](parity-fixes.md#rectangular-dirt-family-settings-recovered-by-the-shared-evaluator) · [Original stage comparisons](parity-fixes.md#dirt-noise-sources-and-downstream-stages) |
| [noise_dirt_4_v2.sbs/dirt_4](../assets/sbs/noise_dirt_4_v2.sbs) | 0 | No | [In progress · 5/19 whole renders completed, 99,535/99,584 exact pixels](parity-fixes.md#discarding-pattern-stamps-that-miss-every-output-sample) · [Recovered 16 × 32 F32 setting, 512/512 exact pixels on one processor](parity-fixes.md#rectangular-dirt-family-settings-recovered-by-the-shared-evaluator) · [Original stage comparisons](parity-fixes.md#dirt-noise-sources-and-downstream-stages) |
| [noise_dirt_5.sbs/dirt_5](../assets/sbs/noise_dirt_5.sbs) | 0 | Yes | [In progress · all 60 originals and 12 archived saves render, 31/60 exact on one processor and 30/60 on eight](parity-fixes.md#shared-branch-expressions-and-all-sixty-noise-dirt-5-renders) · [Earlier comparison · 58/60 tiled whole settings render, all ten recovered settings also measured after ordinary saves](parity-fixes.md#ten-recovered-whole-noise-dirt-5-settings) · [Earlier comparison · eight additional tiled settings and ordinary saves match 40,960/40,960 pixels on one processor, 4/8 settings on eight](parity-fixes.md#deferring-two-tiled-subtrees-until-a-quadrant-batch-fills) · [Earlier comparison · 8/8 additional untiled originals on one, 5/8 on eight, 8/8 ordinary saves](parity-fixes.md#whole-untiled-dirt-relatives-and-the-depth-seven-iteration) · [Earlier comparison · six of eight additional wide settings exact on one processor, both 128 × 64 formats match all 8,187 invariant locations](parity-fixes.md#the-receiving-half-of-a-quadrant-in-two-tiled-trees) · [Earlier comparison · 48/60 whole settings rendered, 701,551/701,696 pixels on one processor, 701,572 on eight](parity-fixes.md#sixty-whole-settings-for-three-directional-and-dirt-noise-packages) · [Recovered 32 × 16 F32 setting, 512/512 exact pixels on one processor](parity-fixes.md#rectangular-dirt-family-settings-recovered-by-the-shared-evaluator) · [Earlier comparison · 32² now exact](parity-fixes.md#deep-pattern-samples-in-custom-render-and-tiling-regions) · [Earlier matrix](parity-fixes.md#dirt-noise-sources-and-downstream-stages) · [64² precision and remaining traversal limits](parity-fixes.md#precision-of-two-dense-noise-generators-in-custom-regions) |
| [noise_dirt_5.sbs/dirt_5](../assets/sbs/noise_dirt_5.sbs) | 0 | Yes | [In progress · all 60 originals and 12 archived saves render, 31/60 exact on one processor and 30/60 on eight](parity-fixes.md#shared-branch-expressions-and-all-sixty-noise-dirt-5-renders) · [Single-tree F32 comparison, 5,120/5,120 on one processor and after reopening](parity-fixes.md#a-complete-quadrant-tree-with-one-physical-copy-per-draw) · [Earlier comparison · 58/60 tiled whole settings render, all ten recovered settings also measured after ordinary saves](parity-fixes.md#ten-recovered-whole-noise-dirt-5-settings) · [Earlier comparison · eight additional tiled settings and ordinary saves match 40,960/40,960 pixels on one processor, 4/8 settings on eight](parity-fixes.md#deferring-two-tiled-subtrees-until-a-quadrant-batch-fills) · [Earlier comparison · 8/8 additional untiled originals on one, 5/8 on eight, 8/8 ordinary saves](parity-fixes.md#whole-untiled-dirt-relatives-and-the-depth-seven-iteration) · [Earlier comparison · six of eight additional wide settings exact on one processor, both 128 × 64 formats match all 8,187 invariant locations](parity-fixes.md#the-receiving-half-of-a-quadrant-in-two-tiled-trees) · [Earlier comparison · 48/60 whole settings rendered, 701,551/701,696 pixels on one processor, 701,572 on eight](parity-fixes.md#sixty-whole-settings-for-three-directional-and-dirt-noise-packages) · [Recovered 32 × 16 F32 setting, 512/512 exact pixels on one processor](parity-fixes.md#rectangular-dirt-family-settings-recovered-by-the-shared-evaluator) · [Earlier comparison · 32² now exact](parity-fixes.md#deep-pattern-samples-in-custom-render-and-tiling-regions) · [Earlier matrix](parity-fixes.md#dirt-noise-sources-and-downstream-stages) · [64² precision and remaining traversal limits](parity-fixes.md#precision-of-two-dense-noise-generators-in-custom-regions) |
| [noise_dirt_5_v2.sbs/dirt_5](../assets/sbs/noise_dirt_5_v2.sbs) | 0 | No | [In progress · 6/8 additional untiled originals on one, 6/8 on eight, 6/8 ordinary saves](parity-fixes.md#whole-untiled-dirt-relatives-and-the-depth-seven-iteration) · [Earlier comparison · 11/19 whole outputs, 107,341/107,776 pixels](parity-fixes.md#dirt-noise-sources-and-downstream-stages) · [Recovered 32 × 16 F32 setting, 457/512 exact pixels on one processor](parity-fixes.md#rectangular-dirt-family-settings-recovered-by-the-shared-evaluator) |
| [noise_dirt_gradient.sbs/dirt_gradient](../assets/sbs/noise_dirt_gradient.sbs) | 0 | Yes | [In progress · 8/8 additional untiled originals on one, 7/8 on eight, 8/8 ordinary saves](parity-fixes.md#whole-untiled-dirt-relatives-and-the-depth-seven-iteration) · [Earlier comparison · 60/60 originals have now rendered across the recorded passes](parity-fixes.md#rectangular-dirt-family-settings-recovered-by-the-shared-evaluator) · [Earlier comparison · 58/60 whole settings rendered, 653,612/654,592 pixels on one processor, 653,621 on eight](parity-fixes.md#sixty-whole-settings-for-three-directional-and-dirt-noise-packages) · [Earlier comparison · 19/19 whole outputs, 141,554/142,592 pixels](parity-fixes.md#dirt-noise-sources-and-downstream-stages) |
| [noise_dirt_gradient_v2.sbs/dirt_gradient](../assets/sbs/noise_dirt_gradient_v2.sbs) | 0 | No | [In progress · 5/8 additional untiled originals on each processor count, 5/8 ordinary saves, all U8 and F16 pixels exact on one processor](parity-fixes.md#filtering-a-resized-pattern-background-on-each-axis) · [Earlier comparison · 1/8 additional untiled originals on one, 2/8 on eight, 1/8 ordinary saves](parity-fixes.md#whole-untiled-dirt-relatives-and-the-depth-seven-iteration) · [Earlier comparison · 40/60 whole settings rendered, 428,169/464,640 exact pixels on one processor, 434,967 on eight](parity-fixes.md#sixty-whole-renders-after-correcting-the-inner-iterator) · [Recovered 32 × 16 F32 setting, 361/512 exact pixels on one processor](parity-fixes.md#rectangular-dirt-family-settings-recovered-by-the-shared-evaluator) · [Nested initial branch, 704/704 middle-stage samples](parity-fixes.md#initial-branch-of-a-nested-pattern-iterator) · [Earlier 19 outputs](parity-fixes.md#dirt-noise-sources-and-downstream-stages) · [Single-tree final stage, 2,816/2,816 F32 pixels with wrapping off](parity-fixes.md#single-branch-controls-in-complete-quadrant-trees) · [6/6 tiled settings render, 3 exact on one processor](parity-fixes.md#tiled-outputs-of-ten-noise-roots-and-the-full-wood-fibers-2-series) |