4 should be the result.
Suppose the buckets are indexed from b1 to b1000

First round (4 pigs). Split buckets to 16 sub set. {b1b64}, {b65b128}, ...... {b961b1000}. Then one pig die / no pig die. We can know one of the sub set contains poison.

Second round (more than 3 pigs). Suppose poison in {b1b64}, split buckets to 8 sub set. {b1b8}, {b9b16}, ...... {b57b64}. Then one pig die / no pig die. We can know one of the sub set contains poison.

Third round (more than 2 pigs). Suppose poison in {b1b8}, split buckets to 4 subset. {b1b2}, {b3b4}, ...... {b7b8}. Then one pig die / no pig die. We can know one of the sub set contains poison.

Fourth round (more than 1 pig). Suppose poison in {b1b2}, let the pig drink b1. If pig die, then b1 is the bucket with poison. Otherwise b2 is the bucket with poison.