Skip to content

2.0.05: split AutoGrind's travel, station and reach helpers; show overlay frame cost - #19

Merged
MrHakan merged 2 commits into
mainfrom
ccr-5681ba59-e5pne2
Oct 8, 2026
Merged

MrHakan merged 2 commits into
mainfrom
ccr-5681ba59-e5pne2

Conversation

@MrHakan

@MrHakan MrHakan commented Oct 8, 2026

Copy link
Copy Markdown
Owner

Summary

This covers the last overhaul step in the 2.1.00 major plan: the rest of item D1, then item C2. There are two commits.

1. Move AutoGrind's travel, station and reach helpers out of GrindExecutor (no behaviour change)

The executor's helpers are now three collaborators held in final fields:

Field Class What it holds
g.travel GrindTravel One Baritone goal at a time, the mining process AutoGrind owns, stall detection and movementProblem
g.stations GrindStations The table and furnace a plan uses, and the station menu AutoGrind opened
g.reach GrindReach Reach, line of sight, aiming and the bounded nearby-block lookup

GrindExecutor goes from 814 to 592 lines.

The move used the same compiler-guided method as 2.0.04:

  1. Members were cut out unchanged.
  2. Callers were routed through the new field, e.g. g.moveNear → g.travel.moveNear.
  3. Every unresolved executor reference in the moved code was prefixed from javac's own errors.

An automated comparison confirmed the 32 moved members (210 lines) match the originals apart from the g. prefix. Two other edits were needed:

  • Three private members the executor still reads became package-private.
  • A local in start() was renamed so it no longer shadows the new stations field.

2. Show each world overlay's frame cost in the Module Timings widget (C2)

  • Why: module tick timings miss render work. An ESP's tick only publishes targets, and the boxes are written every frame.
  • OverlayTimings: the frame-based counterpart of ModuleTimings, with a 120-frame window and a 180-frame expiry. ModuleTimings gains a constructor for both; its default is unchanged.
  • Measurement: WorldOverlays opens a frame each time it collects, which also closes the previous one. Each overlay's labels and its deferred lines add into one slot, so an overlay is one sample per frame.
  • Cost when unused: measurement is self-expiring. When the widget is closed, the only cost is opening the frame.
  • Widget: ModuleTimingsHud lists the three costliest overlays under the module rows.
  • Where timing happens: in WorldOverlays rather than RenderService.guard, because only the dispatcher knows which frame slot a call belongs to.

Validation (local, Java 25 + Xvfb)

  • ./gradlew build: 923 tests, 0 failures. The 6 new tests are in OverlayTimingsTest.

  • tools/smoke-client.sh passed, including every AutoGrind scenario. The shared entity walk game test now also requires all five entity overlays to be measured over several frames, and ESP to cost more than nothing. With 300 armor stands in view it measured:

    Overlay Cost per frame
    ESP (256 boxes) 1812 µs
    Nametags 196 µs
    Tracers 53 µs
    ItemESP 11 µs
    ProjectileESP 8 µs

    The plan now names ESP's per-box cost as the next render target, ahead of the Trajectories rework.

  • tools/test-baritone.sh passed against real Baritone 26.2. It covered 384-block travel, remote mining, rebuilding a tool mid-goal, returning to an unloaded base, door and chest access, and replacement-goal ownership.

Release

mod_version=2.0.05, with a CHANGELOG.md section.

🤖 Generated with Claude Code

https://claude.ai/code/session_01TGuJsde5s6BFqgC63uNGrh


Generated by Claude Code

claude added 2 commits October 8, 2026 10:56
After 2.0.04 the executor still mixed lifecycle and planning with three kinds of helper. They are now collaborators held in final fields: g.travel (GrindTravel: one Baritone goal at a time, the mining process AutoGrind owns, stall detection and the pause message), g.stations (GrindStations: the table and furnace a plan uses and the station menu AutoGrind opened) and g.reach (GrindReach: reach, line of sight, aiming and the bounded nearby-block lookup). The executor is down from 814 to 592 lines.

The move used the same compiler-guided method as 2.0.04: members were cut out unchanged, callers were routed through the new field (g.moveNear -> g.travel.moveNear), and every unresolved executor reference in the moved code was prefixed from javac's own errors. The 32 moved members (210 lines) match the originals apart from that prefix; three private members the executor still reads became package-private, and a local in start() was renamed so it no longer shadows the new stations field. Release as 2.0.05.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01TGuJsde5s6BFqgC63uNGrh
Module tick timings miss render work: an ESP's tick only publishes targets, and the boxes are written every frame. OverlayTimings is the frame-based counterpart, a ModuleTimings with a 120-frame window and a 180-frame expiry (ModuleTimings gains a constructor for both; the default is unchanged). WorldOverlays opens a frame each time it collects, which closes the previous one, and adds each overlay's labels and deferred lines into one slot, so a drawn overlay is one sample per frame. Measurement stays self-expiring: unless the widget asked within the last 180 frames, the only cost is opening the frame.

ModuleTimingsHud lists the three costliest overlays under the module rows, at a fixed position so the heading does not jump while the module rows fill in. Timing lives in WorldOverlays rather than RenderService.guard because only the dispatcher knows which frame slot a call belongs to.

Unit tests cover one sample per frame for two passes, dropping an overlay that stops drawing, expiry, the frame window and a late pass on a closed frame. The shared entity walk game test now also requires all five entity overlays to be measured over several frames with 300 stands in view, and ESP to cost more than nothing.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01TGuJsde5s6BFqgC63uNGrh
Copilot AI balanced review requested due to automatic review settings October 8, 2026 10:56

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copilot was unable to review this pull request because the user who requested the review has reached their quota limit.

@MrHakan
MrHakan merged commit 5240475 into main Oct 8, 2026
1 check passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants