Writing 20 to 30 man-years of software code in just weeks is no easy task.

That's apparently what had to be done at Tesla to correct a bottleneck that was holding up Model 3 production.

Tesla Model 3 Production

Tesla Model 3 Production

Following the recent Q3 report, Musk explained on the earnings call that one of the major production constraints for the Model 3 was that software for two of the four Model 3 battery modules/production zones had to be recreated. Quoting Musk:

“To date, our primary production constraint has been in the battery module assembly line at Gigafactory 1, where cells are packaged into modules.”

“We had to rewrite all of the software, from scratch. We managed to write 20 to 30 man-years of software in 4 weeks.” 

Tesla outs the issues on suppliers, saying that the initial programming was "done by manufacturing systems suppliers."  Musk further noted that Tesla itself "significantly redesigned" the system/software to correct the issues.

The Tesla CEO also noted specific issues to the zones (both software and hardware related):

 "Zone two (of four) in particular, we had a subcontractor, a systems integration subcontractor, that unfortunately really dropped the ball, and we did not realize the degree to which the ball was dropped until quite recently, and this is a very complex manufacturing area. We had to rewrite all of the software from scratch, and redo many of the mechanical and electrical elements of zone two of module production."

This bottleneck was hinted at awhile back, but now we get a clearer idea of what the actual issue was. The rewritten software should allow full automation of the battery module assembly process, which in turn should increase Model 3 production. However, the hiccup was enough to force Tesla to push back production targets for the Model 3 and to issue emails to reservation holders noting delivery delays.

Tesla now says it'll produce 5,000 Model 3s per week by the end of Q1 2018, basically a three-month setback from initial projections.