Scammers deepfake CEO's voice to talk underling into $243k transfer? - <AUTHOR> https://nakedsecurity.sophos.com/2019/09/05/scammers-deepfake-ceos-voice-to-talk-underling-into-243000-transfer/ <comment><USER2> Boss, executive, manager, supervisor. Person in charge. Of these people there are many who want their subordinates to enact their will in the way that requires their own personal least amount of effort.

They want to give ambiguous direction and receive exactly what they imagined but still be delightfully surprised. They don't want to hear about the unintended consequences of getting exactly what they asked for; they want it to "just work and don't trouble me with the details".

Pedantry is unacceptable. Everything must be interpreted exactly how it was meant to be. The rules are meant for others. If a subordinate fails while breaking a rule, then they are fired. If a subordinate fails because they didn't break a rule, then they are fired.

Ultimately, as we come closer to perfect impersonation at the press of a button, these 'people in charge' will have a tough time adapting. They want absolute obedience and unquestioning loyalty. Unless their subordinate was talking to a social engineer using a deep fake.

On the other hand. The people in charge who trust their subordinates, who let them fail and encourage them to do better, who let them question their approach and decisions. These people in charge will find themselves and their organizations more resilient to these attacks. "Yeah, Jeff might be a real jerk sometimes and he's always second guessing decisions, but he doesn't transfer $12 million just because he gets a phone call where someone who sounds like me is upset that the money hasn't been transferred."

<comment><USER3> This development is a blessing in disguise for people tired of dealing with "decision-makers" giving orders continuously. A tedious authentication step is a good speedbump against impulsive CEOs.

<comment><USER4> We should be able to trust what's displayed as a caller (stolen unlocked smartphone is a different problem). It doesn't seem that hard. It's not rocket science. I don't understand why we don't have that yet.

<comment><USER5> That only helps if you're able to recognize that number. Otherwise it's just an equally plausible number to be called from. In this case it's the voice that tricked the person and I'm pretty sure that if your boss calls you and demands something the likelihood to comply is pretty high. Your suspicions about not recognizing the phone number will not even get time to properly form.

We need for bosses to understand that this is not the way to request things but to always go through authorized channels which implement better "authentication" processes. This may also dampen their willingness to make "out of band" requests.

<comment><USER6> What millennium do you live in that when one of your contacts calls you, the thing that shows up is a number and not the caller's name?

That's my biggest pet peeve about Android. (Totally unrelated discussion, sorry) I can't tell it to send all calls that aren't from my contact list directly to voicemail. They're universally spam.

<comment><USER5> The millennium in which my CEO can call me from any phone in the company and I'd be hard pressed to tell if it's legit or not? Or from a phone in another parent or subsidiary in any number of countries that I have basically no chance of recognizing? The simple fact that it's the CEO calling discourages anyone from questioning it because C level executives and senior management have a way of imposing this kind of "absolute authority" in many companies.

</comment></comment></comment></comment></comment></comment><comment><USER7> Although the general class of problem is real, this story didn't hold up under examination. Here's a follow-up article in Spiegel: [https://www.spiegel.de/netzwelt/web/deepfakes-werden- erkennu...](https://www.spiegel.de/netzwelt/web/deepfakes-werden- erkennungsmethoden-die-naechsten-uploadfilter-a-1286373.html)

It's in German, but Google Translate to the rescue. Key paragraphs:

'But when asked, how do you know that such a software and no voice imitator has been used, a spokeswoman replies to SPIEGEL by email: "We do not know with 100% certainty. Theoretically, it could have been a human voice imitator But we do not assume that there are some clues (but no evidence). "

'In turn, the clues she mentions have no technical relevance; they are by no means interpreted as evidence of a deepfake. The supposedly "first case" can therefore at best be termed a "possible case". Which is quite symptomatic of the debate about deepfakes and the resulting risks.'

<comment><USER8> Possible case, furthered tempered by "infosec industry source". :) It is their job to sell fear

<comment><USER9> The entire "infosec industry" is fraudulent, in my estimation. A bunch of assholes selling powerpoints and not a whole lot else. I've seen it a lot.

None of them know what they're talking about. Source: my direct experience

<comment><USER8> I wouldn't say that, but they do suffer from something the IT industry as a whole suffers from: there is/was a need, and by fulfilling that need, they find themselves in a quandary where they're committed to something that must continue to exist in order to avoid inflicting self-harm.

You can't go into business selling software on the assumption you'll sell a single copy and your work is finished. Infosec is no different. There is always this paradoxical need to ensure you never become entirely redundant, regardless of the function you specialize in

I think a lot of the great "evolutionary difficulties" in our industry can be phrased this way. It's why things like Microsoft Excel are laughed at even as hundreds of thousands are trained in the art of constructing effectively bespoke spreadsheets apps in Django by the million every year. I hope for a correction some day, just as much as I hope I'm on the right side of it when it comes..

<comment><USER9> You misunderstand. "Infosec" is a shopping list item on govt requirements. "We need this, this, this, and it needs to be secure!" They assume security is just this additional ingredient that can be purchased, mixed in, and boom; project is secure, like mixing in chili to anything will make it hot. The infosec companies do everything they can to encourage this assumption.

It's all bullshit, and these people are pure scum.

<comment><USER8> Speaking as a developer, I've had my ass handed to me by competent security folk on several occasions. Unfortunately in the software industry, security must regularly be an additional ingredient that can be purchased and mixed in, because 98% of us are completely clueless and absolutely not thinking about this stuff as we're trying to clear a sprint board

<comment><USER10> Serious questions:

> because 98% of us are completely clueless

Do universities/bootcamps teach OWASP-style classes of programming vulnerabilities these days? Some developers are curious enough to learn them on their own, but many are oblivious.

I suspect there could be a startup idea here somewhere.

> absolutely not thinking about this stuff as we're trying to clear a sprint > board

Does anyone have a decent tool/process for remembering all of the detailed tasks for every type of software deliverable? I find myself in a state of cognitive coma after sprint planning when I need to divide tasks into subtasks.

<comment><USER11> > Do universities/bootcamps teach OWASP-style classes of programming > vulnerabilities these days? Some developers are curious enough to learn them > on their own, but many are oblivious.

I had exactly one course that touched on security.

A course in web programming.

The instruction we received consisted of: "If your project is not secure, it will lose points."

I'm not sure a single person on that class had one point taken off for getting security wrong.

Why would a university care about educating people in something ephemeral, and domain-specific, like security, when it could instead be teaching them about complexity theory and Djikstra, and third normal form?

</comment></comment></comment></comment></comment></comment></comment></comment><comment><USER12> Sure, this is a troubling new variation, but it's still the kind of social engineering that can be deflected with reasonable protocols, such as a second channel of authentication (e.g. "Sounds good boss, can you email me the transfer/order id to confirm things and I'll finish it from here". The underling CEO was as vulnerable to someone imitating his boss's voice the old- fashioned way.

Regardless of the advances in AI, I think text-based social engineering will still be prevalent and efficient. IIRC, the Anonymous hackers who targeted HBGary got SSH access by fooling the company's chief security officer. Sure, they did by emailing from the company owner's account (thanks to a weak admin password surfaced through other vulnerabilities). But the hackers didn't even know the account name when asking for a password reset. The CSO could've stopped things by asking to do a call, e.g. _" Hey let me call you, I need to walk you through this part"_ or even just texting the phone for confirmation.

