=== shadow ('before') vs tree ('after'), EOL-insensitive diff ===
--- segmented_copy_if.hpp
   @@ -49,13 +49,26 @@
    segmented_copy_if_dst_bounded
       (SrcIter first, Sent last, DstIter dst_first, DstSent dst_last, Pred pred, DstTag, SrcCat)
    {
   +   //[alg.copy] mandates exactly last - first applications of pred.  Testing an
   +   //element, discovering the destination segment is full and returning makes the
   +   //enclosing destination walker call this leaf again on the same element, which
   +   //re-applies pred.  Checking the destination once on entry and again after each
   +   //write removes that: when the destination fills, `first` has already moved
   +   //past the element that was written, so the next call resumes on an untested
   +   //element.  With an unreachable_sentinel_t destination both checks fold away,
   +   //so the flat path is unchanged.
   +   if(BOOST_UNLIKELY(dst_first == dst_last))
   +      return segduo<SrcIter, DstIter>(first, dst_first);
   +
       BOOST_CONTAINER_SEGMENTED_UNROLL(4)
       for(; first != last; ++first) {
          if(pred(*first)) {
   -         if(BOOST_UNLIKELY(dst_first == dst_last))
   -            goto out_path;
             *dst_first = *first;
             ++dst_first;
   +         if(BOOST_UNLIKELY(dst_first == dst_last)) {
   +            ++first;
   +            goto out_path;
   +         }
          }
       }
       out_path:
--- segmented_remove_copy.hpp
   @@ -38,13 +38,26 @@
    segmented_remove_copy_dst_bounded
       (SrcIter first, Sent last, DstIter dst_first, DstSent dst_last, const T& value, DstTag, SrcCat)
    {
   +   //[alg.remove] mandates exactly last - first comparisons.  Comparing an
   +   //element, discovering the destination segment is full and returning makes the
   +   //enclosing destination walker call this leaf again on the same element, which
   +   //compares it a second time.  Checking the destination once on entry and again
   +   //after each write removes that: when the destination fills, `first` has
   +   //already moved past the element that was written, so the next call resumes on
   +   //an uncompared element.  With an unreachable_sentinel_t destination both
   +   //checks fold away, so the flat path is unchanged.
   +   if(BOOST_UNLIKELY(dst_first == dst_last))
   +      return segduo<SrcIter, DstIter>(first, dst_first);
   +
       BOOST_CONTAINER_SEGMENTED_UNROLL(4)
       for(; first != last; ++first) {
          if(!(*first == value)) {
   -         if(BOOST_UNLIKELY(dst_first == dst_last))
   -            goto out_path;
             transfer_op<Move>::apply(*dst_first, *first);
             ++dst_first;
   +         if(BOOST_UNLIKELY(dst_first == dst_last)) {
   +            ++first;
   +            goto out_path;
   +         }
          }
       }
       out_path:
--- segmented_remove_copy_if.hpp
   @@ -51,13 +51,26 @@
    segmented_remove_copy_if_dst_bounded
       (SrcIter first, Sent last, DstIter dst_first, DstSent dst_last, Pred pred, DstTag, SrcCat)
    {
   +   //[alg.remove] mandates exactly last - first applications of pred.  Testing an
   +   //element, discovering the destination segment is full and returning makes the
   +   //enclosing destination walker call this leaf again on the same element, which
   +   //re-applies pred.  Checking the destination once on entry and again after each
   +   //write removes that: when the destination fills, `first` has already moved
   +   //past the element that was written, so the next call resumes on an untested
   +   //element.  With an unreachable_sentinel_t destination both checks fold away,
   +   //so the flat path is unchanged.
   +   if(BOOST_UNLIKELY(dst_first == dst_last))
   +      return segduo<SrcIter, DstIter>(first, dst_first);
   +
       BOOST_CONTAINER_SEGMENTED_UNROLL(4)
       for(; first != last; ++first) {
          if(!pred(*first)) {
   -         if(BOOST_UNLIKELY(dst_first == dst_last))
   -            goto out_path;
             transfer_op<Move>::apply(*dst_first, *first);
             ++dst_first;
   +         if(BOOST_UNLIKELY(dst_first == dst_last)) {
   +            ++first;
   +            goto out_path;
   +         }
          }
       }
       out_path:
--- segmented_partition_copy.hpp
   @@ -130,22 +130,40 @@
       // an output running out on the same element counts as source exhaustion,
       // which is what those callers require, so the out_false exits report the flag
       // as "source left".
   +   //
   +   // [alg.partitions] mandates exactly last - first applications of pred.
   +   // Testing an element, discovering that the output it belongs to is full and
   +   // returning makes the enclosing walker call this leaf again on the same
   +   // element, which re-applies pred.  Each output is therefore tested once on
   +   // entry and again after each write to it: when one fills, `first` has already
   +   // moved past the element that was written, so the next call resumes on an
   +   // untested element, and the loop body can take for granted that both outputs
   +   // have room.  With unreachable_sentinel_t outputs the tests fold away, so the
   +   // flat path is unchanged.
   +   if(BOOST_UNLIKELY(t_first == t_last))
   +      return segquartet<SrcIter, TIter, FIter, bool>(first, t_first, f_first, false);
   +   if(BOOST_UNLIKELY(f_first == f_last))
   +      return segquartet<SrcIter, TIter, FIter, bool>(first, t_first, f_first, first != last);
   +
       bool false_output_full = false;
       BOOST_CONTAINER_SEGMENTED_UNROLL(4)
       for(; first != last; ++first) {
          if(pred(*first)) {
   -         if(BOOST_UNLIKELY(t_first == t_last))
   -            break;
             *t_first = *first;
             ++t_first;
   +         if(BOOST_UNLIKELY(t_first == t_last)) {
   +            ++first;
   +            break;
   +         }
          }
          else {
   +         *f_first = *first;
   +         ++f_first;
             if(BOOST_UNLIKELY(f_first == f_last)) {
   -            false_output_full = true;
   +            ++first;
   +            false_output_full = first != last;
                break;
             }
   -         *f_first = *first;
   -         ++f_first;
          }
       }
       return segquartet<SrcIter, TIter, FIter, bool>

================ group 25  g++-16 : median of 5 pinned runs ================
algo                             before    after   delta  spread   nsg/seg bef nsg/seg aft
copy(1S)                         0.1070   0.1070   +0.0%   20.6%          2.34        2.34
copy(2S)                         0.0560   0.0530   -5.4%   67.9%          5.04        5.11  <<<
copy(1+2S)                       0.0650   0.0660   +1.5%   52.3%          5.82        5.70
copy_if(1S hit)                  0.3060   0.3050   -0.3%  101.0%          1.50        1.50
copy_if(2S hit)                  0.2890   0.3640  +26.0%  105.9%          1.61        1.27  <<<
copy_if(1+2S hit)                0.3960   0.3950   -0.3%   65.2%          1.29        1.30
copy_if(1S miss)                 0.3710   0.3680   -0.8%   81.1%          1.35        1.37
copy_if(2S miss)                 0.2560   0.2560   +0.0%  129.7%          0.91        0.91
copy_if(1+2S miss)               0.3120   0.3080   -1.3%  109.6%          1.10        1.05
copy_n(1S)                       0.0520   0.0570   +9.6%   76.9%          5.38        5.02  <<<
copy_n(2S)                       0.0570   0.0540   -5.3%   68.4%          4.91        5.11  <<<
copy_n(1+2S)                     0.0640   0.0650   +1.6%   54.7%          6.25        6.22
remove_copy(1S hit)              0.2570   0.2560   -0.4%   51.2%          1.83        1.82
remove_copy(2S hit)              0.2600   0.2600   +0.0%   69.2%          1.69        1.73
remove_copy(1+2S hit)            0.2730   0.2730   +0.0%   63.7%          1.78        1.77
remove_copy(1S miss)             0.2500   0.2490   -0.4%   39.2%          1.85        1.81
remove_copy(2S miss)             0.2600   0.2590   -0.4%   56.5%          1.37        1.34
remove_copy(1+2S miss)           0.2680   0.2680   +0.0%   50.7%          1.74        1.56
remove_copy_if(1S hit)           0.4290   0.4270   -0.5%   44.1%          1.25        1.15
remove_copy_if(2S hit)           0.3360   0.3630   +8.0%  100.6%          1.43        1.33  <<<
remove_copy_if(1+2S hit)         0.3980   0.4470  +12.3%   77.6%          1.26        1.10  <<<
remove_copy_if(1S miss)          0.2480   0.2470   -0.4%   39.1%          1.78        1.78
remove_copy_if(2S miss)          0.2580   0.2570   -0.4%   49.6%          1.26        1.30
remove_copy_if(1+2S miss)        0.2630   0.2630   +0.0%   48.7%          1.87        1.68
swap_ranges(1S)                  0.1010   0.1020   +1.0%   33.7%          3.29        3.11
swap_ranges(2S)                  0.0840   0.0840   +0.0%   34.5%          4.67        3.96
swap_ranges(1+2S)                0.1020   0.0990   -2.9%   33.3%          4.46        4.15
transform(1S)                    0.1060   0.1060   +0.0%   29.2%          3.46        3.44
transform(2S)                    0.0520   0.0520   +0.0%   78.8%          6.12        6.12
transform(1+2S)                  0.0650   0.0660   +1.5%   75.4%          6.71        6.38

================ group 25  clang++-22 : median of 5 pinned runs ================
algo                             before    after   delta  spread   nsg/seg bef nsg/seg aft
copy(1S)                         0.0490   0.0500   +2.0%   38.0%          5.51        5.40
copy(2S)                         0.0510   0.0470   -7.8%   55.3%          4.55        4.94  <<<
copy(1+2S)                       0.0580   0.0580   +0.0%   39.7%          7.21        7.29
copy_if(1S hit)                  0.2460   0.2500   +1.6%   75.6%          1.72        1.70
copy_if(2S hit)                  0.2410   0.2300   -4.6%   96.1%          0.95        1.00  <<<
copy_if(1+2S hit)                0.1940   0.1930   -0.5%  105.7%          2.74        2.76
copy_if(1S miss)                 0.1100   0.1100   +0.0%   98.2%          5.07        5.08
copy_if(2S miss)                 0.0820   0.0820   +0.0%   41.5%          2.33        2.34
copy_if(1+2S miss)               0.0880   0.0890   +1.1%   61.8%          6.11        6.02
copy_n(1S)                       0.0500   0.0510   +2.0%   39.2%          6.82        6.69
copy_n(2S)                       0.0510   0.0470   -7.8%   53.2%          6.67        7.23  <<<
copy_n(1+2S)                     0.0570   0.0580   +1.8%   50.0%          8.23        8.07
remove_copy(1S hit)              0.2420   0.2410   -0.4%  105.0%          1.70        1.71
remove_copy(2S hit)              0.2240   0.2220   -0.9%   32.0%          1.33        1.34
remove_copy(1+2S hit)            0.2370   0.2370   +0.0%   41.8%          1.94        1.94
remove_copy(1S miss)             0.2440   0.2440   +0.0%   18.4%          1.59        1.57
remove_copy(2S miss)             0.2240   0.2220   -0.9%   29.7%          1.56        1.58
remove_copy(1+2S miss)           0.2240   0.2250   +0.4%   38.4%          1.86        1.85
remove_copy_if(1S hit)           0.3160   0.3180   +0.6%   71.8%          1.65        1.63
remove_copy_if(2S hit)           0.2980   0.2890   -3.0%   84.4%          1.29        1.32  <<<
remove_copy_if(1+2S hit)         0.3140   0.3110   -1.0%   83.0%          1.71        1.91
remove_copy_if(1S miss)          0.2340   0.2330   -0.4%   23.2%          1.64        1.61
remove_copy_if(2S miss)          0.1950   0.1920   -1.5%   34.4%          1.83        1.85
remove_copy_if(1+2S miss)        0.1960   0.1960   +0.0%   34.7%          2.12        2.13
swap_ranges(1S)                  0.0880   0.0880   +0.0%   21.6%          4.32        4.31
swap_ranges(2S)                  0.0860   0.0870   +1.2%   31.0%          5.40        5.32
swap_ranges(1+2S)                0.1000   0.1010   +1.0%   30.7%          6.74        7.09
transform(1S)                    0.0520   0.0520   +0.0%   34.6%          6.21        6.19
transform(2S)                    0.0560   0.0540   -3.6%   48.2%          6.07        6.31  <<<
transform(1+2S)                  0.0600   0.0610   +1.7%   50.8%          8.08        7.18

================ group 15  g++-16 : median of 5 pinned runs ================
algo                             before    after   delta  spread   nsg/seg bef nsg/seg aft
is_sorted(hit)                   0.2320   0.2320   +0.0%    0.4%          2.02        1.47
is_sorted(miss)                  0.1160   0.1160   +0.0%    0.0%          1.90        1.23
is_sorted_until(hit)             0.2320   0.2320   +0.0%    0.4%          2.06        1.47
is_sorted_until(miss)            0.1160   0.1160   +0.0%    0.0%          1.94        1.28
remove(hit)                      0.3280   0.4100  +25.0%   13.1%          1.27        1.02  <<<
remove(miss)                     0.2350   0.2350   +0.0%    0.0%          2.29        2.29
remove_if(hit)                   0.4240   0.5760  +35.8%    7.1%          1.46        1.06  <<<
remove_if(miss)                  0.2390   0.3460  +44.8%    0.6%          1.02        0.71  <<<
search_n(1hit)                   0.1170   0.1170   +0.0%    0.0%          1.04        1.04
search_n(miss)                   0.1250   0.1260   +0.8%    1.6%          2.35        2.36
search_n(8mid)                   0.0260   0.0260   +0.0%    0.0%          1.96        1.96

================ group 15  clang++-22 : median of 5 pinned runs ================
algo                             before    after   delta  spread   nsg/seg bef nsg/seg aft
is_sorted(hit)                   0.0980   0.0980   +0.0%    0.0%          2.77        2.78
is_sorted(miss)                  0.0490   0.0490   +0.0%    0.0%          3.59        3.65
is_sorted_until(hit)             0.0980   0.0980   +0.0%    0.0%          2.77        2.78
is_sorted_until(miss)            0.0490   0.0490   +0.0%    0.0%          3.51        3.51
remove(hit)                      0.2030   0.2050   +1.0%  103.4%          2.28        2.24
remove(miss)                     0.0980   0.0980   +0.0%   58.2%          2.48        2.49
remove_if(hit)                   0.3320   0.3340   +0.6%    1.5%          1.61        1.79
remove_if(miss)                  0.1760   0.1760   +0.0%    0.0%          1.35        1.35
search_n(1hit)                   0.0490   0.0490   +0.0%    0.0%          4.24        4.24
search_n(miss)                   0.0840   0.0850   +1.2%    1.2%          2.56        2.54
search_n(8mid)                   0.0180   0.0180   +0.0%    0.0%          2.50        2.50

================ group 30  g++-16 : median of 5 pinned runs ================
algo                             before    after   delta  spread   nsg/seg bef nsg/seg aft
merge(1S)                        0.4530   0.4550   +0.4%    5.5%          1.41        1.40
merge(2S)                        0.5670   0.5700   +0.5%    2.8%          1.17        1.17
merge(3S)                        0.5280   0.5110   -3.2%    4.7%          1.60        1.66  <<<
merge(1+2S)                      0.5800   0.5910   +1.9%    2.6%          1.60        1.61
merge(1+3S)                      0.5460   0.5510   +0.9%    3.5%          1.52        1.52
merge(2+3S)                      0.5480   0.5490   +0.2%    2.4%          1.74        1.75
merge(1+2+3S)                    0.5290   0.5430   +2.6%    6.0%          1.77        1.70
set_difference(1S)               0.7270   0.7230   -0.6%    3.7%          0.62        0.61
set_difference(2S)               0.8260   0.8240   -0.2%    2.7%          1.00        1.00
set_difference(3S)               0.8250   0.8270   +0.2%    1.6%          1.00        1.00
set_difference(1+2S)             0.7550   0.7610   +0.8%    2.5%          0.64        0.62
set_difference(1+3S)             0.7730   0.7780   +0.6%    2.7%          0.62        0.62
set_difference(2+3S)             0.8420   0.8470   +0.6%    2.6%          0.98        0.98
set_difference(1+2+3S)           0.7760   0.7670   -1.2%    3.2%          0.66        0.66
set_intersection(1S)             0.2610   0.2620   +0.4%    8.0%          1.49        1.46
set_intersection(2S)             0.2880   0.2890   +0.3%    0.7%          1.41        1.40
set_intersection(3S)             0.3110   0.3100   -0.3%    4.2%          1.26        1.26
set_intersection(1+2S)           0.2830   0.2850   +0.7%    4.6%          1.92        1.93
set_intersection(1+3S)           0.2820   0.2960   +5.0%    7.4%          1.55        1.49  <<<
set_intersection(2+3S)           0.3190   0.3220   +0.9%    3.8%          1.52        1.52
set_intersection(1+2+3S)         0.2980   0.3050   +2.3%    9.7%          2.29        2.29
set_sym_diff(1S)                 0.5380   0.5400   +0.4%    2.2%          1.13        1.14
set_sym_diff(2S)                 0.6410   0.6510   +1.6%    4.7%          0.96        0.94
set_sym_diff(3S)                 0.5830   0.5880   +0.9%    3.1%          1.11        1.10
set_sym_diff(1+2S)               0.5890   0.5990   +1.7%    3.7%          1.19        1.18
set_sym_diff(1+3S)               0.5310   0.5330   +0.4%    4.0%          1.43        1.46
set_sym_diff(2+3S)               0.5570   0.5580   +0.2%    1.8%          1.37        1.35
set_sym_diff(1+2+3S)             0.6360   0.6320   -0.6%    4.9%          1.42        1.47
set_union(1S)                    0.4560   0.4540   -0.4%    1.8%          1.27        1.29
set_union(2S)                    0.4500   0.4450   -1.1%    2.5%          1.19        1.20
set_union(3S)                    0.5500   0.5360   -2.5%    4.0%          1.23        1.26
set_union(1+2S)                  0.5640   0.5840   +3.5%    5.5%          1.20        1.16  <<<
set_union(1+3S)                  0.5800   0.5830   +0.5%    4.6%          1.34        1.33
set_union(2+3S)                  0.5070   0.5140   +1.4%    5.5%          1.52        1.52
set_union(1+2+3S)                0.5160   0.5210   +1.0%    3.9%          1.62        1.63
partition_copy(1S)               0.2770   0.2740   -1.1%   13.7%          1.09        1.08
partition_copy(2S)               0.2880   0.2750   -4.5%    3.5%          1.38        1.44  <<<
partition_copy(3S)               0.2700   0.3890  +44.1%    4.4%          1.13        0.80  <<<
partition_copy(1+2S)             0.2750   0.2710   -1.5%    3.3%          1.84        1.90
partition_copy(1+3S)             0.2630   0.2630   +0.0%    3.4%          1.39        1.40
partition_copy(2+3S)             0.2890   0.3140   +8.7%    7.0%          1.53        1.42  <<<
partition_copy(1+2+3S)           0.2840   0.2780   -2.1%    7.7%          1.94        1.95

================ group 30  clang++-22 : median of 5 pinned runs ================
algo                             before    after   delta  spread   nsg/seg bef nsg/seg aft
merge(1S)                        2.2090   2.1890   -0.9%    2.6%          0.23        0.23
merge(2S)                        2.2650   2.2420   -1.0%    1.7%          0.24        0.24
merge(3S)                        7.5420   2.5190  -66.6%   66.6%          1.06        1.18  <<<
merge(1+2S)                      2.0640   2.0440   -1.0%    2.8%          0.49        0.49
merge(1+3S)                      2.2330   2.2110   -1.0%    5.5%          0.47        0.47
merge(2+3S)                      2.2340   2.2150   -0.9%    1.6%          0.47        0.47
merge(1+2+3S)                    2.0620   2.0460   -0.8%    1.8%          0.49        0.49
set_difference(1S)               0.9280   0.9250   -0.3%    1.1%          0.43        0.43
set_difference(2S)               1.0590   1.0590   +0.0%    0.4%          1.00        1.00
set_difference(3S)               1.0590   1.0600   +0.1%    1.3%          1.00        1.00
set_difference(1+2S)             1.0540   1.0540   +0.0%    0.6%          0.48        0.48
set_difference(1+3S)             1.0490   1.0470   -0.2%    0.9%          0.45        0.45
set_difference(2+3S)             1.0600   1.0590   -0.1%    0.2%          1.00        1.00
set_difference(1+2+3S)           1.0780   1.0770   -0.1%    1.1%          0.50        0.49
set_intersection(1S)             0.3200   0.3190   -0.3%    2.5%          1.27        1.29
set_intersection(2S)             0.2930   0.2860   -2.4%    2.7%          1.23        1.24
set_intersection(3S)             0.3010   0.3030   +0.7%    3.0%          1.27        1.25
set_intersection(1+2S)           0.4110   0.4080   -0.7%    2.2%          1.11        1.12
set_intersection(1+3S)           0.4060   0.4060   +0.0%    1.2%          1.07        1.07
set_intersection(2+3S)           0.3780   0.3760   -0.5%    0.8%          1.02        1.02
set_intersection(1+2+3S)         0.4290   0.4280   -0.2%    1.6%          1.14        1.13
set_sym_diff(1S)                 0.4710   0.4670   -0.8%    1.9%          1.00        0.99
set_sym_diff(2S)                 0.4120   0.4140   +0.5%    2.2%          1.20        1.19
set_sym_diff(3S)                 0.4020   0.3970   -1.2%    3.0%          1.33        1.34
set_sym_diff(1+2S)               0.4760   0.4780   +0.4%    3.4%          1.33        1.33
set_sym_diff(1+3S)               0.6470   0.6430   -0.6%    1.5%          1.09        1.09
set_sym_diff(2+3S)               0.4090   0.4080   -0.2%    2.0%          1.53        1.53
set_sym_diff(1+2+3S)             0.4760   0.4790   +0.6%    1.1%          1.86        1.84
set_union(1S)                    0.3910   0.3870   -1.0%    3.1%          1.17        1.17
set_union(2S)                    0.4680   0.4660   -0.4%   53.6%          1.11        1.11
set_union(3S)                    0.4240   0.4170   -1.7%   64.6%          1.57        1.59
set_union(1+2S)                  0.4430   0.4400   -0.7%    2.9%          1.42        1.42
set_union(1+3S)                  0.4600   0.4600   +0.0%    2.6%          1.49        1.49
set_union(2+3S)                  0.4580   0.4580   +0.0%    2.0%          1.83        1.83
set_union(1+2+3S)                0.4800   0.4800   +0.0%    1.9%          1.71        1.72
partition_copy(1S)               0.2200   0.2190   -0.5%    5.5%          2.40        2.41
partition_copy(2S)               0.2090   0.2150   +2.9%    2.4%          2.08        1.93
partition_copy(3S)               0.2050   0.2080   +1.5%    2.4%          1.33        1.30
partition_copy(1+2S)             0.2220   0.2550  +14.9%   12.2%          2.41        2.11  <<<
partition_copy(1+3S)             0.2040   0.2030   -0.5%    3.9%          2.61        2.59
partition_copy(2+3S)             0.2380   0.2160   -9.2%    6.3%          1.59        1.75  <<<
partition_copy(1+2+3S)           0.2080   0.2100   +1.0%    5.2%          2.63        2.59
