I suspect the latter will come way before the former...

It is already here. Not humanoid (yet, but it's in the works) but tracked robots with bolted on machine guns have both held and captured positions in UA.

Autonomous kill drones in Ukraine have been publicly admitted to now since 2022. Nothing in a 5Km radius survived, and then the batteries died.