| Commit message (Collapse) | Author | Age |
| |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
clunk interrupts what is parked on its fid
A backend holding a read that has nothing yet had to find its park by
walking the engine's slots and matching a tag. Now Conn.hold() answers
.again and returns a Ticket (slot and that park's sequence number);
Conn.waiting() says whether that very park still waits, and
Conn.answerWith() answers it with what a producer makes, asking the
producer only while it waits and under the same lock, the way lib9p lets
a server keep a Req and respond() later, so a consuming answer is never
spent on a flushed request. The sequence number counts on across the
connections a runner slot serves (initIn keeps it), so a ticket of one
never names a park of the next. A clunk or remove fails everything
parked on its fid with EINTR first, so no slot outlives its fid to be
retried with a released handle or answered to a fid of the same number
walked anew; retry's check for a vanished fid is gone with it. 9ns maps
acme's "shut down" to EIO.
Co-Authored-By: Claude Opus 5.5 <[email protected]>
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
mount
9ns served one FUSE request at a time per 9P server, so a read the server
parks (pardes's log, a pane's event) held up every other operation on the
mount: with 'cat log' parked, 'cat status' took 3.5-4.5 s instead of ~1 ms.
nine.zig: the session is shared by threads and multiplexes by tag the way
Plan 9's mount driver does (devmnt.c mountio/mountmux/mntgate/
mntflushalloc). Each thread calls through its own nine.Caller (reply buffer,
wake-up eventfd, interrupt source, ename). A call writes its T-message under
wlock; the first waiter with nobody reading takes the reading baton, reads
for everyone and hands each R-message to the caller its tag names, then
passes the baton on. Tflush is per tag: a reply that beats the Rflush is
honoured, the flushed tag is not reused before the Rflush, the baton is let
go before the flush is written. With every tag taken a call waits for one
(starved list) instead of failing.
bridge.zig: one thread (the loop) still owns the inode/handle/qid tables and
serves everything that touches them. READ and WRITE are resolved to their
fid on the loop and handed to transfer workers (up to 31 per bridge,
started on demand), which make the 9P calls on their own Caller and reply
themselves. FUSE_INTERRUPT for a worker's request: still queued -> EINTR on
the spot; in flight -> its unique down the worker's pipe -> Tflush of exactly
that tag. Fids are clunked only on RELEASE. mntgen mounts get the same pool
(their dispatcher routes interrupts to it); the mount interrupt pipe moved
into Bridge. main.zig attaches through a Caller.
Tests: two multiplexing tests in nine.zig (a parked read holds up only its
caller and its interrupt flushes exactly its tag; with every tag parked a
call waits for a tag), and a serve()-level test driving a fake /dev/fuse (a
parked READ holds up neither READs nor GETATTR; INTERRUPT -> one Tflush for
the parked tag -> EINTR; RELEASE). Also de-flaked the pre-existing
'short read' test (it raced its own server reply under load).
Measured (own 9ns mount on the live pardes socket, read-only): with log
parked, cat status 4498 ms before, 7 ms after.
Tag window: client.zig gains ClientWith(n) (Client = ClientWith(16) as
before; request/result types hoisted so all instantiations share them).
9ns uses ClientWith(32): 32 is fs.zig's default slot_capacity, so one 9ns
mount can never have more parked on a cloud9 fs server than it parks, and
never meets its "Resource temporarily unavailable" refusal. fs.zig is
unchanged (its default is also the ESP32 board's, held to 24 KiB by its
budget tests). Full window: the loop keeps its tag (metadata unaffected);
the 32nd READ/WRITE waits in the pool queue (blocks, interruptible, never
EAGAIN/EIO).
More tests (bridge.zig, serve() over a fake /dev/fuse): one open is one fid
(two opens of an inode read through distinct fids, concurrently, one of
them parked); FLUSH on a handle with a parked read clunks nothing and the
read later completes on that fid; only RELEASE clunks; a flushed READ whose
reply beats the Rflush returns the data, not EINTR.
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
cloud9.post: servers post their socket under a name in
$XDG_RUNTIME_DIR/9p (post/unpost, posted, dial, Watch) and
serve.Runner.listenPosted posts a server by name, unposting on stop.
Names are budget-checked against the 108-byte socket path; a claim
binds+listens at a private temp path and takes the name with atomic
renames under flock (RENAME_NOREPLACE for free names, RENAME_EXCHANGE
grab-verify-commit for stale ones): the registry path is never unlinked
by a claim, live names refuse with AlreadyPosted, foreign files with
NotSocket, and unpost removes only the caller's inode-matched entry.
Watch surfaces inotify overflow and a replaced registry dir.
9ns --mntgen [--mount DIR] -- PROGRAM: one FUSE mount at /mnt/9p whose
synthetic root lists the posted registry (no connection made); a walk
into an unmounted name dials it and runs the existing bridge dispatch
in a per-server worker thread, routed by mount index in the node id's
top bits (ordinals never reused, cap 4096); a dead server answers EIO
on its subtree and is re-dialed on the next walk. The dial watches
stop_fd through Tversion (connectWatched). All existing 9ns forms are
unchanged.
9proc's unix listener no longer blind-unlinks its path: a foreign
non-socket is refused (Occupied), a live server is refused
(AlreadyListening), only a refused socket is cleared, and stop()
unlinks only the listener's own inode-matched socket.
Hardened by adversarial review (GLM 5.3 x2 + DeepSeek V4.1 Flash, all
high-thinking): double-bind races on one name (0 in 180k rounds),
foreign-file TOCTOU deletions (0 in 4M flips), a 255-byte-name listing
panic, inotify queue overflow silently dropped, listenPosted silently
overwriting, dial-time Tversion hangs wedging the dispatcher, --debug
silently ignored in mntgen, and xattr/statx probes answering EPERM on
the synthetic root (broke `ls -l /mnt/9p`).
Tests: root 80/80, 9ns 47/47, 9proc 60/60, integration 88/88 +
mntgen 37/37, adversarial 213/0, freestanding riscv32 gate green.
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
One upstream 9P connection now serves any number of browser WebSocket
sessions and, with --serve, plain 9P clients over TCP or Unix (a 9pserve-
style frame remux: tags and fids remapped, Tflush forwarded, reconnect on
upstream loss). /fs/<path> maps HTTP onto the tree: GET file or directory
(JSON or HTML), Range, HEAD with 9P headers, PUT (create, truncate, append,
trailing slash makes a directory), DELETE, and ?follow=1 or text/event-stream
turning a blocking read into server-sent events with Tflush on disconnect.
The page gains a lazy tree, stat panel, create, rename, delete, upload and
follow mode. --probe embeds 9proc for self-introspection. New mux-test and
http-fs-test steps; e2e still passes.
Co-Authored-By: Claude Fable 5.1 <[email protected]>
|
| |
|
|
|
|
|
|
|
|
|
|
| |
Runner(Backend, Options, Limits) listens on Unix or TCP, runs a reader and a
serve task per connection in one Io.Group, pushes frames into an fs.Server,
and lets the backend answer now or later from any task or thread (reply,
flush, wake); Tflush, greet timeout, connection limit, close and stop with
cancellation are covered by tests over real sockets. The engine and the
backend contract stay Io-free, so the push/step mode for freestanding
targets is unchanged. Documented as the two ways to drive the engine.
Co-Authored-By: Claude Fable 5.1 <[email protected]>
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
9proc's own fid table, walk loop and dir-read engine are replaced by
cloud9.fs.Server; the tree (static, vars, providers) is served through the
engine's Req/Reply contract with node ids that keep the old qid scheme.
Providers may answer later by returning error.Again (parked in the engine,
retried each step, Tflush -> EINTR); no new files are exposed.
Engine (backward compatible, all opt-in via Backend.features / Options):
create, remove, wstat, reference accounting for backends that count
handles, a salted fid index, name_capacity 0 (names from getattr),
Reply.ename for backend-chosen error text, Attr.path/version/atime.
Engine-level error strings and the 217-byte msize floor now apply to 9proc;
tests updated accordingly.
Co-Authored-By: Claude Fable 5.1 <[email protected]>
|
| |
|
|
|
|
|
|
|
|
|
|
|
| |
The asynchronous 9P file-server engine from the Pardes editor moves into the
library: fid table, walks, directory cursors, a job/slot model where backend
replies arrive later by tag (status again = parked), Tflush cancellation and
orphaned fids on hangup. Allocation-free, no OS calls, no std.Io; comptime
Options (fid, slot, park data, name and user capacities) replace the
editor's constants. Backend contract types (Req, Reply/ReplyWith, Op,
Status, Attr, E, error strings) live here. 29 engine tests plus the client
tests that sat beside it in Pardes.
Co-Authored-By: Claude Fable 5.1 <[email protected]>
|
| |
|
|
|
|
|
|
| |
Directories, binaries, build options (-D9ns, -D9proc), step names, module
name (9proc), thread and fs names, env var NINEPLAYER_MOUNT -> NINE_MOUNT,
docs and test scripts. Browser assets move to web/static.
Co-Authored-By: Claude Fable 5.1 <[email protected]>
|
| |
|
|
|
|
|
|
|
|
|
|
|
| |
9player/: FUSE mount CLI that mounts a 9P2000 tree into a fresh user+mount
namespace and runs a program in it (no root, no libfuse, no libc).
introspect/: the 9P debug/introspection library (freestanding core, value
renderers, Linux probe with threads/stacks/memory/breakpoints/panics) and
its demo server. Each has its own build fragment; the root build.zig wires
them behind -D9player/-Dintrospect with namespaced steps (9player-itest,
introspect-check-freestanding, programs-test, ...) and exports the
introspect module for dependents. This is the layout for related programs.
Co-Authored-By: Claude Fable 5.1 <[email protected]>
|
| | |
|
| |
|