perf: band toolmode sweeps into three-row passes #104

Merged
gecko merged 1 commit from t3/optimize-toolmode-farm-pathing into main 2026-11-03 19:46:10 +00:00
Owner

Summary

Toolmode previously walked the 100 disjoint 3×3 tile centres in a serpentine, so the fixed 30×30 chunk inset cost ~297 blocks of centre-to-centre travel before opportunistic swings. A straight pass reaches three adjacent tile rows (the eye-to-crop drop leaves ~4.35 blocks of horizontal reach), so the same plot can be cleared with four trimmed passes.

  • Add ToolCoveragePlan: geometry-only boustrophedon over bands of three tile rows, with legs trimmed by the reachable along-track distance. It chooses the shorter axis and the end nearest the bot.
  • WartToolRoute(harvest, true) uses the plan for dense regular waves. It builds, advances and retires legs, holds a pass while a reachable in-band target is about to leave reach (bounded when a ray stays blocked), and hands leftovers back to the per-tile route. Dense/sparse selection is travel-based; sparse, partial, edge and irregular plots are unchanged.
  • WartToolSweep orders reachable targets by their expiry margin inside the active band before ahead/distance, so a pass clears the urgent column first.
  • FarmSession enables the coverage route for toolmode; BotModule passes the real ray-reachability guard into the route.

Validation

Tested commit: 46db203aab00cc4e8a1612090c47c6ccad0a0a4f

  • ./scripts/ci-preflight.sh
  • ./gradlew --no-daemon --max-workers=1 '-Dorg.gradle.jvmargs=-Xms128m -Xmx1g -XX:MaxMetaspaceSize=512m -Dfile.encoding=UTF-8' lint build
  • ./scripts/check-release-jar.sh
  • New server-free tests:
    • ToolCoveragePlanTest: four legs, trimmed endpoints, every band covers its rows, split bands, irregular/incomplete grids rejected.
    • ToolCoverageRouteTest: dense plan activation, sparse fallback, legacy constructor, band expiry, sweep urgency.
    • ToolCoverageTraversalTest: full 30×30 pass at 1–20 tick confirmation delays, 100 swings, less walking than the per-tile route, corner start, sparse wave.

Server-free steering simulation vs the existing route (same reach/confirmation model): a fully ripe 30×30 inset walks ~116–160 blocks depending on start and confirmation delay versus ~127–290 for the per-tile route; the four-pass plan itself is 112 blocks. This is a geometry/trajectory result, not a live-server benchmark; real reach/ray and the custom tool remain attended work.

Notes

  • The plan uses a conservative 4.1-block horizontal reach (actual eye-to-crop-centre reach is ~4.36) so trimmed legs keep a margin at the outer rows.
  • No planting, pickup, storage, commands or tool-metadata changes; the plan never confirms a swing.
  • The per-tile route remains the fallback for sparse, irregular and legacy plots.
## Summary Toolmode previously walked the 100 disjoint 3×3 tile centres in a serpentine, so the fixed 30×30 chunk inset cost ~297 blocks of centre-to-centre travel before opportunistic swings. A straight pass reaches three adjacent tile rows (the eye-to-crop drop leaves ~4.35 blocks of horizontal reach), so the same plot can be cleared with four trimmed passes. - Add `ToolCoveragePlan`: geometry-only boustrophedon over bands of three tile rows, with legs trimmed by the reachable along-track distance. It chooses the shorter axis and the end nearest the bot. - `WartToolRoute(harvest, true)` uses the plan for dense regular waves. It builds, advances and retires legs, holds a pass while a reachable in-band target is about to leave reach (bounded when a ray stays blocked), and hands leftovers back to the per-tile route. Dense/sparse selection is travel-based; sparse, partial, edge and irregular plots are unchanged. - `WartToolSweep` orders reachable targets by their expiry margin inside the active band before `ahead`/distance, so a pass clears the urgent column first. - `FarmSession` enables the coverage route for toolmode; `BotModule` passes the real ray-reachability guard into the route. ## Validation Tested commit: `46db203aab00cc4e8a1612090c47c6ccad0a0a4f` - `./scripts/ci-preflight.sh` - `./gradlew --no-daemon --max-workers=1 '-Dorg.gradle.jvmargs=-Xms128m -Xmx1g -XX:MaxMetaspaceSize=512m -Dfile.encoding=UTF-8' lint build` - `./scripts/check-release-jar.sh` - New server-free tests: - `ToolCoveragePlanTest`: four legs, trimmed endpoints, every band covers its rows, split bands, irregular/incomplete grids rejected. - `ToolCoverageRouteTest`: dense plan activation, sparse fallback, legacy constructor, band expiry, sweep urgency. - `ToolCoverageTraversalTest`: full 30×30 pass at 1–20 tick confirmation delays, 100 swings, less walking than the per-tile route, corner start, sparse wave. Server-free steering simulation vs the existing route (same reach/confirmation model): a fully ripe 30×30 inset walks ~116–160 blocks depending on start and confirmation delay versus ~127–290 for the per-tile route; the four-pass plan itself is 112 blocks. This is a geometry/trajectory result, not a live-server benchmark; real reach/ray and the custom tool remain attended work. ## Notes - The plan uses a conservative 4.1-block horizontal reach (actual eye-to-crop-centre reach is ~4.36) so trimmed legs keep a margin at the outer rows. - No planting, pickup, storage, commands or tool-metadata changes; the plan never confirms a swing. - The per-tile route remains the fallback for sparse, irregular and legacy plots.
perf: band toolmode sweeps into three-row passes
All checks were successful
build / Java 25 build (pull_request) Successful in 3m36s
46db203aab
A straight toolmode pass reaches three adjacent 3x3 tile rows, so the fixed 30x30 chunk inset needs four trimmed passes instead of walking all 100 tile centres. Dense regular waves now plan a boustrophedon over banded passes, trimmed by the horizontal reach; the sweep prefers the most expiring in-band target and the route holds a pass while that target is about to leave its reach window. Sparse, partial and irregular plots keep the existing per-tile route, which also cleans up leftovers.

The plan is geometry-only and never confirms a swing. Tests cover the plan geometry, dense/sparse selection, sweep ordering, and full-pass steering at several confirmation delays.
Author
Owner

Forgejo build passed for tested commit 46db203: build / Java 25 build (pull_request) success. Checks: #104/checks

Forgejo build passed for tested commit 46db203: `build / Java 25 build (pull_request)` success. Checks: https://git.glitched.systems/gecko/mcbot/pulls/104/checks
gecko merged commit aa9fdf8da4 into main 2026-11-03 19:46:10 +00:00
Sign in to join this conversation.
No reviewers
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set

Reference
gecko/mcbot!104
No description provided.