I am nominally in a Professor X's lab, but I work with and communicate with his PhD Student Y most of the time. Would it be looked down upon for Y to write me a LoR for grad school, since even though he knows me better, he is only a grad student/would be a fresh PhD by the time I get around to applying? Should I plan to ask X for a rec letter even though I don't directly work with him?
A recommendation from a professor is worth more than a recommendation from a PhD student. X also has more experience writing recommendation letters than Y, and probably has a better idea of what makes a good letter from reading the letters of applicants. X may be more aware of your work than you might realize from talking to Y. Anyways, it's best to ask X to write and sign the letter, possibly with Y providing input or assistance in writing.