roadmap PROPOSED

A caller gives up on a call at a deadline

Raised by lane/timed-call-proposal. On 2026-11-11 (UTC) the architect accepted, on #3499, that the board's PMIC route bounds its own wait because reboot cannot bound its call. The same ruling named a timed call as its own milestone. This file is that milestone. The system call surface is the architect's call, and the architect ruled its shape on 2026-11-11 (UTC); the ruling is below.

Reuse: the Timer object and the bound notification, both already built; remove_sender in crates/inter_process_communication; milestone 371 (a reply capability that names a call). No new object, system call number or dependency.

Name: provisional. Every new name below is the lane's, not a ruling.

Background: how a call works today

A client makes a call with Rendezvous::CALL (crates/moho_abi/src/rendezvous.rs, CALL). It sends two words and blocks until a reply arrives. The kernel mints a one-shot Reply capability that names the caller. The server receives it with RECEIVE_CAPABILITY and answers once with reply::REPLY. §12 (Call/Reply IPC: a one-shot reply capability) is the design.

The caller waits in one of two phases. First it may sit on the rendezvous's sender queue, because no server has taken the request yet. Then it is reply-parked: the server holds the Reply, and the caller sits on no queue at all. ipc_call_badged in kernel/src/sched/rendezvous.rs parks it with WaitRole::Reply and says that only the reply, or an abort, may wake it. Its BUGS say it plainly: a live server that never replies blocks its caller forever.

Time enters through two other objects. A Timer (crates/moho_abi/src/timer.rs, ARM) signals a notification when the counter reaches an absolute deadline. §147 (a timer a userspace service cannot hold) chose that object on 2026-09-05 (UTC), and the architect refused a deadline argument on RECEIVE or CALL as a way to save effort. A notification bound to a thread ends that thread's RECEIVE (§101 (notification objects)). bound_receiver in kernel/src/sched/notification.rs wakes a bound thread only when it waits as a WaitRole::Receiver.

So a client cannot bound a call. §101's rule 3 says a signal that arriving while the thread waits in CALL stays in the word until its next receive. A timer the client armed fires, the bit lands in the word, and the client stays parked.

Who would use it

The design

Option A, as ruled: a new Rendezvous method, CALL_BOUND, which is CALL that the caller's bound notification can end in either phase. The caller arms its Timer onto that notification and calls. The call returns the reply, or the notification's word with a tag in x4, as a bound receive already does. No system call number changes, and plain CALL keeps §101's rule 3 unchanged.

It is the composition §147 chose. The timer supplies the deadline and the notification is the wake source, so a call also ends on anything else that signals that word, such as a ^C or a supervisor's cancel.

What CALL_BOUND returns

What happens on each side

In the sender phase the kernel unlinks the caller with remove_sender and drops the Reply it carried. The server never sees the request.

In the reply phase the server keeps its Reply. The danger is that a stale Reply answers the caller's next call. Today one sweep prevents that: strand_reply_caller deletes every Reply naming the thread before it wakes it. That is safe on the teardown paths it serves now, but not as a routine event. The sweep empties the server's slot, and the server's next RECEIVE_CAPABILITY can file a new caller's Reply in that free slot. A server that parks replies, as line_editor does with its pending field, would then answer the wrong caller from the slot number it kept. Milestone 371 (a reply capability that names a call) removes the hazard: the stale Reply stays in its slot, names a call that is over, and the reply guard refuses it. So this milestone depends on 371.

Nothing tells the server that its caller left. The kernel drops its late REPLY, which returns 0, as a reply to a caller that is no longer waiting already does. REPLY_CAPABILITY already returns 1 in that case. A later opt-in can tell the server, as QNX's unblock pulse does, without changing this method.

A caller's code

reboot once the spawn service grants it a Timer and a notification bound to its thread. The names are provisional.

/// How long `reboot` waits for the route to answer: the route's own two seconds, and one more.
const ROUTE_CALL_BOUND_SECONDS: u64 = 3;

let deadline = now() + moho_abi::timer::counter_ticks_for(ROUTE_CALL_BOUND_SECONDS, 0, cntfrq());
if timer_arm(TIMER_SLOT, deadline, NOTIFICATION_SLOT, DEADLINE_BIT) < 0 {
    complain(b"reboot: the timer refused the deadline; asking the kernel\n");
} else {
    match call_bound(ROUTE_SLOT, route::request(route::RESET), 0) {
        CallOutcome::Replied(status, word) => {
            let _ = timer_cancel(TIMER_SLOT);
            report_route_answer(status, word); // as today
        }
        CallOutcome::Abandoned(_) => {
            complain(b"reboot: the power controller took the request and did not answer in three seconds; asking the kernel\n");
        }
        CallOutcome::Withdrawn(_) => {
            complain(b"reboot: the power controller never took the request; asking the kernel\n");
        }
    }
}
reboot_object_invoke(REBOOT_SLOT); // the kernel's REBOOT, as today

The options

Each option keeps plain CALL and its round trip unchanged. Every new path is out of line, as take_bound_signal is, so script/fastpath-footprint and script/icount must show no change. Nobody has measured the costs below yet, because nothing exists to measure; the building lane measures them.

A. CALL_BOUND: the bound notification ends the call (ruled)

B. A deadline argument: CALL_BEFORE(w0, w1, deadline)

CALL leaves its third argument unused, so a new method could carry an absolute deadline there. The kernel would keep the deadline on the thread and wake it at the tick.

C. A timeout for the next blocking call, as QNX's TimerTimeout sets

A new Timer method would arm a deadline that ends whatever the thread blocks in next.

D. No kernel change: the runtime packages the stand-in

user_mode_runtime would gain the swapper's pattern: start a small process to make the call, and wait with a deadline on its forwarded answer.

E. Bounds in servers only

This keeps the status quo of #3499: each server bounds its own work. It covers a slow server that still answers. It does not cover a hung server, the case the bound exists for.

Prior art, read 2026-11-11 (UTC) unless marked

The seven questions

  1. Considered and refused: B, for §147's reason and its single wake source; C, as ambient state; D, for its cost per call and its teardown in place of a give-up; E, because it misses the hung server.
  2. The tree already ends a bound receive with a notification and tags it in x4. A copies that shape onto a call.
  3. Prior art is above. The lane read each claim from its source today, and quotes the L4 paper's verdict.
  4. The premise holds. bound_receiver matches only WaitRole::Receiver, and §101's rule 3 counts a signal during CALL.
  5. Nobody has measured the costs, because nothing exists yet. 371's sweep, which A avoids, is 128 by 16 comparisons per caller freed.
  6. A new method is permanent once programs call it. Nife has no installs and no outside programs, so before the first release it is a two-way door.
  7. Yes. B is no harder to build than A, and A wins on composition and authority, not effort.

The ruling

Ruled 2026-11-11 (UTC), on #3508: option A. nife adds Rendezvous::CALL_BOUND (name provisional), a call that the caller's bound notification ends in either phase, returning withdrawn or abandoned. A lane builds it after milestone 371. The ruling refuses options B, C, D and E, each for the reason its section gives. The building lane records the method's semantics in design/decisions/ as this ruling.

What drives it

reboot's bound on its call to the PMIC route waits on this, and the two stand-ins and the hanging tests would use it on the day it lands.