asking for CS coauthor as an undergraduate I've been working on a project with a graduate student in my lab for the past month and a half. I spend about 20 hours a week on the project.

I implemented a part of our algorithm, wrote part of the paper, revised the paper, tested/debugged the scripts we use for data collection, and produced some figures used in the paper.

Would it be appropriate for me to ask the graduate student for coauthorship? Do my contributions seem deserving of a coauthorship?
Yes. Implementing part of the algorithm, running it and producing the figures, and especially writing a significant portion of the text of the paper, are all contributions that should count for a listing in the authors.

We can't exactly know whether your contribution to each of these were "significant" without seeing the paper, but it is very likely. So, ask.