You're talking about piece, right? I know that it's actually determined by the execution state per frame and the button inputs [1]. I looked into Tetris AI before because I found it fascinating, but I might be mistaken.
[1]https://tetrissuomi.wordpress.com/wp-content/uploads/2020/04...