tobogganSe connecter

louise

The Louise language: compiler, runtime, std, tooling

Clone avec HTTPS, un jeton personnel en mot de passe, ou avec SSH, une clé ajoutée dans vos paramètres.

Runtime ABI 3: ctx->xargs points at the running thread's slots (issue #137)

The 26 slots for call arguments after the sixth were part of every
actor's context: 208 of the 336 bytes of an Actor, though they only hold
values between a caller's stores and the callee's copy. ctx->xargs is now
a pointer, which run_slice sets to the resuming scheduler thread's slots
(sched::XARGS). Generated C is unchanged (ctx->xargs[i] reads the same),
the context shrinks to 48 bytes, and TL_ABI_VERSION goes to 3.

Why it is safe: nothing suspends between the stores and the copy.
Generated functions copy their arguments before their preemption check;
closure entries copy, drop the closure and store again before their tail
call; the runtime's callers (prims::call_closure, effect clauses,
callbacks) call straight into generated code. Callbacks run only on their
extern call's thread, and the blocking pool never runs Louise code
(ADR 0015).

tests/run/many_arguments.lse: 32 actors calling a 9-parameter recursive
function, a closure with captures and 7 arguments, and a 7-argument ctl
operation, preempted and moved between threads. With the pointer set
only on an actor's first slice (a stale thread's slots), it gave wrong
results or crashed in 10 runs of 10 on 4 and 8 threads; it passes in 10
of 10 otherwise, on 1 to 22 threads, with and without immediate
hibernation, with the leak oracle at 0. No test program had more than
six parameters before.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>

olivier · il y a 1 mois · 5e55b06bbb64790dd2ee14fd5113d5d62b8ae553

Parents 8f14728

7 fichiers modifiés, 105 ajouts, 13 suppressions