Hi,
If you set the quantity to unlimited in the variant and the full stock of all the variants in the main product, the stock will be updated in the main product.
If you set the quantity in the variant and to unlimited in the main product, the stock will be updated in the variant only.
If you set the quantity to unlimited in the variant and unlimited in the main product, no stock will be updated.
If you set the quantity in the variant and the full stock of all the variants in the main product, the stock will be updated in both the variant and the main product.
Note that if the stock is not updated, it's maybe because the order is not confirmed after the payment and you have the "Update the product stock on confirmed status" setting activated in the HikaShop configuration (or you messed with the order statuses in the menu System>Order statuses).