I had an idea for a type of stalemate: One side cannot move at all because the king is trapped and all of that side’s pieces and pawns are pinned. This means that that side has no legal moves, and thus it is stalemate.
I wondered how many pieces and pawns, for both sides, could be put in such a position that were nessacary. I define this as either pinning a piece, blocking a piece, or trapping the the opponent’s king. The final position must be legal, stalemate for one side, and be legally reachable.
The best I can up with is the following position
[FEN "b2q1bq1/1N1N1N1k/8/rP1K1P1r/8/1P1B1P2/q2q4/2q1q1qq w - - 0 1"]
Initially, I though that 16 was the limit, not counting the kings of course: A piece/pawn around a king in the middle of the board, and a pinning piece for each of those. But I found that by spreading out the pieces that I could fit in 4 more-necessary to trap white king.
CLARIFICATION: I suppose the position I am looking for is one with promoted pieces and where 8 pins are absolutely nessacary. In this case, how about without promoted pieces, and as such 4 nessacary pins? Is more than 28 possible in this case? I suspect that it is. (Of course, it would be nigh near impossible to stalemate the white queen!)
Is this the limit, 22 units, for a pinned pieces stalemate, within the rules I have made? Do note that you can have one piece of protection per each king escape square to inflate the number needed.
UPDATE: I have found that there are categories for this where the black king does and does not help trap the white king. Evargalo has done the second option with 28 units.
I have “found” another 28 units position for the first category of the black king having to help. I say “found because it’s more or less just a slightly edited version of Evargalo’s position.
This is legal as two captures of white pawns, one white queen, and one black pawn ensure that the position is legal, as they allow for black to get their four promoted piece and get white their promoted horse.
[FEN "qn1r2b1/1R1BkNp1/1p3bP1/rN1K2Br/P3P2p/nR1N1b1P/b2r1P2/8 w - - 0 1"]