Rendered at 06:44:05 GMT+0000 (Coordinated Universal Time) with Cloudflare Workers.
JoeAltmaier 1 days ago [-]
Probably not related.
I remember implementing the original fork() call in the first Posix implementation. It consumed so much CPU time and resources (on machines with precious little of either) that I optimized it. It was often (usually) followed by exec() which combined meant, start this parallel process. The downside was, fork copied the entire parent process state, just to instantly throw it away on the next call.
So I made fork() do a lightweight copy (no pages, no tables, just mark the new process as a child of the older one) and upon exec 'forget' to complete the fork. Else the child process would fault on the incomplete copy as it executed and complete it then.
thepoet 2 days ago [-]
Nice writeup. The step after forking paused sandboxes would be to fork live running sandboxes with the RAM, device state and disk all being forked. Get the same execution point with all processes still running rather than having to resume. You then also have to take care of kernel RNG
state, boot ID, clocks, cached session keys etc. before the forked version starts meaningful work.
Actually we considered that too, but the problem is network state. The software that gets resumed multiple times usually does not deal that well with sudden resumption later on ( with all the associated state in the network long gone, different local endpoint in practice ( from the internet at least ) etc ).
Also, storing large memory dumps is in my view not cost efficient as mostly restoring state is fast enough.
What do you consider to be main benefit in live fork?
Iv 2 days ago [-]
We are in the process of designing OSes for LLMs agents rather than humans, aren't we?
yyyk 2 days ago [-]
Lisp and Smalltalk VMs were already capable of this. We just keep reinventing the wheel...
r_lee 2 days ago [-]
awesome, they can run Linux. right?
right?
nekusar 2 days ago [-]
What you describe is basically a 'save state' that we see in various game console emulators.
We know those work. But it would be crazy awesome to have a unbooted AND booted/execution image to finally sidestep the "worked on my machine" issue.
After 30 years in the industry, "trivial", "basic", and "simple" are words I've learned should never appear in the description for anything I expect to use. Ah, the author is the delusional sort, I'm sure the experience of using this thing will be perfectly smooth and well thought out.
stefanfisk 1 days ago [-]
The author which wrote "But don’t use it for anything in production right now! It’s a toy." in the readme?
damezumari 5 days ago [-]
I wrote up about our sandboxes. Everyone and their dog is offering them, but I think the fork operation is somewhat interesting at least for our own use - being able to fire copies of sandbox with a single API call has been convenient for our agentic use (reusing all earlier setup steps has saved lots of time and tokens).
Disclaimer: I know there's some more effort 'snapshotting' and other concepts elsewhere too, but from our point of view making it first-class citizen in both UI and API felt sensible and it has been useful.
verdverm 5 days ago [-]
You can do this at the container layer level with Dagger. Forking and time travel were my primary aims when building an agent sandbox on top of Dagger.
jstanley 2 days ago [-]
I'm curious how you handle open TCP sockets etc. at forking time? Do all sockets just get closed on one branch of the fork?
EDIT: I see you're only cloning filesystem contents, never mind.
damezumari 22 hours ago [-]
We considered forking running sandboxes too ( we do have memory pause-resume in addition to the disk only one ) but a lot of software does not handle multiple copies of itself well, as well as network, crypto, etc state being same is more of a problem than benefit.
justincormack 2 days ago [-]
Also encryption state, where you have to be very careful or you can break the encryption.
sidewndr46 2 days ago [-]
how would cloning computational state result in breaking encryption?
justincormack 2 days ago [-]
if you reuse a nonce with different data but the same key eg in AES-GCM, for example, so if you fork after creating an ephemeral key but before use thats quite likely, if the nonces are sequential.
jFriedensreich 2 days ago [-]
I thought forking is baseline now. Who on earth would use a saas only non open source sandbox though?
I remember implementing the original fork() call in the first Posix implementation. It consumed so much CPU time and resources (on machines with precious little of either) that I optimized it. It was often (usually) followed by exec() which combined meant, start this parallel process. The downside was, fork copied the entire parent process state, just to instantly throw it away on the next call.
So I made fork() do a lightweight copy (no pages, no tables, just mark the new process as a child of the older one) and upon exec 'forget' to complete the fork. Else the child process would fault on the incomplete copy as it executed and complete it then.
Disclosure: I am working an open-source KVM-based VMM for agent sandboxes, https://github.com/instavm/tarit
Also, storing large memory dumps is in my view not cost efficient as mostly restoring state is fast enough.
What do you consider to be main benefit in live fork?
right?
We know those work. But it would be crazy awesome to have a unbooted AND booted/execution image to finally sidestep the "worked on my machine" issue.
Disclaimer: I know there's some more effort 'snapshotting' and other concepts elsewhere too, but from our point of view making it first-class citizen in both UI and API felt sensible and it has been useful.
EDIT: I see you're only cloning filesystem contents, never mind.