To continue or quit my PhD in physics after 4yrs？ I am from China, currently a 4th year physics PhD student in Boston. This is a small department with ~10 professors. I am working for one assistant professor now. But I am thinking about leaving this group/school if I have a better choice.

I have a colleague who is also from China and we joined the lab about the same time. At this beginning, we have some advanced experiment instrument to build with the help from the instrument company engineer. My advisor asked us to take a video of the building process so that we can refer to it later if needed. The other guy took the job since he has a video recorder. When the instrument was ready to use, my advisor asked me to write an operation manual and so I needed the videos. The other guy said yes at first, but refused to let me copy any of these or just viewing from his recorder unless I take him to a restaurant!

I was completely shocked by his behavior. My advisor was also there and tried to figure out how to deal with this and asked me if I can do that. I agreed to give that guy a treat nearby but then that guy said it must be a fancy downtown one. That I cannot endure anymore and just said no. Then he attacked my personality and not being grateful to him. My advisor stopped him by saying sometimes you have to work with different people. This is the first time I am in a quarrel with that person. But I still trusted my advisor.

Then similar events like that happens again and again. My advisor failed me every time. When I mentioned this stuff,  he just said he doesn't care and he wasn't there to see what really happened. 

When I was working on my project and made some progress, my advisor promised that guy he can use my data to write another paper. My advisor mainly talked to the other guy about data analysis because I had a busy work schedule. One time I need to use the data analysis code they have used, and the other person sent me code with problems. I had to figure out how to write it by myself.

Stuff like that makes me decide to work independently. So I told my advisor I would like to have only me working on my project and wouldn't work on his at all. My advisor agreed, but started assigning all funded projects to that guy. For the entire past year, I have only two months project time working on some random samples. 

My advisor rarely comments on my work compared to the other person's work. The rest of time, well, I was mostly following my advisor's guide, doing bunch of data fitting. While he only looked at my result for a minute and asked me to fit again. When finally it was finished, he decided it will not be used in my second paper. 

During such time, I was almost driven mad and got into a bad relationship with my advisor. He will also be triggered by some small mistakes of mine and so am I at his. He promised me that I can graduate in 2yrs if I worked really hard but I just lost faith in him. 

I had planned to be a pioneer in physics. But after this, I only want to get a decent job in industry and have a chance to stay in US in the future. But I only have limited experience in programming besides my experimental experience. What can I do at this point?
We only have half the story. What you describe seems outrageous (particularly the dinner part!), but I imagine if your professor had described the situation, he would characterize it quite differently (I have one socially-awkward but useful student and one whiny, unproductive student...just as an example, not saying you're actually whiny or unproductive). Given this, I'm going to avoid criticizing any of you.

In any case, the current situation is clearly untenable. A couple of options:


Talk to your advisor. Send an e-mail asking for a formal meeting to discuss your status. In the meeting, you might start by saying something nice about finding his work interesting and regretting that things haven't gone as well as you would like. Then, ask him when he sees you graduating and whether he will give you interesting work going forward. If you can smooth things over and make a good plan going forward to work independently, maybe you can finish out your last two years. If not, better to find out now so you can cut your losses.
Get a new advisor. In a small group of ~10 professors, this may be difficult. I would start by talking to the department chair or a trusted professor
Transfer to a new university. I realize this may be difficult with your visa restrictions. 
Leave with an MS, if this is possible. If you are OK going into industry, an MS is not so bad (and you can always apply to PhD programs after leaving with an MS).