Live data from Hacker News

Exploring the software that flies SpaceX rockets and starships

stackoverflow.blog

91–100 of 118 posts

Re: Exploring the software that flies SpaceX rockets and starships

#91
post #57

are the 50hz chips manufactured at 50hz ? or are they downclocked to 50hz. why cant you use higher clocked speeds ? like even 500 mhz, etc ? is there something special about 10 and 50hz ?

If I understood it correctly, they’re not talking about a chip literally running at 50Mhz. They’re talking about polling a sensor in a loop running on a 50Mhz timer. The processor doing that is certainly running at a much higher clock frequency

To clarify, its 50Hz not 50MHz

Re: Exploring the software that flies SpaceX rockets and starships

#92
post #57

are the 50hz chips manufactured at 50hz ? or are they downclocked to 50hz. why cant you use higher clocked speeds ? like even 500 mhz, etc ? is there something special about 10 and 50hz ?

If I understood it correctly, they’re not talking about a chip literally running at 50Mhz. They’re talking about polling a sensor in a loop running on a 50Mhz timer. The processor doing that is certainly running at a much higher clock frequency

Yeah they're talking about the control loop itself which means 50 times a second the computer/program looks at it's inputs (sensors) and changes it's outputs (commands to actuators). The actual computers processing that program run much faster.

Re: Exploring the software that flies SpaceX rockets and starships

#93
post #84

Earlier quoted context omitted.

Nope, more likely there are internal CPU timers which emits hardware interrupts on which the tasks are performed

No, he is correct. Alot of embedded software uses a more complex form of that exact technique that he is shown in the code. You technically can have a dedicated timer interrupt for every task but there are usually alot more tasks than HW timers, so instead they use a dedicated HW timer for time-keeping and use that as reference for all other tasks.

Exactly. IF there is operating system used (it's not always needed), programmers implement separate OS tasks. For simpler systems (like just reading some sensors) real time os is not needed, then such loops are implemented as a template (with much more error checking and restarting). Typically that "wait for tick" function just waits until hardware timer sets overflow flag (not even full interrupt), and this is done to have simple, easy to reason about system.

Re: Exploring the software that flies SpaceX rockets and starships

#94
post #52

are the 50hz chips manufactured at 50hz ? or are they downclocked to 50hz. why cant you use higher clocked speeds ? like even 500 mhz, etc ? is there something special about 10 and 50hz ?

That's the number of times per second the main update code runs and it has nothing to do with the number of clock cycles or instructions per second the CPU can run (other than the fact that the chip needs to be fast enough to have the update code finish before the next time it needs to start).

ah thanks! that makes it so much clearer.

Re: Exploring the software that flies SpaceX rockets and starships

#95
post #85

Earlier quoted context omitted.

I think we've solved the GC vs Manual debate. Just add more RAM and explode your computer when it's done running

Very funny. But leak memory until you have to restart the process seems to be a very common strategy in practice. The programs explode even if the computer doesn't.

Many moons ago I remember talking with someone who works in HFT software and they said they'd just load the system with tons of RAM because allocation/deallocation and even manual memory management was too slow.

Re: Exploring the software that flies SpaceX rockets and starships

#96
post #62
post #29

Earlier quoted context omitted.

I had once thinking about this type of system, and later found that the SNMP(1988) as well as NIST/Army 4D/RCS project(1980s) had this train of thought before I was even born. Now I'm wondering why this type of distributed, synchronized, hard realtime decision making framework don't seem to exist as some Apache Foundation project or something. It just sounds right and massively useful but I can't find an implementati…

See the Beam/OTP as part of Erlang and now Elixir, Gleam, etc. Erlang came out of Ericcson when they were building giant telephone switches. Nowadays things like RabbitMQ and WhatsApp run on the Beam VM. The beam handles both local and remote nodes, mostly transparently. Then there are things like Nomad or k8s which try to tackle the problem more like *nix(linux/BSD/etc) does, but across multiple nodes. These are not…

Even though you can achieve pretty good latency with Erlang because of the lack of global memory (most if not all allocation is local to an Erlang process).

Re: Exploring the software that flies SpaceX rockets and starships

#97
post #29

Earlier quoted context omitted.

I had once thinking about this type of system, and later found that the SNMP(1988) as well as NIST/Army 4D/RCS project(1980s) had this train of thought before I was even born. Now I'm wondering why this type of distributed, synchronized, hard realtime decision making framework don't seem to exist as some Apache Foundation project or something. It just sounds right and massively useful but I can't find an implementati…

That’s mostly how kubernetes works also. It’s not that uncommon of a pattern

This is not how Kubernetes works. The concepts are completely different (pod, allocation etc.)

Re: Exploring the software that flies SpaceX rockets and starships

#98
post #76
post #66

Earlier quoted context omitted.

They've been known to leak memory ... https://devblogs.microsoft.com/oldnewthing/20180228-00/?p=98... >This sparked an interesting memory for me. I was once working with a customer who was producing on-board software for a missile. In my analysis of the code, I pointed out that they had a number of problems with storage leaks. Imagine my surprise when the customers chief software engineer said "Of course it leaks". H…

That is a great story, but I cringed at the part about adding additional hardware to support their leaky code. Surely there had to be a better way?

Allocating/deallocating memory has a cost, if you can afford to just add more memory that's faster than any clever memory management solution you have.

Re: Exploring the software that flies SpaceX rockets and starships

#99
post #57

Earlier quoted context omitted.

If I understood it correctly, they’re not talking about a chip literally running at 50Mhz. They’re talking about polling a sensor in a loop running on a 50Mhz timer. The processor doing that is certainly running at a much higher clock frequency

To clarify, its 50Hz not 50MHz

and 50hz = 0.02s

Re: Exploring the software that flies SpaceX rockets and starships

#100

Earlier quoted context omitted.

That’s mostly how kubernetes works also. It’s not that uncommon of a pattern

This is not how Kubernetes works. The concepts are completely different (pod, allocation etc.)

all the main controllers work by running a reconciliation loop constantly, what are you talking about?
Post reply on HN