Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
43 commits
Select commit Hold shift + click to select a range
223088d
Migrate filesystem clients to broker
wdcui Sep 8, 2026
262d3a2
Fix brokered runner CI tests
wdcui Sep 8, 2026
e9df5db
Enable x18 rewriting in brokered test
wdcui Sep 8, 2026
7b4bf68
Move filesystem tests to their broker-core owners
wdcui Sep 9, 2026
043b12d
Decouple guest tests from broker authority
wdcui Sep 9, 2026
30ae0f1
Move file APIs onto LiteBox
wdcui Sep 9, 2026
c124a27
Consolidate guest file module
wdcui Sep 9, 2026
0d52521
Reference broker files during operations
wdcui Sep 9, 2026
91b1181
Share protocol file type
wdcui Sep 9, 2026
a40ddd0
Use protocol filesystem value types
wdcui Sep 10, 2026
aea9366
Share protocol filesystem metadata
wdcui Sep 10, 2026
ba4937f
Use BrokerFile directly for file descriptors
wdcui Sep 10, 2026
af98390
Share protocol open options and normalized paths
wdcui Sep 10, 2026
6858ca1
Remove local file backend coupling
wdcui Sep 10, 2026
0f7a951
Remove LiteBox filesystem facade tests
wdcui Sep 11, 2026
fa1e409
Keep LiteBox ownership shim-local
wdcui Sep 11, 2026
7100845
Restore LiteBox clone layout
wdcui Sep 11, 2026
f0d7787
Simplify pipe nonblocking state
wdcui Sep 11, 2026
8232c9e
Remove refactoring-only filesystem tests
wdcui Sep 11, 2026
bc1cf1c
Minimize filesystem migration changes
wdcui Sep 11, 2026
ccde9d4
Restore broker filesystem type names
wdcui Sep 11, 2026
53ef169
Restore filesystem metadata field names
wdcui Sep 11, 2026
673b7bc
Restore filesystem type qualification
wdcui Sep 11, 2026
31e9b09
Preserve resolver seek arithmetic
wdcui Sep 11, 2026
a7779e9
Use resolver directly in filesystem tests
wdcui Sep 11, 2026
5d6e2ff
Share filesystem mode conversion
wdcui Sep 11, 2026
26e4bcc
Decouple broker filesystem from runner CLI
wdcui Sep 11, 2026
75df27b
Add Windows broker platform crate
wdcui Sep 11, 2026
3843abe
Allow Windows broker platform to use std
wdcui Sep 11, 2026
90e6f0a
Share broker filesystem construction
wdcui Sep 11, 2026
473e450
Call shared broker filesystem builder directly
wdcui Sep 11, 2026
3835a4e
Gate host filesystem options to Linux
wdcui Sep 11, 2026
3e281fc
Move syscall rewriting to Linux runner
wdcui Sep 11, 2026
12c746e
Inline broker file service construction
wdcui Sep 12, 2026
e52fbae
Require broker-loaded runner programs
wdcui Sep 12, 2026
50034f6
Use real broker in Linux shim tests
wdcui Sep 12, 2026
f763f4d
Share in-process broker test support
wdcui Sep 12, 2026
e4c4921
Centralize broker test providers
wdcui Sep 12, 2026
0d8eb3d
Share terminal-only test stdio
wdcui Sep 12, 2026
5c6a961
Minimize Linux shim test churn
wdcui Sep 12, 2026
4ca357c
Isolate Windows registry paths
wdcui Sep 12, 2026
7fdf2a4
Centralize Windows file namespaces
wdcui Sep 12, 2026
8fbb7b8
Update post-rebase ratchets
wdcui Sep 12, 2026
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
13 changes: 9 additions & 4 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -90,6 +90,7 @@ jobs:
# is the PR this job starts covering it.
AARCH64_CRATES: >-
-p litebox
-p litebox_broker_core
-p litebox_broker_userland
-p litebox_common_linux
-p litebox_egress_proxy
Expand Down Expand Up @@ -318,6 +319,9 @@ jobs:
# `std` access, since it owns hosted Linux broker resources such as
# sockets and the epoll reactor.
#
# - `litebox_broker_platform_windows_userland` is allowed to have
# `std` access, since it owns hosted Windows broker resources.
#
# - `litebox_broker_userland` is allowed to have `std` access,
# since it is the hosted userland broker executable.
#
Expand All @@ -328,16 +332,16 @@ jobs:
# not work with the current no_std checker.
#
# - `litebox_runner_linux_on_windows_userland` is allowed to have `std`
# access since it needs to actually access the file-system, pull in
# relevant files, and then actually trigger LiteBox itself.
# access since it is a hosted executable that connects to the broker
# and launches the LiteBox guest.
#
# - `litebox_runner_windows_on_linux_userland` is allowed to have `std`
# access since it needs to actually access the file-system, pull in
# relevant files, and then actually trigger LiteBox itself.
#
# - `litebox_runner_linux_userland` is allowed to have `std` access
# since it needs to actually access the file-system, pull in
# relevant files, and then actually trigger LiteBox itself.
# since it is a hosted executable that connects to the broker and
# launches the LiteBox guest.
#
# - `litebox_runner_windows_userland` is allowed to have `std` access
# since it needs to actually access the file-system, pull in
Expand Down Expand Up @@ -381,6 +385,7 @@ jobs:
-not -path './Cargo.toml' \
-not -path './litebox_broker_local_userland/Cargo.toml' \
-not -path './litebox_broker_platform_linux_userland/Cargo.toml' \
-not -path './litebox_broker_platform_windows_userland/Cargo.toml' \
-not -path './litebox_broker_transport_linux_userland/Cargo.toml' \
-not -path './litebox_broker_transport_windows_userland/Cargo.toml' \
-not -path './litebox_broker_userland/Cargo.toml' \
Expand Down
36 changes: 19 additions & 17 deletions Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 2 additions & 0 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ members = [
"litebox_broker_local_userland",
"litebox_broker_core",
"litebox_broker_platform_linux_userland",
"litebox_broker_platform_windows_userland",
"litebox_broker_protocol",
"litebox_broker_host",
"litebox_broker_transport",
Expand Down Expand Up @@ -47,6 +48,7 @@ default-members = [
"litebox_broker_local_userland",
"litebox_broker_core",
"litebox_broker_platform_linux_userland",
"litebox_broker_platform_windows_userland",
"litebox_broker_protocol",
"litebox_broker_host",
"litebox_broker_transport",
Expand Down
26 changes: 22 additions & 4 deletions dev_bench/src/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -450,9 +450,16 @@ fn run_rewritten_hello_static(ctx: BenchCtx<'_>) -> Result<()> {
is_init,
lock_tracing,
} = ctx;
let tar_file = sh.current_dir().join("hello_static_rootfs.tar");
if is_init {
rewriter_hello_static(ctx.with_init(true))?;
rewriter_hello_static(ctx.with_init(false))?;
sh.remove_path(&tar_file)?;
cmd!(
sh,
"tar --format=ustar -cf {tar_file} hello_static_rewritten"
)
.run()?;
let features: &[&str] = if lock_tracing {
&["--features", "lock_tracing"]
} else {
Expand All @@ -463,11 +470,15 @@ fn run_rewritten_hello_static(ctx: BenchCtx<'_>) -> Result<()> {
"cargo build -p litebox_runner_linux_userland --release {features...}"
)
.run()?;
cmd!(sh, "cargo build -p litebox_broker_userland --release").run()?;
} else {
let broker = project_root.join("target/release/litebox-broker-userland");
let runner = project_root.join("target/release/litebox_runner_linux_userland");
cmd!(
sh,
"{project_root}/target/release/litebox_runner_linux_userland --unstable hello_static_rewritten"
).run()?;
"{broker} --fs-initial-files {tar_file} --runner {runner} /hello_static_rewritten"
)
.run()?;
}
Ok(())
}
Expand Down Expand Up @@ -586,9 +597,13 @@ fn run_rewritten_node(ctx: BenchCtx<'_>) -> Result<()> {
rewriter_node(ctx.with_init(false))?;

let tar_base_dir = sh.current_dir().join("node_tar_base");
sh.create_dir(&tar_base_dir)?;
sh.write_file(tar_base_dir.join("hello_world.js"), HELLO_WORLD_JS)?;
std::fs::copy(
sh.current_dir().join("node_rewritten"),
tar_base_dir.join("node_rewritten"),
)?;
let libs = find_dependencies(sh, "node")?;
sh.create_dir(&tar_base_dir)?;
for lib in libs {
let dest_path = tar_base_dir
.join(lib.strip_prefix("/").unwrap_or_else(|_| {
Expand Down Expand Up @@ -618,11 +633,14 @@ fn run_rewritten_node(ctx: BenchCtx<'_>) -> Result<()> {
"cargo build -p litebox_runner_linux_userland {release...} {features...}"
)
.run()?;
cmd!(sh, "cargo build -p litebox_broker_userland {release...}").run()?;
} else {
let mode = if release_mode { "release" } else { "debug" };
let broker = project_root.join(format!("target/{mode}/litebox-broker-userland"));
let runner = project_root.join(format!("target/{mode}/litebox_runner_linux_userland"));
cmd!(
sh,
"{project_root}/target/{mode}/litebox_runner_linux_userland --unstable --env HOME=/ --initial-files {tar_file} node_rewritten hello_world.js"
"{broker} --fs-initial-files {tar_file} --runner {runner} --env HOME=/ /node_rewritten hello_world.js"
).run()?;
}
Ok(())
Expand Down
5 changes: 2 additions & 3 deletions dev_bench/unixbench/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,11 +7,11 @@ Run [byte-unixbench](https://github.com/kdlucas/byte-unixbench) benchmarks nativ
- The UnixBench source tree at `byte-unixbench-6.0.0/UnixBench/` (extracted from `v6.0.0.zip`).
- `gcc`, `make`, `ldd`, `tar` on the host.
- Pre-built LiteBox binaries (`litebox-broker-userland`,
`litebox_runner_linux_userland`, and `litebox_syscall_rewriter`).
`litebox_runner_linux_userland`, and `litebox_packager`).

Build LiteBox (from workspace root):
```bash
cargo build --release -p litebox_broker_userland -p litebox_runner_linux_userland -p litebox_syscall_rewriter
cargo build --release -p litebox_broker_userland -p litebox_runner_linux_userland -p litebox_packager
```

## Quick Start
Expand Down Expand Up @@ -144,5 +144,4 @@ python run_unixbench.py --mode litebox --windows --prepared-dir ./prepared --run
```

**Key differences from Linux mode:**
- No `--rewrite-syscalls` needed — binaries are already pre-rewritten
- No native baseline (Linux binaries can't run natively on Windows)
31 changes: 14 additions & 17 deletions dev_bench/unixbench/run_unixbench.py
Original file line number Diff line number Diff line change
Expand Up @@ -296,12 +296,11 @@ def prepare_litebox_rootfs(

The packager discovers shared-library dependencies via ldd, rewrites all
ELF files with the syscall rewriter, and produces a tar suitable for
``--initial-files``. The rewritten main binary is then extracted from
the tar so it can be passed to the runner as the program to execute.
broker ``--fs-initial-files``.

Returns (tar_path, rewritten_binary_path) or None on failure.
Returns (tar_path, guest_program_path) or None on failure.
"""
binary = pgms_dir / bench.binary
binary = (pgms_dir / bench.binary).resolve()
if not binary.exists():
print(f" [SKIP] {bench.name}: binary not found at {binary}")
return None
Expand All @@ -323,19 +322,17 @@ def prepare_litebox_rootfs(
print(f" Error: packager failed for {bench.name}: {stderr[:500]}")
return None

# Extract the rewritten main binary from the tar
rewritten = work_dir / f"{bench.binary}.hooked"
try:
extract_rewritten_binary(tar_path, binary, rewritten)
except RuntimeError as e:
print(f" Error: {e}")
return None

# For execl: add the rewritten binary at /pgms/execl in the tar
if bench.name == "execl":
rewritten = work_dir / f"{bench.binary}.hooked"
try:
extract_rewritten_binary(tar_path, binary, rewritten)
except RuntimeError as e:
print(f" Error: {e}")
return None
add_execl_to_tar(tar_path, rewritten)

return tar_path, rewritten
return tar_path, binary


def _run_litebox_cmd(
Expand Down Expand Up @@ -433,11 +430,12 @@ def run_litebox(
if prepared is None:
return None

tar_path, rewritten = prepared
tar_path, guest_program = prepared
broker_path = runner_path.with_name("litebox-broker-userland")

cmd = [
str(broker_path),
"--fs-initial-files", str(tar_path),
"--runner", str(runner_path),
"--env", "LD_LIBRARY_PATH=/lib64:/lib32:/lib",
"--env", "HOME=/",
Expand All @@ -447,8 +445,7 @@ def run_litebox(
if bench.name == "execl":
cmd += ["--env", "UB_BINDIR=/pgms"]

cmd += ["--initial-files", str(tar_path)]
cmd += [str(rewritten)]
cmd += [str(guest_program)]

return _run_litebox_cmd(bench, duration, cmd)

Expand Down Expand Up @@ -491,6 +488,7 @@ def run_litebox_windows(
broker_path = runner_path.with_name("litebox-broker-userland.exe")
cmd = [
str(broker_path),
"--fs-initial-files", str(tar_path),
"--runner", str(runner_path),
"--env", "LD_LIBRARY_PATH=/lib64:/lib32:/lib",
"--env", "HOME=/",
Expand All @@ -500,7 +498,6 @@ def run_litebox_windows(
if bench.name == "execl":
cmd += ["--env", "UB_BINDIR=/pgms"]

cmd += ["--initial-files", str(tar_path)]
cmd += [tar_program_path]

return _run_litebox_cmd(bench, duration, cmd)
Expand Down
4 changes: 2 additions & 2 deletions dev_tests/src/ratchet.rs
Original file line number Diff line number Diff line change
Expand Up @@ -34,21 +34,21 @@ fn ratchet_globals() -> Result<()> {
ratchet(
&[
("dev_bench/", 1),
("litebox/", 7),
("litebox_broker_core/", 1),
("litebox_broker_transport_linux_userland/", 1),
("litebox_broker_userland/", 1),
("litebox/", 7),
("litebox_platform/", 2),
("litebox_platform_linux_kernel/", 5),
("litebox_platform_linux_userland/", 5),
("litebox_platform_lvbs/", 21),
("litebox_platform_windows_userland/", 12),
("litebox_runner_lvbs/", 8),
("litebox_runner_snp/", 2),
("litebox_runner_windows_userland/", 2),
("litebox_shim_linux/", 2),
("litebox_shim_optee/", 6),
("litebox_shim_windows/", 1),
("litebox_runner_windows_userland/", 2),
],
|file| {
Ok(file
Expand Down
Loading
Loading