Skip to content

settle verb: block until the client has finished drawing what a command just placed #8

Description

@Flatts3000

The proposal below is known to be wrong, and the comments say why. "Wait for the chunk
build queue to be empty" cannot work: getCompileQueueSize() measures backlog waiting for a
worker, not compiles in flight, so it reads near-zero throughout the work it is supposed to
detect. Measured on two clients, one with Sodium and one without. The goal in the first section
still stands; the mechanism does not.

The problem

shoot_scenes.py in the Recompile repo does this:

time.sleep(2.0)   # let the chunk meshes rebuild before grabbing the frame

That sleep is a guess. Too short and the screenshot catches a half-built world; too long and every
shoot pays for it. There is currently no way to ask the client whether it has finished drawing what
a command just placed.

The proposal

A verb that blocks until the client is visually settled, then replies. Roughly: the chunk build
queue is empty and at least one full frame has been rendered since it emptied.

{"verb": "settle"}
{"ok": true, "waitedMs": 840, "frames": 3}

Reporting how long it waited matters: a caller that sees 4000ms learns something a sleep(2) would
have hidden either way.

Why the mod and not a command

The chunk build queue is client render state. No command can see it, and no server-side signal
corresponds to it: the server considers a setblock done the instant it happens, which is exactly
the moment the mesh has not been rebuilt.

Notes

  • Needs a timeout and a clear failure, in the style of the existing 30s command timeout.
  • Worth reporting whether it gave up rather than settling, so a flaky shot is attributable.
  • Probably the highest-value item available: it converts a known source of silent wrong output into
    a deterministic wait.

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or requestparkedIntentionally paused; skipped by autonomous passes

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions