=== 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%    5.6%          2.34        2.34
copy(2S)                         0.0540   0.0530   -1.9%   17.0%          5.20        5.13
copy(1+2S)                       0.0650   0.0630   -3.1%   15.9%          5.78        5.87  <<<
copy_if(1S hit)                  0.3000   0.3060   +2.0%    6.2%          1.52        1.50
copy_if(2S hit)                  0.2880   0.3310  +14.9%   25.4%          1.57        1.40  <<<
copy_if(1+2S hit)                0.3970   0.3950   -0.5%   13.4%          1.28        1.30
copy_if(1S miss)                 0.3580   0.3690   +3.1%    4.3%          1.39        1.37  <<<
copy_if(2S miss)                 0.2560   0.2560   +0.0%    6.3%          0.90        0.90
copy_if(1+2S miss)               0.3110   0.3050   -1.9%    3.0%          1.09        1.06
copy_n(1S)                       0.0530   0.0530   +0.0%   15.1%          5.28        5.40
copy_n(2S)                       0.0550   0.0540   -1.8%   20.4%          5.09        5.09
copy_n(1+2S)                     0.0650   0.0650   +0.0%   20.0%          6.26        6.34
remove_copy(1S hit)              0.2560   0.2560   +0.0%    2.0%          1.84        1.83
remove_copy(2S hit)              0.2590   0.2610   +0.8%    2.7%          1.69        1.71
remove_copy(1+2S hit)            0.2730   0.2740   +0.4%    3.6%          1.70        1.82
remove_copy(1S miss)             0.2490   0.2490   +0.0%    1.2%          1.84        1.86
remove_copy(2S miss)             0.2590   0.2600   +0.4%    1.2%          1.39        1.34
remove_copy(1+2S miss)           0.2680   0.2690   +0.4%    1.9%          1.64        1.68
remove_copy_if(1S hit)           0.4180   0.4050   -3.1%    9.9%          1.20        1.21  <<<
remove_copy_if(2S hit)           0.3290   0.3770  +14.6%    7.4%          1.45        1.29  <<<
remove_copy_if(1+2S hit)         0.4010   0.4480  +11.7%   11.2%          1.21        1.09  <<<
remove_copy_if(1S miss)          0.2470   0.2470   +0.0%    1.6%          1.77        1.78
remove_copy_if(2S miss)          0.2570   0.2590   +0.8%    1.9%          1.26        1.29
remove_copy_if(1+2S miss)        0.2640   0.2640   +0.0%   11.7%          1.56        1.64
swap_ranges(1S)                  0.1010   0.1020   +1.0%    1.0%          3.14        3.14
swap_ranges(2S)                  0.0840   0.0840   +0.0%    2.4%          4.00        3.90
swap_ranges(1+2S)                0.0990   0.0990   +0.0%    1.0%          4.31        3.98
transform(1S)                    0.1070   0.1050   -1.9%    3.8%          3.40        3.48
transform(2S)                    0.0540   0.0540   +0.0%   13.0%          5.89        5.89
transform(1+2S)                  0.0660   0.0640   -3.0%    7.6%          6.39        6.62  <<<

================ group 25  clang++-22 : median of 5 pinned runs ================
algo                             before    after   delta  spread   nsg/seg bef nsg/seg aft
copy(1S)                         0.0500   0.0490   -2.0%   18.0%          5.40        5.51
copy(2S)                         0.0500   0.0500   +0.0%   16.0%          4.62        4.62
copy(1+2S)                       0.0580   0.0580   +0.0%    8.6%          7.10        7.21
copy_if(1S hit)                  0.2480   0.2490   +0.4%   11.2%          1.71        1.70
copy_if(2S hit)                  0.2400   0.2300   -4.2%    1.3%          0.95        0.99  <<<
copy_if(1+2S hit)                0.1930   0.1930   +0.0%    3.6%          2.75        2.76
copy_if(1S miss)                 0.1100   0.1100   +0.0%    0.9%          5.06        5.05
copy_if(2S miss)                 0.0820   0.0820   +0.0%    0.0%          2.33        2.34
copy_if(1+2S miss)               0.0880   0.0890   +1.1%    2.3%          6.09        5.99
copy_n(1S)                       0.0490   0.0500   +2.0%   16.3%          6.96        6.80
copy_n(2S)                       0.0500   0.0500   +0.0%   14.0%          6.82        6.82
copy_n(1+2S)                     0.0560   0.0560   +0.0%   10.7%          8.34        8.36
remove_copy(1S hit)              0.2420   0.2420   +0.0%    1.2%          1.70        1.70
remove_copy(2S hit)              0.2250   0.2220   -1.3%    1.3%          1.33        1.35
remove_copy(1+2S hit)            0.2360   0.2370   +0.4%    1.7%          1.94        1.95
remove_copy(1S miss)             0.2430   0.2440   +0.4%    1.2%          1.58        1.58
remove_copy(2S miss)             0.2250   0.2220   -1.3%    0.9%          1.56        1.58
remove_copy(1+2S miss)           0.2240   0.2250   +0.4%    1.3%          1.86        1.85
remove_copy_if(1S hit)           0.3180   0.3150   -0.9%    4.1%          1.63        1.62
remove_copy_if(2S hit)           0.2900   0.2980   +2.8%    3.4%          1.32        1.30
remove_copy_if(1+2S hit)         0.3140   0.3120   -0.6%    2.6%          1.73        1.86
remove_copy_if(1S miss)          0.2330   0.2330   +0.0%    0.4%          1.63        1.62
remove_copy_if(2S miss)          0.1950   0.1930   -1.0%    1.6%          1.82        1.82
remove_copy_if(1+2S miss)        0.1980   0.1970   -0.5%    2.0%          2.13        2.12
swap_ranges(1S)                  0.0880   0.0870   -1.1%    1.1%          4.34        4.41
swap_ranges(2S)                  0.0860   0.0870   +1.2%    1.2%          5.40        5.32
swap_ranges(1+2S)                0.0990   0.1000   +1.0%    1.0%          6.74        7.16
transform(1S)                    0.0520   0.0520   +0.0%   13.5%          6.21        6.19
transform(2S)                    0.0510   0.0520   +2.0%    7.8%          6.69        6.54
transform(1+2S)                  0.0590   0.0590   +0.0%    6.8%          8.14        7.25

================ 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.0%          2.00        1.48
is_sorted(miss)                  0.1160   0.1160   +0.0%    0.0%          1.90        1.25
is_sorted_until(hit)             0.2320   0.2320   +0.0%    0.0%          2.05        1.47
is_sorted_until(miss)            0.1160   0.1160   +0.0%    0.0%          1.93        1.30
remove(hit)                      0.3270   0.4160  +27.2%    6.4%          1.29        1.01  <<<
remove(miss)                     0.2350   0.2350   +0.0%    0.9%          2.30        2.29
remove_if(hit)                   0.4350   0.5830  +34.0%    4.8%          1.40        1.04  <<<
remove_if(miss)                  0.2390   0.3470  +45.2%    8.4%          1.02        0.70  <<<
search_n(1hit)                   0.1170   0.1170   +0.0%    0.0%          1.04        1.04
search_n(miss)                   0.1250   0.1250   +0.0%    9.6%          2.35        2.38
search_n(8mid)                   0.0260   0.0260   +0.0%   11.5%          1.96        2.00

================ 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.77
is_sorted(miss)                  0.0490   0.0490   +0.0%    0.0%          3.65        3.65
is_sorted_until(hit)             0.0980   0.0980   +0.0%    0.0%          2.77        2.77
is_sorted_until(miss)            0.0490   0.0490   +0.0%    0.0%          3.65        3.59
remove(hit)                      0.2030   0.2070   +2.0%    3.4%          2.27        2.21
remove(miss)                     0.0980   0.0980   +0.0%    3.1%          2.48        2.48
remove_if(hit)                   0.3330   0.3350   +0.6%    1.2%          1.60        1.78
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.0850   0.0850   +0.0%    1.2%          2.53        2.53
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.4610   +1.8%    7.2%          1.41        1.39
merge(2S)                        0.5680   0.5720   +0.7%    4.2%          1.17        1.16
merge(3S)                        0.5190   0.5090   -1.9%    5.8%          1.63        1.66
merge(1+2S)                      0.5850   0.5840   -0.2%    2.7%          1.57        1.61
merge(1+3S)                      0.5470   0.5470   +0.0%    1.6%          1.54        1.53
merge(2+3S)                      0.5440   0.5480   +0.7%   78.8%          1.76        1.74
merge(1+2+3S)                    0.5230   0.5340   +2.1%    4.1%          1.79        1.72
set_difference(1S)               0.7270   0.7240   -0.4%    1.7%          0.62        0.62
set_difference(2S)               0.8240   0.8240   +0.0%    1.3%          1.00        1.00
set_difference(3S)               0.8250   0.8250   +0.0%    1.7%          1.00        1.00
set_difference(1+2S)             0.7560   0.7570   +0.1%    1.3%          0.63        0.72
set_difference(1+3S)             0.7730   0.7730   +0.0%    1.4%          0.62        0.61
set_difference(2+3S)             0.8390   0.8390   +0.0%    2.7%          0.99        0.98
set_difference(1+2+3S)           0.7710   0.7680   -0.4%    1.6%          0.66        0.65
set_intersection(1S)             0.2710   0.2550   -5.9%   10.0%          1.44        1.52  <<<
set_intersection(2S)             0.2880   0.2890   +0.3%    1.4%          1.40        1.38
set_intersection(3S)             0.3100   0.3080   -0.6%    3.2%          1.24        1.26
set_intersection(1+2S)           0.2830   0.2840   +0.4%    8.1%          1.90        1.91
set_intersection(1+3S)           0.2840   0.2810   -1.1%    2.1%          1.54        1.56
set_intersection(2+3S)           0.3350   0.3320   -0.9%    7.2%          1.44        1.46
set_intersection(1+2+3S)         0.3050   0.3010   -1.3%    9.3%          2.18        2.20
set_sym_diff(1S)                 0.5380   0.5370   -0.2%    1.5%          1.13        1.14
set_sym_diff(2S)                 0.6270   0.6400   +2.1%    4.2%          0.97        0.95
set_sym_diff(3S)                 0.5860   0.5840   -0.3%   80.2%          1.10        1.09
set_sym_diff(1+2S)               0.5910   0.5920   +0.2%    2.7%          1.18        1.19
set_sym_diff(1+3S)               0.5310   0.5270   -0.8%    2.3%          1.43        1.47
set_sym_diff(2+3S)               0.5560   0.5550   -0.2%    7.4%          1.37        1.35
set_sym_diff(1+2+3S)             0.6270   0.6330   +1.0%    3.5%          1.45        1.43
set_union(1S)                    0.4520   0.4510   -0.2%    1.5%          1.28        1.28
set_union(2S)                    0.4450   0.4440   -0.2%    2.2%          1.19        1.20
set_union(3S)                    0.5470   0.5300   -3.1%    6.2%          1.23        1.26  <<<
set_union(1+2S)                  0.5900   0.5670   -3.9%   73.6%          1.15        1.18  <<<
set_union(1+3S)                  0.5710   0.5670   -0.7%    3.2%          1.37        1.37
set_union(2+3S)                  0.5130   0.4990   -2.7%    3.8%          1.50        1.54
set_union(1+2+3S)                0.5120   0.5070   -1.0%    3.6%          1.63        1.65
partition_copy(1S)               0.2780   0.2570   -7.6%    7.6%          1.06        1.16  <<<
partition_copy(2S)               0.2840   0.2750   -3.2%    2.8%          1.40        1.45  <<<
partition_copy(3S)               0.2710   0.3800  +40.2%    3.7%          1.14        0.79  <<<
partition_copy(1+2S)             0.2760   0.2650   -4.0%    3.0%          1.86        1.91  <<<
partition_copy(1+3S)             0.2650   0.2630   -0.8%    3.8%          1.38        1.38
partition_copy(2+3S)             0.2880   0.3030   +5.2%    8.7%          1.54        1.47  <<<
partition_copy(1+2+3S)           0.2860   0.2750   -3.8%    5.9%          1.92        1.96  <<<

================ group 30  clang++-22 : median of 5 pinned runs ================
algo                             before    after   delta  spread   nsg/seg bef nsg/seg aft
merge(1S)                        2.2040   2.1930   -0.5%    1.6%          0.23        0.23
merge(2S)                        2.2470   2.2510   +0.2%    1.4%          0.24        0.24
merge(3S)                        2.5310   2.5250   -0.2%    2.1%          1.19        1.18
merge(1+2S)                      2.0500   2.0520   +0.1%    1.7%          0.49        0.49
merge(1+3S)                      2.2220   2.2190   -0.1%    2.3%          0.46        0.47
merge(2+3S)                      2.2550   2.2190   -1.6%    9.6%          0.47        0.47
merge(1+2+3S)                    2.0570   2.0570   +0.0%    1.7%          0.49        0.49
set_difference(1S)               0.9330   0.9360   +0.3%    1.9%          0.43        0.43
set_difference(2S)               1.0600   1.0710   +1.0%    3.5%          1.00        1.00
set_difference(3S)               1.0650   1.0600   -0.5%    4.2%          1.00        1.00
set_difference(1+2S)             1.0570   1.0540   -0.3%    5.6%          0.48        0.48
set_difference(1+3S)             1.0500   1.0500   +0.0%    2.2%          0.45        0.45
set_difference(2+3S)             1.0630   1.0610   -0.2%    1.9%          1.00        1.00
set_difference(1+2+3S)           1.0780   1.0800   +0.2%    1.9%          0.50        0.50
set_intersection(1S)             0.3210   0.3220   +0.3%    5.6%          1.28        1.29
set_intersection(2S)             0.2900   0.2870   -1.0%    2.8%          1.23        1.26
set_intersection(3S)             0.2990   0.2990   +0.0%    2.0%          1.27        1.28
set_intersection(1+2S)           0.4150   0.4110   -1.0%    4.3%          1.16        1.13
set_intersection(1+3S)           0.4070   0.4070   +0.0%    0.7%          1.07        1.08
set_intersection(2+3S)           0.3780   0.3780   +0.0%    5.3%          1.01        1.02
set_intersection(1+2+3S)         0.4270   0.4290   +0.5%    3.3%          1.14        1.15
set_sym_diff(1S)                 0.4680   0.4750   +1.5%    1.7%          0.99        0.99
set_sym_diff(2S)                 0.4110   0.4130   +0.5%    2.7%          1.20        1.22
set_sym_diff(3S)                 0.3990   0.4040   +1.3%    5.2%          1.34        1.32
set_sym_diff(1+2S)               0.4770   0.4810   +0.8%   70.4%          1.31        1.33
set_sym_diff(1+3S)               0.6500   0.6470   -0.5%   50.3%          1.08        1.09
set_sym_diff(2+3S)               0.4100   0.4110   +0.2%   12.7%          1.53        1.53
set_sym_diff(1+2+3S)             0.4780   0.4780   +0.0%   12.6%          1.85        1.86
set_union(1S)                    0.3880   0.3900   +0.5%    8.7%          1.16        1.19
set_union(2S)                    0.4710   0.4760   +1.1%    5.7%          1.11        1.10
set_union(3S)                    0.4190   0.4210   +0.5%    3.6%          1.59        1.59
set_union(1+2S)                  0.4440   0.4450   +0.2%    2.0%          1.42        1.42
set_union(1+3S)                  0.4530   0.4610   +1.8%   80.9%          1.52        1.49
set_union(2+3S)                  0.4600   0.4590   -0.2%    2.0%          1.83        1.85
set_union(1+2+3S)                0.4780   0.4800   +0.4%    2.1%          1.72        1.74
partition_copy(1S)               0.2210   0.2210   +0.0%    5.9%          2.39        2.39
partition_copy(2S)               0.2090   0.2150   +2.9%    1.4%          1.79        1.96
partition_copy(3S)               0.2040   0.2100   +2.9%    5.7%          1.39        1.37
partition_copy(1+2S)             0.2200   0.2270   +3.2%   11.9%          2.47        2.37  <<<
partition_copy(1+3S)             0.2040   0.2060   +1.0%    2.9%          2.57        2.56
partition_copy(2+3S)             0.2360   0.2230   -5.5%    5.4%          1.60        1.72  <<<
partition_copy(1+2+3S)           0.2100   0.2130   +1.4%    4.7%          2.60        2.59
