Remix.run Logo
Animats a day ago

As is common in hard real time code, there is no dynamic allocation during operation:

    allocation/deallocation from/to the free store (heap) 
    shall not occur after initialization.
This works fine when the problem is roughly constant, as it was in, say, 2005. But what do things look like in modern AI-guided drones?
jandrewrogers a day ago | parent | next [-]

Why would the modern environment materially change this? The initialized resource allocation reflects the limitations of the hardware. That budget is what it is.

I can't think of anything about "modern AI-guided drones" that would change the fundamental mechanics. Some systems support very elastic and dynamic workloads under fixed allocation constraints.

Animats 21 hours ago | parent [-]

Basic flight control is a fixed-sized problem. More military aircraft systems now on what the environment and enemy are doing.

jasonwatkinspdx 21 hours ago | parent | next [-]

You're just imagining things at this point.

The overwhelming majority of embedded systems are desired around a max buffer size and known worst case execution time. Attempting to balance resources dynamically in a fine grained way is almost always a mistake in these systems.

Putting the words "modern" and "drone" in your sentence doesn't change this.

jandrewrogers 19 hours ago | parent | prev [-]

The compute side of real-time tracking and analysis of entity behavior in the environment is bottlenecked by what the sensors can resolve at this point. On the software side you really can’t flood the zone with enough drones etc such that software can’t keep up.

These systems have limits but they are extremely high and in the improbable scenario that you hit them then it is a priority problem. That design problem has mature solutions from several decades ago when the limits were a few dozen simultaneous tracks.

mrgaro 19 hours ago | parent | prev | next [-]

There are missiles in which the allocation rate is calculated per second and then the hardware just has enough memory for the entire duration of the missile's flight plus a bit more. Garbage collection is then done by exploding the missile on the target ;)

superxpro12 11 hours ago | parent [-]

We call this "explosive deallocation". Destructors have a whole new meaning.

m4nu3l a day ago | parent | prev | next [-]

What you are actually doing here is moving allocation logic from the heap allocator to your program logic.

In this way you can use pools or buffers of which you know exactly the size. But, unless your program is always using exactly the same amount of memory at all times, you now have to manage memory allocations in your pool/buffers.

csmantle a day ago | parent | prev | next [-]

"AI" comes in various flavors. It could be a expert system, a decision forest, a CNN, a Transformer, etc. In most inference scenarios the model is fixed, the input/output shapes are pre-defined and actions are prescribed. So it's not that dynamic after all.

vlovich123 21 hours ago | parent [-]

This is also true of LLMs. I’m really not sure of OP’s point - AI (really all ML) generally is like the canonical “trivial to preallocate” problem.

Where dynamic allocation starts to be really helpful is if you want to minimize your peak RAM usage for coexistence purposes (eg you have other processes running) or want to undersize your physical RAM requirements by leveraging temporal differences between different parts of code (ie components A and B never use memory simultaneously so either A or B can reuse the same RAM). It also does simplify some algorithms and also if you’re ever dealing with variable length inputs then it can help you not have to reason about maximums at design time (provided you just correctly handle an allocations failure).

dfedbeef 21 hours ago | parent | prev [-]

How do you think these modern AI-guided drones use their AI? What part of the drone uses it?

darubedarob 20 hours ago | parent [-]

[dead]