[https://arstechnica.com/tech-policy/2011/02/anonymous- speaks...](https://arstechnica.com/tech-policy/2011/02/anonymous-speaks-the- inside-story-of-the-hbgary-hack/3/)

</comment><comment><USER13> Does this trend bring us into the promised "post-truth" world?

...or will it force humanity to finally acknowledge the very basic security concept of public/private keys for signing important shit?

<comment><USER14> I recently chatted about the potential use of DeepFake in future propaganda with other HN readers, and apparently it's going to be here soon. You may want to follow this thread, [https://news.ycombinator.com/item?id=21269150](https://news.ycombinator.com/item?id=21269150)

But in short,

Several observations...

* A major threat is end-to-end VoIP/telephony encryption. Currently, the most common way to verify one's public key and ensure that no MITM wiretapping is going on, is reading a hash (encoded to words) aloud in a phone conversation. It's used to many protocols, such as Signal, or ZRTP by Phil Zimmermann et al. There is no real security, but it's considered a shortcut with reasonable security for most people, the assumption is that voice synthesis cannot be done in real-time yet. But with DeepFake it's disastrous for cryptography. Now, this shortcut is going to be blocked soon. Full verification, like signing your VoIP key with your long-term public key, or asking security questions (e.g. OTR's SMP algorithm) is needed (perhaps not to everyone, but it's now required for a lot of people to a greater extent).

* KirinDave suggested that, in additional to signing, timestamping will also be important. If automatic synthesis of video and audio becomes widespread, one way to prove the authenticity of the material is to timestamp it as soon as it's recorded, or even timestamping it in real-time if real-time forgery is a serious threat (I hope not). This is one of few use cases that a blockchain actually makes sense if you want minimum trust over 3rd-parties.

The final thought is that it's time to rewatch _Ghost in The Shell_ (the TV animation series, not the movie). Released in 2000s, it portrayed and predicted our world remarkably well, and it'll give you a lot of inspirations of what would the future society look like. In one episode, the protagonists realized a government conspiracy aimed to intensify a military conflict that involves nuclear weapon, and they had the following dialogue.

> "How do we stop it? Can we post the video footage online?"

> "No. Video footage is seen as completely untrustworthy today."

<comment><USER15> Your second observation regarding time stamps is something I'm really interested in. The broader topic is provenance: the ability to say "this AV stream came from this device at this time." I just wrote a post echoing KirinDave's idea but perhaps expanding the scope in this thread: [https://news.ycombinator.com/item?id=21526278](https://news.ycombinator.com/item?id=21526278)

The more verifiable pieces of data that you can associate with a recording, the more you can trust that it came from when/who it claims to. If I send a recording that can be tied to:

\- a timestamp service with my request for one stored in a blockchain,

\- a tamper-evident device that signs the data with its own private key,

\- my own private key

then you can have a high degree of certainty that I am the one who recorded and sent the content and that it has not been altered. I could still be tied to a chair while a voice actor impersonates me and forces me to send it. This is after all basically the modern equivalent of a proof-of-life photo with the kidnapped victim holding today's newspaper. But it's a lot more effort for someone to go through compared to having none of those other guarantees.

It's a fascinating topic that will only become more relevant as deepfaking gets easier. Whoever makes the first device/system to do this, if it's not a flawed premise, will make a pretty penny.

</comment></comment></comment><comment><USER16> Those "Grandma send money to your grandson to bail him out" scams are about to get a lot more interesting. It's one thing to convince your grandparents never to send money to random people calling on your behalf, but if the conversation happens in your voice? How do harden against such an attack when dealing with people who are technologically illiterate?

Perhaps this opens up a market for secure identity verification that is accessable to the layman...

<comment><USER17> To be fair, these scammers _already_ claim to be the grandson. My grandma got a call from me, from jail, in Mexico. I guess I had a little too much to drink at a wedding, and I had a cold, so my voice was a little off. And I desperately needed to post bail in a foreign country.

It wasn't the voice that tipped my grandma off. Just that I do not drink. So that was close.

</comment></comment><comment><USER18> What I don't get about these scams is what is preventing them from working with the bank to reverse the fraudulent transfers? Sure I get that in these instances money is usually moving between the banking systems of two different countries, but just like we have extradition treaties, how is this not a thing?

<comment><USER19> Well, the issue is I think specifically wire transfers are designed to NOT be reversible? I'm not saying they can't reverse in case of fraud (like this). But it's probably way more difficult because the money would have been IMMEDIATELY available in the fraudsters account, in which case they probably knew to move the money somewhere else immediately / withdraw it (in some regards, I'm not sure how you withdraw $200k cash).

Anyway- that's my guess why this is difficult to reverse.. if it was easy to reverse, both sides would be very suspicious of each other during a large transfer.

</comment></comment><comment><USER20> This and other discussions on HN make me think on the fact that so much of your voice has been recorded by companies when you call their support lines. Are these troves of voice recordings stored safely with appropriate levels of access control?

I mean most people can usually pick up on the difference between a voice recording and a generated voice sample based on the recording. Have there been studies where generated voices are then subjected to telephone compression and layered with background noise to appear to be a phone call from a car?

If DeepFake voices only need 5 second clips to produce good enough versions of anyone's voice and any discrepancy in quality could be attributed as a bad telephone connection or masked with background noise, is anyone really safe?

<comment><USER21> > This and other discussions on HN make me think on the fact that so much of > your voice has been recorded by companies when you call their support lines. > Are these troves of voice recordings stored safely with appropriate levels > of access control?"

"When we said 'quality and training purposes', we were referring to training a neural network."

</comment></comment><comment><USER22> One way to defeat this (kindof) is to institute a callback on the internally shared number.

So it would have went like this:

        1. scammer deepfakes CEO voice
        2. demands X dollars transferred elsewhere
        3. Employee hangs up and calls back using pre-shared phone#
        4. Gets confirmation

Of course this can be somewhat thwarted by sim-stealing attacks. But this is just another _layer_ of defense, that stops another 99.xxx % of attacks. Enough of those and these attacks would be infeasible.

<comment><USER23> Or you just don't authorize multi-million dollar unreversable transfers with a phone call? Processes for this kind of thing are in place for a reason.

<comment><USER22> Well, the obvious counterexample would be Fintech. Calls and messages over approved SEC communications methods can be and are normal operating procedure.

But in this article's case, we're talking about $.243 million , which flies counter to "don't authorize multi-million dollar unreversable transfers".

Not sure what your point was here.

</comment></comment></comment><comment><USER24> My bet is on a voice actor -- or an underling invoking deep fake to cover his arse

<comment><USER11> Transferring $230,000 to your cousin's account, and hoping to stay out of jail, by telling everyone that a deep-fake CEO told you to do that is an incredibly dumb way to steal.

I mean, people do _incredibly_ dumb things, so it is certainly possible. I doubt it, though.

</comment></comment><comment><USER25> How do they know it was AI and not a voice actor?

<comment><USER26> its a random assumption / hypothesis. maybe even it was the real ceo... :D that'd be too funny

<comment><USER27> Be an effective way to get some money.

</comment></comment></comment><comment><USER28> > Bafflingly, though, Dessa said that its team created the Rogan replica voice > with a text-to-speech deep learning system they developed called RealTalk, > which generates life-like speech using _only text inputs_.

I'm missing something here. How could they replicate the sound of his voice using _only text inputs_ [emphasis theirs]?

<comment><USER29> The voice model is trained on voice inputs. The text-to-speech synthesis is based on text only, rather than audio of a different voice. So, together you have voice and text as inputs.

<comment><USER30> Do you know if anyone done this without using text? I mean training a model only using voice samples from different people, and using voice input only during inference.

</comment></comment></comment><comment><USER31> At some point, we are all just going to blame deepfakes for all of our foibles.

"Honey, I sent $20k to that camgirl because I thought she was you! Deepfakes!"

</comment><comment><USER32> Related discussion (separate article) from yesterday: [https://news.ycombinator.com/item?id=21525878](https://news.ycombinator.com/item?id=21525878)

</comment><comment><USER33> Odds are there was no deepfaking involved here, nonsense clickbait title.

</comment><comment><USER34> Almost everything digital in audio seems to have been a decade or two ahead of video (non-linear editing, lossless/uncompressed quality, digital synthesis of elements, distribution, etc), primarily due to the bandwidth and processing power requirements being much greater for video.

So I'm curious how, with regard to deepfake technology, video seems to be well ahead of audio. Is audio deep fake technology simply less interesting to people? Are listeners far more sensitive to voice not being perfect? Is the human input just a lot less helpful in modeling the output with voice vs video (where the initial human input is only slightly more helpful than just synthesizing from text-to-speech)?

</comment><comment><USER35> There is zero information to backup the claim this was a deepfake and not just impersonation.

<comment> the-dude I haven't even seen information backing up the claim of the calls. It could be all made up.

</comment></comment><comment><USER36> If this worked, this scheme is going to be widespread next year, making phones even more useless.

It's ok to get spam and scam for emails if you're not paying anything but there's no reason to get the same for phones if you're paying top $ for it.

</comment><comment><USER37> Wouldn't have taken much effort to verify this. Doesn't even sound like he was that sure it was his CEO, just says he had a German accent and a similar melody. You'd think for a transfer this large he would want to be a bit more certain than that!

</comment><comment><USER38> My dystopian mind thinks it's only a matter of time when a deepfake launches fire and fury across the globe. Imagine the Cuban Missile Crisis with deepfakes. Yes, I know there are layers and layers of safeguards, but....

</comment><comment><USER39> Sounds like a good story for some embezzlment.

</comment><comment><USER31> Reminds of when some scammer bilked Google and Facebook out of $100MM through fake invoices. I'm not sure deepfakes is really likely or a differentiator here.

</comment><comment><USER40> At present day to fight these tricks like your bank calling you or a contact you know calling you both saying fraud...just hang up and dial their phone number directly. Call your bank yourself and ask to be transferred to the fraud department...dial your bosses number directly, etc.

Until the scammers are able to take control of your phone number which I hope never happens I think the above is a good solution to fight this junk.

<comment><USER41> That latter part happens all the time, it's called SIM swapping.

</comment></comment><comment><USER42> How could there be enough samples of his voice? Seems like quite a jump to "it was a deep fake" unless there's more info they haven't revealed

<comment><USER43> From yesterday: [https://news.ycombinator.com/item?id=21525878](https://news.ycombinator.com/item?id=21525878)

Only requires 5 seconds of voice audio to synthesize believable speech.

<comment><USER12> The cadence of the synthesized voices are still noticeably artificial, even for the short demo phrases. This is not to say this isn't impressive. But how much does this method improve when it isn't constrained by a 5-second sample? If we feed it several hours of public speeches from Martin Luther King Jr, or hell, tens of hours of audio from President Obama or Trump – will it have the same artificial cadence, even if the tone and pitch of the imitated voice is accurate?

</comment></comment></comment><comment><USER23> "Deepfakes voices!" makes a cool headline but there's a 90% chance either the employee or the CEO is in on it. Right now the only real fact is "the employee claims someone who sounded like the CEO called"... it's far more probable that either the employee is lying or the CEO actually made the call.

<comment><USER30> Not sure what makes you skeptical. The technology to do this sort of scam was ready at least a year ago. If anything I'm surprised it hasn't happened sooner (it probably did, we just haven't heard about it). If making money transfers is part of your job and your boss calls you to make an urgent transfer for a reasonable amount, why wouldn't you do it?

<comment><USER23> Because the simplest explanation is often the right one. Do you think it's more likely that some scamming group somehow got thousands of hours of the CEO's voice, trained a world-class voice model, got internal info about how the CEO usually calls and requests transfers, found the correct employee to target, spoofed the incoming number... or was the employee's drinking buddy like "hey, just transfer X to this offshore account and say the CEO called you, we can pin it on that deepfakes stuff we saw in the news"? Or even more likely, CEO wants to embezzle some money so he makes a call for the transfer then feigns ignorance?

If there was any sort of proof that this happened, like a recording, then sure. But there's no facts in the article other than "analysts suspect..." and an attention-grabbing headline.

Maybe I'm just jaded but after everything that's happened over the last few years, but I take everything the media publishes with a grain of salt these days.

<comment><USER30> My understanding is you don't need 1000s of hours of CEO's voice. You train the model on many voices, then fine tune it on a few hours of the target voice.

Regardless of what happened in this particular case, this type of scam is now possible, feasible, and will get easier to perform with time. We should be concerned.

</comment></comment></comment></comment><comment><USER44> Maybe it was genuine screw up and the deep fake story was created to cover ones ass.

</comment><comment><USER45> Trust is under full on assault by the nefarious among us.

I ask you, how will we be able to trust moving forward? Will all transacting be in person? We can fake id's too.

How will we be able to verify reality in this age of deception?

</comment><comment><USER46> Previous discussion from 2 months ago: [https://news.ycombinator.com/item?id=20864659](https://news.ycombinator.com/item?id=20864659)

</comment><comment><USER47> A simple predefined verbal password that updates once in a while would be sufficient. Especially if you're transferring hundreds of thousands based on a single phone call.

</comment><comment> the-dude So the CEO was caught embezzling 243k and he blamed it on a deepfake?

Genius.

</comment><comment><USER48> I have a slightly hard time believing all possible responses could be regenerated or done on the fly with a true deep fake. Maybe possible with great planning.

<comment><USER49> I assumed a human was listening in and typing responses for a text-to-voice program to speak out

<comment><USER50> It'd be pretty tough for the operator would have to wait for the other party to finish their thought, comprehend said thought, formulate an appropriate response, and then type it out on a keyboard.. Whilst maintaining the expected rhythm of a real-time phone conversation

<comment><USER49> Faster than writing an AI that could pass the turing test ;)

But yeah a voice actor seems like an even easier (if less press-worthy) way to run this grift

</comment></comment></comment></comment><comment><USER51> Poor internal controls on the CEO's team part.

<comment><USER52> Yes, in this case. On the other hand, it's not hard to see that we're probably increasingly headed towards a future with more rigorous identity and authorization verification for at least some actions and purposes. And those more rigorous processes will inevitably lead to more edge cases that force people to go to a lot of trouble to verify who they are. (Yes, of course we can get your access to your Google account back. Just bring a notarized birth certificate and two other forms of ID to our Mountain View office between 10-11am on a Friday.)

<comment><USER51> I think we will do better, but i'm an optimist.

</comment></comment></comment><comment><USER53> The Motel 6 Saga! (Sequel)

[https://youtu.be/6ePFuTLYTaE](https://youtu.be/6ePFuTLYTaE)

</comment><comment><USER54> I tell banks and other people that I will call them back to verify the authenticity of the incoming call.

</comment><comment><USER55> Are there ML models that can detect a faked / synthesized voice, even if we can't?

<comment><USER56> the models to detect if it's fake are used to reinforce it's training [https://en.wikipedia.org/wiki/Generative_adversarial_network](https://en.wikipedia.org/wiki/Generative_adversarial_network)

<comment><USER57> The best question is: is there something computationally easy to check but computationally difficult to generate?

<comment><USER56> probably but whatever will be used it will just be the next generation input, it's going to continue escalate indefinitely.

</comment></comment></comment></comment><comment><USER58> Anybody who will give away 243K based on a phone call alone is a moron.

<comment><USER17> Working with much larger sums of money quickly distorts your perceptions of what is "a lot". 243k is under the signing authority of a random Director level manager, and to a CEO would likely feel like a rounding error.

</comment></comment><comment><USER59> Combine this with callerId spoofing and it'd probably fool me.

</comment><comment><USER60> Every company should pre-emptively attempt all known forms of CEO fraud every couple of weeks as a kind of vaccination against the real thing.

<comment><USER61> This is a thing already. Large banks spend up to multiple billions per year on security (for example) and even a 3,000 person enterprise can easily drop millions a year. Red-teaming is an absolutely necessary aspect of security these days.

</comment></comment><comment><USER62> And so it begins.

</comment><comment><USER63> Artificial voices must have improved a lot in the past 2-3 years. None of the ones I've ever heard would pass muster. Something weird in their intonation, a kind of sameness or monotony in their speech i.e. lack of excitability, a bit too perfect and precise.

I just went to cereproc, one of these companies advertising a very realistic synthetic voice, and none of their voices convinced me at all, though I have to admit it was pretty good.

When they get so good that they are indistinguishable except through Turing tests, and maybe not even then, we'll all be in trouble. I somehow expect that we haven't yet reached that point, though it can't be long in coming.

<comment><USER64> You read the article right? It literally happened. It's already good enough to fool people who aren't paying attention.

<comment><USER65> > "Analysts told the WSJ that they believe that artificial intelligence- > (AI)-based software was used to create a convincing imitation of the German > CEO's voice…"

> "If this turns out to indeed be a deepfake audio scam…"

It didn't literally happen, they _think_ that's what happened. I'm sceptical personally, I didn't realise deep fake audio could be done in realtime now? And who is this CEO that must have hundreds of hours of publicly available audio that the voice could be trained on?

<comment><USER66> Take a look at this article that hit HN yesterday: [https://news.ycombinator.com/item?id=21525878](https://news.ycombinator.com/item?id=21525878)</comment></comment></comment></comment>


AWS vs. Packet.net – Why We Left AWS - <AUTHOR> http://blog.tiingo.com/switched-away-aws-packet-net-benchmarking-networking-disk-processing-speeds/ <comment><USER2> Interesting. Does the elastic ip add on allow for eg an ip "shared" between a couple of LB's using keepalived? It mentions assigning it to a server in the faq, but doesn't specify what that actually does.

</comment><comment><USER3> Too bad it stands no chance. It's either amazon, Google or with a lot of much azure the customer would pick.

</comment><comment><USER4> Looks like it's 5x the cost of Hetzner for similar hardware. So what is the advantage?

</comment><comment><USER5> packet.net looks interesting. I wish there was a free tier to explore it.

<comment><USER6> Heh - yep. They have the type 0 which is $0.05/hr. It was a gateway drug for me <_<. Type 0 is also where I contain my scrapy farm. I find it works pretty effectively.

I'll shoot them a note linking to your comment

Also: Thank you for whomever linked to my blog post!

<comment><USER7> So $0.05/hr is pretty cheap, but agreed free trial is better. We made a little page with $25 on it if you'd like to try it out! [https://www.packet.net/promo/hacker- news/](https://www.packet.net/promo/hacker-news/)

<comment><USER5> Awesome! Just signed up. Looking forward to kicking the tires.</comment></comment></comment></comment>


New Atheism's fatal arrogance - <AUTHOR> http://www.salon.com/2015/05/09/new_atheisms_fatal_arrogance_the_glaring_intellectual_laziness_of_bill_maher_richard_dawkins/?utm_content=buffer7fff4&utm_medium=social&utm_source=facebook.com&utm_campaign=buffer

<comment><USER2> It seems related to Pandora's Box. After Evilness and other Bad things escaped it, Pandora opened it a second time to release the Hope/Expectation to make life more bearable.

Religion was never intended to find "truth", its just something that helps people making their day even when life sucks.

</comment><comment><USER3> The person who kindly shared this link may like to read this response:

[https://whyevolutionistrue.wordpress.com/2015/05/10/salon- pu...](https://whyevolutionistrue.wordpress.com/2015/05/10/salon-pulls-out- all-the-stops-in-dissing-new-atheists/)

</comment><comment><USER4> Any article that discusses atheism and does not even mention Ayn Rand is incomplete. Its probably a good thing she wasn't mentioned as one of the "new" atheists because she is an old atheist from way back when it wasn't fashionable but was shocking to be one.

I agree with this critique of the new kid's approach to attacking religion, though their services probably do have some value in slowing its advance. Rand, of course, addressed this critique in her work, stating that atheism is not a central tenet or even a very important conclusion in her philosophy. It is a consequence of going by reason but she did not stop there and defined a whole systematic philosophy including metaphysics (existential), epistemology, ethic and politics. So the main question to the New Atheists in this article is "Okay, so you don't believe in God. What do you believe?" None of them have a a consistent, integrated, rational alternative to the proto-philosophy that is religion. The closest is Sam Harris who at least claims it is possible to define an ethic system based on reason but he is not honest enough to do it.</comment>


7k more signatures needed on the Snowden pardon petition  - <AUTHOR> https://petitions.whitehouse.gov/petition/pardon-edward-snowden/Dp03vGYD?at93 <comment><USER2> Looks like this post is being flagged. 55 points in 2 hours and it sits near the bottom.

I think this is a misuse of the flag button given HN guidelines. I don't see how this post is spam or offtopic: "If you think something is spam or offtopic, flag it by going to its page and clicking on the "flag" link."

I'm seeing this more and more on HN. The flag button is being used to "downvote" posts that present a point of view that some disagree with. I find this trend disturbing.

<comment> jack-r-abbit I often flag duplicate posts so they'll drop out in favor of the first post. I did not flag this one but it is a duplicate post. The WH petition to pardon him has been posted before very recently. Adding a garbage url parameter to the end may fool HN de-duping algorithm but not humans. Same with changing the title.

</comment></comment><comment><USER3> It's not a petition to pardon Snowden, it's a petition for a White House response on the topic of pardoning Snowden.

Key difference.

<comment><USER4> Petitions is a perfect outlet to convey to crowds an illusion of having control over [insert your problem here]. Lack of control is the first cause of rebellion. Rebellions are expensive to contain. Petitions are the vehicle to detour crowd's attention away from the real cause of [insert your problem here].

</comment></comment><comment><USER5> 5600... keep it up...

</comment><comment><USER6> 3k signatures left (presumably this means 4k signatures happened in the past 5 hours).

</comment><comment><USER7> We're going to have to switch the title to 6K here right away.

</comment><comment><USER8> And now NSA has 100k targets.

<comment><USER9> False. The NSA already has 7 billion targets.</comment></comment>


Why would a professor from Harvard shovel his own snow? (2016) - <AUTHOR> https://www.youtube.com/watch?v=kqyXIe5up68 <comment><AUTHOR> "The world's scarcest resources (highly skilled entrepreneurs, innovators and engineers) are being deployed to economize on one of the world's most abundant resources (low skill labor) because prices and availability are distorted by barriers to labor mobility". \- Lant Pritchett</comment>


Bit Twiddling Hacks (2005) - <AUTHOR> http://graphics.stanford.edu/~seander/bithacks.html

<comment><USER2> Neat. Also here's some other sources beyond the usual CS bookshelf suspects:

[http://www.hackersdelight.org/](http://www.hackersdelight.org/)

[http://www.inwap.com/pdp10/hbaker/hakmem/hakmem.html](http://www.inwap.com/pdp10/hbaker/hakmem/hakmem.html)

(We recently had to grab the C standards in order to bust out some integer under/overflow macros that wouldn't be brittle.)

</comment><comment><USER3> There's also a lot of 64-bit hacks on pages related to chess programming (8x8 boards). For example: [https://chessprogramming.wikispaces.com/Bitboards](https://chessprogramming.wikispaces.com/Bitboards)

And my faviourite bit hack question on SO: [https://stackoverflow.com/questions/14537831/isolate- specifi...](https://stackoverflow.com/questions/14537831/isolate-specific-row- column-diagonal-from-a-64-bit-number)

</comment><comment><USER4> It's an awesome page.

I would guess one of the reasons it's here though is that it's almost required reading for Google interviews, #DetermineIfPowerOf2 is a particular favorite.

</comment><comment><USER5> Another resource in the same vein (it links to this page, among others):

[http://aggregate.org/MAGIC/](http://aggregate.org/MAGIC/)

</comment><comment><USER6> This has been popular over the years, but hasn't had attention on HN in a while:

[https://hn.algolia.com/?q=bit+twiddling+hacks#!/story/foreve...](https://hn.algolia.com/?q=bit+twiddling+hacks#!/story/forever/0/bit%20twiddling%20hacks)

We put 2005 on it, though the Internet Archive says there were earlier versions.

</comment><comment><USER7> He should pay bounties in BTC...</comment>


Relation between the psychological and thermodynamic arrows of time - <AUTHOR> http://arxiv.org/abs/1310.1095 <comment><USER2> I read the whole paper, but I still don't get exactly why this relation exists. They described some properties of "memory systems", and then said that a memory system must "remember more than one thing", and for some reason knowing the future as well as the past corresponds to "only knowing one thing", which means that anything that knows the future isn't a memory, because it only knows one thing.

Can someone please explain the whole thing with "knowing multiple things" and robustness to perturbations in the system?

</comment><comment><USER3> 10 upvotes because it has an interesting title. Anyone that attempted to actually read it could see theres no damn paper. Sorry I seem frustrated with this- I really wanted to read it. Time for bed.

<comment><USER4> Looks to be a rigorous exposition of an argument I saw to resolve Loschmidt's paradox (why there can be an arrow I time in a time symmetric universe). The argument is that formation of memories (whether in a brain or tape recorder or whatever) is necessarily an increasing entropy process, so all memories will be of lower entropy states.

IOW, it's not that "entropy increases futureward, we remember pastward, what a coincidence!" Rather, "if this were not an increasing entropy direction, we could not have memories of it."

First saw the point in Drescher's _Good and Real_.

</comment></comment><comment><USER5> Todd Brun is notable for being a collaborator (student?) of Jim Hartle for a number years when they worked on the decoherent histories formalism of quantum mechanics. Jim was one of the original developers of the formalism.</comment>


Robot baby will frighten you to death - <AUTHOR> http://www.theverge.com/2012/7/26/3188043/robot-baby-osaka-university-asada-laboratory

<comment><USER2> "rich facial expressions"

Nick Cage called, he wants his job back.</comment>


Entrepreneurs Are Better Off Going It Alone, Study Says - <AUTHOR> https://www.wsj.com/articles/entrepreneurs-are-better-off-going-it-alone-study-says-11556503320?mod=rsswn <comment><USER2> sad that this didn't get any discussion here on HN.

To throw my few cents in favour of going solo: [https://twitter.com/mikekarnj/status/1111219803635834880?s=1...](https://twitter.com/mikekarnj/status/1111219803635834880?s=12)

You can go solo and give 2x shares to your hires

<comment><AUTHOR> There are benefits on both sides of the debate for sure.</comment></comment>


Oral history of electrical engineer Robert P. Colwell [pdf] - <AUTHOR> http://newsletter.sigmicro.org/sigmicro-oral-history-transcripts/Bob-Colwell-Transcript.pdf <comment><USER2> This looks like it has a lot of overlap with his book _The Pentium Chronicles_ , which I've read a couple of times, and highly recommend.</comment>


What are your favorite tech podcast episodes? - <AUTHOR> Your favorite podcast episodes , not favorite podcasts. <comment><USER2> The Orbital Mechanics Episode 147: Interview: Al Bowers, NASA Armstrong on the aero-gravity assist maneuver</comment>


Ask HN: What Is Google's Container Runtime? - <AUTHOR> We know Google internally uses Kubernetes, but what is the container runtime ? Is it Docker ? Perhaps not, LXC ? Or runc (which is again Docker)? Or a Homebrew solution ? Is there some documentation on this somewhere please ?<p>Thanks ! <comment><USER2> I thought Google was still using Borg[1] internally but Kubernetes is being built with the lessons learned from Borg. From that paper:

>Now, all Borg tasks run inside a Linux cgroup-based resource container...

I don't work for Google so this is just a guess, but you could probably ping @kelseyhightower on twitter and get a real answer pretty quickly.

[1] [http://research.google.com/pubs/pub43438.html](http://research.google.com/pubs/pub43438.html)

<comment><AUTHOR> Well just did that, let's see....</comment></comment>


Google is a surveillance company - <AUTHOR> http://www.securitytube.net/Changing-Threats-To-Privacy-From-TIA-to-Google-(Blackhat-2010)-video.aspx

<comment><USER2> This video is great. It not only sums up the problem in the elegant terms of _choice_ , but it also proposes starts at solutions in the elegant terms of _working code_. It made my day to watch this.

<comment><USER3> I usually tend to avoid the 1 to 2 hour long video/talks. However in this case, the value received from its content absolutely justified every minute of its length. I wish more people would not dismiss it because of its length like I almost did.

</comment></comment><comment><USER4> The problem isn't Google so much as it is a lack of an understanding of the value of privacy and anonymity on the internet among the general population.

And it is also a matter of the lack of serious support for maintaining such privacy and anonymity at the internet infrastructure level, and at the level of applications that interface with the internet (web browsers in particular).

These things go hand in hand. As the general public becomes more educated about the value of privacy and anonymity (and what happens when, due to the lack of either, abuses occur) there will be more demand for technology that supports keeping their data and lives more private.

Then software, hardware, and services that protect privacy and anonymity will become more economically viable, and companies like Google will have a much harder time spying on their users.

This is why education about the value of privacy and anonymity is so valuable.

Until that happens, people will _voluntarily_ leak information about themselves all over the place. Witness the popularity of Facebook, or hundreds of other sites where people gladly give up their privacy for various dubious enticements.

<comment><USER5> I wonder if the public ever will become educated about the value of privacy. A few days ago I've tried to explain a friend who often uses Internet cafes how to use Google's two factor authentication for Gmail. Her answer was: "Why should I do this, this just makes it more complicated". When I explained to her that it prevents other's from being able to read her mails she responded that there's nothing interesting in her mailbox and she doubts anyone is interested in doing so.

A decade or so ago I still had hope that tools like PGP/GPG will be widespread amongst the Internet population. But this all completely changed. People who used to use PGP to encrypt their mails and who've used to run their own mailservers because they didn't trust their provider just use GMail today.

We're moving from a decentraliced infrastructure to a pure client/server infrastructure and there's not much you can do about this. There are a few areas where it's possible to avoid the cloud, but in most other areas the choice is either to use the prevalent centralized infrastructure or to not communicate with others.

<comment><USER6> "she responded that there's nothing interesting in her mailbox and she doubts anyone is interested in doing so."

What is wrong with this response?

<comment><USER2> I wear pants. I have nothing to hide, particularly, but I don't want anyone but my wife and my doctor looking under them. Certainly not Eric Schmidt.

The problem is that consequences of transparent pants are easy to understand, but the consequences of unencrypted email are less so.

<comment><USER7> It seems like privacy law is the proper domain to control these things for the public. Your pants, while not transparent, do not pose much of a roadblock from a determined party looking inside them. That it's illegal for anyone to do so without your consent is the actual deterrent -- not any intrinsic property of your pants.

<comment><USER2> I concur, but the value of such a law will not be apparent to anyone who doesn't _feel_ the same way about transparent pants and unencrypted email.

I should also add that I think it's evil to take advantage of the user ignorance of the issue to improve ad targeting.

</comment></comment></comment></comment></comment></comment><comment><USER8> Original link <http://vimeo.com/11303353>

"BlackHat Europe 2010 - Changing Threats To Privacy From TIA to Google"

<comment><USER9> The original-original source is here: [https://media.blackhat.com/bh- eu-10/video/Marlinspike/BlackH...](https://media.blackhat.com/bh- eu-10/video/Marlinspike/BlackHat-EU-2010-Marlinspike-Threats-to-Privacy.m4v)

</comment></comment><comment><USER10> I absolutely agree with the talk! Google is the new Microsoft :) and Facebook is the new Google and will also become the next Microsoft very soon.

What Google is doing is actually monitoring every aspect of our online life! Really worrisome!

<comment><USER11> And Facebook isn't? How about big hungry corps come in different sizes and shapes but are still big hungry corps.

</comment></comment><comment><USER12> Google is not a surveillance company. It's an AI company with a rapacious appetite for data so that it can learn about the world and make better decisions.

</comment><comment> pc-pro-schools It bothers me I can't watch the person talking ^.^

</comment><comment><USER13> FUD.

Not Google nor even Facebook are privacy's real threats, they are just easy targets.

There is a fine line - it would seem - between a security expert and an alarmist. That line is getting crossed more often as of late seeing as spreading FUD is their marketing strategy.

Yes privacy is important but some people are loosing all prospective in advocating for it, and in doing so are entrenching on other rights mainly freedom of speech.

Relevant: [http://gigaom.com/2011/02/17/jarvis-publicness-needs-its- adv...](http://gigaom.com/2011/02/17/jarvis-publicness-needs-its-advocates- just-like-privacy/)

<comment><USER14> I'm curious to know what you think privacy's real threats are, then?

I had two motivations in giving this talk. One was to explore the shift in where data accumulates and is collected on the internet. The other was to explore the concept of "choice," in terms of how these technologies are subsequently presented to us.

Given the events of the past year, along with the CALEA II conversations that have recently begun in DC, it doesn't seem particularly alarmist to start having a conversation about these things.

I'm not sure whether you watched the talk or not, but my premise isn't that everyone should stop using Google or Facebook, as you seem to assume. Because I don't actually believe that's even possible. Or at least, that it's not a simple choice.

<comment><USER15> I found your talk to be one of the more pragmatic takes on current challenges to privacy that I've heard for precisely this reason. While people can and sometimes do choose to opt-out, I've never been personally comfortable with the high costs of doing so. It's a neat research agenda to start from that observation and try to mitigate the cost to privacy.</comment></comment></comment>


Coalition Condemns DHS Proposal to Demand Passwords to Enter the U.S - <AUTHOR> https://cdt.org/insight/no-to-dhs-social-media-password-requirement/ <comment><USER2> This seems to be where i first started seeing the CBP/DHS social media stuff:

[https://www.shaheen.senate.gov/news/press/shaheen-leads- lett...](https://www.shaheen.senate.gov/news/press/shaheen-leads-letter-to- dhs-calling-for-social-media-background-checks-in-visa-screening-process)

when did they start actually asking for passwords? Seems like that is the slippery slope that we were expecting back in 2016.</comment>


I abandon my abusive relationship with Facebook - <AUTHOR> http://blog.plover.com/misc/facebook.html

<comment><USER2> This post seems a bit too much like forced outrage, maybe as a kneejerk because Luluvise doesn't seem like the kindest of sites (at least at first glance, I haven't looked)

I've talked here about why I enjoy facebook in general before[1], so I'll only mention the relevant bit here:

All of my privacy options are on the lowest possible setting. I treat anything that occurs on the site as if it were public. I don't see why not, I'm not going to pretend that photos of myself or my wall postings are anywhere near interesting enough to hide. In fact I'm not sure why people who put things on facebook want privacy at all for that data. I never worry that something I say might be picked up on by the wrong person because I'd never post anything that I wouldn't want the world to hear.

Why is it a big deal if "People who can see your info can bring it with them when they use apps"? You _already gave away the data._ It's not like you can let your friends (or whatever settings you have) look at your images but not copy them. You already willingly granted them that power. You friends are all free to climb Mount Everest and paper the top with printouts of all your photos for them to pepper the frozen landscape for the next 100 years if they so please.

I think the outrage is overblown a bit. Luluvise certainly doesn't need facebook's nod here to accomplish their goal. It's not like luluvise did something novel with your data, they just made doing something slightly easier with data you already willingly gave to all the people that your settings desired.

[1] <http://news.ycombinator.com/item?id=3543185>

<comment><USER3> I don't see any forced outrage. It'a a "death of a thousand cuts" sort of issue, or in this case 53 cuts.

You say you "already gave away the data". That's the heart of the problem, isn't it? The author of that essay doesn't agree, and thinks that fundamentally he should be in final control of his data, to the point of being able to delete it if and when he wishes.

FB (and you) disagree, which is why he's leaving FB. You find it useful, sure, but not all people are "shy people like [you]", and don't have the same reasons for wanting to use FB.

<comment><USER4> My concern extends to the increasing mining of social graphs. For example, the concern that having "undesirable" friends may turn you in turn into an "outcast": For loans, insurance, job applications, and who knows what else. (The No Fly List? I wouldn't put it past them...)

This could have a rather corrosive effect on the very "networking" nature and commonality of the Internet. I don't particularly want to be shepherded into a class, or caste, based hierarchy of online connectivity.

I mean, people will cluster and groups will form, on their own. But enabling third parties to so aggressively and thoroughly use that to classify and segregate? No, thanks.

Maybe I'm just naive, and this will inevitably happen. Well, I have control over my own actions and participation in same.

</comment></comment></comment><comment><USER5> You can fully delete your FB profile (not just deactivate) - in their help center there is a blurb and a link to do a full deletion...

[http://www.facebook.com/help/search/?q=how+do+i+delete+my+ac...](http://www.facebook.com/help/search/?q=how+do+i+delete+my+account)

</comment><comment><USER6> I had 2000+ friends. I deleted my account two weeks ago and it should be gone by tomorrow.

I have no more interest in monetizing my connections for the benefit of a small group of people I don't even like or respect.</comment>


Tough Times on the Road to StarCraft - <AUTHOR> http://www.codeofhonor.com/blog/tough-times-on-the-road-to-starcraft <comment><USER2> What's the point of using linked lists ? Low memory ? I'll never understand why the usage of linked lists is so common.

I mean you don't have fast random access with linked list, aren't hash maps just better for fast insertion/deletion ? Object pools are also pretty great too.

I'll never forget the day a classmate in some game programming school argued that linked list were like vectors (std::vector).

Linked lists only seems viable for insertions, they're not viable for fast deletion since you need to search for the pointer first. Maybe you need to index linked lists instead, but since the heap already allows itself to be fragmented like a linked list can, wouldn't it be better to just use vectors as often as possible so it can be more cache friendly ?

<comment><USER3> Linked lists have more consistent performance than std::vector. And taking half a second to render one frame when you're averaging 100fps is way worse than consistent 50 FPS.

There was recently an article about intrusive linked lists, and this same question came up. I took the unreal linked list library, and wrote a similar std::vector implementation, and tested it. The test was simple, fire 50,000 bullets at a rate of 500 rounds per second, and remove them when they fall 2 meters. They existed in 3 separate lists: physics objects, renderable objects, and all objects. When they hit the ground, they were removed from all lists. Capture the clock ticks to generate each "frame", and do a few calculations on them at the end.

The average and median operation times for std::vector were indeed a fair bit faster (at -o3, at no optimizations the ILL implementation was faster). However, the worst case for std::vector was... much worse. More than 1000x worse in some runs. One test run showed the worse case taking over two millisecond for a single frame of just manipulating vectors!

        $ ./benchmark_ill
        Minimum: 0.000000
        Maximum: 0.000094
        Average: 0.000005
        Median: 0.000005
        Total Frames Rendered: 18968118
        Total Run Time: 100.663895

        $ ./benchmark_v
        Minimum: 0.000000
        Maximum: 0.004813
        Average: 0.000002
        Median: 0.000002
        Total Frames Rendered: 35859663
        Total Run Time: 100.664009

<comment><USER4> Wait a sec. You can't bust out numbers like that without being clear about a few key points:

1\. What was std::vector's removal algorithm like? Are you sure that .remove() wasn't shifting all elements in the vector? The "correct" removal algorithm in that case looks like this: Swap the target element to the end, and then decrease the vector's size by 1. But if I remember correctly, std::vector's remove method doesn't work like that, so of course it will have terrible worst-case performance if it was shifting all elements of the array when you remove the first one.

2\. What's causing the worst-case slowdown? Are you sure you weren't simply seeing the effects of the L2 CPU cache being invalidated?

A linked list will thrash the CPU cache constantly, whereas vectors thrash the cache much less since the elements are stored in contiguous memory. For a modern game running on a modern CPU, vectors are almost always the better choice for that reason.

EDIT: I'm not sure your numbers are trustworthy. For example, there's no way it rendered 35859663 frames in 100 seconds. That would be 358,596 FPS.

Assuming your FPS was actually something like 358, not 358,596, that's still an extremely high FPS. When your FPS is so high, it becomes difficult to accurately measure the reasons for worst-case performance. A sudden spike within a single frame could be for any of a dozen reasons, such as CPU cache eviction, a GPU pipeline stall, or some other program on your computer taking CPU resources.

<comment><USER3> > You can't bust out numbers like that

Nobody is preventing you from writing your own benchmark and "busting out [your own] numbers". :)

That said, yes, my deletion algorithm is naive, and I welcome a pull request to fix it.

[https://github.com/garrickp/intrusive_benchmark](https://github.com/garrickp/intrusive_benchmark)

> Are you sure you weren't simply seeing the effects of the L2 CPU cache being > invalidated

Perhaps, but I doubt it's the cause of the worst case scenario, particularly since I'm doing identical loops over the physics and renderable objects, and as you say the linked list should have the worse performance.

EDIT: One more small point - if the programmer is relying on the order of the items at all, the "tail tuck" method of deletion would not work.

EDIT[2]: Addressing your edit - the numbers are only for the action of applying physics and adding/deleting objects - the code should reflect that. There is no actual rendering time or AI or anything else which would prevent us from seeing upwards of 100,000 "frames" per second.

The times are also fairly stable (the standard deviation of max times is around 20%) between runs.

<comment><USER4> I apologize that my comment probably came off as a bit too upfront. I need to work on that.

I was only saying that it isn't really a good idea to present numbers like that without having a clear idea of what's causing the worst-case performance. Glancing over the code, and assuming the first bullet fired is always the first one to impact the ground, it looks like the code is always going to run std::vector::erase on the first element of the vector, which will always shift the 499 remaining elements. It's possible that's the reason for the worst-case performance, rather than vector being inherently a worse choice than list.

It was very counterintuitive and weird to realize that vector is almost always a better choice than list due to how powerful the CPU caches are. CPU caching is so good that taking full advantage of caching will usually outweigh algorithmic tweaks, like whether you're using a list or a vector. So the power of vector is that its elements are in contiguous memory, whereas the downfall of list is that they usually aren't.

It's difficult to prove that's true except in real-world scenarios. Unless a test is designed to introduce memory fragmentation, the cache performance penalty of using list won't really show up in the results. All of the list allocations will be pretty much contiguous in a test environment, so the tests will show performance on par with vector. But in the real engine, you'll be left scratching your head why everything's running so slowly, when the answer is because the elements are sprayed all across your memory space and it's causing the CPU cache to stall when they're accessed...

EDIT:

 _There is no actual rendering time or AI or anything else which would prevent us from seeing upwards of 100,000 "frames" per second._

When your FPS is higher than, say, 1,000, it becomes very difficult to pin down the reasons for performance fluctuations. An engine under load behaves differently than an artificial test, so you'll need to measure the performance impact in a real engine, especially when the framerates in the test are so high.

Your monitor is capped at 70 fps, or some high-end monitors can do ~130. Something like 100,000 fps isn't an accurate reflection of the behavior of the real system. Most of the discrepancy is due to memory fragmentation causing CPU thrashing, but your specific test might be running into some other discrepancies, like:

\- clock() might not be a high resolution timer, so the worst-case timing might be due to discrepancies in the clock mechanism itself, especially at 100,000+ FPS. See [http://stackoverflow.com/questions/6749621/high- resolution-t...](http://stackoverflow.com/questions/6749621/high-resolution- timer-in-linux)

\- since your test is running for 100+ seconds and your timing measurements are taking into account an entire frame, some frames are going to run interrupts. If an interrupt takes a long time to process, that load will show up in your timing measurements. The result is that vector (or list) will be unfairly pinned as the reason for the performance issue, when interrupts were the cause.

I'm not confident about the second one, but the point is that there are all kinds of conflating variables.

<comment><USER3> > So the power of vector is that its elements are in contiguous memory

In either case, you'll end jumping all over memory for the actual items in either a std::vec or a linked list, since they are both holding pointers to the actual objects (and based on how the nodes are being created, the linked list containers are closer in memory to the nodes).

That said, my premise was not that linked lists were faster to iterate over, it's that they offer a consistent addition/removal time, which is frequently better for a game engine than access with huge deviations.

There are many games out there which boast 100+ FPS on my gaming computer. However, they still look like crap because they will have intermittent drops to 1 or even .5 fps. I (and many others) would prefer a constant 50 (or 30) FPS than a stuttering 140.

Real time OSes offer the same commitments: constant gaps between program resumes, even if that constant delay is large.

<comment><USER4> Okay, there's some kind of failure to communicate, and the frustration level is rising. The failure is probably on my end, so I apologize.

 _In either case, you 'll end jumping all over memory for the actual items in either a std::vec or a linked list, since they are both holding pointers to the actual objects (and based on how the nodes are being created, the linked list containers are closer in memory to the nodes). That said, my premise was not that linked lists were faster to iterate over, it's that they offer a consistent addition/removal time, which is frequently better for a game engine than access with huge deviations._

CPU caching doesn't work like that. When you access any pointer, the CPU cache will automatically cache 256 bytes from the access address. So if your object is at address "x", everything from [x, x+256) will be put into the CPU cache.

Your Projectile class contains 6 floats, so each Projectile is 24 bytes. When you're using std::vector, all of your projectiles are stored contiguously in memory. That means when you access a projectile, you'll automatically cache (256 bytes / sizeof(Projectile) - 1) = the next 9 projectiles. So you get a bunch of performance for free, simply by using vector.

When you use list, you lose all of that caching. The reason is because list's memory allocations are all over the place. When you use list, the memory region [x, x+256) is solely that _one_ projectile. That means your CPU will end up caching a bunch of irrelevant bytes of memory. That also means the CPU will have to cache _each projectile individually_ as they're accessed. You're trading automatic caching of 10 projectiles for having to cache each individual projectile. Since taking advantage of CPU caching gives you 10x or 100x speedups, that's a very bad tradeoff.

Addition/removal from a container is a tiny, tiny fraction of tininess of what a modern game engine does. It's so tiny that add/removal performance is almost always irrelevant unless you're adding/removing a huge number of elements every frame, which is rare. Iteration performance is almost the only thing that matters for a game engine, because every single frame you'll be iterating over hundreds of containers. If each iteration causes your CPU cache to thrash, then you're in for a world of pain.

The takeaway is that list is an _awful_ choice for any realtime game, and it's dangerous to give the impression that it's better. If someone were to take your tests at face value and start using list in their own game engines, a few months later they're going to be wondering why their performance is so terrible and why their profilers aren't showing the cause. As far as performance characteristics go, memory fragmentation / CPU caching matter so much that discounting them is a recipe for disaster.

 _There are many games out there which boast 100+ FPS on my gaming computer. However, they still look like crap because they will have intermittent drops to 1 or even .5 fps. I (and many others) would prefer a constant 50 (or 30) FPS than a stuttering 140._

Agreed! But list vs vector isn't the cause. A lot of the stuttering has to do with loading resources from disk, flushing the GPU pipeline, or other I/O intensive actions. On a modern CPU, add/removals from containers aren't the reason for the slowdown.

Either way, good luck, and keep on making cool stuff.

<comment><USER5> > When you're using std::vector, all of your projectiles are stored > contiguously in memory

The OP's point is that we're not talking about

      std::vector<projectile>

but about

      std::vector<projectile*>

The latter thrashes the cache, but it's necessary of an object needs to belong to several lists at the same time.

In either case, enlarging the vector also has a significant cost.

<comment><USER4> That's true, but in modern game engines, objects of the same type share an allocation pool. So a bunch of Projectiles should still be in contiguous memory, since they're using the same pool allocator.

At that point, vector is still a better choice because it prevents the CPU from accessing a bunch of intermediate list nodes which will pollute the CPU cache. If you use a vector, there are no intermediate objects, so less stuff winds up in the cache. There's also less memory fragmentation overall.

As long as you're using a vector implementation that grows by a factor of 2 every time it expands, then there shouldn't be any significant cost of enlarging the vector. If it's just storing pointers, it won't invoke any copy constructors. It can even be optimized to a straight-line memcpy, which is blazingly fast on a modern CPU.

<comment><USER5> > That's true, but in modern game engines, objects of the same type share an > allocation pool.

I don't think pool allocation guarantees memory contiguity: what if we have a pool with two elements free, those elements being the first and last ones, and we allocate two elements and stick pointers to them in our vector?

> a vector implementation that grows by a factor of 2....shouldn't be any > significant cost

It depends on what you mean by "cost". I agree that the enlargement cost is acceptable from an overall CPU budget sense, but each enlargement can still cause a latency spike, since the cost for enlargement is still large (especially considering the cost of taking the heap lock) for _that_ insertion. Sometimes consistency is more important than throughput.

> vector is still a better choice because it prevents the CPU from accessing a > bunch of intermediate list nodes which will pollute the CPU cache

Who said anything about intermediate list nodes? The nice thing about an intrusive linked list is that once you pay for accessing an element's cache line, the rest of the accesses are nice and local. There are no intermediate nodes, and all costs are smooth and consistent. Besides: you can issue a memory prefetch instruction for node B while you process node A, further hiding latency.

While a vector is value types might be best in most situations, if you can't use that, an intrusive linked list may or may not be better than a vector of pointers.

<comment><USER4> Good points! I love tech chats like this. There are a few caveats:

A pool should be trying to make new allocations as contiguous as possible. That's accomplished by wrapping the allocations. For example, let's say we have a pool with slots A, B, C, D, E. We allocate A through D, then C is later freed. The pool shouldn't put the next allocation at C. It should be placed at E. That way, the objects are still roughly sorted by creation time: A is younger than B, which is younger than D, and so on.

(The next allocation should go in C after that, because there are no more slots. But by that time D and E might have been freed, so it's still in sorted order.)

That way, if you access any given element, it will cache the next element in memory. Due to the sorted nature of the allocations, that means even if you're iterating over them using some other container like a list or vector of pointers, accessing an element will still _likely_ cache the next iterator's element. Not guaranteed, but likely.

About the vector enlargement: Usually the cost is nil, because as long as the vector stays under 1MB, you can simply preallocate large blocks of memory at startup for each type of vector. Therefore the cost of expansion is just a few arithmetic instructions for bookkeeping purposes, not anything expensive like a heap lock.

Good point about the intrusive list. I personally wouldn't like it because it makes the code more complicated, but as long as you're using a pool allocator, the memory characteristics of an intrusive list shouldn't be too different from the scheme I described above.

</comment></comment></comment></comment></comment></comment></comment></comment></comment></comment></comment><comment><USER6> Very interesting article, if horrifying :)

As someone whose only experience is in corporate service IT development, from the outside the game dev industry looks incredibly cowboy-ish; it would be nice to read a story where a team built a game where they met their deadlines, had no crunch times, followed excellent coding standards (CI, unit tests, peer dev etc.) and maybe even used a modern language (perhaps, heretically, a non- native language like C#!)

<comment><USER7> Interesting perspective! You bring up a lot of different points:

\- There are tons of positive "post mortem" [[http://www.gamasutra.com/features/postmortem/](http://www.gamasutra.com/features/postmortem/)] write ups on gamasutra, but the ones with problems are usually more valuable. One recent example of "doing it right" I remember was the XCOM:Enemy Unknown remake. Check their GDC talks!

\- One thing that makes games special is pushing the envelope. Yes, you can make a game on a very solid stack. But it won't stand out.

\- Game coders think service people are mad also: How can you use a database that you do not fully understand? You don't even have the source? Using a framework or library or cloud that you do not 100% understand seems "cowboy" to them.

\- Games are "fire and forget". That means technical debt is very different. It is bad at the start of a 3 year cycle, but at the end it is totally ok.

\- Not mentioned by you but important to point out: While working on games is great for learning and unlike anything else it is also a terrible industry for coders. Insane crunch time. Low pay.

<comment><USER8>
        - Games are "fire and forget". That means technical debt
        is very different. It is bad at the start of a 3 year
        cycle, but at the end it is totally ok.

There is also a big difference between AAA, online, mobile, social, casual, etc. f2p games for example are expected to live & be actively supported/updated for many years if successful.

Clash of Clans was released 2.5 years ago and will likely continue to get active support for many more years. FarmVille was released almost 5 years ago. WoW more than 10, for a different kind of game that also isn't fire and forget.

They get a lot of flack for other reasons but engineering wise companies like zynga get a lot of stuff right.

<comment><USER7> You are absolutely right. I was intentionally polarizing. But thinking about it more, one thing still stands out: Even long running mmos are planned "for the next 10 years". There is an end in sight. Facebook, Google, Uber, Bitcoins, Most Startups - it's open ended! I don't think it's easy to say one approach is better - but it is useful to understand that they are fundamentally different.

Personally as an engineer I like the coding approach of game dev a lot more.

</comment></comment></comment></comment><comment><USER9> Prior discussion: [https://news.ycombinator.com/item?id=4491216](https://news.ycombinator.com/item?id=4491216)

</comment><comment><USER10> _The team was incredibly invested in the project, and put in unheard of efforts to complete the project while sacrificing personal health and family life._

I wonder if this is "invested" as in, had a substantial equity stake and it was worth the sacrifices of health and relationships because they and their families were setup for life afterwards and retired to a beach in Malibu, or some other meaning...

<comment><USER11> > .. because they and their families were setup for life afterwards and > retired to a beach in Malibu ..

And if the game flopped then? Even a success doesn't guarantee the above does it?

<comment><USER10> Sure, but they weren't taking that chance were they? They were just being exploited.

</comment></comment></comment><comment><USER12> Ironically the horrible path finding gave the game much of it's charm and interesting micro mechanics. The default attack move would cause the units to converge into a single file march... which is suicide against a grouped enemy or defended position.

</comment><comment><USER13> Not that it's not interesting, but a [2012] next to the title would have been helpful

<comment><USER14> Not really, as the article is covering a project near 20 years old.

Who gives a shit when it was written?

</comment></comment><comment><USER15> Previous discussions of this entertaining series from 2012 here:

[https://news.ycombinator.com/item?id=4491216](https://news.ycombinator.com/item?id=4491216)

[https://news.ycombinator.com/item?id=4582123](https://news.ycombinator.com/item?id=4582123)

[https://news.ycombinator.com/item?id=5252003](https://news.ycombinator.com/item?id=5252003)

</comment><comment><USER16> Does anybody know what happened with part three? Was it ever published?

</comment><comment><USER17> Really like the story-telling style of the article. Was wondering where could I find a compilation of similar "programming tales"? Apart from [http://www.folklore.org/](http://www.folklore.org/) of course.

</comment><comment><USER18> He says the maximum number of units is 1600.

If 6 players mindcontrol a drone and an scv and build additional armies, the total number of units could way exceed 1600. Or what am I missing?

<comment><USER19> You'd get the wonderful error »Cannot create more units«. There also was a limit with certain sprites that counted towards that. It was not an uncommon error to see in certain UMS maps that had way too many units running around.

<comment><USER20> You'd also occasionally hit it in zerg-heavy 8 player melee games due to that larvae and overlord count against the limit without consuming any supply. It was always pretty hilarious to see a small pack of mutalisks kill a carrier doom-fleet which couldn't launch any interceptors due to the unit limit.</comment></comment></comment>


You'd Be Surprised at How Many Foods Contain Added Sugar - <AUTHOR> http://www.nytimes.com/2016/05/22/upshot/it-isnt-easy-to-figure-out-which-foods-contain-sugar.html?rref=collection%2Fsectioncollection%2Fhealth&action=click&contentCollection=health&region=stream&module=stream_unit&version=latest&contentPlacement=8&pgtype=sectionfront&_r=0 <comment><USER2> No I wouldn't.</comment>