Skip to content

refactor: move folders to the layout in docs/design/repo-layout.md (layout step 2) - #876

Draft
zzylol wants to merge 3 commits into
docs/repo-layoutfrom
refactor/layout-folder-moves
Draft

zzylol wants to merge 3 commits into
docs/repo-layoutfrom
refactor/layout-folder-moves

Conversation

@zzylol

@zzylol zzylol commented Nov 26, 2026 •

Copy link
Copy Markdown
Contributor

Summary

  • Problem: the repository has two crates at the top level and its measurement code is spread over bench/demo, data_plane/examples and scripts/, so it does not match the layout proposed in docs/design/repo-layout.md (docs(design): repository layout and engine boundaries #874).
  • Change: step 2 of that document's migration order, "folder moves only". Every file moves with git mv, and every path that pointed at an old location is updated.
  • Effect: the folders now match the target layout. The code and its behavior stay the same: the same packages, binaries, example names, test count and test results. For example, cargo run --release -p data_plane --example ingest_bench -- 10000 300 still works; its source is now benchmarks/micro/ingest_bench.rs.

Review guide

  • Base: docs/repo-layout (docs(design): repository layout and engine boundaries #874), so the design doc is in the stack.
  • Read first: Cargo.toml, crates/data-plane/Cargo.toml (the [[example]] entries), eval/demo/run_live_demo.sh, eval/run_vm_demo.sh, deployment/monitoring/{docker-compose.yml,run_binaries.sh,screenshot.sh}, and the three .gitignore files.
  • Mechanical: everything else. Almost all files are 100% renames. The ones that are not have path edits only: test fixtures (../examples → ../../docs/examples), usage lines, and comments.
  • Not changed: package names (control_plane, data_plane), binary names, example names, CLI flags and $ASAPQ_BENCH semantics, except that it now names eval/.

Old → new paths

Old New
control_plane/ crates/control-plane/ (package control_plane)
data_plane/ crates/data-plane/ (package data_plane, still one crate)
data_plane/examples/*_bench.rs (8 files) benchmarks/micro/
data_plane/examples/remote_write_load.rs crates/data-plane/examples/ (unchanged; see Decisions)
bench/demo/{campaign,harness,workloads,profile}/ eval/{campaign,harness,workloads,profile}/
bench/demo/live/, bench/demo/run_live_demo.sh eval/demo/live/, eval/demo/run_live_demo.sh
bench/demo/monitoring/ deployment/monitoring/
bench/demo/{build.sh,fetch_binaries.sh,run_vm_demo.sh,README.md} eval/
bench/demo/.gitignore eval/.gitignore (the /live/… rules become /demo/live/…); its two /monitoring/… rules move to deployment/monitoring/.gitignore
scripts/profile.sh, scripts/tiered_views_cgroup.sh benchmarks/scripts/
examples/*.json (4 files) docs/examples/
scripts/ci/, scripts/sync-asapplanner-main.sh unchanged
— .gitignore: eval/results/ added

Path-reference updates

  • Cargo: workspace members = ["crates/control-plane", "crates/data-plane"], and the control_plane path dependency now points at crates/control-plane. crates/data-plane/Cargo.toml declares the eight benchmarks as [[example]] entries with path = "../../benchmarks/micro/<name>.rs". offset_bench.rs's #[path] include of the test helpers now points at ../../crates/data-plane/tests/common/mod.rs. Cargo.lock loses one line (below).
  • Tests: control-plane/tests/plan_workload.rs, data-plane/tests/common/mod.rs and data-plane/tests/push_precompute.rs read the example workloads from ../../docs/examples. Doc comments are updated to match.
  • CI (.github/): no change needed. The workflows use package names (cargo fmt -p control_plane -p data_plane) and scripts/ci/, which did not move.
  • eval scripts: $ASAPQ_BENCH is now eval/. run_live_demo.sh and run_vm_demo.sh define MON=$ASAPQ_BENCH/../deployment/monitoring and use it wherever they used $BASE/monitoring or $ASAPQ_BENCH/monitoring. run_live_demo.sh sets LIVE=$BASE/demo/live. The recorded live sequences (eval/demo/live/chain_*.sh, demo_sequence*.sh, after_sequence_limits.sh) run from $ASAPQ_BENCH and now call demo/run_live_demo.sh, demo/live/… and ../deployment/monitoring/…. limits_exporter.py finds eval/harness one level further up. profile_query_phase.sh looks for $BACKEND_DIR/benchmarks/scripts/profile.sh. A checkout without that file falls back to plain perf, as before.
  • deployment/monitoring: run_binaries.sh and screenshot.sh use MON=$ASAPQ_BENCH/../deployment/monitoring, and docker-compose.yml mounts ${ASAPQ_BENCH}/../deployment/monitoring/…. Comments and the make_*_dashboard.py help texts point at eval/demo/live/…. The make_dashboard.py panel text now says eval/profile/profile_query_phase.sh.
  • Docs: the README's paths are updated and it gets a short "Repository layout" table. eval/README.md and eval/harness/README.md are updated, including ln -s .. "$ASAPQ_BENCH/backend", which was ../... The four design docs under docs/design/ are historical, so their paths stay as they are and each gets a "Paths" note at the top that maps old paths to new ones.
  • After this PR, a grep for bench/demo, data_plane/, control_plane/, scripts/profile.sh, scripts/tiered_views_cgroup.sh, examples/planner-layering, and for live/ and monitoring/ not under their new parents, matches only the historical design docs (which carry the note), package and binary names in prose, and paths in other repositories.

Behavior: before → after

Behavior is unchanged. The commands are the same; only where a file lives changes:

Before After
Plan a workload cargo run -p control_plane -- --workload examples/planner-layering-example1.json … cargo run -p control_plane -- --workload docs/examples/planner-layering-example1.json …
Micro benchmark cargo run --release -p data_plane --example tier_bench … (source data_plane/examples/) same command (source benchmarks/micro/)
Live demo export ASAPQ_BENCH=<repo>/bench/demo; ./run_live_demo.sh start export ASAPQ_BENCH=<repo>/eval; demo/run_live_demo.sh start
Comparison ./run_vm_demo.sh in bench/demo ./run_vm_demo.sh in eval
Monitoring docker compose -f bench/demo/monitoring/docker-compose.yml docker compose -f deployment/monitoring/docker-compose.yml

Interfaces

None in code. The changed paths are listed above. Package, binary and example names, CLI flags and file formats are unchanged.

Algorithm changes

None.

Decisions and open questions

Needs reviewer decision: none.

Decided (judgment calls made in this PR):

  • Package names stay control_plane and data_plane. Renaming them to match the folders would touch the CI fmt command, every -p in the scripts and READMEs, and the crate imports. That is not a pure move.
  • The benchmarks stay Cargo examples of data_plane, as [[example]] entries pointing into benchmarks/micro/. A separate benchmarks crate would need its own manifest and dev-dependencies, while this way the build commands stay as they are. Their workload fixtures still resolve through CARGO_MANIFEST_DIR (crates/data-plane/tests/workloads).
  • remote_write_load.rs stays in crates/data-plane/examples/. It is a Remote Write load generator, not a *_bench.rs micro benchmark.
  • build.sh, fetch_binaries.sh, run_vm_demo.sh and README.md go to the top of eval/, not eval/scripts/. $ASAPQ_BENCH is eval/, and the harness, campaign scripts and READMEs call these scripts as ./… or ../… from there, so this placement keeps those relative calls working unchanged.
  • bench/demo/.gitignore → eval/.gitignore. Its monitoring rules (/textfile/, /grafana/dashboards/) move to a new deployment/monitoring/.gitignore, so nothing the scripts write becomes tracked.
  • Monitoring paths go through $ASAPQ_BENCH/../deployment/monitoring. A new environment variable or a symlink would also work, but this resolves the same way under every caller, including docker compose.

Verification

An independent review checked the diff for leftover old paths, broken relative paths and non-move changes. It found one formatting break: a longer fixture path in tests/common/mod.rs that needed cargo fmt. It also found three stale doc comments in benchmarks/micro/* and a missing note on path bases in eval/harness/README.md. All of these are fixed in this commit, and cargo fmt --check passes on the pushed head.

Both trees were built and tested on the same host, with the same vendored dependencies (Cargo.lock unchanged), one shared target directory and ulimit -n raised to the hard limit. With the default limit of 1024, planner_executor_parity::push_precompute_answers_what_the_planner_executor_answers fails with Too many open files on main as well. Both runs list the same 189 passing test names (diff of the sorted test … ok lines is empty).

Scope main (8263b22) this PR Newly failing
cargo fmt --all -- --check pass pass —
cargo build --workspace --all-targets --locked pass pass —
cargo clippy --workspace --all-targets --locked -- -D warnings pass pass —
cargo test --workspace --locked 189 passed, 0 failed, 3 ignored (31 suites) 189 passed, 0 failed, 3 ignored (31 suites) none
python3 -m unittest discover -s scripts/ci, node scripts/ci/test_planner_merge.js pass pass —
bash -n on every *.sh, py_compile on every *.py — pass —

Script smoke runs from a copy of this branch, with ASAPQ_BENCH=<copy>/eval:

  • eval/demo/run_live_demo.sh bogus prints its usage, and status runs. Both create eval/demo/live/{data,logs,pids} and deployment/monitoring/{textfile,grafana/dashboards}, and git check-ignore confirms that all of them are ignored.
  • deployment/monitoring/run_binaries.sh status runs. screenshot.sh and eval/profile/profile_query_phase.sh print their usage errors.
  • benchmarks/scripts/tiered_views_cgroup.sh prints build first: cargo build --release -p data_plane --example tier_bench. benchmarks/scripts/profile.sh reaches its tool check.
  • --help works for every eval/demo/live/*.py, deployment/monitoring/grafana/make_{demo,live}_dashboard.py, screenshot.py, eval/harness/{run,report,demo_table}.py. make_dashboard.py writes into deployment/monitoring/grafana/dashboards/. The harness scripts without argparse (tables*.py, accuracy_vs_vm.py, compression.py, merge_plans.py) fail on --help exactly as they do on main. prepare.py --help needs the ASAPQuery checkout, on main as well.
  • eval/run_vm_demo.sh and eval/build.sh were not run: they download pinned binaries and build. Their $MON/$BASE paths were checked against the tree.

Whole-stack review fix

  • crates/control-plane/Cargo.toml drops the unused tracing dependency (only tracing_subscriber is used; it predates the stack), and Cargo.lock drops that edge.
  • Re-verified on the restacked head (373e0a0): fmt, clippy --all-targets -D warnings and cargo test --workspace: 189 passed, 0 failed, 3 ignored (31 suites).

Follow-ups

  • Some directories that the scripts create were not git-ignored before this PR, and this PR keeps it that way: deployment/monitoring/{data,.pylib}/, eval/demo/live/.pylib/, and the campaign's eval/campaign-*/ and eval/final-*/. Adding ignore rules for them is left to a separate change.

  • Step 3 of docs/design/repo-layout.md: split internal-metrics and storage out of crates/data-plane.

  • eval/baselines/ and deployment/ Dockerfiles come in step 9.

@zzylol zzylol added area: control plane Planning, configuration, routing, and control-plane orchestration area: data plane Runtime ingestion, storage, and query-serving data paths labels Nov 26, 2026
Step 2 of the repository layout design (#874): folder moves only, with
every path reference updated. No code or behavior change.

- control_plane -> crates/control-plane, data_plane -> crates/data-plane
  (package names unchanged)
- data_plane/examples/*_bench.rs -> benchmarks/micro/ ([[example]] entries
  of data_plane)
- bench/demo/{campaign,harness,workloads,profile} -> eval/;
  {live,run_live_demo.sh} -> eval/demo/; monitoring -> deployment/monitoring;
  build.sh, fetch_binaries.sh, run_vm_demo.sh, README.md, .gitignore -> eval/
- scripts/{profile.sh,tiered_views_cgroup.sh} -> benchmarks/scripts/
- examples/*.json -> docs/examples/
- eval/results/ is git-ignored
@zzylol zzylol added the enhancement New feature or request label Nov 27, 2026
@zzylol zzylol changed the title refactor: move folders to the layout in docs/design/repo-layout.md refactor: move folders to the layout in docs/design/repo-layout.md (layout step 2) Nov 27, 2026
@zzylol
zzylol force-pushed the refactor/layout-folder-moves branch from 7c0fce8 to 373e0a0 Compare November 28, 2026 00:56
@zzylol
zzylol changed the base branch from main to docs/repo-layout November 28, 2026 00:56
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

area: control plane Planning, configuration, routing, and control-plane orchestration area: data plane Runtime ingestion, storage, and query-serving data paths enhancement New feature or request

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant