A bit of experimenting shows it works on selection and not on cursor position (the two are only the same if there is no other selection.) There is still an inconsistency though and maybe it would make more sense to work from the cursor position anyway.
If you select multiple block on one line, either with the mouse or by holding Shift and click the Left or Right arrow then pressing Alt+T to select whole track always select the last track you added to the selection. So when you click Alt+P (as in your description above) Renoise must internally select them all left to right.
But if you have a selection spanning more than a single pattern then hit Alt+P then it always selects the track aligned with the left-most block in the selection you have made.
Thanks for pointing out the difference of cursor position and current selection. When using the keyboard shortcut sequence [ALT+T], [ALT+P], [ALT+T], I was wondering why the last selection wouldn’t give the same result as the first one.
With the implementation based on the current selection, it would be more intuitive (in my opinion), if [ALT+T]/[ALT+P] would select the number of tracks/patterns the current selection spans. Say, you’d select a block of 2 tracks across 3 patterns. [ALT+T] would select both tracks across all patterns; [ALT+P] would select all tracks across the 3 selected patterns.