dont know if the following attack behaviour is a bug or a feature:

I just play a tournament game with zero luck setting / zero neutrals. And saw how an attack from a territory with 3 armies vs a territory with one army resulted in a captured territory with 2 armies. The plain arithmetics of a zero luck game made me expect the one army territory attacked by 2 troops to change in a one army territory of the attacker.

I thought about this again. What rendered the following question:
Assume in a zero-luck game, 60% offensive kill rate, 70% defensive kill rate that 3 troops attack a territory with 2. Then Warlight randomization might result in the territory with 2 is taken by 3 troops. The calculation as described is the following: the defender loses 3*.6 troops = 1.8 troops. The attacker loses 2*.7 troops = 1.4 troops. Precisely calculated the defender keeps .2 troops and the attacker 1.6 troops. But Warlight does not compare fractions of a number but randomizes, meaning that with (1.0 - 0.2)*100% = 80% probability the defenders losses are 2 troops and with (1.0 - 0.6)*100% = 40% probability the attacker only loses one troops. So the overall probability that an attack with 3 troops captures a territory defended by 2 troops and leaves the attacker in his newly conquered territory 2 troops is .4*.8*100% = 32%. Is my calculation right?

I think it's 48%. Since the attacker would lose 1.4 troops, there's a 40% chance that they lose the 2nd troop, and a 60% chance that they don't. So it would be .6 * .8 = 48%.

Agree, so there is an almost 50% chance that an attacker with 3 troops can capture a territory defended by 2 troops and only loses 1 troop when doing this attack. Wouldnt it be better just to randomize the difference of troops remaining? In this example 1.6 troops left for the attacker - 0.2 troops left for the defender = 1.4 troops left for the attacker and only a 40% chance to keep 2 troops? And what if 3 troops attack a territory of 3? The attacker keeps .9 troops the defender 1.2. With .9*.8*100% = 72% these values are rounded to 1, meaning the attacker and defender each keep one troop. What happens then with equal number of troops? I assume that territory then in not taken and both still have one troop. Another option could be both troops neutralize and both territories become neutral again :).