A repository's layout is a claim about what the project is. Until this week the claim was "a C++ profiler with a Rust port growing inside it": src/ held the Qt application and the C++ service, third_party/ held LLVM, Qt and libunwindstack, MODULE.bazel was 1.9 MB of lockfile, and the Rust lived in a side directory whose crates were linked into OrbitService through a row of -ffi adapters. Post 13 measured the moment the Rust service overtook the C++ one; posts 14 through 25 never touched a C++ file again. The tree just had not caught up.
The cleanup is simple to describe and tedious to do: delete everything the C++ build owned, move the Rust from its side directory to the root, merge its six Cargo workspaces into one, and follow every path. What follows is the result, drawn.
The top level
A Cargo workspace root, and four directories beside it. The files are what any Rust repository has, Cargo.toml, Cargo.lock and the toolchain pin, plus run.sh, which builds the service and opens the viewer, and the usual README, LICENSE and .gitignore. The directories are where the counting starts.
crates/ is the product, tools/ is how it is tested, built and shipped, docs/ is how it is explained. contrib/, which once held Docker images, IWYU configs and a Jupyter notebook for the C++ build, is gone: its two license-header scripts live in .github/scripts, its two logos with the site's media. Build output never enters the tree.crates/: the service, in layers
Twenty-four crates on the service side, and the number is the port's history rather than a design: each phase of the port produced the crate that replaced one C++ library, and the crates kept their boundaries after the C++ left. That turns out to be a reasonable layering. Read from the bottom, each row depends only on rows below it.
orbit-test-rust (the Rust example program, on orbit-api), orbit-pod-dump (prints a capture, on orbit-wire), orbit-frida-transport (the capture lease, on orbit-scope-ring) and orbit-frida-build (the build-script helper that links the Frida devkits). orbit-capture is the Arrow-and-Parquet capture on disk and sits with the leaves because its only in-repo dependencies are the viewer's event crates. Every arrow in the real graph points downward; there are no cycles and no crate reaches up.Two crates are worth singling out because they produce more than a library. orbit-api builds as an rlib, a static library and a shared library at once: liborbit_api.so is what orbit.h loads at run time, and the Python package beside it talks to the same shared object through ctypes. orbit-service is the binary, and its python/ directory is the orbit-profiler wheel that wraps it. Two files that used to sit loose at the root of rust/, included by #[path] from the two Frida crates, now have crates to live in: the devkit link logic is orbit-frida-build, a build-dependency of the agent and the helper, and the setup-only timing is a module of orbit-frida-transport.
crates/orbit-live-*: the web stuff
The viewer used to be src/OrbitLiveViewer, a PascalCase name under the C++ tree because it was born as the C++ service's web front end and linked into it through orbit-live-ffi. That crate is gone, and the seven that remain sit in crates/ with everything else, the pack beside the viewer crate in crates/orbit-live-viewer/viewer-dist. It is the one part of the tree with a build step that is not cargo build, and the diagram is mostly about that step.
build-std, because the renderer's worker threads need a standard library built with atomics, and --profile wasm, a plain release build with no DWARF, since line tables and thin LTO buy a browser nothing. Its output is committed. The server crate embeds whatever is in viewer-dist/ at build time, and the service links the server, which is why a stale pack shows a stale page until the service is rebuilt. rust.sh warns when the pack is older than the viewer's sources.The server has a main.rs of its own, which serves the viewer with a demo producer and no capture stack; that is the fastest way to work on the front end. The real thing is the service: it installs orbit_api::scope into the server's Instrument hook at start-up, which is how the viewer's own WebSocket sends show up as scopes in a capture of the service.
One workspace, where there were six
A canonical Rust repository has one Cargo.toml at its root, one crates/, one lockfile and one target/. Until this week this one had six workspaces and seven lockfiles, and every manifest explained why in the same words: Bazel's crate_universe spliced rust/ into a temporary directory to generate its dependency graph, and a path dependency that left rust/ broke every Bazel build. So orbit-service, which depends on the viewer's server, had to be its own workspace. So did orbit-capture. So did the viewer, three times over. The other reason given, keeping eframe out of the service's lockfile, was never one Cargo needed: feature resolution is per build graph, so cargo build -p orbit-service never compiles eframe whether or not the viewer shares its workspace.
wasm-bindgen, stays at the 0.2.100 the viewer's CLI expects. Shared crates are compiled once per profile instead of once per workspace, CI caches one target/ per job, and cargo test --workspace finally means the whole tree.What the merge took: one [workspace] listing the 31 crates, one lockfile built from the seven, one toolchain pin, a [profile.wasm] so the pack keeps the plain release settings it had in its own workspace, and every --manifest-path in a script or a workflow turned into a -p. The per-crate target/ directories went with it; everything builds into the one at the root, including the Frida devkits that tools/frida/devkits.sh fetches into it.
tools/: driving it and shipping it
| Directory | What it is | Who runs it |
|---|---|---|
e2e/ | One Python script, 27 scenarios: builds the service, starts it, drives the viewer in headless Chrome over CDP, clicks by label, reads the state the viewer exposes on window.__orbit_ui, and writes docs/e2e/report.md and the 47 screenshots. Three C targets live here for the hooking, crash and Frida scenarios, with the privileged uprobe test runner and the hooked-scope checker. | Developers, after a change; the documentation, for its pictures |
build/ | The packaging scripts: the static musl service for Linux, the universal macOS build, the Windows build with the static CRT. | run.sh --static, the release workflow, anyone shipping a binary |
test-programs/ | OrbitTestC, OrbitTestCpp, OrbitTestPython: the same scenario in three languages, every manual-instrumentation call once. Their Rust sibling is the crate orbit-test-rust. Moved here from src/. | The api-* e2e scenarios; the macOS and Windows CI smoke tests |
hook_test/ | The one-function-at-a-time hooking testbench: a C workload with named targets, hooked one by one, with a crash report that names the culprit. | Anyone changing the trampolines or the Frida path |
site/, media-kit/ | build_site.py renders the manual, the blog and a captured demo into /site (ignored). media-kit/ regenerates the landing page's clips from the running viewer. | pages.yml, on every push to main |
frida/ | Downloads the Frida Core and Gum devkits for a platform, checks them against devkits.sha256, builds the agent and helper beside the service. | rust.sh; frida-rust.yml |
install/, sudo/, windows/, release/ | The curl-able installers, the CAP_PERFMON wrapper, the MSVC environment and elevated-test runner, and build_wheels.sh for the two pip packages. | Users; release-rust.yml and python-wheels.yml |
sharing/ | The S3 stack that serves a capture bundle to a viewer on another origin. | Whoever deploys sharing |
docs/: the manual, the log, and the site they become
docs/manual/ is the user-facing reference, twelve Markdown pages from capture.md to troubleshooting.md. docs/blog/ is this log: twenty-six self-contained HTML posts, the metrics/ directory of sixty-eight committed snapshots that every number in them comes from, and two captured streams the front page replays. Four longer essays sit at the top of docs/ next to the build and release notes. The plans, briefs and reviews written while the work was open, the Windows handoff brief, the cross-platform plan, the sampling-viewer plan, the uprobe and instrumentation analyses, live in docs/design/, where the code comments that cite them still find them and where a reader of the manual does not have to step over them.
/site is in .gitignore; what is committed is the Markdown, the posts, and the viewer pack that the front page's live demo runs on. The same script with --service builds the copy the service serves at /site, which is how orbit-service carries its own manual..github/: what each workflow owns
| Workflow | Runs | Covers |
|---|---|---|
frida-rust | PRs, pushes | The Frida agent, transport and helper crates against the pinned devkits |
live-viewer | PRs touching crates/orbit-live-*/ | Native tests of all seven viewer crates, the stable wasm32 compile, the renderer's complexity test in release |
macos-rust, windows-rust | PRs, pushes | The service and the API on those platforms, the C/C++ test programs, a smoke capture |
release-rust | orbit-v* tags | The static musl service, the macOS universal build, the Windows package, with the viewer pack checked for presence |
python-wheels | Tags, manual | The orbit-api and orbit-profiler wheels |
pages | Pushes to main | The viewer pack and the site |
checks, report-checks | PRs | License headers on the Rust, C, shell, PowerShell, JS and Python files a PR touches |
codeql, scorecards | Schedules | Python scanning and the OSSF scorecard. CodeQL used to run a Bazel build for C++. |
Notice what none of them run: cargo test --workspace in rust/. The crates CI tests are the ones a platform job needs, and the rest are run by hand. That gap showed itself during this cleanup, when the full workspace test suite turned out to include a self-sampling unwinder test with no bound on the records it kept; on this machine it reached 70 GB before the OOM killer stepped in. It is bounded now, 4,000 records or five seconds, and runs in under a second. A workspace-wide test job is the obvious next addition.
Where to go for what
| To change | Go to |
|---|---|
| What the viewer draws or how it responds | crates/orbit-live-viewer/src/app.rs and its neighbours; then build_wasm.sh, then rebuild the service |
| What the service captures on Linux | crates/orbit-service/src/ for the loop; orbit-perf-ring and orbit-collector for the kernel side |
| Windows capture | orbit-etw, and windows.rs in the service |
| Function hooking | orbit-frida-agent for what runs in the target, orbit-frida-helper for the controller, orbit-trampoline and orbit-ptrace for the native path |
| The manual-instrumentation API | orbit.h in orbit-api/include, the Rust behind it, python/orbit_api, then all four test programs |
| Symbol loading, unwinding | orbit-object, orbit-unwind; fixtures in orbit-object/testdata |
| The capture file | orbit-wire for the pod stream, orbit-capture for the Parquet bundle |
| How a scenario is verified | tools/e2e/orbit_e2e.py; run one scenario, not the suite |
| What users read | docs/manual/; the site rebuilds itself |
What is not in the tree, and where it went
The C++ application, its Bazel build, third_party/, the Qt icons, the distro-matrix CI and the differential tools that held the two implementations against each other are on the cpp branch, at the last commit before the first Rust one. Every pointer in the docs that used to name a C++ file as "the specification this test mirrors" now says so with the branch beside it. The sixteen C and C++ files that stayed are the public header and its Unreal copy, three thin shims over the Frida devkits, the C targets the tests profile, the two example programs, six fixture sources and one blog experiment. None of them is Orbit's old code; all of them are the Rust profiler's.
Not in the tree either, by design: target/ directories, the built /site, the wheels' staged binaries, and the Frida devkits, which tools/frida fetches and verifies rather than vendors.
The short version. One Cargo workspace at the root. crates/ holds the service in layers and the seven viewer crates with the committed pack the service embeds; tools/ tests, builds and ships it; docs/ explains it and becomes the site, with the working notes in docs/design/. Nothing of the previous life is left in the tree but the blog that tells it.