Order full quadrant batches by their transferred siblings

This commit is contained in:
chasse20 committed 2026-11-26 04:14:24 -05:00
1 parent 7d0cfc78ab
commit 16fb115143
4 files changed
+64 -2

No files matched your search

@@ -320,6 +320,17 @@ fn carried_pairs_can_fill_before_the_following_tree_starts() {
}
}
#[test]
fn a_receiving_batch_precedes_the_upper_pair_after_a_sibling_transfer() {
let sample = |first, second, wrapped: &[usize]| marked_tree_pixel((5, first), (5, second), Continuation::ActiveTrees(2), wrapped, Some([2, 2]), Some(2));
let small = 2.0_f32.powi(-25);
assert_eq!(sample(896, 336, &[]).to_bits(), small.to_bits());
// The 64 corner squares add 192 copies. The lower pair hands off two
// siblings, and the receiving batch and upper pair both precede the last pair.
assert_eq!(sample(336, 896, &[832]).to_bits(), small.to_bits());
assert_eq!(sample(896, 768, &[832]).to_bits(), small.to_bits());
}
#[test]
fn earlier_sibling_transfers_keep_their_order_across_repeated_trees() {
let small = 2.0_f32.powi(-25);
@@ -21,6 +21,11 @@ impl SiblingOffsets {
}
}
fn unvisited_subtrees(&self, used: u32) -> usize {
let subtrees = &self.starts[2];
subtrees.len() - subtrees.partition_point(|&start| start < used)
}
fn children(&self, level: usize, first: usize, count: usize, sole_parent: bool, total: u32) -> Option<SiblingCut> {
let starts = self.starts.get(level)?;
let end = first + count;
@@ -193,6 +198,26 @@ impl UnderfilledQuadrants {
// With no pending sibling in either pair, both paired batches precede the last child.
next.extend(upper_batch);
Self::append_receiver_and_last(&first, full_receiver, last_batch, &mut next)?;
} else if !more_trees && full_receiver && Self::piece_count(&first[..2])? < COPIES_PER_BATCH && Self::piece_count(&first[..3])? >= COPIES_PER_BATCH {
// The first child handed over by the second group completes the receiver.
// How many siblings the lower pair gives up determines when that batch submits.
match self.repeated[0].branches.unvisited_subtrees(lower.before.start) {
2 if !lower.deferred[0].is_empty() && lower.deferred[1].is_empty() => {
next.extend(upper_batch);
// When both pairs transfer one of their final two subtrees,
// the last child finishes before the receiver.
if self.repeated[1].branches.unvisited_subtrees(upper.before.start) == 2 {
next.append(&mut last_batch);
}
Self::append_receiver_and_last(&first, true, last_batch, &mut next)?;
}
3 | 4 if lower.deferred.iter().all(|sibling| !sibling.is_empty()) => {
Self::append_copy_window(&first, 0, COPIES_PER_BATCH, &mut next)?;
next.extend(upper_batch);
next.extend(last_batch);
}
_ => {}
}
} else if !more_trees && !full_receiver {
next.extend(last_batch);
next.extend(upper_batch);
+26
View File
@@ -59,6 +59,32 @@ The first pass classifies all 546 roots: 166 Parity and 380 Too hard. These meas
## 2026-11-26 root comparisons
### Quadrant batch order after a sibling transfer
Noise BNW Spots 1 now matches 65 of its 86 established original settings on one processor, up from 64. The shared pattern renderer accounts for a full batch that finishes in a child transferred from another quadrant. The following two settings exercise different submission orders. Both use scale 1. Counts compare raw F32 pixels. [Renderer](../crates/nodes/src/pattern/underfilled_quadrants/remaining.rs) · [Regression graph](../crates/nodes/src/pattern/tests/underfilled_quadrants.rs)
| Size, seed, disorder, roughness | One processor, before → after | Ordinary save on one, before → after | Fresh eight processors, before → after | Maximum after, one / saved / eight |
|---|---:|---:|---:|---:|
| 32 × 16, 161954, .34375, .46484375 | 501 → 512/512 | 501 → 512/512 | 410 → 408/512 | 0 / 0 / 2⁻²³ |
| 64 × 32, 162172, .5625, .6015625 | 1,994 → 2,045/2,048 | 1,994 → 2,045/2,048 | 1,591 → 1,586/2,048 | 2⁻²⁴ / 2⁻²⁴ / 3 × 2⁻²⁴ |
U8 and F16 each match all 2,560 pixels on the three routes. U16 matches 2,560/2,560 on one processor and on reopening, and 2,558/2,560 on eight, maximum one stored level. All four recent one-processor captures of each F32 frame agree with each other, including the three earlier original captures. The four recent saves also agree with each other at every position. On eight processors those four captures agree at 344/512 and 1,147/2,048 positions. MaterialCraft matches 317 and 1,043 of those positions respectively.
Use two iterations of the [additive-square quadrant tree with an inactive depth-ten branch](#pending-quadrant-siblings-and-the-first-full-receiving-batch). Start with one physical copy per draw. After 26 full batches of 5,460 copies, compare the lower pair, upper pair, first receiving group and last child. The lower pair submits first. When its cut leaves two unvisited depth-five subtrees and it transfers one, the upper pair precedes the receiver. The last child also precedes the receiver when the upper pair has two such subtrees left. When the lower pair has three or four left and transfers two, the receiver precedes the upper pair, followed by the last child. This comparison covers a receiver that fills within the first child supplied by the second group.
For a one-copy boundary, use second-tree depth-three quadrant 52 in zero-based traversal order. Begin twelve draws after its root. For *e* extra copies, move the first ⌊*e*/3⌋ draws to a corner and the next *e* mod 3 draws to an edge. At 165 extra copies the lower pair transfers one sibling. At 166 it transfers two and the upper–receiver order reverses. Repeat with independent counts in quadrants 56 and 48. Across 96 fields, each of the six pairs of batches was compared at nine positions using both gain directions. Of 5,184 relations, 5,155 agreed in both directions on the first capture and all agreed with the renderer. The other 29 came from one field with 95, 330 and 128 extra copies in quadrants 52, 56 and 48. Each of three independent reacquisitions agreed on all 54 relations in that field, including a reversed acquisition order.
For the whole-image control, number the depth-five subtrees from zero in each tree. In the second tree only, place coincident squares from subtrees (896,336), (336,896) or (896,768) on white with gains −1 and 2⁻²⁵. Give other squares gain 2⁻⁷⁶. Test six copy fields. Use one copy everywhere, wrap the leaves of depth-six subtrees 3328–3330, wrap depth-five subtree 832, wrap 832 and 896, wrap 832 and 768, or wrap the leaves of both depth-six ranges 3328–3330 and 3584–3586. A wrapped leaf sits at a corner and contributes four physical copies. Use 32² F32 seed 41384, 16 × 32 U8 seed 41484 with gains −.5 and 2⁻²⁵, 32 × 16 U16 seed 41588 with −1 and 2⁻²⁴, and 64 × 32 F16 seed 41692 with 2⁻²⁵ and −1. All 72 original frames and all 72 ordinary saves match. Each route improved from 73,719 to 73,728/73,728 pixels, maximum zero. The regression failed on the preceding renderer.
| Established Spots 1 panel | One processor, exact pixels · maximum | Eight processors, exact pixels · maximum | Ordinary saves, exact pixels · maximum |
|---|---:|---:|---:|
| U8 | 108,800/108,800 · 0 | 108,799/108,800 · 1 | 90,112/90,112 · 0 |
| U16 | 328,399/328,448 · 1 | 328,244/328,448 · 1 | 93,693/93,696 · 1 |
| F16 | 108,800/108,800 · 0 | 108,798/108,800 · 2⁻¹¹ | 6,400/6,400 · 0 |
| F32 | 278,632/295,680 · 2⁻²² | 230,980/295,680 · 3 × 2⁻²³ | 5,988/6,144 · 2⁻²³ |
Across the established settings, 824,631/841,728 pixels match on one processor, 776,821/841,728 on eight and 196,193/196,352 in 19 ordinary saves. There are 38/86 exact eight-processor frames and 16/19 exact saves. The two fresh rectangular saves extend this coverage. Remaining differences include three repeatable F32 pixels in the larger rectangle and different eight-processor results between captures. All 550 release tests in the node and evaluation crates, formatting, strict workspace Clippy, dependency layering and WebAssembly passed.
### Finishing a quadrant copy batch in the next tree
Noise BNW Spots 1 v2 gained 58 exact F32 pixels across three 16 × 32 original settings on one processor. The same three ordinary SBS saves reopened on one processor gained the same 58. U8 and F16 matched all 1,536 pixels on all three routes. U16 matched 1,536/1,536 on one processor and on reopening, and 1,535/1,536 on eight, maximum one stored level. For the changed setting use scale 1, roughness 1, disorder, speed and anisotropy zero, angle −.375 and tile offset (0,0). The other two settings use the graph defaults.
+2 -2
View File
@@ -41,7 +41,7 @@ Writable quadrant tints now match 16,896/16,896 pixels in 44 settings across fou
Six upstream filters now match 27,648/27,648 original and 27,648/27,648 reopened pixels across four output formats, up from 24,192 on each side. Both directions of an image connection through a graph instance also match 4,608/4,608 F32 pixels on each side. [Published filter properties, fixed controls and raw errors](parity-fixes.md#published-filter-properties-upstream-of-a-quadrant-draw)
Noise BNW Spots 1 matches 824,569/841,728 pixels on one processor, 776,831/841,728 on eight and 196,193/196,352 across 19 ordinary saves. Of 86 original settings, 64 now match in full on one processor and 38 on eight. Four original and four reopened 16 × 32 seed-zero F32 frames match 512/512, maximum zero. Two additional one-processor F32 settings at 32² and 64 × 32 now match all 3,072 original and all 3,072 reopened pixels. The seven-processor captures match 2,282/3,072. Eleven procedural receiving-group controls and their eleven ordinary saves now match all 90,112 pixels across four formats. Denser fields and worker-dependent differences remain open. [Repeated trees, raw counts and maximum errors](parity-fixes.md#full-copy-batches-received-across-repeated-quadrant-trees) [Two new settings and independent square controls](parity-fixes.md#pending-quadrant-siblings-and-the-first-full-receiving-batch) [Procedural fixtures and counts by output format](parity-fixes.md#final-copy-batches-in-one-and-two-quadrant-trees) · [Earlier copy batches](parity-fixes.md#remaining-siblings-at-a-full-quadrant-copy-batch)
Noise BNW Spots 1 matches 65/86 whole original frames on one processor and 38/86 on eight. The established counts are 824,631/841,728 pixels on one processor, 776,821/841,728 on eight and 196,193/196,352 in 19 ordinary saves. Two rectangular F32 settings now give 512/512 and 2,045/2,048 on one processor and after reopening. The corresponding fresh eight-processor captures give 408/512 and 1,586/2,048. All 72 procedural controls match 73,728/73,728 original and reopened pixels on each route. [Sibling transfer, four formats and remaining errors](parity-fixes.md#quadrant-batch-order-after-a-sibling-transfer) · [Earlier receiving groups](parity-fixes.md#full-copy-batches-received-across-repeated-quadrant-trees)
Noise BNW Spots 1 v2 has 62/87 exact original frames on one processor, 58/87 on eight and 13/19 exact ordinary saves in the established settings. Three 16 × 32 settings with two active quadrant trees improved from 1,420 to 1,478/1,536 F32 pixels on one processor and on reopening. Against the fresh eight-processor capture the total went from 1,417 to 1,397/1,536. The maximum is 2⁻²³ on each route. The 64 procedural controls match 1,048,572/1,048,576 original pixels and all 1,048,576 reopened pixels. Four earlier F32 settings still match all 2,304 pixels on one processor and on reopening, and three further seeds match 2,048/2,048 on both routes. [Two-tree boundary, original settings and repeats](parity-fixes.md#finishing-a-quadrant-copy-batch-in-the-next-tree) · [Single-tree cut child](parity-fixes.md#returning-the-cut-child-of-a-completed-outer-quadrant) · [Earlier four-format totals](parity-fixes.md#completing-partial-copy-batches-above-inactive-quadrants)
@@ -417,7 +417,7 @@ Creased matches 10,947,840/10,947,840 pixels across 100 distinct settings throug
| [multiangle_to_normal.sbs/angle_weight](../assets/sbs/multiangle_to_normal.sbs) | 1 | Yes | [Parity: 4 cases](parity-fixes.md#verified-cases) |
| [noise_anisotropic_noise.sbs/anisotropic_noise](../assets/sbs/noise_anisotropic_noise.sbs) | 0 | Yes | [Parity · 18 renders, all 171,264 pixels exact](parity-fixes.md#quarter-turn-directional-blur) · [Saved graph seed and output-format checks](parity-fixes.md#graph-random-seed-inheritance-on-save-and-in-nested-graphs) |
| [noise_anisotropic_noise_v2.sbs/anisotropic_noise_v2](../assets/sbs/noise_anisotropic_noise_v2.sbs) | 0 | No | [Parity · 18 renders, all 171,264 pixels exact](parity-fixes.md#high-pass-anisotropic-noise-and-triangle-grid-controls) |
| [noise_bnw_spots_1.sbs/bnw_spots_1](../assets/sbs/noise_bnw_spots_1.sbs) | 0 | Yes | [In progress · 824,569/841,728 on one processor, 776,831/841,728 on eight and 196,193/196,352 in 19 saves](parity-fixes.md#full-copy-batches-received-across-repeated-quadrant-trees) · [Two rectangular F32 settings across repeated captures and saves](parity-fixes.md#finishing-a-quadrant-copy-batch-in-the-next-tree) · [Two more exact F32 settings on one processor and after reopen](parity-fixes.md#pending-quadrant-siblings-and-the-first-full-receiving-batch) · [Third carried pair and outer routing](parity-fixes.md#carrying-the-third-quadrant-pair-through-an-outer-iteration) · [Earlier cross-tree measurements](parity-fixes.md#full-copy-batches-spanning-successive-quadrant-trees) · [Neighboring quadrants](parity-fixes.md#physical-copy-batches-across-neighboring-quadrants) · [Ninth-batch comparison](parity-fixes.md#connected-graph-depth-and-the-ninth-quadrant-batch) · [Eighth-batch comparison](parity-fixes.md#the-next-full-batch-in-an-eight-level-quadrant-tree) · [Previous 86-setting comparison and 19 saves](parity-fixes.md#a-full-copy-batch-in-the-last-root-quadrant) · [Earlier six batches](parity-fixes.md#leading-copy-batches-in-complete-quadrant-trees) · [Measured physical copy boundary](parity-fixes.md#physical-copy-boundaries-in-dense-quadrant-subtrees) · [Inactive descendants affect draw order, 21/21 independently replayed F32 values](parity-fixes.md#connected-inactive-descendants-and-dense-quadrant-draw-order) · [Eight additional 64 × 32 F32 isolates cook](parity-fixes.md#bounded-work-for-empty-terminal-quadrants) · [Five levels combined, original and reopened, each 8,192/8,192 F32](parity-fixes.md#wide-first-level-shapes-in-additive-quadrant-trees) · [Depths 3–6 match 32,768/32,768 isolated F32 pixels](parity-fixes.md#submission-order-in-underfilled-eight-level-quadrant-trees) · [Earlier 60-setting comparison](parity-fixes.md#connected-quadrant-depth-and-amplified-spot-patterns) · [Zero roughness exact in U16 and F32](parity-fixes.md#grayscale-pattern-output-at-zero-roughness) · [Draw order, 18 changed-format comparisons](parity-fixes.md#draw-order-for-overlapping-procedural-grayscale-stamps) · [12 settings and four attempted reopens](parity-fixes.md#moisture-spot-and-cell-fields-across-processors-and-saved-packages) · [Explicit renderer workers and repeatability](parity-fixes.md#patterns-with-an-explicit-reference-worker-count) |
| [noise_bnw_spots_1.sbs/bnw_spots_1](../assets/sbs/noise_bnw_spots_1.sbs) | 0 | Yes | [In progress · 65/86 on one processor, 38/86 on eight, 16/19 ordinary saves](parity-fixes.md#quadrant-batch-order-after-a-sibling-transfer) · [Earlier receiving groups](parity-fixes.md#full-copy-batches-received-across-repeated-quadrant-trees) · [Two rectangular F32 settings across repeated captures and saves](parity-fixes.md#finishing-a-quadrant-copy-batch-in-the-next-tree) · [Two more exact F32 settings on one processor and after reopen](parity-fixes.md#pending-quadrant-siblings-and-the-first-full-receiving-batch) · [Third carried pair and outer routing](parity-fixes.md#carrying-the-third-quadrant-pair-through-an-outer-iteration) · [Earlier cross-tree measurements](parity-fixes.md#full-copy-batches-spanning-successive-quadrant-trees) · [Neighboring quadrants](parity-fixes.md#physical-copy-batches-across-neighboring-quadrants) · [Ninth-batch comparison](parity-fixes.md#connected-graph-depth-and-the-ninth-quadrant-batch) · [Eighth-batch comparison](parity-fixes.md#the-next-full-batch-in-an-eight-level-quadrant-tree) · [Previous 86-setting comparison and 19 saves](parity-fixes.md#a-full-copy-batch-in-the-last-root-quadrant) · [Earlier six batches](parity-fixes.md#leading-copy-batches-in-complete-quadrant-trees) · [Measured physical copy boundary](parity-fixes.md#physical-copy-boundaries-in-dense-quadrant-subtrees) · [Inactive descendants affect draw order, 21/21 independently replayed F32 values](parity-fixes.md#connected-inactive-descendants-and-dense-quadrant-draw-order) · [Eight additional 64 × 32 F32 isolates cook](parity-fixes.md#bounded-work-for-empty-terminal-quadrants) · [Five levels combined, original and reopened, each 8,192/8,192 F32](parity-fixes.md#wide-first-level-shapes-in-additive-quadrant-trees) · [Depths 3–6 match 32,768/32,768 isolated F32 pixels](parity-fixes.md#submission-order-in-underfilled-eight-level-quadrant-trees) · [Earlier 60-setting comparison](parity-fixes.md#connected-quadrant-depth-and-amplified-spot-patterns) · [Zero roughness exact in U16 and F32](parity-fixes.md#grayscale-pattern-output-at-zero-roughness) · [Draw order, 18 changed-format comparisons](parity-fixes.md#draw-order-for-overlapping-procedural-grayscale-stamps) · [12 settings and four attempted reopens](parity-fixes.md#moisture-spot-and-cell-fields-across-processors-and-saved-packages) · [Explicit renderer workers and repeatability](parity-fixes.md#patterns-with-an-explicit-reference-worker-count) |
| [noise_bnw_spots_1_v2.sbs/bnw_spots_1](../assets/sbs/noise_bnw_spots_1_v2.sbs) | 0 | No | [In progress · 839,460/842,752 on one processor, 830,536/842,752 on eight and 137,715/139,008 in 19 saves](parity-fixes.md#finishing-a-quadrant-copy-batch-in-the-next-tree) · [Three additional F32 settings exact on one processor and ordinary reopens](parity-fixes.md#returning-the-cut-child-of-a-completed-outer-quadrant) · [Earlier two-child measurements](parity-fixes.md#filling-a-quadrant-batch-from-two-transferred-children) · [512/512 at 32 × 16 on one processor and reopening](parity-fixes.md#drawing-the-children-of-a-transferred-quadrant) · [Repeated parents, three new seeds and processor repeats](parity-fixes.md#repeated-drawing-quadrants-and-full-batches-in-the-outer-pair) · [Earlier half-quadrants and reference repeats](parity-fixes.md#which-half-quadrant-completes-the-next-copy-batch) · [Previous tile-copy fix](parity-fixes.md#tile-copies-in-the-last-two-active-quadrant-levels) · [Earlier 87-setting comparison](parity-fixes.md#copy-batches-from-the-final-quadrant-pair-and-the-following-group) · [Final pattern stage and 16² addition-order replay](parity-fixes.md#final-pattern-draws-above-inactive-quadrants-in-spots-1-v2) · [Parameters and earlier comparison](parity-fixes.md#whole-root-precision-and-saved-comparisons-for-the-three-neighboring-spot-graphs) · [All 87 original settings and 19 saves rechecked](parity-fixes.md#dense-settings-recovered-in-the-third-spots-graph) · [Depth-local variable writes fixed, 28,082/28,160 on twelve whole guards](parity-fixes.md#inherited-and-writable-variables-across-quadrant-depths) · [Two additional 64 × 32 isolates, each 2,048/2,048 F32](parity-fixes.md#bounded-work-for-empty-terminal-quadrants) · [Levels 7–8, 8,047/8,192 F32 on original, 8,048/8,192 reopened](parity-fixes.md#wide-first-level-shapes-in-additive-quadrant-trees) · [Earlier spot comparison](parity-fixes.md#connected-quadrant-depth-and-amplified-spot-patterns) · [Zero roughness exact in U16 and F32](parity-fixes.md#grayscale-pattern-output-at-zero-roughness) · [Draw order, 18 changed-format comparisons](parity-fixes.md#draw-order-for-overlapping-procedural-grayscale-stamps) · [12 settings and four attempted reopens](parity-fixes.md#moisture-spot-and-cell-fields-across-processors-and-saved-packages) · [Explicit renderer workers and repeatability](parity-fixes.md#patterns-with-an-explicit-reference-worker-count) |
| [noise_bnw_spots_3.sbs/bnw_spots_3](../assets/sbs/noise_bnw_spots_3.sbs) | 0 | Yes | [In progress · six more settings render, 49,131/49,152 on one processor, 49,132/49,152 on eight](parity-fixes.md#dense-settings-recovered-in-the-third-spots-graph) · [Earlier 48 settings, 671,452/671,744 pixels on one processor, 671,526/671,744 on eight](parity-fixes.md#whole-root-precision-and-saved-comparisons-for-the-three-neighboring-spot-graphs) · [Earlier spot comparison](parity-fixes.md#deep-pattern-samples-in-custom-render-and-tiling-regions) · [Earlier matrix](parity-fixes.md#bnw-spots-3-and-cells-1-pattern-sources) · [64² precision and remaining traversal limits](parity-fixes.md#precision-of-two-dense-noise-generators-in-custom-regions) · [12 settings and four attempted reopens](parity-fixes.md#moisture-spot-and-cell-fields-across-processors-and-saved-packages) · [Explicit worker counts](parity-fixes.md#branch-offsets-center-culling-and-two-dense-spot-graphs) · [Four-format square and reopened comparisons](parity-fixes.md#two-dense-spots-packages-across-storage-formats) |
| [noise_bnw_spots_3_v2.sbs/bnw_spots_3](../assets/sbs/noise_bnw_spots_3_v2.sbs) | 0 | No | [In progress · 16 of 32 blocked settings now render, 185,202/193,536 on one processor and 184,698/193,536 on eight](parity-fixes.md#recovered-settings-in-the-second-version-of-the-third-spots-graph) · [Three recovered saves, 5,999/6,144](parity-fixes.md#recovered-settings-in-the-second-version-of-the-third-spots-graph) · [Dense 32² comparison](parity-fixes.md#bounded-work-for-terminal-quadrant-siblings) · [Earlier comparison · 339,986/347,136 pixels on one processor, 341,093/347,136 on eight · 30 of 62 settings rendered](parity-fixes.md#whole-root-precision-and-saved-comparisons-for-the-three-neighboring-spot-graphs) · [Earlier spot comparison](parity-fixes.md#bnw-spots-3-and-cells-1-pattern-sources) · [12 settings and four attempted reopens](parity-fixes.md#moisture-spot-and-cell-fields-across-processors-and-saved-packages) · [bounded stage counts at scale two](parity-fixes.md#four-cloud-noise-generators-and-repeated-saved-file-comparisons) · [Explicit worker counts](parity-fixes.md#branch-offsets-center-culling-and-two-dense-spot-graphs) · [Dense F32 traversal and worker repeats](parity-fixes.md#dense-quadrant-traversal-and-reference-worker-counts) · [Four-format square and reopened comparisons](parity-fixes.md#two-dense-spots-packages-across-storage-formats) |