cargo test --workspaceruns unit tests, byte-exact packet fixtures and differential auth tests.- Local server:
tools/bds.ps1starts BDS from.testserver/bds(offline, RakNet, port 19140). Download BDS ≤ 26.5x into.testserver/bdsfirst, because 26.60 removes RakNet. Inserver.properties, setonline-mode=false,allow-list=falseandtransport=raknet. cargo run -p acacia-client --example afk -- 127.0.0.1:19140 Bot 10: joins one bot and prints a per-packet histogram.cargo run --release -p acacia-client --example swarm -- 127.0.0.1:19140 10 15joins N bots at once and reports spawn p50/p95 and failures. BDS allows 10 players by default.cargo run -p acacia-auth --example device_loginsigns in with a real account (device code) and caches tokens in./.tokens.cargo run -p acacia-client --features socks --example afk -- <server> @default 60runs an online bot. SetBEDROCK_PROXY,BEDROCK_CMD="/list;hi;!respawn",BEDROCK_AUTO_RESPAWN=1andBEDROCK_TRANSPORT=raknet|nethernet(default auto) as needed.- NetherNet: a second BDS copy in
.testserver/bds-nnwithtransport=nethernetandserver-port=19160. BDS needs an online account for NetherNet even when it is offline (an offline login offers a self-signed identity, which only hosts like sapling accept):BEDROCK_TRANSPORT=nethernet cargo run -p acacia-client --example afk -- 127.0.0.1:19160 @default 30. In Git Bash, setMSYS_NO_PATHCONV=1, or it rewrites/listinto a Windows path. cargo run -p acacia-client --example ping -- play.example.netpings a server; setBEDROCK_PROXYto go through a proxy.- Java look against Java Edition itself:
tools/parity/remote.sh [harness](docs/parity.md).
For testing a server with acacia. Normally the session decodes only the packets it needs and the decoder is
lenient, so a malformed or misplaced packet passes unseen. With strict mode on, every server packet is fully
decoded and each problem is reported as a Violation (and logged at warn); the session keeps running, so one
run lists everything. A test asserts that no violation arrived.
- Turn it on:
BotConfig { strict: true, .. }(BotEvent::Violation),ClientBuilder::strict(true)(Event::Violation, not subject to the packet filter), orBEDROCK_STRICT=1for theafkexample. Reason::Decode: the strict decoder rejected the packet (docs/proto.md, "Strict decoding"), or its id has no type.Reason::Content(bots only): aLevelChunk,Subchunkor cache blob whose chunk data does not decode.Reason::Order: a join-order rule (session/strict.rs). Add a rule only once it is verified against vanilla or BDS.
| Rule | Basis |
|---|---|
| second NetworkSettings / second ServerToClientHandshake | each is sent once per connection |
| sent before PlayStatus(LoginSuccess) | anything but NetworkSettings, the handshake, PlayStatus and Disconnect |
| StartGame before ResourcePackStack | the pack exchange ends with the stack |
| StartGame without JigsawStructureData before it | a vanilla client kicks itself (observed 2026-10) |
| PlayerSpawn before StartGame | the session has no player to spawn |
| second StartGame | one per connection; a dimension change is ChangeDimension |
The replayed BDS 1.26.52 join produces no violation (crates/acacia-bot/tests/strict.rs), and every packet of it
passes the strict decoder (bundled_script_passes_the_strict_decoder in acacia-testserver). A violation against
BDS itself is therefore an acacia schema bug: fix it in tools/codegen/data/overrides.json.
Not covered: the resource-pack exchange (hash mismatches, pack contents), compression and encryption negotiation, unknown block ids inside a chunk that decodes, and anything a vanilla client checks that the schema does not express.
Physics is checked against BDS itself: strict server-authoritative movement sends a CorrectPlayerMovePrediction
for every tick our position is off by more than 0.0001, so each correction is a disagreement to explain.
tools/bds.ps1 -Strictstarts BDS with that profile (plaintools/bds.ps1restores the default movement settings).tools/physics/fuzz.sh <rounds> [seed]builds random terrain on a pad (water, lava, slime, honey, ladders, scaffolding, powder snow...) and drives random inputs over it, recording a trace (.testserver/traces/*.btrc: the server's movement packets plus every input we sent). It prints the seed;FUZZ_BOTS=nruns n offline bots in parallel.cargo run --release -p acacia-bot --example yaw_sweep -- <server> <name> [count] [variants] [ticks]walks or bunny-hops from rest at random yaws and counts corrections per variant (run it on a reset world).cargo run --release -p acacia-bot --example observe -- <server> <nameA> <nameB> [count] [ticks]: bot A sprint-hops (OBS_MODE=walk: walks;mix: diagonal keys, sprint, hops and a mid-walk turn drawn per segment) fromOBS_START=x,zon the pad (pick x ≥ 16 for ulp drift to draw corrections) while bot B logs theMovePlayerbroadcasts of A toOBSERVE_LOG: the server's own position every tick, which a correction only shows once it is 1e-6 off. Compare with A's trace replayed underRUST_LOG=acacia_bot::movement=trace(DESIGN.md "Off-axis ulp corrections").- Movement and pathfind runs on testbox (
examples/course.rs,examples/goto.rs,examples/processes.rs,examples/confirmed.rs,examples/build.rs,examples/swarm_build.rs,place_probe,observe,yaw_sweep) use a strict instance with the test pack off:tools/testbox-bds.sh unpack(with that instance'sBDS_DIR/BDS_PORT;packturns it back on), thenresetbefore every run. The pack (tools/actiontest-pack) rebuilds a scene round each joining player 40 ticks after the spawn: blocks and a water pool in the way, mobs, a hunger effect. It lands about when a goto plans, so a run's start depends on that race; it hid a stuck-start bug for a day (docs/pathfind-plan.md, "Core fixes"). - Testbox jobs (
tools/remote-run.sh,tools/remote-test.sh) run undertools/testbox-guard.sh: killed with their process group onTIMEOUTorSTALLseconds without output (done file 124 / 125). The build locktarget/.busyis taken withflock -o; a lock still held after 600 s ends the job with 126 and the holder's pids in the log (tools/testbox-job.sh). Both scripts wait and print the verdict;DETACH=1returns at once. - Waiting: a filtered test (
-- build::, ~15-25 s after an edit) runs in the foreground, verdict and failing tests' output included. A suite or live run:DETACH=1, thentools/testbox-wait.sh <dir> test|runwithrun_in_background; it exits with the job's code. Not Monitor (it expires after 30 min) and no hand-writtenuntilloops.tools/testbox-watch.shprints a line per job that finishes. - Live runs get a dir of their own (
REMOTE_DIR=work/<folder>-live): remote-test.sh wipes its dir before a sync, so each script refuses while the other's job is still going in the same dir. Release and test builds share almost nothing, so the second dir costs no extra build time. tools/iter-bench.shtimes the unit-test loop (launch, compile, rest; medians): research/iteration-speed.md.- Their
target/is a link to tmpfs (tools/testbox-target.sh): testbox's disk is two shared HDDs and was most of every build. Each worktree getswork/<folder>; a new one fills from sccache, and the least recently used idle targets are dropped when tmpfs or memory runs short (rebuilt from sccache on next use). tools/physics/drill.sh <names>runs scripted drills (crates/acacia-bot/examples/drills.rs), exact control sequences that isolate one variable.cargo run -p acacia-bot --example flight -- <server> <name> [rounds]drills creative flight (crates/acacia-physics README "Flight"); on testbox use its own strict instance (BDS_DIR=work/bds-flight BDS_PORT=19178 tools/testbox-bds.sh, with the-Strictkeys above set in its server.properties).cargo run -p acacia-bot --example dimensions -- <server> <name> [tp|portals|all]drills dimension travel (docs/DESIGN.md "Dimension travel"): overworld, Nether and End by command, then by a Nether portal and End portal blocks, printing each arrival's and walk's corrections and the distance from the server's own position.cargo run -p acacia-bot --example replay -- <trace> [--verbose]replays a trace offline through the current code and reports server corrections we disagree with (--correction-tolerance, default 0.001; 0 compares bit-exactly, and--verboseprints both velocities) and ticks that differ from what the live bot did. "Diverged from the recording" means the replay would send other inputs than were recorded: rules that change our own input flags (sprint, swim, jump starts) can only be judged by a fresh live run.crates/acacia-bot/tests/trace_regression.rsreplays the regression set incrates/acacia-bot/tests/traces(gzipped bot traces from the local BDS) and fails if a trace gains mismatches. Each trace has its own correction tolerance:course-human-linux(testbox Linux BDS) is checked bit-exactly.- Fuzz and drills need an online account in
./.tokensof the checkout they run from (@default, orACCOUNT=@name).
The loop:
- Fuzz on a fresh seed; replay with
--verboseand trace a mismatch withRUST_LOG=acacia_bot=trace. - Work out the rule from the numbers (back the server's velocity out of its positions; compare our step from the server's previous position, not from ours, or a stale offset looks like a per-tick error).
- Wrap the candidate in an env toggle (
if std::env::var_os("HYP_X").is_some() { new } else { current }) and runtools/physics/hyp.sh "" HYP_X=1over the regression set plus recent traces: it must fix and not regress. - A rule backed by one sample gets a drill that varies its parameter (and nothing else can fire: a honey column hid the single block's top threshold). Replay the drill under the toggle.
- Make the rule unconditional, comment its evidence, list it in
crates/acacia-physics/README.mdif it departs from bedsim, add a trace that pins it to the regression set, and confirm with a fresh live fuzz.
Not every correction is physics, and the replay leaves out those the client could not have predicted:
- BDS updates per-tick state (the powder snow freeze) once per server tick, so when the network bunches our inputs a
tick runs on a value reported later. A correction within two ticks of an input whose freeze differs from the one
the server then reported is not counted; a vanilla client is corrected there too.
tools/physics/dupstamp.sh <trace>andtools/physics/freeze.shshow those ticks. - A correction for a tick simulated in a chunk not received yet (just after a long teleport) is not counted.