Excel clone built for Uber China exposed Microsoft calculation error
- Reference: 1695108370
- News link: https://www.theregister.co.uk/2023/09/19/matt_uber_china_excel_clone/
- Source link:
Writing on [1]Substack , Basta said he went to work at Uber in 2016 after a former colleague from cloud storage locker Box suggested he'd be perfect for a job on a "Crystal Ball" team at the rideshare giant.
Basta was told that Uber data scientists built models in the R programming language that the profession favors, and then tried to run those models on laptops that ran overnight.
[2]
"When the data scientists arrive in the morning, the laptops whose models didn't crash have data that's maybe usable that day," Basta was told. Models that crashed represented blind spots in Uber's data.
[3]
[4]
Basta therefore worked on a project called "R-Crusher" that automated the model-making process to make it more reliable. More reliable models were needed because Uber was trying to conquer China at the time.
“Nobody really cared very much about the processes for the US and any other country — we had less to lose and Lyft wasn’t seen as remarkable competition except in the handful of cities they were operating at scale,” Basta wrote. “China was a make-or-break opportunity for Uber, China was only going to succeed if we had the data for it, and the data was going to come (at least in part) from R-Crusher.”
[5]
In mid-2016 Basta said he was given another task. Uber had a model “that ran overnight to generate data for anticipated ridership in China.” Uber would feed that data into “a tab on a special Excel spreadsheet” that produced “a little interactive Excel tool for choosing driver incentives.”
Basta and his team were told to present data from the spreadsheet on the web so staff could acess the model. Uber China didn't want staff to work in Excel. Instead Basta was told to build an interface that looked and behaved like Excel, because that was what Uber’s internal users knew best.
“Every day that we don’t have this tool as specced, we’re losing millions of dollars,” Basta says he was told. Fixing that was critical because Chinese ride-share company DiDi was a real threat. And as stated, Uber had by this time mostly stopped worrying about its main US rival Lyft, Basta wrote.
[6]Servers as pets or cattle was 2012. Now it's McMansions or Hotels
[7]Like Uber, but for China: Beijing creates state-owned meta rideshare service
[8]DiDi, China’s Uber analog, booted from local app stores for data naughtiness
[9]Asia's top rideshare outfit, Grab, is late paying fines for running late
As luck would have it, Basta had worked on a basic collaborative spreadsheet during his time at Box.
Basta described the scenario he envisioned for that project as moments in which a full spreadsheet is too much, but “you just needed a place to put together a handful of formulas, format it with some headings and text, and share it with other people. Sort of like an IPython notebook for spreadsheets.”
[10]
Nothing came of the project at Box, but Basta kept the code and decided it might be the basis of a tool to address Uber’s needs.
“I wasn’t going to be Excel, but it would behave sort of like Excel, it would read an Excel file as input, and it would Excel formulas on some data,” he wrote. “That was about as close to ‘just make it like Excel’ that we were going to get. And it also meant that we could skip the process of translating thousands of dense formulas to JavaScript.”
Basta’s post details how he built the tool, but gets really interesting when he started testing it – because his kind of-spreadsheet and Excel produced different values when working with the same data. After plenty of internal discussion, he figured out the cause of the error, which he described as follows:
You see, when formulas create a circular reference, Excel will run that computation up to a number of times. If, in those computations, the magnitude of the difference between the most recent and previous computed values for the cell falls below some pre-defined epsilon value (usually a very small number, like 0.00001), Excel will stop recomputing the cell and pretend like it finished successfully.
Basta’s efforts produced a tool that looked like Excel, ran in a browser, and produced accurate output – which Excel could not. Colleagues were mightily impressed that Basta had hand-coded this tool and it went into production in July 2016.
Then a manager asked why it displayed formulae.
“You said to make it just like Excel” was Basta’s reply.
At which point the manager offered this comment:
People working for Didi apply for intern jobs at Uber China and then exfiltrate our data. We can’t let them see the formulas or they’ll just copy what we do!
And there we were thinking that interns were just after a solid entry on their CV and some drinking money!
In the first week of August 2016, Didi acquired Uber China.
“Most of us found out because our phones started dinging with news stories about it,” Basta wrote. Once the deal was done, his tool was binned. He uploaded it to [11]GitHub .
Basta doesn’t mourn his work. His post mentions the [12]“cattle vs. pets” metaphor that suggests computing resources aren’t worthy of sentimental treatment. He also wrote he doesn’t see the binning of his tool as a failure.
“You won’t have the opportunity to take lessons away from the project if you see the sunsetting of the project as a failure: there’s often much to learn about what non-technical aspects of the project broke down,” he wrote.
“Perhaps there aren’t any, and maybe management is just a group of fools! But often that’s not the case; your delicately milled cog wasn’t ripped out of the machine because it was misunderstood, it was ripped out because it didn’t operate smoothly as a part of the larger system it was installed in.” ®
Get our [13]Tech Resources
[1] https://basta.substack.com/p/no-sacred-masterpieces
[2] https://pubads.g.doubleclick.net/gampad/jump?co=1&iu=/6978/reg_software/applications&sz=300x50%7C300x100%7C300x250%7C300x251%7C300x252%7C300x600%7C300x601&tile=2&c=2ZQlxQesgD62FgKj@g2L5BAAAAlA&t=ct%3Dns%26unitnum%3D2%26raptor%3Dcondor%26pos%3Dtop%26test%3D0
[3] https://pubads.g.doubleclick.net/gampad/jump?co=1&iu=/6978/reg_software/applications&sz=300x50%7C300x100%7C300x250%7C300x251%7C300x252%7C300x600%7C300x601&tile=4&c=44ZQlxQesgD62FgKj@g2L5BAAAAlA&t=ct%3Dns%26unitnum%3D4%26raptor%3Dfalcon%26pos%3Dmid%26test%3D0
[4] https://pubads.g.doubleclick.net/gampad/jump?co=1&iu=/6978/reg_software/applications&sz=300x50%7C300x100%7C300x250%7C300x251%7C300x252%7C300x600%7C300x601&tile=3&c=33ZQlxQesgD62FgKj@g2L5BAAAAlA&t=ct%3Dns%26unitnum%3D3%26raptor%3Deagle%26pos%3Dmid%26test%3D0
[5] https://pubads.g.doubleclick.net/gampad/jump?co=1&iu=/6978/reg_software/applications&sz=300x50%7C300x100%7C300x250%7C300x251%7C300x252%7C300x600%7C300x601&tile=4&c=44ZQlxQesgD62FgKj@g2L5BAAAAlA&t=ct%3Dns%26unitnum%3D4%26raptor%3Dfalcon%26pos%3Dmid%26test%3D0
[6] https://www.theregister.com/2017/05/08/mcmansions_vs_hotels_vmware_pivotal_nsx/
[7] https://www.theregister.com/2023/01/19/china_meta_rideshare_service/
[8] https://www.theregister.com/2021/07/05/didi_the_ridesharing_platform_that/
[9] https://www.theregister.com/2023/05/18/philippines_fine_grab_again/
[10] https://pubads.g.doubleclick.net/gampad/jump?co=1&iu=/6978/reg_software/applications&sz=300x50%7C300x100%7C300x250%7C300x251%7C300x252%7C300x600%7C300x601&tile=3&c=33ZQlxQesgD62FgKj@g2L5BAAAAlA&t=ct%3Dns%26unitnum%3D3%26raptor%3Deagle%26pos%3Dmid%26test%3D0
[11] https://github.com/WebSheets
[12] https://www.theregister.com/2013/03/18/servers_pets_or_cattle_cern/
[13] https://whitepapers.theregister.com/
Re: Is Excel really the right tool for numerical analysis?
Wikipedia has a decent summary of Excel's numeric errors:
https://en.wikipedia.org/wiki/Numeric_precision_in_Microsoft_Excel
Re: Is Excel really the right tool for numerical analysis?
My favourite excel error is that it treats Feb 29th, 1900 as a valid date
I hear attack lawyers straining at their leashes!
So he admits to using code that he developed whilst working at a former employer for a later employer, and then posting that to GitHub. He's a braver person than I am.
If I were ever to reuse code (or even keep a copy) I would not be admitting that fact to anyone,ever.
> You see, when formulas create a circular reference, Excel will run that computation up to a number of times. If, in those computations, the magnitude of the difference between the most recent and previous computed values for the cell falls below some pre-defined epsilon value (usually a very small number, like 0.00001), Excel will stop recomputing the cell and pretend like it finished successfully.
Im sorry this doesnt sound right.. a circular reference is an error in both excel and algebra.
That depends.
It is possible to create a circular reference that on each 'lap' asymptotes towards a required result.
[1]For example, ways to calculate PI that use loops.
You could create a circular reference in Excel that gets closer and closer to the 'answer' on each lap, and Excel is set up to stop if it sees the values are only changing by a small amount.
I'm not saying that it's a good thing. I'm just pointing out that it isn't necessarily an error.
[1] https://iq.opengenus.org/different-ways-to-calculate-pi/
Excel will throw the error, but as a pop-up, not a #ERROR. The circularly referenced cells (usually) still display a value, which is what's being calculated here.
If you point a Vlookup or something at a range then edit that range, and make parts of it depend on other stuff, etc, then it gets complex.
Excel has to try and figure out a result, otherwise no-one would've started using it.
The issue is now that there are entire divisions of major companies that are working off the results of some arcane spreadsheet with 240 interdependent sheets and 3 million variables, with no history nor change control!
Is Excel really the right tool for numerical analysis?
I've always used Matlab or Octave when I've needed to do "serious" numerical analysis.
Does Excel use techniques like [1]Kahan Summation to reduce the horrendous rounding errors you can get when using floating-point arithmetic?
If you want to see how bad things can get, [2]have a read of this (not light bedtime reading)!
[1] https://en.wikipedia.org/wiki/Kahan_summation_algorithm
[2] https://pages.cs.wisc.edu/~david/courses/cs552/S12/handouts/goldberg-floating-point.pdf