Continue the first overflowing pair through the second pattern quadrant

This commit is contained in:
chasse20 committed 2026-11-22 11:09:41 -05:00
1 parent 8157b78353
commit c99006d899
5 files changed
+140 -1

No files matched your search

@@ -391,3 +391,43 @@ fn final_pair_continues_into_the_next_subtree_when_the_receiver_is_short() {
check_batch_markers(&group_counts, seed, 1, &markers);
}
}
#[test]
fn second_quadrant_fills_a_batch_with_the_first_overflowing_pair() {
for (head, pair, last_prefix, seed, markers) in [
(
80,
[91, 81],
66,
239183,
[(279544, 219111, true), (279545, 177140, true), (279547, 264248, true), (279550, 18082, true), (86047, 293310, false), (91385, 268863, false)],
),
(
84,
[82, 87],
84,
239214,
[(279547, 337858, false), (279548, 238689, true), (279550, 188473, true), (86047, 33592, true), (88046, 272116, false), (91561, 332595, false)],
),
(
72,
[92, 89],
97,
239245,
[(279535, 198075, true), (279536, 12379, true), (279538, 73395, true), (279541, 37478, true), (279544, 204365, true), (279549, 29131, true)],
),
(
67,
[94, 90],
73,
239276,
[(279532, 122270, true), (279533, 151260, true), (279535, 65152, true), (279538, 35090, true), (279541, 198163, true), (279546, 258888, true)],
),
] {
let mut group_counts = [32; 64];
group_counts[16] = head;
group_counts[50..52].copy_from_slice(&pair);
group_counts[62] = last_prefix;
check_batch_markers(&group_counts, seed, 1, &markers);
}
}
+16
View File
@@ -120,6 +120,9 @@ impl TileCopies {
// batch in the receiving subtree changes the order of the remaining draws.
let deferred = self.group_copies(group..group + 2)?.checked_sub(2 * COPIES_PER_BATCH)?;
if self.group_copies(head..head + 1)?.checked_add(deferred)? >= COPIES_PER_BATCH {
if group == 50 && !full_prefix {
return self.full_second_quadrant();
}
if group == 54 && !full_prefix {
return Some(Cow::Borrowed(paired_batches::FULL_RECEIVING_QUADRANT));
}
@@ -157,6 +160,19 @@ impl TileCopies {
Cow::Owned(layout)
}
fn full_second_quadrant(&self) -> Option<Cow<'static, [(usize, usize)]>> {
let mut layout = Cow::Borrowed(paired_batches::FULL_SECOND_QUADRANT);
let prefix = self.group_copies(62..63)?;
if prefix != COPIES_PER_BATCH {
// The first submission ends after one batch. It can fall on either side
// of group 63, which supplies the remaining draws later in the sequence.
let (end, _) = layout.to_mut().iter_mut().find(|(_, rank)| *rank == 0)?;
let boundary = 63 * DEPTH_THREE_PARENTS;
*end = if prefix < COPIES_PER_BATCH { boundary + 1 } else { boundary - 1 };
}
Some(layout)
}
fn penultimate_layout(&self, ordinary: &'static [(usize, usize)]) -> Option<Cow<'static, [(usize, usize)]>> {
let prefix = self.group_copies(60..61)?;
let full_prefix = prefix >= COPIES_PER_BATCH;
@@ -89,6 +89,61 @@ pub(super) const FULL_RECEIVING_QUADRANT: &[(usize, usize)] = &[
(16384, 31),
];
// After groups 50–51, the first group in the second quadrant fills another batch.
pub(super) const FULL_SECOND_QUADRANT: &[(usize, usize)] = &[
(64, 15),
(192, 37),
(1925, 16),
(2048, 38),
(3841, 6),
(4096, 17),
(4352, 9),
(4481, 32),
(4608, 41),
(4736, 35),
(4800, 46),
(4864, 42),
(5889, 10),
(6144, 22),
(7942, 2),
(8192, 19),
(8256, 12),
(8259, 23),
(8384, 33),
(10118, 13),
(10240, 36),
(12035, 4),
(12288, 27),
(12352, 25),
(12416, 34),
(12480, 48),
(12673, 26),
(12800, 43),
(13312, 1),
(13312, 8),
(13376, 20),
(13440, 39),
(13504, 50),
(13703, 21),
(13824, 47),
(14081, 3),
(14336, 11),
(14400, 28),
(14464, 40),
(14528, 44),
(14725, 29),
(14848, 45),
(15105, 5),
(15360, 14),
(15617, 7),
(15680, 30),
(15682, 18),
(15808, 49),
(15872, 31),
(16128, 0),
(16384, 24),
];
const THIRD_PAIR_FROM_END: &[(usize, usize)] = &[
(256, 15),
(394, 34),
+28
View File
@@ -774,6 +774,34 @@ Add the following original procedural settings. Render U16 and F32 at each size
All 442 release tests in the node and evaluator crates passed, along with formatting, strict workspace Clippy, dependency layers and WebAssembly.
### Dirt Gradient when groups 50 and 51 fill the second quadrant
Dirt Gradient matches 107/111 complete settings on one processor and 43/111 on eight. At 32 × 16, seed 188233, the remaining U16 and F32 pixels now agree, one newly exact pixel in each format. The other 109 one-processor results retain their previous counts and maxima. The table uses stored integer levels and absolute floating-point errors. All 28 saved files reproduce their original 430,336 pixels within each application. [Whole-root settings, input formulas and previous counts](#final-horizontal-pair-with-a-short-receiver-in-dirt-gradient)
| Comparison | U8 exact / total · max | U16 exact / total · max | F16 exact / total · max | F32 exact / total · max |
|---|---:|---:|---:|---:|
| One processor | 600,320/600,320 · 0 | 846,584/846,592 · 1 | 600,320/600,320 · 0 | 816,120/816,128 · 1.75833702e−5 |
| Eight processors | 600,320/600,320 · 0 | 846,260/846,592 · 2 | 600,296/600,320 · 0.00048828125 | 815,779/816,128 · 2.03251839e−5 |
| Reference one versus eight | 600,320/600,320 · 0 | 846,260/846,592 · 2 | 600,296/600,320 · 0.00048828125 | 815,777/816,128 · 2.03251839e−5 |
| Saved files on one processor | 36,864/36,864 · 0 | 80,888/80,896 · 1 | 32,768/32,768 · 0 | 279,808/279,808 · 0 |
The first two pattern generators already agreed at this seed. The third generator improved from 201/512 F32 pixels, maximum 4.47034836e-08, to 512/512 with zero error. The root now also matches after its final levels adjustment. In the original overlapping-square test, groups 50 and 51 have 92 and 77 extra tile copies. They fill two 5,460-copy batches and leave one copy for group 16. That group's 96 extra copies take the next batch past capacity. When group 60 is short, a further split depends on group 62. With 84 extra copies it fills exactly one batch. Fewer or more copies move that boundary into the following or preceding subtree. Measurements of signed overlaps gave 51 ordered ranges. Applying their physical copy counts reproduced all 512 pixels of the isolated third generator.
Build a complete quadrant tree with horizontal tiling and active levels seven through nine. Give the 64 groups 32 extra copies each, then set the four groups below. Place two signed, overlapping markers at each of 16 positions and repeat with the opacities exchanged. The four settings cover a receiving total one copy short, exactly full, and one copy above capacity. The eight compiled 128² F32 images match 131,072/131,072 pixels, including all 128 marker comparisons. [Square construction and copy placement](#horizontal-pattern-batches-ending-in-the-preceding-subtree)
| Seed | Group 16 | Group 50 | Group 51 | Group 62 |
|---:|---:|---:|---:|---:|
| 239183 | 80 | 91 | 81 | 66 |
| 239214 | 84 | 82 | 87 | 84 |
| 239245 | 72 | 92 | 89 | 97 |
| 239276 | 67 | 94 | 90 | 73 |
The 128 × 64 weighted controls use three independent series. Vary group 62 across 83, 84, 85 and 96 extra copies with group 60 below 84, using the original, uniform and PCG64-seeded group counts (seed 239015). All 42 settings match 344,064/344,064 pixels. In a separate series vary the pair's overflow across 1, 13 and 35 extra copies, with receiver totals on both sides of full and independently distributed child counts from PCG64 seed 234023. All 18 settings in this continuation match 147,456/147,456 pixels. Finally preserve the original receiving groups while lowering or redistributing the other groups (PCG64 seed 238531). Of 22 settings, 21 match exactly. The combined result is 179,308/180,224 pixels, maximum 2.50339508e−6.
The differing weighted setting reduces each group from 8 through 15 to 32 extra copies while retaining the original receiving groups. Its first one-processor capture differs from MaterialCraft at 916/8,192 pixels. Three subsequent one-processor captures in different case orders each match MaterialCraft on all 8,192 pixels. An independent eight-processor capture matches 7,214/8,192, maximum 2.74181366e−6. Two saved signed fields and three saved weighted fields each reproduce their originals in both applications and match 57,344/57,344 pixels across applications.
Across the whole-root matrix, 16 single-processor differences remain at 128 × 64, seed 191520 and 64 × 128, seed 142326. The eight-processor comparison differs at 705 pixels. The two reference processor settings differ at 707. The new regression failed on the previous renderer. All 443 node and evaluator release tests passed, along with formatting, strict workspace Clippy, dependency layers and WebAssembly.
## 2026-11-21 root comparisons
### Connected quadrant depth and amplified spot patterns
+1 -1
View File
@@ -255,7 +255,7 @@ Creased matches 10,947,840/10,947,840 pixels across 100 distinct settings throug
| [dirt_3.sbs/dirt_3](../assets/sbs/dirt_3.sbs) | 0 | Yes | [In progress · 68 single-processor settings exact, 2,316,526/2,316,544 pixels on eight processors](parity-fixes.md#three-terminal-children-in-seven-level-quadrant-trees) · [Earlier distinct settings](parity-fixes.md#original-and-reopened-dirt-moisture-and-cellular-noise-fields) · [Earlier measurements](parity-fixes.md#wave-frequency-and-phase-in-directional-noise) · [Earlier isolation](parity-fixes.md#bounds-and-pixel-coordinates-of-rotated-pattern-stamps) · [Six reference repeats](parity-fixes.md#repeated-dirt-pattern-stages) · [2,316,511/2,316,544 pixels across 68 single-processor settings](parity-fixes.md#single-processor-comparisons-for-clouds-2-and-five-dirt-fields) |
| [dirt_5.sbs/dirt_5](../assets/sbs/dirt_5.sbs) | 0 | Yes | [In progress · 2,662,656/2,662,656 pixels on one processor, 2,661,672/2,662,656 on eight across 95 settings](parity-fixes.md#three-active-quadrant-levels-in-dirt-5-and-dirt-gradient) · [2,005,576/2,006,016 pixels across 40 new renders](parity-fixes.md#wave-frequency-and-phase-in-directional-noise) · [Earlier measurements](parity-fixes.md#stored-opacity-across-pattern-depths) · [Six reference repeats](parity-fixes.md#repeated-dirt-pattern-stages) · [2,299,232/2,300,160 pixels across 67 single-processor settings](parity-fixes.md#single-processor-comparisons-for-clouds-2-and-five-dirt-fields) |
| [dirt_6.sbs/dirt_6](../assets/sbs/dirt_6.sbs) | 0 | Yes | [In progress · 2,593,024/2,593,024 pixels across 84 single-processor settings, 2,591,547/2,593,024 on eight](parity-fixes.md#individual-tile-copies-across-a-pattern-draw-boundary) · [Previous four-child generator results](parity-fixes.md#wrapped-draw-order-for-four-children-below-depth-seven) · [Earlier measurements](parity-fixes.md#original-and-reopened-dirt-moisture-and-cellular-noise-fields) · [Earlier measurements](parity-fixes.md#wave-frequency-and-phase-in-directional-noise) · [Earlier isolation](parity-fixes.md#drawing-axis-aligned-stamps-smaller-than-one-pixel) · [Six reference repeats](parity-fixes.md#repeated-dirt-pattern-stages) · [2,298,882/2,300,160 pixels across 67 single-processor settings](parity-fixes.md#single-processor-comparisons-for-clouds-2-and-five-dirt-fields) · [untiled generator measurements and four-format reopens](parity-fixes.md#untiled-draw-order-for-two-and-four-children-below-depth-seven) |
| [dirt_gradient.sbs/dirt_gradient](../assets/sbs/dirt_gradient.sbs) | 0 | Yes | [In progress · 105/111 settings and 2,863,342/2,863,360 pixels on one processor, 2,862,657/2,863,360 on eight](parity-fixes.md#final-horizontal-pair-with-a-short-receiver-in-dirt-gradient) · [Earlier middle and penultimate pair comparison](parity-fixes.md#middle-and-penultimate-horizontal-subtree-pairs-in-dirt-gradient) · [Earlier receiving-quadrant comparison](parity-fixes.md#full-receiving-quadrants-and-seven-batch-prefixes-in-dirt-gradient) · [Earlier deferred-copy comparison](parity-fixes.md#deferred-copies-in-horizontal-dirt-gradient-batches) · [Earlier preceding-subtree comparison](parity-fixes.md#horizontal-pattern-batches-ending-in-the-preceding-subtree) · [Earlier both-axis comparison](parity-fixes.md#eight-full-subtree-pairs-in-dirt-gradient) · [Nine horizontal generator settings](parity-fixes.md#a-late-copy-in-the-penultimate-horizontal-subtree-pair) · [Earlier horizontal comparison](parity-fixes.md#individual-tile-copies-after-two-full-horizontal-batches) · [Previous 111-setting comparison](parity-fixes.md#paired-subtree-capacity-in-horizontally-tiled-dirt-gradient) · [Five of nine horizontal generator settings exact](parity-fixes.md#the-first-subtree-pair-in-the-final-dirt-gradient-quadrant) · [2,662,010/2,662,656 pixels on one processor, 2,662,090/2,662,656 on eight across 95 settings](parity-fixes.md#three-active-quadrant-levels-in-dirt-5-and-dirt-gradient) · [2,005,640/2,006,016 pixels across 40 new renders](parity-fixes.md#wave-frequency-and-phase-in-directional-noise) · [Earlier measurements](parity-fixes.md#draw-order-at-six-quadrant-subdivisions) · [Six reference repeats](parity-fixes.md#repeated-dirt-pattern-stages) · [2,299,615/2,300,160 pixels across 67 single-processor settings](parity-fixes.md#single-processor-comparisons-for-clouds-2-and-five-dirt-fields) |
| [dirt_gradient.sbs/dirt_gradient](../assets/sbs/dirt_gradient.sbs) | 0 | Yes | [In progress · 107/111 settings and 2,863,344/2,863,360 pixels on one processor, 2,862,655/2,863,360 on eight](parity-fixes.md#dirt-gradient-when-groups-50-and-51-fill-the-second-quadrant) · [Earlier final-pair comparison](parity-fixes.md#final-horizontal-pair-with-a-short-receiver-in-dirt-gradient) · [Earlier middle and penultimate pair comparison](parity-fixes.md#middle-and-penultimate-horizontal-subtree-pairs-in-dirt-gradient) · [Earlier receiving-quadrant comparison](parity-fixes.md#full-receiving-quadrants-and-seven-batch-prefixes-in-dirt-gradient) · [Earlier deferred-copy comparison](parity-fixes.md#deferred-copies-in-horizontal-dirt-gradient-batches) · [Earlier preceding-subtree comparison](parity-fixes.md#horizontal-pattern-batches-ending-in-the-preceding-subtree) · [Earlier both-axis comparison](parity-fixes.md#eight-full-subtree-pairs-in-dirt-gradient) · [Nine horizontal generator settings](parity-fixes.md#a-late-copy-in-the-penultimate-horizontal-subtree-pair) · [Earlier horizontal comparison](parity-fixes.md#individual-tile-copies-after-two-full-horizontal-batches) · [Previous 111-setting comparison](parity-fixes.md#paired-subtree-capacity-in-horizontally-tiled-dirt-gradient) · [Five of nine horizontal generator settings exact](parity-fixes.md#the-first-subtree-pair-in-the-final-dirt-gradient-quadrant) · [2,662,010/2,662,656 pixels on one processor, 2,662,090/2,662,656 on eight across 95 settings](parity-fixes.md#three-active-quadrant-levels-in-dirt-5-and-dirt-gradient) · [2,005,640/2,006,016 pixels across 40 new renders](parity-fixes.md#wave-frequency-and-phase-in-directional-noise) · [Earlier measurements](parity-fixes.md#draw-order-at-six-quadrant-subdivisions) · [Six reference repeats](parity-fixes.md#repeated-dirt-pattern-stages) · [2,299,615/2,300,160 pixels across 67 single-processor settings](parity-fixes.md#single-processor-comparisons-for-clouds-2-and-five-dirt-fields) |
| [exposure.sbs/exposure](../assets/sbs/exposure.sbs) | 1 | No | [Parity: 4 cases](parity-fixes.md#verified-cases) |
| [extend_shape.sbs/extend_shape_color](../assets/sbs/extend_shape.sbs) | 1 | No | [Parity: 4 cases](parity-fixes.md#verified-cases) |
| [extend_shape.sbs/extend_shape_grayscale](../assets/sbs/extend_shape.sbs) | 1 | No | [Parity: 4 cases](parity-fixes.md#verified-cases) |