Is it that firing doesn't actually calculate accuracy in any way, and calculating hit chance via the combat engine would amount to running a Monte Carlo Simulation with a large number of shots to approximate the hit chance? If it's like this, I could see how it's troublesome...
From my understanding this is essentially correct. What I believe happens when you fire is that the engine takes the soldier's accuracy and the weapon's spread value, mushes the two numbers together, sprays your ammo down range at an angle determined by RNG and the mushy spread number, and then checks the hit boxes like a first person shooter. So the shooting engine never develops or uses a %hit chance. The number reported on your targeting mouse-over is a fuzzy guesstimate from somewhere in the UI code (I think, don't quote me on that one because it's a logic guess).
For real fun:
The reported %hit has no effect on RF. Soldiers may
or may not RF anywhere between 0% and 90%+
RF is more likely to happen if your chosen RF mode shoots more bullets.
RF will
not happen outside the weapon's listed range (in squares).
Higher soldier stats and skills will mean more frequent and accurate RF. Expect +30% RF if you double the soldier's stats and triple the skills.
Some weapons (and it's definitely the weapons) will RF through a LoS blocking alien.
From the tests I've run a noob soldier with a sniper rifle at 50 squares will take about 50% of the RF (Aimed Shot, crouched, 23% reported hit chance) chances he is offered. And it's about a 50/50 chance as to whether he'll take the RF before or after the provoking action.
From the tests I've run a noob soldier with a machine gun at 65 squares will take about 60% of the RF (Full Auto, standing, 00% reported hit chance) chances he is offered.
I do actually know some coding and am currently going back to school to complete the degree, so if you'll tell me which module the RF code is in than I'll try to look at it.