https://youtu.be/_qaKkHuHYE0 (CppCon) A senior software engineer at Google tried to optimize tcmalloc by replacing a mutex with lockless MPMC queue. After many bugs and tears, the result is not statistically significant in production systems.
A fully lock free allocator would be a huge result by itself: you would be able to allocate from a signal handler, or having truly lock free algorithms that do not need custom allocators, or avoid deadlock prone code in tricky parts like dlclose...
But I guess this was only one part and malloc wouldn't be fully lockfree.
In any case the lockfree mallocs designs I have seen use NxN queues to shuffle buffers around, but I guess it would be unsuitable for a generic malloc.
KCP uses a brute force congestion control algorithm that is unfair and inefficient. It is also poorly specified, which is probably why it is less commonly used outside circumvention circles.
What really happened is that China hacked Google, and it pissed Google off when they finally discovered it, many months later. This wasn’t some small intrusion or data breach. It was a systemic, coordinated, widespread, very deep hack, which among other things, gave China all of Google’s source code. It was very similar in scope and ambition to the Solar Winds hack recently out of Russia. It forced Google to completely rethink their security, which at the time was an Igloo model (hard on the outside, soft on the inside, a Gary Larson reference I think), and they had to migrate to where internal access was also limited, which took years.
I’ll share with you, confidentially wink wink, that most companies way overvalue their source code. It’s actually their engineers who are their biggest asset, because the engineers can reproduce the source code if it’s lost (quite quickly at that), whereas the source code can’t do fuck-all on its own. Moreover, most source code bases are so ugly that you couldn’t give them away. But Google had what they now call “HIP” (High-value Intellectual Property) scattered through their source code, which are the tuning parameters and constants for various algorithms and AI models which are the true Secret Sauce to Google’s Search and Ads dominance.
At both small companies I worked at, the real value was in the business relationships built up (suppliers etc). The code could be rewritten. It wouldn't be bug-compatible, but all the ideas and design were backed up in engineers' minds.
There are even advantages from a clean slate methodology; if there’s sufficient buy in from management.
Reason being: if you have done things before and bore the weight of architectural misgivings, you can clearly reproduce the software.
The biggest barrier to doing this normally is:
A) time pressure.
B) pressure to use existing log available tech
C) pressure to be cheap (which is manifested most often in A&B but is it’s own thing too).
This causes “large rewrites” to be rushed, subpar and lesser quality as the emphasis often isn’t on getting to feature parity.
Regardless, if google lost their code- entirely, we would probably have search by next week, auth in a fortnight, mail by next month and something approximating google cloud by the end of the year.
Because a lot of the really hard lessons have been learned, a reimplementation is just time.
I do. If, and only if, you build up the exact same thing. Once engineers band together for a rewrite that changes project architectural, conceptual, and engineering principles, then you're looking at a runaway deadline.
I have used EFISTUB for 10 years but I wouldn't recommend it for the next install. The bootloader is the one arcane place that you don't want to be clever with and get reminded of its presence daily, because once it fails for some reason, it wastes much more time to find and read docs and diagnose than the time saved in boot speedup, because the knowledge to debug it is not something you would remember everyday. And this setup is even rarer than Grub, so any failure cases will not have help from cached knowledge and thus require much more research from first principle. Some backup options here would help in case, even if they impose some tax in boot speed. (If Grub takes a tax of 3 seconds per boot, and if a failure in EFISTUB takes 1 hour to resolve, it takes 1200 boots for EFISTUB to be worth the risk, which is 3 years if it's a laptop booting once per day, and much longer for a desktop.)
Once my desktop using the EFISTUB setup had a kernel that failed to boot, stuck at some filesystem error. Then I had to come up with a rescue plan at the spot, because there was no other way to boot into the desktop and there was no tutorial to help with this at the time.
The issues of EFISTUB:
- It doesn't interact with kernel updates nicely. I used a script in /etc/kernel/postinst.d to copy /vmlinuz to \EFI\debian\vmlinuz.efi. There is no rollback, and no multiple kernels.
- It doesn't work well with kernel parameters. The parameters are encoded in UEFI NVRAM. You have to create separate entries for different kernel parameters, or manipulate the NVRAM back and forth with efibootmgr, which is another gun that easily shoots the foot (you can easily mess up the bootorder variable).
- It doesn't play nicely with Windows and Secure Boot.
I use EFTSTUB with Arch Linux and I agree about it taking up more of your time. However, for me, this was all the very start to first set it up. Since then, it’s been smooth sailing.
I also use multiple kernels and I have had issues with kernel updates, and no issues with kernel parameters. However, there is friction with creating separate entries and so I created a very simple shell script to save my commands.
I’ve had no issues dual booting with Windows using BitLocker. I do not use secure boot (yet).
If you’re willing to spend an hour to set it up, I’d go for it. However, that’s an hour of your life you can save with Grub.
Sure, it's common to have it working for a long time, because breaking changes and interactions between different systems occur very infrequently at the level of bootloader and firmware, but when it happens it can easily get into very difficult support situation. Logistically speaking, firmware is not a nice place to play around. It's not well coded, not well tested, and rarely "used" by an end user.
For one I wouldn't put great confidence in a script to manipulate UEFI boot entries, because it is not idempotent and there are precedents to brick the UEFI with unexpected sequence of interaction. Also Windows' reboot options and its annual upgrade tend to mess with the boot variables. I had to help repair colleagues' laptops that had Grub's boot entries erased by Windows upgrades.
> Also Windows' reboot options and its annual upgrade tend to mess with the boot variables. I had to help repair colleagues' laptops that had Grub's boot entries erased by Windows upgrades.
I'm mostly a Windows user, and this has never happened in my experience: at worst Windows might reorder the UEFI boot options, or change the default boot option, but it has never overwritten or erased an entry.
At worst they are still available in the F12 boot menu.
You can embed the parameters in the EFISTUB, this is explained in the arch wiki.
I use that to test different parameters with the same kernel packaged in different EFI payload, which I can select from the F12 boot menu if I don't want to use the commands to specify "use this payload only for the next boot"
Human can't visualize a tesseract, but human can conceptualize the Idea of a tesseract in the symbolic space, by math, physics, or in other words, by Reason.
The Symbolic is a radically simplification of all the complexities impossible to be fully sensible. Even though the simplification is always particular, contingent, and full of ambiguity (human languages) and often inaccuracy (Newton's laws vs relativity), without the simplification, without Reason, ML systems are probably like animals, eventually succumbing to the full force of the complexity of reality.
Plenty of RL systems learn to play video games just fine without fine-tuned rewards, but I see this line of thought isn't actually what you're getting at.
I would assume serious ML people would not be overly ambitious and overstep their claims beyond empirical realms. You were saying ML "uncovers latent representational structure not present in the data", but I would guess the claim, if that is what you're going against, is merely that the latent structures exist, and no Truth is really "uncovered" by ML per se, in the Heideggerian sense.
I agree ML hasn't really produced an Understanding of the world. The carving along the joints is in other words a symbolic abstraction of the world that is a radical simplification, for which only Reason is capable of, and ML hasn't shown to be capable of Reason. As an aside, I also would not assume the ambiguity you refer to can be fully eliminated even by human intelligence, just see how languages are fully of ambiguity, or even quantum mechanics.
But again, when philosophical critiques are launched against ML, the usual story is ML advocates would retreat to the success of ML in the empirical realms. I'm reminded of the Norvig vs Chomsky debate by this.
I think this debate has historically suffered from being conducted purely philosophically. Hediegger, Dreyfus (Ponty et al.) needed a bit more science and mathematics to see through the show.
All we need to do to make the Heideggerian point is ask the RL researcher what his reward function is. Have him right it out, and note, that its a disjunction of properties which already carve the environment of the robot.
In otherwords, the failure of AI is far less of a mystery than philosophy alone seems to imply. Its a failure in a very very simple sense if one just asks the right technical questions.
For RL, all we need ask is, "what will the machine do when it encounters an object outside of your pregiven disjunction?"
The answer, of course, is fall over.
Hardly what we fear when the wolf learns our movements, or what we love when a person shows us how to play a piano for the first time. The very thing we want, and we are told we have, isnt there... and it's not "not there" philosophically... its not there in the actual journal paper.
The Heideggerian point is a start, but I don't think it's enough to just point out a failure like this. This allegation is something like "The answer is already encoded in the question" like of trick, similar to one played in Foucault's episteme, where science itself is always-already a social construction without which it is impossible to happen.
The trick is challenging on first sight but it won't go very far, because it just tells us what ML lacks but doesn't tell us what ML can have and how to go there. We need a new kind of Turing test that actually reflects the power of human intellect.
I suspect even thinking there's a "test" has it wrong.
Yes, there's an experimental test -- as in, testing to see if salt is salt. But I dont think there's a formal test... as soon as you specify it, you've eliminated the need for intelligence. Intelligence is in that process of specification.
In otherwords, we should be able to ask the machine "what do you think of woody allen's films?" and rather than just taking any answer.. we need an empirical test to see if the machine has actually understood the question. Not a formal test.
There is no doubt a sequence of replies which will convince a person that the machine has understood the question: just record them, and play them back.
We're not interested in the replies. We're interested in whether the machine is actually thinking about the world. Is it evaluating the films? What are its views? What if I show it a bad film and say it wasnt by woody allen? What then?
There's something wrong in seeing this as a formal, rather than experimental, process. For any given machine we will need specific hypothesis tests as to its "intelligence", and we will need to treat it like any other empirical system.
OK, maybe "Turing test" was a bad hint because too often its extension turns into a philosophical rabbit hole of defining intelligence.
I want to get back to your initial statement about uncovering and structures, which I think is still grounded in the empirical realm. I think a less ambitious new test could be about the "uncovering" between analog data and the structures. To be real uncovering, the structures must be symbolic, not just transformed analog representation, and the symbolic structures must be useful, e.g. provide radical reduction of computational complexity compared to equivalent computation with analog data.
The point is to test if the machine can make the right abstraction (real uncovering) and also connect the abstraction with the data, not just games with words.
> For RL, all we need ask is, "what will the machine do when it encounters an object outside of your pregiven disjunction?"
> The answer, of course, is fall over.
There is no reason to think humans are qualitatively different in this regard, it is just that it does not happen very often. One case where it does is that humans pilots, no matter how competent, are incapable of flying without external visual references or instrument proxies for them.
If I am following here, a key part of this argument is that models only represent things "in bounds" of the model, and that unsupervised, iterative approaches are especially susceptible to this. Video games are enormously constrained, artifical model environments, and therefore by definition are completely discoverable.
Meanwhile, human cognition and the real actual world, have vast and subtle detail, and also are not completely knowable at any level minus some physics or similar. Tons of possible data sets are not necessarily discoverable or constrained, yet humans can investigate and draw conclusions, sometimes in very non-obvious ways.
Falling back to pure philosophy, personally I am heavily on the side of the human, and in the wake of Kurt Gödel, believe that plenty of formal systems are never complete, nor can they be shown to be complete or incomplete.
These are all unified as different modes of message passing in probabilistic graphical models. Kalman filters are indeed structurally similar to an HMM without the backward message passing step if viewed as a PGM.
Agreed. And, Bar Shalom's forward/backward alg for maneuvering, nonlinear models from Maneuvering Target Tracking is essentially one full execution PGO.
I find Yanis Varoufakis' account of the history leading up to the collapse of Bretton Woods very telling:
As the combined costs of the Vietnam War and the Great Society began to mount, the government was forced to generate mountains of US government debt. By the end of the 1960s, many governments began to worry that their own position, which was interlocked with the dollar in the context of the Bretton Woods system, was being undermined. By early 1971, liabilities in dollars exceeded $70 billion when the US government possessed only $12 billion of gold with which to back them up.
The increasing quantity of dollars was flooding world markets, giving rise to inflationary pressures in places like France and Britain. European governments were forced to increase the quantity of their own currencies in order to keep their exchange rate with the dollar constant, as stipulated by the Bretton Woods system. This is the basis for the European charge against the United States that, by pursuing the Vietnam War, it was exporting inflation to the rest of the world.
Beyond mere inflationary concerns, the Europeans and the Japanese feared that the build-up of dollars, against the backdrop of a constant US gold stock, might spark off a run on the dollar which might then force the United States to drop its standing commitment to swapping an ounce of gold for $35, in which case their stored dollars would devalue, eating into their national ‘savings’.
The flaw in the Global Plan was intimately connected to what Valery Giscard d’Estaing, President de Gaulle’s finance minister at the time, called the dollar’s exorbitant privilege: The United States’ unique privilege to print money at will without any global institutionalised constraints. De Gaulle and other European allies (plus various governments of oil producing countries whose oil exports were denominated in dollars) accused the Unites States of building its imperial reach on borrowed money that undermined their countries’ prospects. What they failed to add was that the whole point of the Global Plan was to revolve around a surplus generating United States. When America turned into a deficit nation, the Global Plan could not avoid going into a vicious tail spin.
On 29th November 1967, the British government devalued the pound sterling by 14%, well outside the Bretton Woods 1% limit, triggering a crisis and forcing the United States government to use up to 20% of its entire gold reserves to defend the $35 per ounce of gold peg. On 16th March 1968, representatives of the G7’s Central Banks met to hammer out a compromise. They came to a curious agreement which, on the one hand, retained the official peg of $35 an ounce while, on the other hand, left room for speculators to trade gold at market prices.
You can summarise this argument, and several of the other arguments in this thread as: It was large-scale government spending financed by seignorage/inflation instead of taxes that did this. "Free money" for politicians, hidden from the electorate. Not just in America, but as a global phenomenon.
With GREAT emphasis on the fact that is was not the large-scale spending that did it in, but the hidden aspect of it.
You correctly identify the catch-22 for governments: once one government (arguably France I guess, or at least they forced the world to follow them, I guess they didn't start it) showed you could do this, other politicians in other governments had little choice but to follow suit.
In a way you can say that the breaking of the gold standard was the problem. But that's like saying in a heart attack the heart is the problem. It's not wrong, but it's of course not the root cause: it's (usually) the decades-long excess of cholesterol in your arteries, mostly due to unhealthy eating habits, that's where you should look to the root cause. Hiding increasing government expenditures is the root cause.
> You can summarise this argument, and several of the other arguments in this thread as: It was large-scale government spending financed by seignorage/inflation instead of taxes that did this.
That's the angle that a lot of people want to push, but is it actually correct? What about the trade deficit angle? Especially with regards to oil imports.
Everything is connected. Since the government, despite what people seem to think these days, still represents something between 30% (only government directly) and 60% (government + contractors + fully dependent on government + ...) of the economy in the US, it can easily explain a 3% trade deficit.
But again, the actual spending is NOT the problem. Nor is the trade deficit. Using sovereignty (ie. government spending inflation) to take away normal people's ability to negotiate with accurate information (and voting) what their fair share of the economic pie is. THAT is the problem.
We could double government expenditures without causing a real problem. But if we double them and only 1% of people go to their boss "I need a raise" because they just don't know, then it'll be really bad: they'll have to compete for goods and services with the other side having double as much money as it does now.
> Beyond mere inflationary concerns, the Europeans and the Japanese feared that the build-up of dollars, against the backdrop of a constant US gold stock, might spark off a run on the dollar which might then force the United States to drop its standing commitment to swapping an ounce of gold for $35, in which case their stored dollars would devalue, eating into their national ‘savings’.
Isn't this an inflationary concern? The problem is that there are too many dollars for the price of gold to stay low. The devaluation has already happened regardless of whether a run has occurred; there is no way to realize the value of your "national 'savings'" without performing the run and dropping the value.
The only way for this concern to make sense is if
(1) You are committed to never spending your "savings", no matter what; but also
(2) You need the paper value of your "savings" to be a particular number, even though you will never do anything with that number other than look at it.
Can you comment on the tradeoffs between indirect TOF (phase) and direct TOF (time), what made Apple opt for direct TOF here, is it Microsoft's patents?
Indirect ToF: easier to manufacture in small form factors, relatively cheap, well established technology. Easier temperature calibration and lower precision required when manufacturing the emitter, meaning cheaper components and more vendors that can make them. Because the technology can only measure the shift in phase, there is phase ambiguity between waves. The way this is dealt with is to emit multiple frequencies and use the phase shifts from each to disambiguate, but you usually only get a few channels so there ends up being a maximum range, after which there is ambiguity (aliasing, if you will) about if an object falls in a near interval or a far one. Multipath can commonly also cause such artifacts in indirect ToF systems. Finally, because they are continuous wave systems, they can (though modern indirect ToFs try to mitigate this) interfere with each other like crazy if you have multiple running in the same area. I’ll note that there are also gated systems that I would characterize as indirect ToF, that use a train of pulses and an ultrafast shutter to measure distance by how much of each pulse is blocked by the shutter. These suffer from more classical multipath (concave regions are pushed away from the camera), and are not very popular these days. You are right to call out that Microsoft is very heavily patented in the ToF space, and they ship probably the best indirect ToF you can buy for money on the HoloLens 2 and Microsoft Kinect for Azure.
Direct ToF is a newer technology in the mobile space, because it has proven challenging to miniaturize SPADs, which are really the core technology enabling them. Additionally, the timing required is extremely precise, and there are not that many vendors who can supply components adequate for these systems. While there are patent advantages, there are also some significant technical advantages. Direct ToF systems have better long range performance, are much less affected by multipath, interference with other devices is minimal, and most critically - you can push a lot more power, because you emit a single burst instead of a continuous wave. This is really important for range and SNR, because all active IR imaging systems are limited by eye safety. For eye safety you care about not just instantaneous power but also energy delivered to the retina over time. Its helpful to recall that for all these active IR systems that go to consumers, they need to be safe after they’ve been run over by a car, dropped in a pool, shoved into a toddlers eye socket, etc - so this puts pretty strong limits on the amount of power they can deliver (and thus ultimately on range and accuracy). Direct ToFs are also really nice thermally, because your module has a chance to dissipate some heat before you fire it again (vs CW systems where you’re firing it a much higher fraction of the time).
Kudos on the explanation. I'd love to see you do a blog pot that elaborates on these different methods with diagrams for laymen like me who find this fascinating.