Skip to content

Commit ba3182e

Browse files
committed
Remove DaxFS backend: simplify to BranchFS-only
Signed-off-by: Cong Wang <cwang@multikernel.io>
1 parent 65872ce commit ba3182e

18 files changed

Lines changed: 32 additions & 551 deletions

README.md

Lines changed: 5 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -467,17 +467,12 @@ branching status --json
467467

468468
## How it works
469469

470-
BranchContext uses copy-on-write filesystems to create instant, zero-cost
471-
branches of your workspace. Two backends are supported, auto-detected at
472-
runtime:
470+
BranchContext uses [BranchFS](https://github.com/multikernel/branchfs), a
471+
copy-on-write FUSE filesystem, to create instant, zero-cost branches of your
472+
workspace. Branches are virtual paths within a single mount, with
473+
first-winner-commit semantics.
473474

474-
| Backend | How branches work |
475-
|---|---|
476-
| **[BranchFS](https://github.com/multikernel/branchfs)** (FUSE) | Single mount; branches are virtual paths within it. First-winner-commit semantics. |
477-
| **[DaxFS](https://github.com/multikernel/daxfs)** (kernel) | Separate mount per branch. Fastest option for DAX-capable storage. |
478-
479-
You just create a `Workspace` pointed at a mounted path - the backend is
480-
detected automatically.
475+
You just create a `Workspace` pointed at a mounted BranchFS path.
481476

482477
Process isolation (`BranchContext`) uses unprivileged Linux user namespaces
483478
to give each child its own filesystem view. No root required - works on any

examples/parallel_speculation.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
# SPDX-License-Identifier: Apache-2.0
33
"""Parallel speculation example — first successful fix wins.
44
5-
Requires a mounted branchfs or daxfs filesystem.
5+
Requires a mounted branchfs filesystem.
66
77
Usage:
88
python parallel_speculation.py /mnt/workspace

examples/simple_branch.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
# SPDX-License-Identifier: Apache-2.0
33
"""Simple branch example — speculative execution with auto-commit/abort.
44
5-
Requires a mounted branchfs or daxfs filesystem.
5+
Requires a mounted branchfs filesystem.
66
77
Usage:
88
python simple_branch.py /mnt/workspace

examples/speculate_fix.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -299,7 +299,7 @@ def main():
299299
parser = argparse.ArgumentParser(
300300
description="Fix a buggy module: one LLM call, N branches.",
301301
)
302-
parser.add_argument("workspace", help="BranchFS/DaxFS workspace path")
302+
parser.add_argument("workspace", help="BranchFS workspace path")
303303
parser.add_argument("--model", default="gpt-4o-mini",
304304
help="LLM model name (default: gpt-4o-mini)")
305305
parser.add_argument("-n", type=int, default=4,

integration/SKILL.md

Lines changed: 7 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -6,19 +6,17 @@ the winner, and abort the rest — instantly.
66

77
## Workspace
88

9-
A workspace is a directory backed by a copy-on-write filesystem (branchfs
10-
or daxfs). All branching operations happen within a workspace.
9+
A workspace is a directory backed by [BranchFS](https://github.com/multikernel/branchfs),
10+
a copy-on-write FUSE filesystem. All branching operations happen within a workspace.
1111

12-
**Prerequisite:** The workspace must be mounted before use. Two backends
13-
are supported, auto-detected at runtime:
12+
**Prerequisite:** The workspace must be mounted before use:
1413

15-
| Backend | Mount |
16-
|---------|-------|
17-
| [BranchFS](https://github.com/multikernel/branchfs) (FUSE) | `branchfs /mnt/workspace` |
18-
| [DaxFS](https://github.com/multikernel/daxfs) (kernel) | `mount -t daxfs <device> /mnt/workspace` |
14+
```bash
15+
branchfs /mnt/workspace
16+
```
1917

2018
The CLI auto-detects the workspace from your current directory if you are
21-
inside a branchfs/daxfs mount. Otherwise pass `-w /mnt/workspace`.
19+
inside a branchfs mount. Otherwise pass `-w /mnt/workspace`.
2220

2321
## CLI
2422

src/branching/__init__.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
"""
33
BranchContext - Unified branching for speculative execution.
44
5-
Supports filesystem branching (BranchFS FUSE, DaxFS), process branching
5+
Supports filesystem branching (BranchFS FUSE), process branching
66
(fork + namespaces), and AI agent integration patterns (speculation,
77
best-of-N, reflexion, tree-of-thoughts).
88

src/branching/core/base.py

Lines changed: 1 addition & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@ def fstype(cls) -> str:
2828
Return filesystem type name as it appears in /proc/mounts.
2929
3030
Returns:
31-
Filesystem type string (e.g., 'daxfs', 'fuse.branchfs')
31+
Filesystem type string (e.g., 'fuse.branchfs')
3232
"""
3333
pass
3434

@@ -80,12 +80,3 @@ def abort(cls, mountpoint: Path) -> None:
8080
"""
8181
pass
8282

83-
@classmethod
84-
def single_mount(cls) -> bool:
85-
"""Whether this backend uses a single mount (view switches in-place).
86-
87-
Returns True for ioctl-based backends like BranchFS where branching
88-
happens within a single mount. Returns False for mount-per-branch
89-
backends like DaxFS.
90-
"""
91-
return False

src/branching/core/branch.py

Lines changed: 5 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -59,8 +59,8 @@ def __init__(
5959
parent_branch: Parent's branch path (e.g., '/main' or '/main/L1')
6060
on_success: Action on clean exit - "commit" or None
6161
on_error: Action on exception - "abort" or None
62-
mount_root: Filesystem mount root (for single-mount backends where
63-
branch virtual paths are always relative to root).
62+
mount_root: Filesystem mount root (branch virtual paths are
63+
always relative to this root).
6464
"""
6565
self._fs = fs
6666
self._name = name
@@ -107,13 +107,7 @@ def branch(
107107
Returns:
108108
New Branch instance
109109
"""
110-
if self._fs.single_mount():
111-
# Single-mount backends: mountpoint is always the mount root
112-
# (create_branch will return the actual virtual path)
113-
child_mount = self._mount_root
114-
else:
115-
# Mount-per-branch backends: create sibling directory
116-
child_mount = self._path.parent / f"{self._path.name}_{name}"
110+
child_mount = self._mount_root
117111
return Branch(
118112
fs=self._fs,
119113
name=name,
@@ -127,10 +121,7 @@ def branch(
127121

128122
def commit(self) -> None:
129123
"""
130-
Commit the branch.
131-
132-
For DaxFS: commits the entire branch chain to main.
133-
For BranchFS: commits the leaf branch to its parent.
124+
Commit the branch (merges changes to parent).
134125
"""
135126
if self._finished:
136127
return
@@ -139,10 +130,7 @@ def commit(self) -> None:
139130

140131
def abort(self) -> None:
141132
"""
142-
Abort the branch.
143-
144-
For DaxFS: aborts the entire branch chain back to main.
145-
For BranchFS: aborts the leaf branch, returning to parent.
133+
Abort the branch (rolls back to parent).
146134
"""
147135
if self._finished:
148136
return

src/branching/core/registry.py

Lines changed: 1 addition & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ def register(fstype: str, fs_class: Type[FSBackend]) -> None:
1919
Called by filesystem modules during import to register themselves.
2020
2121
Args:
22-
fstype: Filesystem type name (e.g., 'daxfs', 'fuse.branchfs')
22+
fstype: Filesystem type name (e.g., 'fuse.branchfs')
2323
fs_class: FSBackend subclass that handles this filesystem
2424
"""
2525
_registry[fstype] = fs_class
@@ -91,11 +91,6 @@ def _ensure_implementations_loaded() -> None:
9191
9292
Imports backend modules which register themselves on import.
9393
"""
94-
if "daxfs" not in _registry:
95-
try:
96-
from ..fs import daxfs as _ # noqa: F401
97-
except ImportError:
98-
pass
9994
if "fuse.branchfs" not in _registry:
10095
try:
10196
from ..fs import branchfs as _ # noqa: F401

src/branching/core/workspace.py

Lines changed: 1 addition & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -54,33 +54,17 @@ def fstype(self) -> str:
5454
"""Detected filesystem type name."""
5555
return self._fs.fstype()
5656

57-
@property
58-
def single_mount(self) -> bool:
59-
"""Whether the backend uses stack-based branching on a single mount.
60-
61-
When True, branches are serialized (no concurrent siblings).
62-
"""
63-
return self._fs.single_mount()
64-
6557
def _generate_mountpoint(self, name: str) -> Path:
6658
"""
6759
Generate a mountpoint path for a branch.
6860
69-
Backend-aware: single-mount backends (BranchFS) reuse the mount root;
70-
mount-per-branch backends (DaxFS) create a sibling directory.
71-
7261
Args:
7362
name: Branch name
7463
7564
Returns:
7665
Path for the new branch mount
7766
"""
78-
if self._fs.single_mount():
79-
# BranchFS: view switches in-place, same mount root
80-
return self._mount_root
81-
else:
82-
# DaxFS: each branch gets its own mount
83-
return self._path.parent / f"{self._path.name}_{name}"
67+
return self._mount_root
8468

8569
def branch(
8670
self,

0 commit comments

Comments
 (0)