Skip to content

feat(host): opt-in ADVANCED_OK buffer-aware look-ahead streaming (deferred) #15

Description

@CameronBrooks11

Deferred — evidence-gated

Streaming is currently plain send-one-await-ok pacing (host.py:232-250) — the
lowest-common-denominator handshake every Marlin supports. ADVANCED_OK adds
ok N<line> P<planner_free> B<blocks_free> (gcode/queue.cpp:251-263), enabling
buffer-count look-ahead. Prior art (design doc Lane C): the ecosystem treats this as
a fragile opt-in — only OctoPrint's third-party BufferBuddy plugin uses it; core
OctoPrint, Cura, and printrun all deliberately ignore P/B.

Proposed approach (only when a real workload needs it)

Behind an explicit flag, and only when profile.advanced_ok is confirmed
(firmware proven to emit P/B), allow sending ahead until fewer than B commands
are in flight (BufferBuddy-style) to avoid planner underrun on small segments. Stay
one-outstanding by default. Never auto-enable.

Acceptance criteria (when/if taken)

  • Look-ahead is off by default and gated on confirmed ADVANCED_OK fields.
  • One-outstanding behavior unchanged when the flag is off or fields absent.

Evidence

_reference/Marlin/Marlin/src/gcode/queue.cpp:251-263, marlin_host/protocol.py:89-95,
marlin_host/host.py:232-250; OctoPrint BufferBuddy / OctoPrint/OctoPrint#2834.
Design: working/dialect-and-mock-investigation.md (Later).

Part of #5.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or request

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions