What does the 41+1+1+1+1 layout check?
This layout refers to the common comparator filter with overflow protection, and not to any sorting scheme. Repeat the complete body according to author’s drawing; Its behavior is tested below. Reference: Minecraft: comparator.
Five slots contain 45 conditional items and give the signal 2. The added target item raises the quantity to 46 and the signal to 3; The bottom hopper is temporarily opened, then the stock returns to the original. Placeholders must also add up to 64 and not appear in the input stream.
Four tests using stone
Empty the result chest. Feed 1 stone: it should hit the target output, and the filter should save 41 stone and four aggregates. Then feed 1 soil: it should go to the general balance and not replace the aggregates.
Give 64 stone and recalculate the increase. Then repeat with a mixture of 32 stone + 32 earth. Finally, compare both the target chest and the remainder: an empty filter by itself does not prove correct sorting.
The occupancy thresholds and two device modes are shown here: Comparators: reading a chest’s fullness.
Test the neighboring filter and a full output
Collect the second module nearby, fill the first output chest and continue supplying the first resource. When working properly, the overflow should not open the adjacent filter and carry away its samples. If your neighbor's layout changes, turn off the shared input.
For items with a stack of 16 and non-stackable items, this setting is not suitable: comparator takes into account the percentage of slots filled, and not just the sum of items. Named placeholders are not a defense if the same named item can come from above.
To connect the receiver to the chest, the following instructions will be useful: Hoppers: send items to the right container.

